From: Thomas E. Dickey Date: Sun, 13 Oct 2002 03:35:53 +0000 (-0400) Subject: ncurses 5.3 X-Git-Tag: v5.3 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=46722468f47c2b77b3987729b4bcf2321cccfd01 ncurses 5.3 --- diff --git a/ANNOUNCE b/ANNOUNCE index 7b5f4efa..e39a0bee 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,385 +1,290 @@ - Announcing ncurses 5.2 + Announcing ncurses 5.3 - 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 + 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 + 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 should port easily - to any ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 - Warp! + 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 + 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 + The ncurses distribution is available via anonymous FTP at the GNU distribution site [1]ftp://ftp.gnu.org/pub/gnu/ncurses. - It is also available at [2]ftp://dickey.his.com/ncurses. + It is also available at [2]ftp://invisible-island.net/ncurses. Release Notes - This release is designed to be upward compatible from ncurses 5.0 and - 5.1; very few applications will require recompilation, depending on - the platform. These are the highlights from the change-log since - ncurses 5.1 release. + This release is designed to be upward compatible from ncurses 5.0 and + 5.2; very few applications will require recompilation, depending on + the platform. These are the highlights from the change-log since + ncurses 5.2 release. Interface changes: - * change type of ospeed variable back to short to match its use in - legacy applications. It was altered after ncurses 4.2 to speed_t - to repair a type mismatch which was introduced after 1.9.4 in - 1995. The principal users of termcap continued to use short, which - is not the same size. - NOTE: A few applications will have to be recompiled (about 1% of - the programs in a typical Linux distribution, 10% of the programs - that use ncurses). These are easy to identify with nm or strings. - * remove a private function _nc_can_clear_with(), which was built - with the configure --enable-expanded option but not used. - * add several private functions (prefixed with "_nc_") for tracing - chtype values in the debug library, and for better access and - buffer limit checking. + * change type for bool used in headers to NCURSES_BOOL, which + usually is the same as the compiler's definition for bool. + * add all but two functions for X/Open curses wide-character + support. These are only available if the library is configured + using the --enable-widec option. Missing functions are + + pecho_wchar() + + slk_wset() + * add environment variable $NCURSES_ASSUMED_COLORS to modify the + assume_default_colors() extension. New features and improvements: - * rewrote tgoto() to make it better support existing termcap - applications which use hardcoded strings rather than obtain all of - their information from the termcap file. If the string does not - appear to be a terminfo string (i.e., does not refer to a "%p" - parameter, or terminfo-style padding), and termcap support is - configured, tgoto() will interpret it as termcap. Otherwise, as - before, it will use tparm(). - * to ensure that the tgoto() changes work properly, added checks to - tic which report capabilities that do not reference the expected - number of parameters. - * new configure script options: - + option --disable-root-environ adds runtime checks which tell - ncurses to disregard $TERMINFO and similar environment - variables if the current user is root, or running - setuid/setgid. - + option --disable-assumed-color allows you to use the pre-5.1 - convention of default colors used for color-pair 0 to be - configured (see assume_default_colors()). - + implement configure script options that transform installed - program names, e.g., --program-prefix, including the manpage - names and cross references. - + option --with-database allows you to specify a different - terminfo source-file to install. On OS/2 EMX, the default is - misc/emx.src, otherwise misc/terminfo.src - + option --with-default-terminfo-dir allows you to specify the - default terminfo database directory. - + option --with-libtool allows you to build with libtool. - NOTE: libtool uses a different notation for numbering shared - library versions from the existing ncurses configuration. - + option --with-manpage-tbl causes the manpages to be - preprocessed by tbl(1) prior to installation, - + option --without-curses-h causes the installation process to - install curses.h as ncurses.h and make appropriate changes to - headers and manpages. - * modified configure script options: - + change symbol used by the --install-prefix configure option - from INSTALL_PREFIX to DESTDIR (the latter has become common - usage although the name is misleading). - + modify ld -rpath options (e.g., Linux, and Solaris) to use an - absolute pathname for the build tree's lib directory, - avoiding confusion with directories relative to the current - one with the installed programs. - + modified misc/run_tic.in to use tic -o, to eliminate - dependency on $TERMINFO variable for installs. - * terminfo database: - + updated xterm terminfo entries to match XFree86 xterm patch - #146. - + added amiga-vnc, Matrix Orbital, and QNX qansi to - misc/terminfo.src. - + added os2 entry to misc/emx.src. - + add S0 and E0 extensions to screen's terminfo entry since - otherwise the FreeBSD port makes it pass termcap equivalents - to tgoto, which would be misinterpreted by older versions of - ncurses. - * improvements to program usability: - + modify programs to use curses_version() string to report the - version of ncurses with which they are compiled rather than - the NCURSES_VERSION string. The function returns the patch - level in addition to the major and minor version numbers. - + modify tput program so it can be renamed or invoked via a - link as 'reset' or 'init', producing the same effect as - tput reset or tput init. - + add error checking to infocmp's -v and -m options to ensure - that the option value is indeed a number. - * improved performance: - + replace a lookup table in lib_vidattr.c used to decode - no_color_video with a logic expression which is faster. + * Improved support for termcap applications: + + add logic to dump_entry.c to remove function-key definitions + that do not fit into the 1023-byte limit for generated + termcaps. This makes hds200 fit. + + modify tgetent() to check if exit_attribute_mode resets the + alternate character set, and if so, attempt to adjust the + copy of the termcap "me" string which it will return to + eliminate that part. In particular, 'screen' would lose track + of line-drawing characters. + + add check/fix to comp_parse.c to suppress warning about + missing acsc string. This happens in configurations where raw + termcap information is processed; tic already does this and + other checks. + + add tic -A option to suppress capabilities which are + commented out when translating to termcap. + + modify logic in lib_baudrate.c for ospeed, for FreeBSD to + make it work properly for termcap applications (patch by + Andrey A Chernov). + * add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + * correct logic for COLORFGBG environment variable: if rxvt is + compiled with xpm support, the variable has three fields, making + it slightly incompatible with itself. In either case, the + background color is the last field. Major bug fixes: - * correct manlinks.sed script introduced in ncurses 5.1 to avoid - using ERE "\+", which is not understood by standard versions of - sed. This happens to work with GNU sed, but is not portable, and - was the initial motivation for this release. - * remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. - This differed from the "hpux*" case by using reversed symbolic - links, which made the 5.1 version not match the configuration of - 5.0 shared libraries. - * guard against corrupt terminfo data: - + modify tparm() to disallow arithmetic on strings, analyze the - varargs list to read strings as strings and numbers as - numbers. - + modify tparm()'s internal function spop() to treat a null - pointer as an empty string. - + modify parse_format() in lib_tparm.c to ignore precision if - it is longer than 10000. - + rewrote limit checks in lib_mvcur.c using new functions - _nc_safe_strcat(), etc. Made other related changes to check - lengths used for strcat() and strcpy(). - * corrections to screen optimization: - + added special case in lib_vidattr.c to reset underline and - standout for devices that have no sgr0 defined. - + change handling of non_dest_scroll_region in tty_update.c to - clear text after it is shifted in rather than before shifting - out. Also correct row computation. - + modify rs2 capability in xterm-r6 and similar entries where - cursor save/restore bracketed the sequence for resetting - video attributes. The cursor restore would undo that. - * UTF-8 support: - + when checking LC_ALL, LC_CTYPE, and LANG environment - variables for UTF-8 locale, ignore those which are set to an - empty value, as per SUSV2. - + encode 0xFFFD in UTF-8 with 3 bytes, not 2. - + modify _nc_utf8_outch() to avoid sign-extension when checking - for out-of-range value. - * other library fixes: - + added checks for an empty $HOME environment variable, to - avoid retrieving terminfo descriptions from ./.terminfo . - + change functions _nc_parse_entry() and postprocess_termcap() - to avoid using strtok(), because it is non-reentrant. - + initialize fds[] array to 0's in _nc_timed_wait(); apparently - poll() only sets the revents members of that array when there - is activity corresponding to the related file. - + add a check for null pointer in Make_Enum_Type(). - + fix a heap problem with the c++ binding. - + correct missing includes for in several places, - including the C++ binding. This is not noted by gcc unless we - use the -fno-builtin option. - * several fixes for tic: - + add a check for empty buffers returned by fgets() in - comp_scan.c next_char() function, in case tic is run on a - non-text file (fixes a core dump). - + modify tic to verify that its inputs are really files, in - case someone tries to read a directory (or /dev/zero). - + correct an uninitialized parameter to open_tempfile() in - tic.c which made "tic -I" give an ambiguous error message - about tmpnam. - + correct logic in adjust_cancels(), which did not check both - alternatives when reclassifying an extended name between - boolean, number and string, causing an infinite loop in tic. - * using new checks in tic for parameter counts in capability - strings, found/fixed several errors both in the terminfo database - and in the include/Caps file. - + modified several terminfo capability strings, including the - definitions for setaf, setab, in include/Caps to indicate - that the entries are parameterized. This information is used - to tell which strings are translated when converting to - termcap. This fixes a problem where the generated termcap - would contain a spurious "%p1" for the terminfo "%p1%d". - + correct parameter counts in include/Caps for dclk as well as - some printer-specific capabilities: csnm, defc, scs, scsd, - smgtp, smglp. - * various fixes for install scripts used to support configure - --srcdir and --with-install-prefix. - * correct several mismatches between manpage filename and ".TH" - directives, renaming dft_fgbg.3x to default_colors.3x and - menu_attribs.3x to menu_attributes.3x. + * rewrote limit-checks in wscrl() and associated + _nc_scroll_window(), to ensure that if the parameter of wscrl() is + larger than the size of the scrolling region, then the scrolling + region will be cleared. + * modify tset to restore original I/O modes if an error is + encountered. Also modify to use buffered stderr consistently + rather than mixing with write(). + * move calls to def_shell_mode() and def_prog_mode() before loop + with callbacks in lib_set_term.c, since the c++ demo otherwise + initialized the tty modes before saving them. + * modified wresize() to ensure that a failed realloc will not + corrupt the window structure, and to make subwindows fit within + the resized window. + * altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. + * correct/improve logic to produce an exit status for errors in + tput, which did not exit with an error when told to put a string + not in the current terminfo entry. + * modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without + picking up extraneous trailing blanks. + * add a check in relative_move() to guard against buffer overflow in + the overwrite logic. + * add some limit/pointer checks to -S option of tputs. + * modify mvcur() to avoid emitting newline characters when nonl() + mode is set. Normally this is not a problem since the actual + terminal mode is set to suppress nl/crlf translations, however it + is useful to allow the caller to manipulate the terminal mode to + avoid staircasing effects after spawning a process which writes + messages (for lynx 2.8.4). Portability: * configure script: - + newer config.guess, config.sub, including changes to support - OS/2 EMX. The configure script for OS/2 EMX still relies on a - patch since there is no (working) support for that platform - in the main autoconf distribution. - + make configure script checks on variables $GCC and $GXX - consistently compare against 'yes' rather than test if they - are nonnull, since either may be set to the corresponding - name of the C or C++ compiler. - + change configure script to use AC_CANONICAL_SYSTEM rather - than AC_CANONICAL_HOST, which means that configure --target - will set a default program-prefix. - + modify the check for big-core to force a couple of memory - accesses, which may work as needed for older/less-capable - machines (if not, there's still the explicit configure - option). - + modify configure test for tcgetattr() to allow for old - implementations, e.g., on BeOS, which only defined it as a - macro. - + add configure check for filesystems (such as OS/2 EMX) which - do not distinguish between upper/lowercase filenames, use - this to fix tags rules in makefiles. - + add MKncurses_def.sh to generate fallback definitions for - ncurses_cfg.h, to quiet gcc -Wundef warnings, modified - ifdef's in code to consistently use "#if" rather than - "#ifdef". - + change most remaining unquoted parameters of test in - configure script to use quotes, for instance fixing a problem - in the --disable-database option. - + modify scripts so that "make install.data" works on OS/2 EMX. - + modify scripts and makefiles so the Ada95 directory builds on - OS/2 EMX. + + modify check in --disable-overwrite option so that it is used + by default unless the --prefix/$prefix value is not /usr, in + attempt to work around packagers who do not read the INSTALL + notes. + + correct a typo in configure --enable-colorfgbg option, and + move it to the experimental section (cf: 20011208). + + modify configure script to allow building with termcap only, + or with fallbacks only. In this case, we do not build tic and + toe. + + modify run_tic.sh to check if the build is a cross-compile. + In that case, do not use the build's tic to install the + terminfo database. + + modify c++/Makefile.in to accommodate archive programs that + are different for C++ than for C, and add cases for vendor's + C++ compilers on Solaris and IRIX. + + add several configure script options to aid with + cross-compiling: --with-build-cc, --with-build-cflags, + --with-build-ldflags, and --with-build-libs. + + add experimental --with-caps=XXX option to customize to + similar terminfo database formats such as AIX 4.x + + add configure option --with-ospeed to assist packagers in + transition to 5.3 change to ospeed type. * library: - + replaced case-statement in _nc_tracebits() for CSIZE with a - table to simplify working around implementations that define - random combinations of the related macros to zero. - + improved OS/2 mouse support by retrying as a 2-button mouse - if code fails to set up a 3-button mouse. - + added private entrypoint _nc_basename(), used to consolidate - related code in progs, as well as accommodating OS/2 EMX - pathnames. - + alter definition of NCURSES_CONST to make it non-empty. - + redefine 'TEXT' in menu.h for AMIGA, since it is reported to - have an (unspecified) symbol conflict. + + implement a simple vsscanf() fallback function which uses the + %n conversion to help parse the input data. + + various fixes to build/work with different implementations of + vsscanf(). + + add/use macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., + Solaris. + + finish changes needed to build dll's on cygwin. + + add #undef's before possible redefinition of ERR and OK in + curses.h * programs: - + modified progs/tset.c and tack/sysdep.c to build with sgttyb - interface if neither termio or termios is available. Tested - this with FreeBSD 2.1.5 (which does have termios - but the - sgttyb does work). + + modify ifdef's in write_entry.c to allow use of symbolic + links on platforms with no hard links, e.g., BeOS. + + modify _nc_write_entry() to allow for the possibility that + linking aliases on a filesystem that ignores case would not + succeed because the source and destination differ only by + case, e.g., NCR260VT300WPP0 on cygwin. + + modify logic in tic, toe, tput and tset which checks for + basename of argv[0] to work properly on systems such as OS/2 + which have case-independent filenames and/or program + suffixes, e.g., ".ext". 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 + * 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 + * 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 + * 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 + * 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 + * 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 + * 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 + 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 + * 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 + 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 + * 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 + * 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 + * 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 + 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 + * 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 + * 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 + * 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 + * 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 + 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 + 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 + * 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 + * 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 + 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 + * 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 + * 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 + * 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 + 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 + * 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 + 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 + The ncurses code has been tested with a wide variety of applications including (versions starting with those noted): cdk Curses Development Kit - [3]http://www.vexus.ca/CDK.html - [4]http://dickey.his.com/cdk. + [3]http://invisible-island.net/cdk. + [4]http://www.vexus.ca/CDK.html ded directory-editor - [5]http://dickey.his.com/ded. + [5]http://invisible-island.net/ded. dialog - the underlying application used in Slackware's setup, and the + the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [6]http://dickey.his.com/dialog. + [6]http://invisible-island.net/dialog. lynx the character-screen WWW browser [7]http://lynx.isc.org/release. - Midnight Commander 4.1 + Midnight Commander file manager [8]www.gnome.org/mc/. @@ -416,57 +321,57 @@ vile vi-like-emacs - [16]http://dickey.his.com/vile. + [16]http://invisible-island.net/vile. - The ncurses distribution includes a selection of test programs + The ncurses distribution includes a selection of test programs (including a few games). Who's Who and What's What The original developers of ncurses are [17]Zeyd Ben-Halim and [18]Eric - S. Raymond. Ongoing work is being done by [19]Thomas Dickey and - [20]Jürgen Pfeifer. [21]Thomas Dickey acts as the maintainer for the - Free Software Foundation, which holds the copyright on ncurses. + S. Raymond. Ongoing work is being done by [19]Thomas Dickey and + [20]Jürgen Pfeifer. [21]Thomas Dickey acts as the maintainer for the + Free Software Foundation, which holds the copyright on ncurses. Contact the current maintainers at [22]bug-ncurses@gnu.org. - To join the ncurses mailing list, please write email to + To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: subscribe @ 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 [23]ftp://dickey.his.com/ncurses. + Beta versions of ncurses and patches to the current release are made + available at [23]ftp://invisible-island.net/ncurses. Future Plans - * Extended-level XPG4 conformance, with internationalization + * 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 + 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 includes and uses a version of the terminfo-format - terminal description file maintained by Eric Raymond. + The distribution includes and uses a version of the terminfo-format + terminal description file maintained by Eric Raymond. [24]http://earthspace.net/~esr/terminfo. - You can find lots of information on terminal-related topics not + You can find lots of information on terminal-related topics not covered in the terminfo file at [25]Richard Shuford's archive. References 1. ftp://ftp.gnu.org/pub/gnu/ncurses - 2. ftp://dickey.his.com/ncurses - 3. http://www.vexus.ca/CDK.html - 4. http://dickey.his.com/cdk/cdk.html - 5. http://dickey.his.com/ded/ded.html - 6. http://dickey.his.com/dialog/dialog.html + 2. ftp://invisible-island.net/ncurses + 3. http://invisible-island.net/cdk/cdk.html + 4. http://www.vexus.ca/CDK.html + 5. http://invisible-island.net/ded/ded.html + 6. http://invisible-island.net/dialog/dialog.html 7. http://lynx.isc.org/release/ - 8. file://localhost/usr/build/ncurses/ncurses-5.2-20001021/doc/html/www.gnome.org/mc/ + 8. file://localhost/usr/build/ncurses/ncurses-5.2-20021012/doc/html/www.gnome.org/mc/ 9. http://www.mutt.org/ 10. http://www.ncftp.com/ 11. http://www.bostic.com/vi/ @@ -474,13 +379,13 @@ References 13. http://members.iinet.net.au/~yusuf/taper/ 14. http://www.bg.debian.org/Packages/unstable/text/vh.html 15. http://www.pp.clinet.fi/~walker/minicom.html - 16. http://dickey.his.com/vile/vile.html + 16. http://invisible-island.net/vile/vile.html 17. mailto:zmbenhal@netcom.com 18. http://www.ccil.org/~esr/home.html 19. mailto:dickey@herndon4.his.com - 20. mailto:juergen.pfeifer@gmx.net + 20. http://www.familiepfeifer.de/Contact.aspx?Lang=en 21. mailto:dickey@herndon4.his.com 22. mailto:bug-ncurses@gnu.org - 23. ftp://dickey.his.com/ncurses + 23. ftp://invisible-island.net/ncurses 24. http://earthspace.net/~esr/terminfo 25. http://www.cs.utk.edu/~shuford/terminal_index.html diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in index 9f38ec4c..9f6db419 100644 --- a/Ada95/Makefile.in +++ b/Ada95/Makefile.in @@ -26,10 +26,11 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer, 1996 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en # # Version Control -# $Revision: 1.13 $ +# $Revision: 1.14 $ # SHELL = /bin/sh THIS = Makefile diff --git a/Ada95/README b/Ada95/README index 8a530611..21e9b4cd 100644 --- a/Ada95/README +++ b/Ada95/README @@ -26,7 +26,8 @@ -- authorization. -- ------------------------------------------------------------------------------- --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en The documentation is provided in HTML format in the ./html subdirectory. The main document is named index.html diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in index b1651379..bccea45f 100644 --- a/Ada95/gen/Makefile.in +++ b/Ada95/gen/Makefile.in @@ -26,10 +26,11 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer, 1996 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en # # Version Control -# $Revision: 1.34 $ +# $Revision: 1.41 $ # .SUFFIXES: @@ -81,8 +82,8 @@ DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' GNATHTML = `type -p gnathtml || type -p gnathtml.pl` GNATHP = www.gnat.com -MAIL = juergen.pfeifer@gmx.net -HOMEP = home.t-online.de/home/Juergen.Pfeifer +MAIL = www.familiepfeifer.de/Contact.aspx?Lang=en +HOMEP = www.familiepfeifer.de/juergen ################################################################################ ALIB = @cf_ada_package@ @@ -101,7 +102,8 @@ GEN_FILES1 = Key_Definitions \ Linker_Options \ Base_Defs \ Window_Offsets \ - Version_Info + Version_Info \ + Trace_Defs GEN_FILES2 = Menu_Opt_Rep \ Menu_Base_Defs \ @@ -123,6 +125,7 @@ GEN_FILES5 = Chtype_Def \ GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ $(ADA_SRCDIR)/$(ABASE)-aux.ads \ + $(ADA_SRCDIR)/$(ABASE)-trace.ads \ $(ADA_SRCDIR)/$(ABASE)-menus.ads \ $(ADA_SRCDIR)/$(ABASE)-forms.ads \ $(ADA_SRCDIR)/$(ABASE)-mouse.ads \ @@ -136,6 +139,7 @@ GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ $(srcdir)/$(ABASE)-aux.ads.m4 \ + $(srcdir)/$(ABASE)-trace.ads.m4 \ $(srcdir)/$(ABASE)-menus.ads.m4 \ $(srcdir)/$(ABASE)-forms.ads.m4 \ $(srcdir)/$(ABASE)-mouse.ads.m4 \ @@ -217,6 +221,9 @@ Version_Info: gen$x Window_Offsets: gen$x $(GENERATE) B D >$@ +Trace_Defs: gen$x + $(GENERATE) B T >$@ + Menu_Opt_Rep: gen$x $(GENERATE) M R >$@ @@ -271,6 +278,12 @@ $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \ $(srcdir)/$(ABASE)-aux.ads.m4 |\ $(DEL_ADAMODE) >$@ +$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \ + $(GEN_FILES5) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-trace.ads.m4 |\ + $(DEL_ADAMODE) >$@ + $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \ $(GEN_FILES2) $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ @@ -406,9 +419,9 @@ adahtml: sed -e 's%<A HREF%%g' |\ sed -e 's/3X/3x/g' |\ - sed -e 's/$$\([A-Za-z0-9_]*:.*\)\$$/@\1@/' |\ + sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\ sed -e 's%Juergen Pfeifer%J\ürgen Pfeifer%g' |\ - sed -e 's%$(MAIL)%\<$(MAIL)\>%g' |\ + sed -e 's%http://$(MAIL)%$(MAIL)%g' |\ sed -e 's%</A>%%g' > $$a.tmp ;\ mv $$a.tmp $$f ;\ done diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 64e9f912..11ba3d73 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1996 * + * Author: Juergen Pfeifer, 1996 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /* Version Control - $Revision: 1.32 $ + $Revision: 1.35 $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -285,6 +286,26 @@ static void gen_attr_set( const char *name ) gen_reps (nap, name, (len+7)/8, little_endian?start:0); } +static void gen_trace(const char *name) +{ + static const name_attribute_pair nap[] = { + {"Times", TRACE_TIMES}, + {"Tputs", TRACE_TPUTS}, + {"Update", TRACE_UPDATE}, + {"Cursor_Move", TRACE_MOVE}, + {"Character_Output", TRACE_CHARPUT}, + {"Calls", TRACE_CALLS}, + {"Virtual_Puts", TRACE_VIRTPUT}, + {"Input_Events", TRACE_IEVENT}, + {"TTY_State", TRACE_BITS}, + {"Internal_Calls", TRACE_ICALLS}, + {"Character_Calls", TRACE_CCALLS}, + {"Termcap_TermInfo", TRACE_DATABASE}, + {(char *)0, 0} + }; + gen_reps(nap,name,sizeof(int),0); +} + static void gen_menu_opt_rep(const char *name) { static const name_attribute_pair nap[] = { @@ -937,6 +958,9 @@ void gen_mouse_events(void) #ifdef BUTTON_ALT GEN_MEVENT(BUTTON_ALT); #endif +#ifdef REPORT_MOUSE_POSITION + GEN_MEVENT(REPORT_MOUSE_POSITION); +#endif #ifdef ALL_MOUSE_EVENTS GEN_MEVENT(ALL_MOUSE_EVENTS); #endif @@ -1012,14 +1036,19 @@ static void mouse_basedefs(void) */ static void color_def (const char *name, int value) { - printf(" %-8s : constant Color_Number := %d;\n",name,value); + printf(" %-16s : constant Color_Number := %d;\n",name,value); } +#define HAVE_USE_DEFAULT_COLORS 1 + /* * Generate all color definitions */ static void gen_color (void) { +#ifdef HAVE_USE_DEFAULT_COLORS + color_def ("Default_Color",-1); +#endif #ifdef COLOR_BLACK color_def ("Black",COLOR_BLACK); #endif @@ -1108,7 +1137,7 @@ eti_gen(char*buf, int code, const char* name, int* etimin, int* etimax) o = offsetof(WINDOW, member); \ if ((o%sizeof(itype) == 0)) { \ printf(" Offset%-*s : constant Natural := %2ld; -- %s\n", \ - 8, #member, o/sizeof(itype),#itype); \ + 12, #member, o/sizeof(itype),#itype); \ } \ } @@ -1128,22 +1157,46 @@ gen_offsets(void) GEN_OFFSET(_pary,int); GEN_OFFSET(_parx,int); if (sizeof(bool) == sizeof(char)) { + GEN_OFFSET(_notimeout,char); + GEN_OFFSET(_clear,char); + GEN_OFFSET(_leaveok,char); GEN_OFFSET(_scroll,char); + GEN_OFFSET(_idlok,char); + GEN_OFFSET(_idcok,char); + GEN_OFFSET(_immed,char); + GEN_OFFSET(_sync,char); + GEN_OFFSET(_use_keypad,char); s_bool = "char"; } else if (sizeof(bool) == sizeof(short)) { + GEN_OFFSET(_notimeout,short); + GEN_OFFSET(_clear,short); + GEN_OFFSET(_leaveok,short); GEN_OFFSET(_scroll,short); + GEN_OFFSET(_idlok,short); + GEN_OFFSET(_idcok,short); + GEN_OFFSET(_immed,short); + GEN_OFFSET(_sync,short); + GEN_OFFSET(_use_keypad,short); s_bool = "short"; } else if (sizeof(bool) == sizeof(int)) { + GEN_OFFSET(_notimeout,int); + GEN_OFFSET(_clear,int); + GEN_OFFSET(_leaveok,int); GEN_OFFSET(_scroll,int); + GEN_OFFSET(_idlok,int); + GEN_OFFSET(_idcok,int); + GEN_OFFSET(_immed,int); + GEN_OFFSET(_sync,int); + GEN_OFFSET(_use_keypad,int); s_bool = "int"; } printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n", - 8, "_bool", (long) sizeof(bool),"bool"); + 12, "_bool", (long) sizeof(bool),"bool"); /* In ncurses _maxy and _maxx needs an offset for the "public" * value */ printf(" Offset%-*s : constant Natural := %2d; -- %s\n", - 8, "_XY",1,"int"); + 12, "_XY",1,"int"); printf("\n"); printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n",s_bool); } @@ -1212,6 +1265,9 @@ int main(int argc, char *argv[]) case 'V': /* generate version info */ gen_version_info(); break; + case 'T': /* generate the Trace info */ + gen_trace("Trace_Attribute_Set"); + break; default: break; } diff --git a/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/Ada95/gen/terminal_interface-curses-aux.ads.m4 index 71e4872b..aacac4f5 100644 --- a/Ada95/gen/terminal_interface-curses-aux.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-aux.ads.m4 @@ -35,9 +35,10 @@ include(M4MACRO)---------------------------------------------------------------- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.13 $ +-- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 index ff7882f7..79726781 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 index aedd01ba..6f99e854 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.13 $ +-- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 index cddc1d1e..b07618ae 100644 --- a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 index f969ce04..9123f9d9 100644 --- a/Ada95/gen/terminal_interface-curses-forms.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.24 $ +-- $Revision: 1.26 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Form_Base_Defs') @@ -685,6 +686,9 @@ include(`Form_Opt_Rep')Dnl -- AKA pragma Inline (Is_New_Page); + -- MANPAGE(`form_requestname.3x') + -- Not Implemented: form_request_name, form_request_by_name + ------------------------------------------------------------------------------ private type Field is new System.Storage_Elements.Integer_Address; diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 index 8d601d80..1c42bbeb 100644 --- a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 index 2f26f08a..87ffadc7 100644 --- a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 index 2bc350a7..ba620792 100644 --- a/Ada95/gen/terminal_interface-curses-menus.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.21 $ +-- $Revision: 1.23 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Menu_Base_Defs') @@ -473,6 +474,13 @@ include(`Item_Rep')dnl procedure Set_Format (Men : in Menu; Lines : in Line_Count; Columns : in Column_Count); + -- Not implemented: 0 argument for Lines or Columns; + -- instead use Format to get the current sizes + -- The default format is 16 rows, 1 column. Calling + -- set_menu_format with a null menu pointer will change this + -- default. A zero row or column argument to set_menu_format + -- is interpreted as a request not to change the current + -- value. -- AKA pragma Inline (Set_Format); @@ -570,7 +578,7 @@ include(`Item_Rep')dnl -- Reset Men to Null_Menu -- Not inlined - -- MANPAGE(`menu_new.3x') + -- MANPAGE(`menu_driver.3x') type Driver_Result is (Menu_Ok, Request_Denied, @@ -583,6 +591,8 @@ include(`Item_Rep')dnl -- AKA -- Driver is not inlined + -- ANCHOR(`menu_requestname.3x') + -- Not Implemented: menu_request_name, menu_request_by_name ------------------------------------------------------------------------------- private type Item is new System.Storage_Elements.Integer_Address; diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 index 0db4ffbb..84eeacb2 100644 --- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.19 $ +-- $Revision: 1.21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Mouse_Base_Defs') @@ -52,6 +53,12 @@ package Terminal_Interface.Curses.Mouse is -- is still marked as experimental. So also this binding will change -- if the ncurses methods change. -- + -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates + -- in the parent package. + -- + -- Not implemented: + -- REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event + -- or Start_Mouse) type Event_Mask is private; No_Events : constant Event_Mask; All_Events : constant Event_Mask; @@ -107,6 +114,8 @@ package Terminal_Interface.Curses.Mouse is -- ANCHOR(`mousemask()',`Start_Mouse') -- There is one difference to mousmask(): we return the value of the -- old mask, that means the event mask value before this call. + -- Not Implemented: The library version + -- returns a Mouse_Mask that tells which events are reported. function Start_Mouse (Mask : Event_Mask := All_Events) return Event_Mask; -- AKA @@ -128,6 +137,8 @@ package Terminal_Interface.Curses.Mouse is State : out Button_State); -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they -- may not be identical to window coordinates. + -- Not Implemented: Get_Event only reports one event, the C library + -- version supports multiple events, e.g. {click-1, click-3} pragma Inline (Get_Event); -- ANCHOR(`ungetmouse()',`Unget_Mouse') diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 index 1369cfd7..4b9a8581 100644 --- a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4 index 04e374fc..7d571b9e 100644 --- a/Ada95/gen/terminal_interface-curses-panels.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-panels.ads.m4 @@ -36,9 +36,10 @@ include(M4MACRO)dnl -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.15 $ +-- $Revision: 1.16 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; diff --git a/Ada95/gen/terminal_interface-curses-trace.ads.m4 b/Ada95/gen/terminal_interface-curses-trace.ads.m4 new file mode 100644 index 00000000..546004fd --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-trace.ads.m4 @@ -0,0 +1,78 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-trace__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Trace -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control: +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package Terminal_Interface.Curses.Trace is + pragma Preelaborate (Terminal_Interface.Curses.Trace); + + pragma Warnings (Off); +include(`Trace_Defs') + + pragma Warnings (On); + + Trace_Disable : constant Trace_Attribute_Set := (others => False); + + Trace_Ordinary : constant Trace_Attribute_Set := + (Times => True, + Tputs => True, + Update => True, + Cursor_Move => True, + Character_Output => True, + others => False); + Trace_Maximum : constant Trace_Attribute_Set := (others => True); + +------------------------------------------------------------------------------ + + -- MANPAGE(`curs_trace.3x') + + -- ANCHOR(`trace()',`Trace_on') + procedure Trace_On (x : Trace_Attribute_Set); + -- The debugging library has trace. + + -- ANCHOR(`_tracef()',`Trace_Put') + procedure Trace_Put (str : String); + -- AKA + + Current_Trace_Setting : Trace_Attribute_Set; + pragma Import (C, Current_Trace_Setting, "_nc_tracing"); + +end Terminal_Interface.Curses.Trace; diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 index 11930d97..bd879cdd 100644 --- a/Ada95/gen/terminal_interface-curses.ads.m4 +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -35,9 +35,10 @@ include(M4MACRO)---------------------------------------------------------------- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.28 $ +-- $Revision: 1.30 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') @@ -95,7 +96,7 @@ include(`Old_Keys')dnl ------------------------------------------------------------------------------ - type Color_Number is range 0 .. Integer (Interfaces.C.short'Last); + type Color_Number is range -1 .. Integer (Interfaces.C.short'Last); for Color_Number'Size use Interfaces.C.short'Size; -- (n)curses uses a short for the color index -- The model is, that a Color_Number is an index into an array of @@ -198,7 +199,7 @@ include(`AC_Rep') include(`ACS_Map')dnl -- MANPAGE(`curs_initscr.3x') - -- | Not implemented: newterm, set_term, delscreen + -- | Not implemented: newterm, set_term, delscreen, curscr -- ANCHOR(`stdscr',`Standard_Window') function Standard_Window return Window; @@ -233,6 +234,7 @@ include(`ACS_Map')dnl Line : in Line_Position; Column : in Column_Position); -- AKA + -- ALIAS(`move()') pragma Inline (Move_Cursor); -- MANPAGE(`curs_addch.3x') @@ -241,6 +243,7 @@ include(`ACS_Map')dnl procedure Add (Win : in Window := Standard_Window; Ch : in Attributed_Character); -- AKA + -- ALIAS(`addch()') procedure Add (Win : in Window := Standard_Window; Ch : in Character); @@ -254,6 +257,7 @@ include(`ACS_Map')dnl Column : in Column_Position; Ch : in Attributed_Character); -- AKA + -- ALIAS(`mvaddch()') procedure Add (Win : in Window := Standard_Window; @@ -268,6 +272,7 @@ include(`ACS_Map')dnl (Win : in Window := Standard_Window; Ch : in Attributed_Character); -- AKA + -- ALIAS(`echochar()') procedure Add_With_Immediate_Echo (Win : in Window := Standard_Window; @@ -276,6 +281,7 @@ include(`ACS_Map')dnl pragma Inline (Add_With_Immediate_Echo); -- MANPAGE(`curs_window.3x') + -- Not Implemented: wcursyncup -- ANCHOR(`newwin()',`Create') function Create @@ -283,6 +289,8 @@ include(`ACS_Map')dnl Number_Of_Columns : Column_Count; First_Line_Position : Line_Position; First_Column_Position : Column_Position) return Window; + -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns + -- the C version lets them be 0, see the man page. -- AKA pragma Inline (Create); @@ -363,6 +371,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`waddstr()') + -- ALIAS(`addnstr()') + -- ALIAS(`addstr()') -- ANCHOR(`mvwaddnstr()',`Add') procedure Add (Win : in Window := Standard_Window; @@ -372,6 +382,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`mvwaddstr()') + -- ALIAS(`mvaddnstr()') + -- ALIAS(`mvaddstr()') -- MANPAGE(`curs_addchstr.3x') @@ -381,6 +393,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`waddchstr()') + -- ALIAS(`addchnstr()') + -- ALIAS(`addchstr()') -- ANCHOR(`mvwaddchnstr()',`Add') procedure Add (Win : in Window := Standard_Window; @@ -390,9 +404,13 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`mvwaddchstr()') + -- ALIAS(`mvaddchnstr()') + -- ALIAS(`mvaddchstr()') pragma Inline (Add); -- MANPAGE(`curs_border.3x') + -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline + -- | use Move_Cursor then Horizontal_Line or Vertical_Line -- ANCHOR(`wborder()',`Border') procedure Border @@ -407,6 +425,7 @@ include(`ACS_Map')dnl Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character ); -- AKA + -- ALIAS(`border()') pragma Inline (Border); -- ANCHOR(`box()',`Box') @@ -423,6 +442,7 @@ include(`ACS_Map')dnl Line_Size : in Natural; Line_Symbol : in Attributed_Character := Default_Character); -- AKA + -- ALIAS(`hline()') pragma Inline (Horizontal_Line); -- ANCHOR(`wvline()',`Vertical_Line') @@ -431,14 +451,17 @@ include(`ACS_Map')dnl Line_Size : in Natural; Line_Symbol : in Attributed_Character := Default_Character); -- AKA + -- ALIAS(`vline()') pragma Inline (Vertical_Line); -- MANPAGE(`curs_getch.3x') + -- Not implemented: mvgetch, mvwgetch -- ANCHOR(`wgetch()',`Get_Keystroke') function Get_Keystroke (Win : Window := Standard_Window) return Real_Key_Code; -- AKA + -- ALIAS(`getch()') -- Get a character from the keyboard and echo it - if enabled - to the -- window. -- If for any reason (i.e. a timeout) we couldn't get a character the @@ -475,14 +498,28 @@ include(`ACS_Map')dnl pragma Inline (Function_Key_Code); -- MANPAGE(`curs_attr.3x') + -- | Not implemented attr_off, wattr_off, + -- | attr_on, wattr_on, attr_set, wattr_set + + -- PAIR_NUMBER + -- PAIR_NUMBER(c) is the same as c.Color + + -- ANCHOR(`standout()',`Standout') + procedure Standout (Win : Window := Standard_Window; + On : Boolean := True); + -- ALIAS(`wstandout()') + -- ALIAS(`wstandend()') -- ANCHOR(`wattron()',`Switch_Character_Attribute') procedure Switch_Character_Attribute (Win : in Window := Standard_Window; Attr : in Character_Attribute_Set := Normal_Video; On : in Boolean := True); -- if False we switch Off. + -- Switches those Attributes set to true in the list. -- AKA -- ALIAS(`wattroff()') + -- ALIAS(`attron()') + -- ALIAS(`attroff()') -- ANCHOR(`wattrset()',`Set_Character_Attributes') procedure Set_Character_Attributes @@ -490,12 +527,14 @@ include(`ACS_Map')dnl Attr : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA + -- ALIAS(`attrset()') pragma Inline (Set_Character_Attributes); -- ANCHOR(`wattr_get()',`Get_Character_Attributes') function Get_Character_Attribute (Win : in Window := Standard_Window) return Character_Attribute_Set; -- AKA + -- ALIAS(`attr_get()') -- ANCHOR(`wattr_get()',`Get_Character_Attribute') function Get_Character_Attribute @@ -507,6 +546,7 @@ include(`ACS_Map')dnl procedure Set_Color (Win : in Window := Standard_Window; Pair : in Color_Pair); -- AKA + -- ALIAS(`color_set()') pragma Inline (Set_Color); -- ANCHOR(`wchgat()',`Change_Attributes') @@ -516,6 +556,7 @@ include(`ACS_Map')dnl Attr : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA + -- ALIAS(`chgat()') -- ANCHOR(`mvwchgat()',`Change_Attributes') procedure Change_Attributes @@ -526,6 +567,7 @@ include(`ACS_Map')dnl Attr : in Character_Attribute_Set := Normal_Video; Color : in Color_Pair := Color_Pair'First); -- AKA + -- ALIAS(`mvchgat()') pragma Inline (Change_Attributes); -- MANPAGE(`curs_beep.3x') @@ -574,6 +616,11 @@ include(`ACS_Map')dnl -- AKA pragma Inline (Set_KeyPad_Mode); + function Get_KeyPad_Mode (Win : in Window := Standard_Window) + return Boolean; + -- This has no pendant in C. There you've to look into the WINDOWS + -- structure to get the value. Bad practice, not repeated in Ada. + type Half_Delay_Amount is range 1 .. 255; -- ANCHOR(`halfdelay()',`Half_Delay') @@ -610,6 +657,7 @@ include(`ACS_Map')dnl Mode : in Timeout_Mode; Amount : in Natural); -- in Milliseconds -- AKA + -- ALIAS(`timeout()') -- Instead of overloading the semantic of the sign of amount, we -- introduce the Timeout_Mode parameter. This should improve -- readability. For Blocking and Non_Blocking, the Amount is not @@ -683,6 +731,7 @@ include(`ACS_Map')dnl Top_Line : in Line_Position; Bottom_Line : in Line_Position); -- AKA + -- ALIAS(`setscrreg()') pragma Inline (Set_Scroll_Region); -- MANPAGE(`curs_refresh.3x') @@ -697,6 +746,7 @@ include(`ACS_Map')dnl -- AKA -- There is an overloaded Refresh for Pads. -- The Inline pragma appears there + -- ALIAS(`refresh()') -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update') procedure Refresh_Without_Update @@ -721,33 +771,41 @@ include(`ACS_Map')dnl -- ANCHOR(`werase()',`Erase') procedure Erase (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`erase()') pragma Inline (Erase); -- ANCHOR(`wclear()',`Clear') procedure Clear (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`clear()') pragma Inline (Clear); -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') procedure Clear_To_End_Of_Screen (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`clrtobot()') pragma Inline (Clear_To_End_Of_Screen); -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line') procedure Clear_To_End_Of_Line (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`clrtoeol()') pragma Inline (Clear_To_End_Of_Line); -- MANPAGE(`curs_bkgd.3x') -- ANCHOR(`wbkgdset()',`Set_Background') + -- TODO: we could have Set_Background(Window; Character_Attribute_Set) + -- because in C it is common to see bkgdset(A_BOLD) or + -- bkgdset(COLOR_PAIR(n)) procedure Set_Background (Win : in Window := Standard_Window; Ch : in Attributed_Character); -- AKA + -- ALIAS(`bkgdset()') pragma Inline (Set_Background); -- ANCHOR(`wbkgd()',`Change_Background') @@ -755,12 +813,15 @@ include(`ACS_Map')dnl (Win : in Window := Standard_Window; Ch : in Attributed_Character); -- AKA + -- ALIAS(`bkgd()') pragma Inline (Change_Background); -- ANCHOR(`wbkgdget()',`Get_Background') + -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough. function Get_Background (Win : Window := Standard_Window) return Attributed_Character; -- AKA + -- ALIAS(`bkgdget()') pragma Inline (Get_Background); -- MANPAGE(`curs_touch.3x') @@ -834,16 +895,19 @@ include(`ACS_Map')dnl (Win : in Window := Standard_Window; Lines : in Integer := 1); -- default is to insert one line above -- AKA + -- ALIAS(`insdelln()') pragma Inline (Insert_Delete_Lines); -- ANCHOR(`wdeleteln()',`Delete_Line') procedure Delete_Line (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`deleteln()') pragma Inline (Delete_Line); -- ANCHOR(`winsertln()',`Insert_Line') procedure Insert_Line (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`insertln()') pragma Inline (Insert_Line); -- MANPAGE(`curs_getyx.3x') @@ -942,6 +1006,8 @@ include(`ACS_Map')dnl procedure Scroll (Win : in Window := Standard_Window; Amount : in Integer := 1); -- AKA + -- ALIAS(`scroll()') + -- ALIAS(`scrl()') pragma Inline (Scroll); -- MANPAGE(`curs_delch.3x') @@ -949,6 +1015,7 @@ include(`ACS_Map')dnl -- ANCHOR(`wdelch()',`Delete_Character') procedure Delete_Character (Win : in Window := Standard_Window); -- AKA + -- ALIAS(`delch()') -- ANCHOR(`mvwdelch()',`Delete_Character') procedure Delete_Character @@ -956,6 +1023,7 @@ include(`ACS_Map')dnl Line : in Line_Position; Column : in Column_Position); -- AKA + -- ALIAS(`mvdelch()') pragma Inline (Delete_Character); -- MANPAGE(`curs_inch.3x') @@ -963,6 +1031,7 @@ include(`ACS_Map')dnl -- ANCHOR(`winch()',`Peek') function Peek (Win : Window := Standard_Window) return Attributed_Character; + -- ALIAS(`inch()') -- AKA -- ANCHOR(`mvwinch()',`Peek') @@ -971,14 +1040,16 @@ include(`ACS_Map')dnl Line : Line_Position; Column : Column_Position) return Attributed_Character; -- AKA + -- ALIAS(`mvinch()') -- More Peek's follow, pragma Inline appears later. - -- MANPAGE(`curs_winch.3x') + -- MANPAGE(`curs_insch.3x') -- ANCHOR(`winsch()',`Insert') procedure Insert (Win : in Window := Standard_Window; Ch : in Attributed_Character); -- AKA + -- ALIAS(`insch()') -- ANCHOR(`mvwinsch()',`Insert') procedure Insert (Win : in Window := Standard_Window; @@ -986,8 +1057,9 @@ include(`ACS_Map')dnl Column : in Column_Position; Ch : in Attributed_Character); -- AKA + -- ALIAS(`mvinsch()') - -- MANPAGE(`curs_winch.3x') + -- MANPAGE(`curs_insstr.3x') -- ANCHOR(`winsnstr()',`Insert') procedure Insert (Win : in Window := Standard_Window; @@ -995,6 +1067,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`winsstr()') + -- ALIAS(`insnstr()') + -- ALIAS(`insstr()') -- ANCHOR(`mvwinsnstr()',`Insert') procedure Insert (Win : in Window := Standard_Window; @@ -1004,6 +1078,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`mvwinsstr()') + -- ALIAS(`mvinsnstr()') + -- ALIAS(`mvinsstr()') pragma Inline (Insert); -- MANPAGE(`curs_instr.3x') @@ -1014,6 +1090,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`winstr()') + -- ALIAS(`innstr()') + -- ALIAS(`instr()') -- ANCHOR(`mvwinnstr()',`Peek') procedure Peek (Win : in Window := Standard_Window; @@ -1023,6 +1101,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`mvwinstr()') + -- ALIAS(`mvinnstr()') + -- ALIAS(`mvinstr()') -- MANPAGE(`curs_inchstr.3x') @@ -1032,6 +1112,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`winchstr()') + -- ALIAS(`inchnstr()') + -- ALIAS(`inchstr()') -- ANCHOR(`mvwinchnstr()',`Peek') procedure Peek (Win : in Window := Standard_Window; @@ -1041,6 +1123,8 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`mvwinchstr()') + -- ALIAS(`mvinchnstr()') + -- ALIAS(`mvinchstr()') -- We don't inline the Peek procedures -- MANPAGE(`curs_getstr.3x') @@ -1051,19 +1135,27 @@ include(`ACS_Map')dnl Len : in Integer := -1); -- AKA -- ALIAS(`wgetstr()') + -- ALIAS(`getnstr()') + -- ALIAS(`getstr()') + -- actually getstr is not supported because that results in buffer + -- overflows. + -- ANCHOR(`mvwgetnstr()',`Get') procedure Get (Win : in Window := Standard_Window; Line : in Line_Position; Column : in Column_Position; Str : out String; Len : in Integer := -1); -- AKA - -- not specified in ncurses, should be: mvwgetnstr() - -- and mvwgetstr() (which exists) + -- ALIAS(`mvwgetstr()') + -- ALIAS(`mvgetnstr()') + -- ALIAS(`mvgetstr()') -- Get is not inlined -- MANPAGE(`curs_slk.3x') + -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set + type Soft_Label_Key_Format is (Three_Two_Three, Four_Four, PC_Style, -- ncurses specific @@ -1149,6 +1241,9 @@ include(`ACS_Map')dnl -- AKA pragma Inline (Set_Soft_Label_Key_Color); + -- MANPAGE(`keybound.3x') + -- Not Implemented: keybound + -- MANPAGE(`keyok.3x') -- ANCHOR(`keyok()',`Enable_Key') @@ -1167,8 +1262,10 @@ include(`ACS_Map')dnl -- MANPAGE(`curs_util.3x') - -- | Not implemented : filter, use_env, putwin, getwin + -- | Not implemented : filter, use_env + -- | putwin, getwin are in the child package PutWin -- + -- ANCHOR(`keyname()',`Key_Name') procedure Key_Name (Key : in Real_Key_Code; Name : out String); @@ -1256,6 +1353,12 @@ include(`ACS_Map')dnl -- MANPAGE(`curs_color.3x') + -- COLOR_PAIR + -- COLOR_PAIR(n) in C is the same as + -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video) + -- In C you often see something like c = c | COLOR_PAIR(n); + -- This is equivalent to c.Color := n; + -- ANCHOR(`start_color()',`Start_Color') procedure Start_Color; -- AKA @@ -1302,7 +1405,6 @@ include(`ACS_Map')dnl pragma Inline (Color_Content); -- MANPAGE(`curs_kernel.3x') - -- | Not implemented: getsyx, setsyx -- type Curses_Mode is (Curses, Shell); @@ -1375,6 +1477,73 @@ include(`ACS_Map')dnl -- Window or if you pass the Null_Window as argument. -- We don't inline this procedure + -- MANPAGE(`dft_fgbg.3x') + + -- ANCHOR(`use_default_colors()',`Use_Default_Colors') + procedure Use_Default_Colors; + -- AKA + pragma Inline (Use_Default_Colors); + + -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors') + procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; + Back : Color_Number := Default_Color); + -- AKA + pragma Inline (Assume_Default_Colors); + + -- MANPAGE(`curs_extend.3x') + + -- ANCHOR(`curses_version()',`Curses_Version') + function Curses_Version return String; + -- AKA + + -- ANCHOR(`use_extended_names()',`Use_Extended_Names') + -- The returnvalue is the previous setting of the flag + function Use_Extended_Names (Enable : Boolean) return Boolean; + -- AKA + + -- MANPAGE(`curs_scr_dump.3x') + + -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') + procedure Screen_Dump_To_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_restore()',`Screen_Restore_From_File') + procedure Screen_Restore_From_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_init()',`Screen_Init_From_File') + procedure Screen_Init_From_File (Filename : in String); + -- AKA + + -- ANCHOR(`scr_set()',`Screen_Set_File') + procedure Screen_Set_File (Filename : in String); + -- AKA + + -- MANPAGE(`curs_print.3x') + -- Not implemented: mcprint + + -- MANPAGE(`curs_printw.3x') + -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw, + -- vw_printw + -- Please use the Ada style Text_IO child packages for formatted + -- printing. It doesn't make a lot of sense to map the printf style + -- C functions to Ada. + + -- MANPAGE(`curs_scanw.3x') + -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw + + + -- MANPAGE(`resizeterm.3x') + -- Not Implemented: resizeterm + + -- MANPAGE(`wresize.3x') + + -- ANCHOR(`wresize()',`Resize') + procedure Resize (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count); + -- AKA + private type Window is new System.Storage_Elements.Integer_Address; Null_Window : constant Window := 0; diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in index d9cf0cf7..23cf94f8 100644 --- a/Ada95/samples/Makefile.in +++ b/Ada95/samples/Makefile.in @@ -26,10 +26,11 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer, 1996 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en # # Version Control -# $Revision: 1.25 $ +# $Revision: 1.29 $ # .SUFFIXES: @@ -84,9 +85,9 @@ ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses CARGS =-cargs $(ADAFLAGS) -LARGS =-largs -L../../lib $(LD_FLAGS) -lAdaCurses -lncurses@LIB_SUFFIX@ - -PROGS = tour rain +LARGS =-largs -L../../lib @TEST_ARGS@ $(LD_FLAGS) -lAdaCurses @EXTRA_LIBS@ + +PROGS = tour rain ncurses TOUR_OBJS = tour.o sample.o sample-curses_demo.o sample-explanation.o \ sample-form_demo.o sample-function_key_setting.o \ @@ -98,7 +99,19 @@ TOUR_OBJS = tour.o sample.o sample-curses_demo.o sample-explanation.o \ RAIN_OBJS = rain.o status.o -all :: tour$x rain$x +NCURSES_OBJS = ncurses.o ncurses2-getch_test.o \ + ncurses2-acs_and_scroll.o ncurses2-m.o \ + ncurses2-acs_display.o ncurses2-menu_test.o \ + ncurses2-attr_test.o ncurses2-overlap_test.o \ + ncurses2-color_edit.o ncurses2-slk_test.o \ + ncurses2-color_test.o ncurses2-test_sgr_attributes.o \ + ncurses2-demo_forms.o ncurses2-trace_set.o \ + ncurses2-demo_pad.o ncurses2-util.o \ + ncurses2-demo_panels.o ncurses2.o \ + ncurses2-flushinp_test.o + + +all :: tour$x rain$x ncurses$x @ sources : @@ -113,6 +126,9 @@ uninstall \ uninstall.libs :: @ +ncurses$x : + $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) + tour$x : explain.msg $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) @@ -126,7 +142,8 @@ mostlyclean: @ clean :: mostlyclean - rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] explain.msg + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ + explain.msg trace screendump distclean :: clean rm -f Makefile diff --git a/Ada95/samples/ncurses.adb b/Ada95/samples/ncurses.adb new file mode 100644 index 00000000..19f658d5 --- /dev/null +++ b/Ada95/samples/ncurses.adb @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.m; use ncurses2.m; +with GNAT.OS_Lib; use GNAT.OS_Lib; + +procedure ncurses is +begin + OS_Exit (main); +end ncurses; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb new file mode 100644 index 00000000..65c2939a --- /dev/null +++ b/Ada95/samples/ncurses2-acs_and_scroll.adb @@ -0,0 +1,722 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Windows and scrolling tester. +-- Demonstrate windows + +with Ada.Strings.Fixed; +with Ada.Strings; + +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Terminal_Interface.Curses.PutWin; use Terminal_Interface.Curses.PutWin; + +with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; +with Ada.Streams; use Ada.Streams; + +procedure ncurses2.acs_and_scroll is + + + Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#; + Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#; + + Quit : constant Key_Code := CTRL ('Q'); + Escape : constant Key_Code := CTRL ('['); + + + Botlines : constant Line_Position := 4; + + type pair is record + y : Line_Position; + x : Column_Position; + end record; + + type Frame; + type FrameA is access Frame; + + f : File_Type; + dumpfile : constant String := "screendump"; + + procedure Outerbox (ul, lr : pair; onoff : Boolean); + function HaveKeyPad (w : Window) return Boolean; + function HaveScroll (w : Window) return Boolean; + procedure newwin_legend (curpw : Window); + procedure transient (curpw : Window; msg : String); + procedure newwin_report (win : Window := Standard_Window); + procedure selectcell (uli : Line_Position; + ulj : Column_Position; + lri : Line_Position; + lrj : Column_Position; + p : out pair; + b : out Boolean); + function getwindow return Window; + procedure newwin_move (win : Window; + dy : Line_Position; + dx : Column_Position); + function delete_framed (fp : FrameA; showit : Boolean) return FrameA; + + use Ada.Streams.Stream_IO; + + + -- A linked list + -- I wish there was a standard library linked list. Oh well. + type Frame is record + next, last : FrameA; + do_scroll : Boolean; + do_keypad : Boolean; + wind : Window; + end record; + + current : FrameA; + + c : Key_Code; + + procedure Outerbox (ul, lr : pair; onoff : Boolean) is + begin + if onoff then + -- Note the fix of an obscure bug + -- try making a 1x1 box then enlarging it, the is a blank + -- upper left corner! + Add (Line => ul.y - 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + Add (Line => ul.y - 1, Column => lr.x + 1, + Ch => ACS_Map (ACS_Upper_Right_Corner)); + Add (Line => lr.y + 1, Column => lr.x + 1, + Ch => ACS_Map (ACS_Lower_Right_Corner)); + Add (Line => lr.y + 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Lower_Left_Corner)); + + Move_Cursor (Line => ul.y - 1, Column => ul.x); + Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => ul.x - 1); + Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), + Line_Size => Integer (lr.y - ul.y) + 1); + Move_Cursor (Line => lr.y + 1, Column => ul.x); + Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => lr.x + 1); + Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), + Line_Size => Integer (lr.y - ul.y) + 1); + else + Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ' '); + Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ' '); + Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ' '); + Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ' '); + + Move_Cursor (Line => ul.y - 1, Column => ul.x); + Horizontal_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => ul.x - 1); + Vertical_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.y - ul.y) + 1); + Move_Cursor (Line => lr.y + 1, Column => ul.x); + Horizontal_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => lr.x + 1); + Vertical_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.y - ul.y) + 1); + end if; + end Outerbox; + + function HaveKeyPad (w : Window) return Boolean is + begin + return Get_KeyPad_Mode (w); + exception + when Curses_Exception => return False; + end HaveKeyPad; + + function HaveScroll (w : Window) return Boolean is + begin + return Scrolling_Allowed (w); + exception + when Curses_Exception => return False; + end HaveScroll; + + + procedure newwin_legend (curpw : Window) is + + package p is new genericPuts (200); + use p; + use p.BS; + + type string_a is access String; + + type rrr is record + msg : string_a; + code : Integer range 0 .. 3; + end record; + + legend : constant array (Positive range <>) of rrr := + ( + ( + new String'("^C = create window"), 0 + ), + ( + new String'("^N = next window"), 0 + ), + ( + new String'("^P = previous window"), 0 + ), + ( + new String'("^F = scroll forward"), 0 + ), + ( + new String'("^B = scroll backward"), 0 + ), + ( + new String'("^K = keypad(%s)"), 1 + ), + ( + new String'("^S = scrollok(%s)"), 2 + ), + ( + new String'("^W = save window to file"), 0 + ), + ( + new String'("^R = restore window"), 0 + ), + ( + new String'("^X = resize"), 0 + ), + ( + new String'("^Q%s = exit"), 3 + ) + ); + + buf : Bounded_String; + do_keypad : Boolean := HaveKeyPad (curpw); + do_scroll : Boolean := HaveScroll (curpw); + + pos : Natural; + + mypair : pair; + + use Ada.Strings.Fixed; + + begin + Move_Cursor (Line => Lines - 4, Column => 0); + for n in legend'Range loop + pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all, + Pattern => "%s"); + -- buf := (others => ' '); + buf := To_Bounded_String (legend (n).msg.all); + case legend (n).code is + when 0 => null; + when 1 => + if do_keypad then + Replace_Slice (buf, pos, pos + 1, "yes"); + else + Replace_Slice (buf, pos, pos + 1, "no"); + end if; + when 2 => + if do_scroll then + Replace_Slice (buf, pos, pos + 1, "yes"); + else + Replace_Slice (buf, pos, pos + 1, "no"); + end if; + when 3 => + if do_keypad then + Replace_Slice (buf, pos, pos + 1, "/ESC"); + else + Replace_Slice (buf, pos, pos + 1, ""); + end if; + end case; + Get_Cursor_Position (Line => mypair.y, Column => mypair.x); + if Columns < mypair.x + 3 + Column_Position (Length (buf)) then + Add (Ch => newl); + elsif n /= 1 then -- n /= legen'First + Add (Str => ", "); + end if; + myAdd (Str => buf); + end loop; + Clear_To_End_Of_Line; + end newwin_legend; + + + procedure transient (curpw : Window; msg : String) is + begin + newwin_legend (curpw); + if msg /= "" then + Add (Line => Lines - 1, Column => 0, Str => msg); + Refresh; + Nap_Milli_Seconds (1000); + end if; + + Move_Cursor (Line => Lines - 1, Column => 0); + + if HaveKeyPad (curpw) then + Add (Str => "Non-arrow"); + else + Add (Str => "All other"); + end if; + Add (str => " characters are echoed, window should "); + if not HaveScroll (curpw) then + Add (Str => "not "); + end if; + Add (str => "scroll"); + + Clear_To_End_Of_Line; + end transient; + + + procedure newwin_report (win : Window := Standard_Window) is + y : Line_Position; + x : Column_Position; + use Int_IO; + tmp2a : String (1 .. 2); + tmp2b : String (1 .. 2); + begin + if win /= Standard_Window then + transient (win, ""); + end if; + Get_Cursor_Position (win, y, x); + Move_Cursor (Line => Lines - 1, Column => Columns - 17); + Put (tmp2a, Integer (y)); + Put (tmp2b, Integer (x)); + Add (Str => "Y = " & tmp2a & " X = " & tmp2b); + if win /= Standard_Window then + Refresh; + else + Move_Cursor (win, y, x); + end if; + end newwin_report; + + procedure selectcell (uli : Line_Position; + ulj : Column_Position; + lri : Line_Position; + lrj : Column_Position; + p : out pair; + b : out Boolean) is + c : Key_Code; + res : pair; + i : Line_Position := 0; + j : Column_Position := 0; + si : Line_Position := lri - uli + 1; + sj : Column_Position := lrj - ulj + 1; + begin + res.y := uli; + res.x := ulj; + loop + Move_Cursor (Line => uli + i, Column => ulj + j); + newwin_report; + + c := Getchar; + case c is + when + Macro_Quit | + Macro_Escape => + -- on the same line macro calls interfere due to the # comment + -- this is needed because keypad off affects all windows. + -- try removing the ESCAPE and see what happens. + b := False; + return; + when KEY_UP => + i := i + si - 1; + -- same as i := i - 1 because of Modulus arithetic, + -- on Line_Position, which is a Natural + -- the C version uses this form too, interestingly. + when KEY_DOWN => + i := i + 1; + when KEY_LEFT => + j := j + sj - 1; + when KEY_RIGHT => + j := j + 1; + when Key_Mouse => + declare + event : Mouse_Event; + y : Line_Position; + x : Column_Position; + Button : Mouse_Button; + State : Button_State; + + begin + event := Get_Mouse; + Get_Event (Event => event, + Y => y, + X => x, + Button => Button, + State => State); + if y > uli and x > ulj then + i := y - uli; + j := x - ulj; + -- same as when others => + res.y := uli + i; + res.x := ulj + j; + p := res; + b := True; + return; + else + Beep; + end if; + end; + when others => + res.y := uli + i; + res.x := ulj + j; + p := res; + b := True; + return; + end case; + i := i mod si; + j := j mod sj; + end loop; + end selectcell; + + + function getwindow return Window is + rwindow : Window; + ul, lr : pair; + result : Boolean; + begin + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else to mark corner 1"); + Refresh; + selectcell (2, 1, Lines - Botlines - 2, Columns - 2, ul, result); + if not result then + return Null_Window; + end if; + Add (Line => ul.y - 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else to mark corner 2"); + Refresh; + selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, lr, result); + if not result then + return Null_Window; + end if; + + rwindow := Sub_Window (Number_Of_Lines => lr.y - ul.y + 1, + Number_Of_Columns => lr.x - ul.x + 1, + First_Line_Position => ul.y, + First_Column_Position => ul.x); + + Outerbox (ul, lr, True); + Refresh; + + Refresh (rwindow); + + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + return rwindow; + end getwindow; + + + procedure newwin_move (win : Window; + dy : Line_Position; + dx : Column_Position) is + cur_y, max_y : Line_Position; + cur_x, max_x : Column_Position; + begin + Get_Cursor_Position (win, cur_y, cur_x); + Get_Size (win, max_y, max_x); + cur_x := Column_Position'Min (Column_Position'Max (cur_x + dx, 0), + max_x - 1); + cur_y := Line_Position'Min (Line_Position'Max (cur_y + dy, 0), + max_y - 1); + + Move_Cursor (win, Line => cur_y, Column => cur_x); + end newwin_move; + + function delete_framed (fp : FrameA; showit : Boolean) return FrameA is + np : FrameA; + begin + fp.last.next := fp.next; + fp.next.last := fp.last; + + if showit then + Erase (fp.wind); + Refresh (fp.wind); + end if; + Delete (fp.wind); + + if fp = fp.next then + np := null; + else + np := fp.next; + end if; + -- TODO free(fp); + return np; + end delete_framed; + + Mask : Event_Mask := No_Events; + Mask2 : Event_Mask; + + usescr : Window; + +begin + if Has_Mouse then + Register_Reportable_Event ( + Button => Left, + State => Clicked, + Mask => Mask); + Mask2 := Start_Mouse (Mask); + end if; + c := CTRL ('C'); + Set_Raw_Mode (SwitchOn => True); + loop + transient (Standard_Window, ""); + case c is + when Character'Pos ('c') mod 16#20# => -- Ctrl('c') + declare + neww : FrameA := new Frame'(null, null, False, False, + Null_Window); + begin + neww.wind := getwindow; + if neww.wind = Null_Window then + exit; + -- was goto breakout; ha ha ha + else + + if current = null then + neww.next := neww; + neww.last := neww; + else + neww.next := current.next; + neww.last := current; + neww.last.next := neww; + neww.next.last := neww; + end if; + current := neww; + + Set_KeyPad_Mode (current.wind, True); + current.do_keypad := HaveKeyPad (current.wind); + current.do_scroll := HaveScroll (current.wind); + end if; + end; + when Character'Pos ('N') mod 16#20# => -- Ctrl('N') + if current /= null then + current := current.next; + end if; + when Character'Pos ('P') mod 16#20# => -- Ctrl('P') + if current /= null then + current := current.last; + end if; + when Character'Pos ('F') mod 16#20# => -- Ctrl('F') + if current /= null and HaveScroll (current.wind) then + Scroll (current.wind, 1); + end if; + when Character'Pos ('B') mod 16#20# => -- Ctrl('B') + if current /= null and HaveScroll (current.wind) then + -- The C version of Scroll may return ERR which is ignored + -- we need to avoid the exception + -- with the 'and HaveScroll(current.wind)' + Scroll (current.wind, -1); + end if; + when Character'Pos ('K') mod 16#20# => -- Ctrl('K') + if current /= null then + current.do_keypad := not current.do_keypad; + Set_KeyPad_Mode (current.wind, current.do_keypad); + end if; + when Character'Pos ('S') mod 16#20# => -- Ctrl('S') + if current /= null then + current.do_scroll := not current.do_scroll; + Allow_Scrolling (current.wind, current.do_scroll); + end if; + when Character'Pos ('W') mod 16#20# => -- Ctrl('W') + if current /= current.next then + Create (f, Name => dumpfile); -- TODO error checking + if not Is_Open (f) then + raise Curses_Exception; + end if; + Put_Window (current.wind, f); + Close (f); + current := delete_framed (current, True); + end if; + when Character'Pos ('R') mod 16#20# => -- Ctrl('R') + declare + neww : FrameA := new Frame'(null, null, False, False, + Null_Window); + begin + Open (f, Mode => In_File, Name => dumpfile); + neww := new Frame'(null, null, False, False, Null_Window); + + neww.next := current.next; + neww.last := current; + neww.last.next := neww; + neww.next.last := neww; + + neww.wind := Get_Window (f); + Close (f); + + Refresh (neww.wind); + end; + when Character'Pos ('X') mod 16#20# => -- Ctrl('X') + if current /= null then + declare + tmp, ul, lr : pair; + mx : Column_Position; + my : Line_Position; + tmpbool : Boolean; + begin + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else " & + "to mark new corner"); + Refresh; + + Get_Window_Position (current.wind, ul.y, ul.x); + + selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, + tmp, tmpbool); + if not tmpbool then + -- the C version had a goto. I refuse gotos. + Beep; + else + Get_Size (current.wind, lr.y, lr.x); + lr.y := lr.y + ul.y - 1; + lr.x := lr.x + ul.x - 1; + Outerbox (ul, lr, False); + Refresh_Without_Update; + + Get_Size (current.wind, my, mx); + if my > tmp.y - ul.y then + Get_Cursor_Position (current.wind, lr.y, lr.x); + Move_Cursor (current.wind, tmp.y - ul.y + 1, 0); + Clear_To_End_Of_Screen (current.wind); + Move_Cursor (current.wind, lr.y, lr.x); + end if; + if mx > tmp.x - ul.x then + for i in 0 .. my - 1 loop + Move_Cursor (current.wind, i, tmp.x - ul.x + 1); + Clear_To_End_Of_Line (current.wind); + end loop; + end if; + Refresh_Without_Update (current.wind); + + lr := tmp; + -- The C version passes invalid args to resize + -- which returns an ERR. For Ada we avoid the exception. + if lr.y /= ul.y and lr.x /= ul.x then + Resize (current.wind, lr.y - ul.y + 0, + lr.x - ul.x + 0); + end if; + + Get_Window_Position (current.wind, ul.y, ul.x); + Get_Size (current.wind, lr.y, lr.x); + lr.y := lr.y + ul.y - 1; + lr.x := lr.x + ul.x - 1; + Outerbox (ul, lr, True); + Refresh_Without_Update; + + Refresh_Without_Update (current.wind); + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Update_Screen; + end if; + end; + end if; + when Key_F10 => + declare tmp : pair; tmpbool : Boolean; + begin + -- undocumented --- use this to test area clears + selectcell (0, 0, Lines - 1, Columns - 1, tmp, tmpbool); + Clear_To_End_Of_Screen; + Refresh; + end; + when Key_Cursor_Up => + newwin_move (current.wind, -1, 0); + when Key_Cursor_Down => + newwin_move (current.wind, 1, 0); + when Key_Cursor_Left => + newwin_move (current.wind, 0, -1); + when Key_Cursor_Right => + newwin_move (current.wind, 0, 1); + when Key_Backspace | Key_Delete_Char => + declare + y : Line_Position; + x : Column_Position; + tmp : Line_Position; + begin + Get_Cursor_Position (current.wind, y, x); + -- x := x - 1; + -- I got tricked by the -1 = Max_Natural - 1 result + -- y := y - 1; + if not (x = 0 and y = 0) then + if x = 0 then + y := y - 1; + Get_Size (current.wind, tmp, x); + end if; + x := x - 1; + Delete_Character (current.wind, y, x); + end if; + end; + when others => + -- TODO c = '\r' ? + if current /= null then + declare + begin + Add (current.wind, Ch => Code_To_Char (c)); + exception + when Curses_Exception => null; + -- this happens if we are at the + -- lower right of a window and add a character. + end; + else + Beep; + end if; + end case; + newwin_report (current.wind); + if current /= null then + usescr := current.wind; + else + usescr := Standard_Window; + end if; + Refresh (usescr); + c := Getchar (usescr); + exit when c = Quit or (c = Escape and HaveKeyPad (usescr)); + -- TODO when does c = ERR happen? + end loop; + + -- TODO while current /= null loop + -- current := delete_framed(current, False); + -- end loop; + + Allow_Scrolling (Mode => True); + + End_Mouse; + Set_Raw_Mode (SwitchOn => True); + Erase; + End_Windows; + +end ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.ads b/Ada95/samples/ncurses2-acs_and_scroll.ads new file mode 100644 index 00000000..79e4862a --- /dev/null +++ b/Ada95/samples/ncurses2-acs_and_scroll.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_display.adb b/Ada95/samples/ncurses2-acs_display.adb new file mode 100644 index 00000000..ab072132 --- /dev/null +++ b/Ada95/samples/ncurses2-acs_display.adb @@ -0,0 +1,231 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Strings.Unbounded; +with Ada.Strings.Fixed; + +procedure ncurses2.acs_display is + use Int_IO; + + procedure show_upper_chars (first : Integer); + function show_1_acs (N : Integer; + name : String; + code : Attributed_Character) + return Integer; + procedure show_acs_chars; + + + procedure show_upper_chars (first : Integer) is + C1 : Boolean := (first = 128); + last : Integer := first + 31; + package p is new ncurses2.genericPuts (200); + use p; + use p.BS; + use Ada.Strings.Unbounded; + + tmpa : Unbounded_String; + tmpb : BS.Bounded_String; + begin + Erase; + Switch_Character_Attribute + (Attr => (Bold_Character => True, others => False)); + Move_Cursor (Line => 0, Column => 20); + tmpa := To_Unbounded_String ("Display of "); + if C1 then + tmpa := tmpa & "C1"; + else + tmpa := tmpa & "GR"; + end if; + tmpa := tmpa & " Character Codes "; + myPut (tmpb, first); + Append (tmpa, To_String (tmpb)); + Append (tmpa, " to "); + myPut (tmpb, last); + Append (tmpa, To_String (tmpb)); + Add (Str => To_String (tmpa)); + Switch_Character_Attribute + (On => False, + Attr => (Bold_Character => True, others => False)); + Refresh; + + for code in first .. last loop + declare + row : Line_Position := Line_Position (4 + ((code - first) mod 16)); + col : Column_Position := Column_Position (((code - first) / 16) * + Integer (Columns) / 2); + tmp3 : String (1 .. 3); + tmpx : String (1 .. Integer (Columns / 4)); + reply : Key_Code; + begin + Put (tmp3, code); + myPut (tmpb, code, 16); + tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')'); + + Ada.Strings.Fixed.Move (To_String (tmpa), tmpx, + Justify => Ada.Strings.Right); + Add (Line => row, Column => col, + Str => tmpx & ' ' & ':' & ' '); + if C1 then + Set_NoDelay_Mode (Mode => True); + end if; + Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code))); + -- TODO check this + if C1 then + reply := Getchar; + while reply /= Key_None loop + Add (Ch => Code_To_Char (reply)); + Nap_Milli_Seconds (10); + reply := Getchar; + end loop; + Set_NoDelay_Mode (Mode => False); + end if; + end; + end loop; + end show_upper_chars; + + function show_1_acs (N : Integer; + name : String; + code : Attributed_Character) + return Integer is + height : constant Integer := 16; + row : Line_Position := Line_Position (4 + (N mod height)); + col : Column_Position := Column_Position ((N / height) * + Integer (Columns) / 2); + tmpx : String (1 .. Integer (Columns) / 3); + begin + Ada.Strings.Fixed.Move (name, tmpx, + Justify => Ada.Strings.Right, + Drop => Ada.Strings.Left); + Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' '); + -- we need more room than C because our identifiers are longer + -- 22 chars actually + Add (Ch => code); + return N + 1; + end show_1_acs; + + procedure show_acs_chars is + n : Integer; + begin + Erase; + Switch_Character_Attribute + (Attr => (Bold_Character => True, others => False)); + Add (Line => 0, Column => 20, + Str => "Display of the ACS Character Set"); + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + Refresh; + + -- the following is useful to generate the below + -- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads | + -- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}' + + n := show_1_acs (0, "ACS_Upper_Left_Corner", + ACS_Map (ACS_Upper_Left_Corner)); + n := show_1_acs (n, "ACS_Lower_Left_Corner", + ACS_Map (ACS_Lower_Left_Corner)); + n := show_1_acs (n, "ACS_Upper_Right_Corner", + ACS_Map (ACS_Upper_Right_Corner)); + n := show_1_acs (n, "ACS_Lower_Right_Corner", + ACS_Map (ACS_Lower_Right_Corner)); + n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee)); + n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee)); + n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee)); + n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee)); + n := show_1_acs (n, "ACS_Horizontal_Line", + ACS_Map (ACS_Horizontal_Line)); + n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line)); + n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol)); + n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1)); + n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9)); + n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond)); + n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board)); + n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree)); + n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus)); + n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet)); + n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow)); + n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow)); + n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow)); + n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow)); + n := show_1_acs (n, "ACS_Board_Of_Squares", + ACS_Map (ACS_Board_Of_Squares)); + n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern)); + n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block)); + n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3)); + n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7)); + n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal)); + n := show_1_acs (n, "ACS_Greater_Or_Equal", + ACS_Map (ACS_Greater_Or_Equal)); + n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI)); + n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal)); + n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling)); + + end show_acs_chars; + + c1 : Key_Code; + c : Character := 'a'; +begin + loop + case c is + when 'a' => + show_acs_chars; + when '0' | '1' | '2' | '3' => + show_upper_chars (ctoi (c) * 32 + 128); + when others => + null; + end case; + Add (Line => Lines - 3, Column => 0, + Str => "Note: ANSI terminals may not display C1 characters."); + Add (Line => Lines - 2, Column => 0, + Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit"); + Refresh; + c1 := Getchar; + c := Code_To_Char (c1); + exit when c = 'q' or c = 'x'; + end loop; + Pause; + Erase; + End_Windows; +end ncurses2.acs_display; + diff --git a/Ada95/samples/ncurses2-acs_display.ads b/Ada95/samples/ncurses2-acs_display.ads new file mode 100644 index 00000000..4e616c5e --- /dev/null +++ b/Ada95/samples/ncurses2-acs_display.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_display; diff --git a/Ada95/samples/ncurses2-attr_test.adb b/Ada95/samples/ncurses2-attr_test.adb new file mode 100644 index 00000000..d852bb7f --- /dev/null +++ b/Ada95/samples/ncurses2-attr_test.adb @@ -0,0 +1,367 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Terminfo; +use Terminal_Interface.Curses.Terminfo; +with Ada.Characters.Handling; +with Ada.Strings.Fixed; + +procedure ncurses2.attr_test is + + function subset (super, sub : Character_Attribute_Set) return Boolean; + function intersect (b, a : Character_Attribute_Set) return Boolean; + function has_A_COLOR (attr : Attributed_Character) return Boolean; + function show_attr (row : Line_Position; + skip : Natural; + attr : Character_Attribute_Set; + name : String; + once : Boolean) return Line_Position; + procedure attr_getc (skip : out Integer; + fg, bg : in out Color_Number; + result : out Boolean); + + + function subset (super, sub : Character_Attribute_Set) return Boolean is + begin + if + (super.Stand_Out or not sub.Stand_Out) and + (super.Under_Line or not sub.Under_Line) and + (super.Reverse_Video or not sub.Reverse_Video) and + (super.Blink or not sub.Blink) and + (super.Dim_Character or not sub.Dim_Character) and + (super.Bold_Character or not sub.Bold_Character) and + (super.Alternate_Character_Set or not sub.Alternate_Character_Set) and + (super.Invisible_Character or not sub.Invisible_Character) -- and +-- (super.Protected_Character or not sub.Protected_Character) and +-- (super.Horizontal or not sub.Horizontal) and +-- (super.Left or not sub.Left) and +-- (super.Low or not sub.Low) and +-- (super.Right or not sub.Right) and +-- (super.Top or not sub.Top) and +-- (super.Vertical or not sub.Vertical) + then + return True; + else + return False; + end if; + end subset; + + + function intersect (b, a : Character_Attribute_Set) return Boolean is + begin + if + (a.Stand_Out and b.Stand_Out) or + (a.Under_Line and b.Under_Line) or + (a.Reverse_Video and b.Reverse_Video) or + (a.Blink and b.Blink) or + (a.Dim_Character and b.Dim_Character) or + (a.Bold_Character and b.Bold_Character) or + (a.Alternate_Character_Set and b.Alternate_Character_Set) or + (a.Invisible_Character and b.Invisible_Character) -- or +-- (a.Protected_Character and b.Protected_Character) or +-- (a.Horizontal and b.Horizontal) or +-- (a.Left and b.Left) or +-- (a.Low and b.Low) or +-- (a.Right and b.Right) or +-- (a.Top and b.Top) or +-- (a.Vertical and b.Vertical) + then + return True; + else + return False; + end if; + end intersect; + + function has_A_COLOR (attr : Attributed_Character) return Boolean is + begin + if attr.Color /= Color_Pair (0) then + return True; + else + return False; + end if; + end has_A_COLOR; + + -- Print some text with attributes. + function show_attr (row : Line_Position; + skip : Natural; + attr : Character_Attribute_Set; + name : String; + once : Boolean) return Line_Position is + + function make_record (n : Integer) return Character_Attribute_Set; + function make_record (n : Integer) return Character_Attribute_Set is + -- unsupported means true + a : Character_Attribute_Set := (others => False); + m : Integer; + rest : Integer; + begin + -- ncv is a bitmap with these fields + -- A_STANDOUT, + -- A_UNDERLINE, + -- A_REVERSE, + -- A_BLINK, + -- A_DIM, + -- A_BOLD, + -- A_INVIS, + -- A_PROTECT, + -- A_ALTCHARSET + -- It means no_color_video, + -- video attributes that can't be used with colors + -- see man terminfo.5 + m := n mod 2; + rest := n / 2; + if 1 = m then + a.Stand_Out := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Under_Line := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Reverse_Video := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Blink := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Bold_Character := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Invisible_Character := True; + end if; + m := rest mod 2; + rest := rest / 2; +-- if 1 = m then +-- a.Protected_Character := True; +-- end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Alternate_Character_Set := True; + end if; + + return a; + end make_record; + + ncv : constant Integer := Get_Number ("ncv"); + + begin + Move_Cursor (Line => row, Column => 8); + Add (Str => name & " mode:"); + Move_Cursor (Line => row, Column => 24); + Add (Ch => '|'); + if skip /= 0 then + -- printw("%*s", skip, " ") + Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); + end if; + if once then + Switch_Character_Attribute (Attr => attr); + else + Set_Character_Attributes (Attr => attr); + end if; + Add (Str => "abcde fghij klmno pqrst uvwxy z"); + if once then + Switch_Character_Attribute (Attr => attr, On => False); + end if; + if skip /= 0 then + Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); + end if; + Add (Ch => '|'); + if attr /= Normal_Video then + declare begin + if not subset (super => Supported_Attributes, sub => attr) then + Add (Str => " (N/A)"); + elsif ncv > 0 and has_A_COLOR (Get_Background) then + declare + Color_Supported_Attributes : + Character_Attribute_Set := make_record (ncv); + begin + if intersect (Color_Supported_Attributes, attr) then + Add (Str => " (NCV) "); + end if; + end; + end if; + end; + end if; + return row + 2; + end show_attr; + + procedure attr_getc (skip : out Integer; fg, bg : in out Color_Number; + result : out Boolean) is + ch : Key_Code := Getchar; + nc : constant Color_Number := Color_Number (Number_Of_Colors); + curscr : Window; + pragma Import (C, curscr, "curscr"); + -- curscr is not implemented in the Ada binding + begin + result := True; + if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then + skip := ctoi (Code_To_Char (ch)); + elsif ch = CTRL ('L') then + Touch; + Touch (curscr); + Refresh; + elsif Has_Colors then + case ch is + -- Note the mathematical elegance compared to the C version. + when Character'Pos ('f') => fg := (fg + 1) mod nc; + when Character'Pos ('F') => fg := (fg - 1) mod nc; + when Character'Pos ('b') => bg := (bg + 1) mod nc; + when Character'Pos ('B') => bg := (bg - 1) mod nc; + when others => + result := False; + end case; + else + result := False; + end if; + end attr_getc; + + + + -- pairs could be defined as array ( Color_Number(0) .. colors - 1) of + -- array (Color_Number(0).. colors - 1) of Boolean; + pairs : array (Color_Pair'Range) of Boolean := (others => False); + fg, bg : Color_Number := Black; -- = 0; + xmc : constant Integer := Get_Number ("xmc"); + skip : Integer := xmc; + n : Integer; + + use Int_IO; + +begin + pairs (0) := True; + + if skip < 0 then + skip := 0; + end if; + n := skip; + + loop + declare + row : Line_Position := 2; + normal : Attributed_Character := Blank2; + -- ??? + begin + -- row := 2; -- weird, row is set to 0 without this. + -- TODO delete the above line, it was a gdb quirk that confused me + if Has_Colors then declare + pair : Color_Pair := + Color_Pair (fg * Color_Number (Number_Of_Colors) + bg); + begin + -- Go though each color pair. Assume that the number of + -- Redefinable_Color_Pairs is 8*8 with predefined Colors 0..7 + if not pairs (pair) then + Init_Pair (pair, fg, bg); + pairs (pair) := True; + end if; + normal.Color := pair; + end; + end if; + Set_Background (Ch => normal); + Erase; + + Add (Line => 0, Column => 20, + Str => "Character attribute test display"); + + row := show_attr (row, n, (Stand_Out => True, others => False), + "STANDOUT", True); + row := show_attr (row, n, (Reverse_Video => True, others => False), + "REVERSE", True); + row := show_attr (row, n, (Bold_Character => True, others => False), + "BOLD", True); + row := show_attr (row, n, (Under_Line => True, others => False), + "UNDERLINE", True); + row := show_attr (row, n, (Dim_Character => True, others => False), + "DIM", True); + row := show_attr (row, n, (Blink => True, others => False), + "BLINK", True); +-- row := show_attr (row, n, (Protected_Character => True, +-- others => False), "PROTECT", True); + row := show_attr (row, n, (Invisible_Character => True, + others => False), "INVISIBLE", True); + row := show_attr (row, n, Normal_Video, "NORMAL", False); + + Move_Cursor (Line => row, Column => 8); + if xmc > -1 then + Add (Str => "This terminal does have the magic-cookie glitch"); + else + Add (Str => "This terminal does not have the magic-cookie glitch"); + end if; + Move_Cursor (Line => row + 1, Column => 8); + Add (Str => "Enter a digit to set gaps on each side of " & + "displayed attributes"); + Move_Cursor (Line => row + 2, Column => 8); + Add (Str => "^L = repaint"); + if Has_Colors then + declare tmp1 : String (1 .. 1); + begin + Add (Str => ". f/F/b/F toggle colors ("); + Put (tmp1, Integer (fg)); + Add (Str => tmp1); + Add (Ch => '/'); + Put (tmp1, Integer (bg)); + Add (Str => tmp1); + Add (Ch => ')'); + end; + end if; + Refresh; + end; + + declare result : Boolean; begin + attr_getc (n, fg, bg, result); + exit when not result; + end; + end loop; + + Set_Background (Ch => Blank2); + Erase; + End_Windows; +end ncurses2.attr_test; diff --git a/Ada95/samples/ncurses2-attr_test.ads b/Ada95/samples/ncurses2-attr_test.ads new file mode 100644 index 00000000..fb1ed185 --- /dev/null +++ b/Ada95/samples/ncurses2-attr_test.ads @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.attr_test; + diff --git a/Ada95/samples/ncurses2-color_edit.adb b/Ada95/samples/ncurses2-color_edit.adb new file mode 100644 index 00000000..ac14628f --- /dev/null +++ b/Ada95/samples/ncurses2-color_edit.adb @@ -0,0 +1,264 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + + +procedure ncurses2.color_edit is + use Int_IO; + + type RGB_Enum is (Redx, Greenx, Bluex); + + procedure change_color (current : Color_Number; + field : RGB_Enum; + value : RGB_Value; + usebase : Boolean); + + + + procedure change_color (current : Color_Number; + field : RGB_Enum; + value : RGB_Value; + usebase : Boolean) is + red, green, blue : RGB_Value; + begin + if usebase then + Color_Content (current, red, green, blue); + else + red := 0; + green := 0; + blue := 0; + end if; + + case field is + when Redx => red := red + value; + when Greenx => green := green + value; + when Bluex => blue := blue + value; + end case; + + declare + begin + Init_Color (current, red, green, blue); + exception + when Curses_Exception => Beep; + end; + + end change_color; + + + package x is new ncurses2.genericPuts (100); use x; + + tmpb : x.BS.Bounded_String; + + tmp4 : String (1 .. 4); + tmp6 : String (1 .. 6); + tmp8 : String (1 .. 8); + -- This would be easier if Ada had a Bounded_String + -- defined as a class instead of the inferior generic package, + -- then I could define Put, Add, and Get for them. Blech. + value : RGB_Value := 0; + red, green, blue : RGB_Value; + max_colors : constant Natural := Number_Of_Colors; + current : Color_Number := 0; + field : RGB_Enum := Redx; + this_c : Key_Code := 0; + last_c : Key_Code; +begin + Refresh; + + for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop + Init_Pair (Color_Pair (i), White, i); + end loop; + + Move_Cursor (Line => Lines - 2, Column => 0); + Add (Str => "Number: "); + myPut (tmpb, Integer (value)); + myAdd (Str => tmpb); + + loop + + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + Add (Line => 0, Column => 20, Str => "Color RGB Value Editing"); + + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + + for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop + Move_Cursor (Line => 2 + Line_Position (i), Column => 0); + if current = i then + Add (Ch => '>'); + else + Add (Ch => ' '); + end if; + -- TODO if i <= color_names'Max then + Put (tmp8, Integer (i)); + Set_Character_Attributes (Color => Color_Pair (i)); + Add (Str => " "); + Set_Character_Attributes; + + Refresh; + + Color_Content (i, red, green, blue); + Add (Str => " R = "); + if current = i and field = Redx then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (red)); + Add (Str => tmp4); + if current = i and field = Redx then + Set_Character_Attributes; + end if; + Add (Str => " G = "); + if current = i and field = Greenx then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (green)); + Add (Str => tmp4); + if current = i and field = Greenx then + Set_Character_Attributes; + end if; + Add (Str => " B = "); + if current = i and field = Bluex then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (blue)); + Add (Str => tmp4); + if current = i and field = Bluex then + Set_Character_Attributes; + end if; + Set_Character_Attributes; + Add (ch => ')'); + end loop; + Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0, + Str => "Use up/down to select a color, left/right to change " & + "fields."); + Add (Line => Line_Position (Number_Of_Colors + 4), Column => 0, + Str => "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); + + Move_Cursor (Line => 2 + Line_Position (current), Column => 0); + + last_c := this_c; + this_c := Getchar; + if Is_Digit (this_c) then + value := 0; + end if; + + case this_c is + when KEY_UP => + current := (current - 1) mod Color_Number (max_colors); + when KEY_DOWN => + current := (current + 1) mod Color_Number (max_colors); + when KEY_RIGHT => + field := RGB_Enum'Val ((RGB_Enum'Pos (field) + 1) mod 3); + when KEY_LEFT => + field := RGB_Enum'Val ((RGB_Enum'Pos (field) - 1) mod 3); + when + Character'Pos ('0') | + Character'Pos ('1') | + Character'Pos ('2') | + Character'Pos ('3') | + Character'Pos ('4') | + Character'Pos ('5') | + Character'Pos ('6') | + Character'Pos ('7') | + Character'Pos ('8') | + Character'Pos ('9') => + value := value * 10 + RGB_Value (ctoi (Code_To_Char (this_c))); + + when Character'Pos ('+') => + change_color (current, field, value, True); + + when Character'Pos ('-') => + change_color (current, field, -value, True); + + when Character'Pos ('=') => + change_color (current, field, value, False); + + when Character'Pos ('?') => + Erase; + P (" RGB Value Editing Help"); + P (""); + P ("You are in the RGB value editor. Use the arrow keys to " & + "select one of"); + P ("the fields in one of the RGB triples of the current colors;" & + " the one"); + P ("currently selected will be reverse-video highlighted."); + P (""); + P ("To change a field, enter the digits of the new value; they" & + " are echoed"); + P ("as entered. Finish by typing `='. The change will take" & + " effect instantly."); + P ("To increment or decrement a value, use the same procedure," & + " but finish"); + P ("with a `+' or `-'."); + P (""); + P ("To quit, do `x' or 'q'"); + + Pause; + Erase; + when Character'Pos ('q') | + Character'Pos ('x') => + null; + when others => + Beep; + end case; + Move_Cursor (Line => Lines - 2, Column => 0); + Put (tmp6, Integer (value)); + Add (Str => "Number: " & tmp6); + + Clear_To_End_Of_Line; + exit when this_c = Character'Pos ('x') or + this_c = Character'Pos ('q'); + end loop; + + Erase; + End_Windows; +end ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_edit.ads b/Ada95/samples/ncurses2-color_edit.ads new file mode 100644 index 00000000..3e8e392d --- /dev/null +++ b/Ada95/samples/ncurses2-color_edit.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_test.adb b/Ada95/samples/ncurses2-color_test.adb new file mode 100644 index 00000000..ecbf2903 --- /dev/null +++ b/Ada95/samples/ncurses2-color_test.adb @@ -0,0 +1,164 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Ada.Strings.Fixed; + +procedure ncurses2.color_test is + use Int_IO; + + procedure show_color_name (y, x : Integer; color : Integer); + + color_names : constant array (0 .. 15) of String (1 .. 7) := + ( + "black", + "red", + "green", + "yellow", + "blue", + "magenta", + "cyan", + "white", + "BLACK", + "RED", + "GREEN", + "YELLOW", + "BLUE", + "MAGENTA", + "CYAN", + "WHITE" + ); + + + procedure show_color_name (y, x : Integer; color : Integer) is + tmp5 : String (1 .. 5); + begin + if Number_Of_Colors > 8 then + + Put (tmp5, color); + Add (Line => Line_Position (y), Column => Column_Position (x), + Str => tmp5); + else + Add (Line => Line_Position (y), Column => Column_Position (x), + Str => color_names (color)); + end if; + end show_color_name; + + + top, width : Integer; + hello : String (1 .. 5); + -- tmp3 : String (1 .. 3); + -- tmp2 : String (1 .. 2); + +begin + Refresh; + Add (Str => "There are "); + -- Put(tmp3, Number_Of_Colors*Number_Of_Colors); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors * + Number_Of_Colors), + Ada.Strings.Left)); + Add (Str => " color pairs"); + Add (Ch => newl); + + if Number_Of_Colors > 8 then + width := 4; + else + width := 8; + end if; + + if Number_Of_Colors > 8 then + hello := "Test"; + else + hello := "Hello"; + end if; + + for Bright in Boolean loop + if Number_Of_Colors > 8 then + top := 0; + else + top := Boolean'Pos (Bright) * (Number_Of_Colors + 3); + end if; + Clear_To_End_Of_Screen; + Move_Cursor (Line => Line_Position (top) + 1, Column => 0); + -- Put(tmp2, Number_Of_Colors); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), + Ada.Strings.Left)); + Add (Ch => 'x'); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), + Ada.Strings.Left)); + Add (Str => " matrix of foreground/background colors, bright *"); + if Bright then + Add (Str => "on"); + else + Add (Str => "off"); + end if; + Add (Ch => '*'); + + for i in 0 .. Number_Of_Colors - 1 loop + show_color_name (top + 2, (i + 1) * width, i); + end loop; + for i in 0 .. Number_Of_Colors - 1 loop + show_color_name (top + 3 + i, 0, i); + end loop; + for i in 1 .. Number_Of_Color_Pairs - 1 loop + Init_Pair (Color_Pair (i), Color_Number (i mod Number_Of_Colors), + Color_Number (i / Number_Of_Colors)); + -- attron((attr_t) COLOR_PAIR(i)) -- Huh? + Set_Color (Pair => Color_Pair (i)); + if Bright then + Switch_Character_Attribute (Attr => (Bold_Character => True, + others => False)); + end if; + Add (Line => Line_Position (top + 3 + (i / Number_Of_Colors)), + Column => Column_Position ((i mod Number_Of_Colors + 1) * + width), + Str => hello); + Set_Character_Attributes; + end loop; + if Number_Of_Colors > 8 or Bright then + Pause; + end if; + end loop; + + Erase; + End_Windows; +end ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-color_test.ads b/Ada95/samples/ncurses2-color_test.ads new file mode 100644 index 00000000..6e663181 --- /dev/null +++ b/Ada95/samples/ncurses2-color_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb new file mode 100644 index 00000000..7f4cefc9 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_forms.adb @@ -0,0 +1,496 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with Terminal_Interface.Curses.Forms.Field_User_Data; +with Ada.Characters.Handling; +with Ada.Strings; +with Ada.Strings.Bounded; + +procedure ncurses2.demo_forms is + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (80); + + type myptr is access Integer; + + -- The C version stores a pointer in the userptr and + -- converts it into a long integer. + -- The correct, but inconvenient way to do it is to use a + -- pointer to long and keep the pointer constant. + -- It just adds one memory piece to allocate and deallocate (not done here) + + package StringData is new + Terminal_Interface.Curses.Forms.Field_User_Data (Integer, myptr); + + function edit_secure (me : Field; c_in : Key_Code) return Key_Code; + function form_virtualize (f : Form; w : Window) return Key_Code; + function my_form_driver (f : Form; c : Key_Code) return Boolean; + function make_label (frow : Line_Position; + fcol : Column_Position; + label : String) return Field; + function make_field (frow : Line_Position; + fcol : Column_Position; + rows : Line_Count; + cols : Column_Count; + secure : Boolean) return Field; + procedure display_form (f : Form); + procedure erase_form (f : Form); + + -- prints '*' instead of characters. + -- Not that this keeps a bug from the C version: + -- type in the psasword field then move off and back. + -- the cursor is at position one, but + -- this assumes it as at the end so text gets appended instead + -- of overwtitting. + function edit_secure (me : Field; c_in : Key_Code) return Key_Code is + rows, frow : Line_Position; + nrow : Natural; + cols, fcol : Column_Position; + nbuf : Buffer_Number; + c : Key_Code := c_in; + c2 : Character; + + use StringData; + begin + Info (me, rows, cols, frow, fcol, nrow, nbuf); + -- TODO if result = Form_Ok and nbuf > 0 then + -- C version checked the return value + -- of Info, the Ada binding throws an exception I think. + if nbuf > 0 then + declare + temp : BS.Bounded_String; + temps : String (1 .. 10); + -- TODO Get_Buffer povides no information on the field length? + len : myptr; + begin + Get_Buffer (me, 1, Str => temps); + -- strcpy(temp, field_buffer(me, 1)); + Get_User_Data (me, len); + temp := BS.To_Bounded_String (temps (1 .. len.all)); + if c <= Key_Max then + c2 := Code_To_Char (c); + if Ada.Characters.Handling.Is_Graphic (c2) then + BS.Append (temp, c2); + len.all := len.all + 1; + Set_Buffer (me, 1, BS.To_String (temp)); + c := Character'Pos ('*'); + else + c := 0; + end if; + else + case c is + when REQ_BEG_FIELD | + REQ_CLR_EOF | + REQ_CLR_EOL | + REQ_DEL_LINE | + REQ_DEL_WORD | + REQ_DOWN_CHAR | + REQ_END_FIELD | + REQ_INS_CHAR | + REQ_INS_LINE | + REQ_LEFT_CHAR | + REQ_NEW_LINE | + REQ_NEXT_WORD | + REQ_PREV_WORD | + REQ_RIGHT_CHAR | + REQ_UP_CHAR => + c := 0; -- we don't want to do inline editing + when REQ_CLR_FIELD => + if len.all /= 0 then + temp := BS.To_Bounded_String (""); + Set_Buffer (me, 1, BS.To_String (temp)); + len.all := 0; + end if; + + when REQ_DEL_CHAR | + REQ_DEL_PREV => + if len.all /= 0 then + BS.Delete (temp, BS.Length (temp), BS.Length (temp)); + Set_Buffer (me, 1, BS.To_String (temp)); + len.all := len.all - 1; + end if; + when others => null; + end case; + end if; + end; + end if; + return c; + end edit_secure; + + mode : Key_Code := REQ_INS_MODE; + + function form_virtualize (f : Form; w : Window) return Key_Code is + type lookup_t is record + code : Key_Code; + result : Key_Code; + -- should be Form_Request_Code, but we need MAX_COMMAND + 1 + end record; + + lookup : constant array (Positive range <>) of lookup_t := + ( + ( + Character'Pos ('A') mod 16#20#, REQ_NEXT_CHOICE + ), + ( + Character'Pos ('B') mod 16#20#, REQ_PREV_WORD + ), + ( + Character'Pos ('C') mod 16#20#, REQ_CLR_EOL + ), + ( + Character'Pos ('D') mod 16#20#, REQ_DOWN_FIELD + ), + ( + Character'Pos ('E') mod 16#20#, REQ_END_FIELD + ), + ( + Character'Pos ('F') mod 16#20#, REQ_NEXT_PAGE + ), + ( + Character'Pos ('G') mod 16#20#, REQ_DEL_WORD + ), + ( + Character'Pos ('H') mod 16#20#, REQ_DEL_PREV + ), + ( + Character'Pos ('I') mod 16#20#, REQ_INS_CHAR + ), + ( + Character'Pos ('K') mod 16#20#, REQ_CLR_EOF + ), + ( + Character'Pos ('L') mod 16#20#, REQ_LEFT_FIELD + ), + ( + Character'Pos ('M') mod 16#20#, REQ_NEW_LINE + ), + ( + Character'Pos ('N') mod 16#20#, REQ_NEXT_FIELD + ), + ( + Character'Pos ('O') mod 16#20#, REQ_INS_LINE + ), + ( + Character'Pos ('P') mod 16#20#, REQ_PREV_FIELD + ), + ( + Character'Pos ('R') mod 16#20#, REQ_RIGHT_FIELD + ), + ( + Character'Pos ('S') mod 16#20#, REQ_BEG_FIELD + ), + ( + Character'Pos ('U') mod 16#20#, REQ_UP_FIELD + ), + ( + Character'Pos ('V') mod 16#20#, REQ_DEL_CHAR + ), + ( + Character'Pos ('W') mod 16#20#, REQ_NEXT_WORD + ), + ( + Character'Pos ('X') mod 16#20#, REQ_CLR_FIELD + ), + ( + Character'Pos ('Y') mod 16#20#, REQ_DEL_LINE + ), + ( + Character'Pos ('Z') mod 16#20#, REQ_PREV_CHOICE + ), + ( + Character'Pos ('[') mod 16#20#, -- ESCAPE + Form_Request_Code'Last + 1 + ), + ( + Key_Backspace, REQ_DEL_PREV + ), + ( + KEY_DOWN, REQ_DOWN_CHAR + ), + ( + Key_End, REQ_LAST_FIELD + ), + ( + Key_Home, REQ_FIRST_FIELD + ), + ( + KEY_LEFT, REQ_LEFT_CHAR + ), + ( + KEY_LL, REQ_LAST_FIELD + ), + ( + Key_Next, REQ_NEXT_FIELD + ), + ( + KEY_NPAGE, REQ_NEXT_PAGE + ), + ( + KEY_PPAGE, REQ_PREV_PAGE + ), + ( + Key_Previous, REQ_PREV_FIELD + ), + ( + KEY_RIGHT, REQ_RIGHT_CHAR + ), + ( + KEY_UP, REQ_UP_CHAR + ), + ( + Character'Pos ('Q') mod 16#20#, -- QUIT + Form_Request_Code'Last + 1 -- TODO MAX_FORM_COMMAND + 1 + ) + ); + + c : Key_Code := Getchar (w); + me : Field := Current (f); + + begin + if c = Character'Pos (']') mod 16#20# then + if mode = REQ_INS_MODE then + mode := REQ_OVL_MODE; + else + mode := REQ_INS_MODE; + end if; + c := mode; + else + for n in lookup'Range loop + if lookup (n).code = c then + c := lookup (n).result; + exit; + end if; + end loop; + end if; + + -- Force the field that the user is typing into to be in reverse video, + -- while the other fields are shown underlined. + if c <= Key_Max then + c := edit_secure (me, c); + Set_Background (me, (Reverse_Video => True, others => False)); + elsif c <= Form_Request_Code'Last then + c := edit_secure (me, c); + Set_Background (me, (Under_Line => True, others => False)); + end if; + return c; + end form_virtualize; + + function my_form_driver (f : Form; c : Key_Code) return Boolean is + flag : Driver_Result := Driver (f, F_Validate_Field); + begin + if c = Form_Request_Code'Last + 1 + and flag = Form_Ok then + return True; + else + Beep; + return False; + end if; + end my_form_driver; + + function make_label (frow : Line_Position; + fcol : Column_Position; + label : String) return Field is + f : Field := Create (1, label'Length, frow, fcol, 0, 0); + o : Field_Option_Set := Get_Options (f); + begin + if f /= Null_Field then + Set_Buffer (f, 0, label); + o.Active := False; + Set_Options (f, o); + end if; + return f; + end make_label; + + function make_field (frow : Line_Position; + fcol : Column_Position; + rows : Line_Count; + cols : Column_Count; + secure : Boolean) return Field is + f : Field; + use StringData; + len : myptr; + begin + if secure then + f := Create (rows, cols, frow, fcol, 0, 1); + else + f := Create (rows, cols, frow, fcol, 0, 0); + end if; + + if f /= Null_Field then + Set_Background (f, (Under_Line => True, others => False)); + len := new Integer; + len.all := 0; + Set_User_Data (f, len); + end if; + return f; + end make_field; + + procedure display_form (f : Form) is + w : Window; + rows : Line_Count; + cols : Column_Count; + begin + Scale (f, rows, cols); + + w := New_Window (rows + 2, cols + 4, 0, 0); + if w /= Null_Window then + Set_Window (f, w); + Set_Sub_Window (f, Derived_Window (w, rows, cols, 1, 2)); + Box (w); -- 0,0 + Set_KeyPad_Mode (w, True); + end if; + + -- TODO if Post(f) /= Form_Ok then it's a procedure + declare + begin + Post (f); + exception + when + Eti_System_Error | + Eti_Bad_Argument | + Eti_Posted | + Eti_Connected | + Eti_Bad_State | + Eti_No_Room | + Eti_Not_Posted | + Eti_Unknown_Command | + Eti_No_Match | + Eti_Not_Selectable | + Eti_Not_Connected | + Eti_Request_Denied | + Eti_Invalid_Field | + Eti_Current => + Refresh (w); + end; + -- end if; + end display_form; + + procedure erase_form (f : Form) is + w : Window := Get_Window (f); + s : Window := Get_Sub_Window (f); + begin + Post (f, False); + Erase (w); + Refresh (w); + Delete (s); + Delete (w); + end erase_form; + + finished : Boolean := False; + f : Field_Array_Access := new Field_Array (1 .. 12); + secure : Field; + myform : Form; + w : Window; + c : Key_Code; + result : Driver_Result; +begin + Move_Cursor (Line => 18, Column => 0); + Add (Str => "Defined form-traversal keys: ^Q/ESC- exit form"); + Add (Ch => newl); + Add (Str => "^N -- go to next field ^P -- go to previous field"); + Add (Ch => newl); + Add (Str => "Home -- go to first field End -- go to last field"); + Add (Ch => newl); + Add (Str => "^L -- go to field to left ^R -- go to field to right"); + Add (Ch => newl); + Add (Str => "^U -- move upward to field ^D -- move downward to field"); + Add (Ch => newl); + Add (Str => "^W -- go to next word ^B -- go to previous word"); + Add (Ch => newl); + Add (Str => "^S -- go to start of field ^E -- go to end of field"); + Add (Ch => newl); + Add (Str => "^H -- delete previous char ^Y -- delete line"); + Add (Ch => newl); + Add (Str => "^G -- delete current word ^C -- clear to end of line"); + Add (Ch => newl); + Add (Str => "^K -- clear to end of field ^X -- clear field"); + Add (Ch => newl); + Add (Str => "Arrow keys move within a field as you would expect."); + + Add (Line => 4, Column => 57, Str => "Forms Entry Test"); + + Refresh; + + -- describe the form + f (1) := make_label (0, 15, "Sample Form"); + f (2) := make_label (2, 0, "Last Name"); + f (3) := make_field (3, 0, 1, 18, False); + f (4) := make_label (2, 20, "First Name"); + f (5) := make_field (3, 20, 1, 12, False); + f (6) := make_label (2, 34, "Middle Name"); + f (7) := make_field (3, 34, 1, 12, False); + f (8) := make_label (5, 0, "Comments"); + f (9) := make_field (6, 0, 4, 46, False); + f (10) := make_label (5, 20, "Password:"); + f (11) := make_field (5, 30, 1, 9, True); + secure := f (11); + f (12) := Null_Field; + + myform := New_Form (f); + + display_form (myform); + + w := Get_Window (myform); + Set_Raw_Mode (SwitchOn => True); + Set_NL_Mode (SwitchOn => True); -- lets us read ^M's + while not finished loop + c := form_virtualize (myform, w); + result := Driver (myform, c); + case result is + when Form_Ok => + Add (Line => 5, Column => 57, Str => Get_Buffer (secure, 1)); + Clear_To_End_Of_Line; + Refresh; + when Unknown_Request => + finished := my_form_driver (myform, c); + when others => + Beep; + end case; + end loop; + + erase_form (myform); + + -- TODO Free_Form(myform); + -- for (c = 0; f[c] != 0; c++) free_field(f[c]); + Set_Raw_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => True); + +end ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_forms.ads b/Ada95/samples/ncurses2-demo_forms.ads new file mode 100644 index 00000000..eabaa01b --- /dev/null +++ b/Ada95/samples/ncurses2-demo_forms.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_pad.adb b/Ada95/samples/ncurses2-demo_pad.adb new file mode 100644 index 00000000..1b17cbd5 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_pad.adb @@ -0,0 +1,671 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Interfaces.C; +with System.Storage_Elements; +with System.Address_To_Access_Conversions; + +with Ada.Text_IO; +-- with Ada.Real_Time; use Ada.Real_Time; +-- TODO is there a way to use Real_Time or Ada.Calendar in place of +-- gettimeofday? + +-- Demonstrate pads. +procedure ncurses2.demo_pad is + + type timestruct is record + seconds : Integer; + microseconds : Integer; + end record; + + type myfunc is access function (w : Window) return Key_Code; + + function gettime return timestruct; + procedure do_h_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Column_Position); + procedure do_v_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Line_Position); + function padgetch (win : Window) return Key_Code; + function panner_legend (line : Line_Position) return Boolean; + procedure panner_legend (line : Line_Position); + procedure panner_h_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_x : Column_Position); + procedure panner_v_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_y : Line_Position); + procedure panner (pad : Window; + top_xp : Column_Position; + top_yp : Line_Position; + portyp : Line_Position; + portxp : Column_Position; + pgetc : myfunc); + + function gettime return timestruct is + + retval : timestruct; + + use Interfaces.C; + type timeval is record + tv_sec : long; + tv_usec : long; + end record; + pragma Convention (C, timeval); + + -- TODO function from_timeval is new Ada.Unchecked_Conversion( + -- timeval_a, System.Storage_Elements.Integer_Address); + -- should Interfaces.C.Pointers be used here? + + package myP is new System.Address_To_Access_Conversions (timeval); + use myP; + + t : Object_Pointer := new timeval; + + function gettimeofday + (TP : System.Storage_Elements.Integer_Address; + TZP : System.Storage_Elements.Integer_Address) return int; + pragma Import (C, gettimeofday, "gettimeofday"); + tmp : int; + begin + tmp := gettimeofday (System.Storage_Elements.To_Integer + (myP.To_Address (t)), + System.Storage_Elements.To_Integer + (myP.To_Address (null))); + retval.seconds := Integer (t.tv_sec); + retval.microseconds := Integer (t.tv_usec); + return retval; + end gettime; + + + -- in C, The behavior of mvhline, mvvline for negative/zero length is + -- unspecified, though we can rely on negative x/y values to stop the + -- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it. + procedure do_h_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Column_Position) is + begin + if to > x then + Move_Cursor (Line => y, Column => x); + Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c); + end if; + end do_h_line; + + procedure do_v_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Line_Position) is + begin + if to > y then + Move_Cursor (Line => y, Column => x); + Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c); + end if; + end do_v_line; + + + + + function padgetch (win : Window) return Key_Code is + c : Key_Code; + c2 : Character; + begin + c := Getchar (win); + c2 := Code_To_Char (c); + + case c2 is + when '!' => + ShellOut (False); + return Key_Refresh; + when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r') + End_Windows; + Refresh; + return Key_Refresh; + when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') + return Key_Refresh; + when 'U' => + return Key_Cursor_Up; + when 'D' => + return Key_Cursor_Down; + when 'R' => + return Key_Cursor_Right; + when 'L' => + return Key_Cursor_Left; + when '+' => + return Key_Insert_Line; + when '-' => + return Key_Delete_Line; + when '>' => + return Key_Insert_Char; + when '<' => + return Key_Delete_Char; + -- when ERR=> /* FALLTHRU */ + when 'q' => + return (Key_Exit); + when others => + return (c); + end case; + end padgetch; + + show_panner_legend : Boolean := True; + + function panner_legend (line : Line_Position) return Boolean is + legend : constant array (0 .. 3) of String (1 .. 61) := + ( + "Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ", + "Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.", + "Use +,- (or j,k) to grow/shrink the panner vertically. ", + "Use <,> (or h,l) to grow/shrink the panner horizontally. "); + legendsize : constant := 4; + + n : Integer := legendsize - Integer (Lines - line); + begin + if line < Lines and n >= 0 then + Move_Cursor (Line => line, Column => 0); + if show_panner_legend then + Add (Str => legend (n)); + end if; + Clear_To_End_Of_Line; + return show_panner_legend; + end if; + return False; + end panner_legend; + + procedure panner_legend (line : Line_Position) is + tmp : Boolean; + begin + tmp := panner_legend (line); + end panner_legend; + + procedure panner_h_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_x : Column_Position) is + begin + if not panner_legend (from_y) then + do_h_line (from_y, from_x, Blank2, to_x); + end if; + end panner_h_cleanup; + + procedure panner_v_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_y : Line_Position) is + begin + if not panner_legend (from_y) then + do_v_line (from_y, from_x, Blank2, to_y); + end if; + end panner_v_cleanup; + + + procedure panner (pad : Window; + top_xp : Column_Position; + top_yp : Line_Position; + portyp : Line_Position; + portxp : Column_Position; + pgetc : myfunc) is + + function f (y : Line_Position) return Line_Position; + function f (x : Column_Position) return Column_Position; + function greater (y1, y2 : Line_Position) return Integer; + function greater (x1, x2 : Column_Position) return Integer; + + top_x : Column_Position := top_xp; + top_y : Line_Position := top_yp; + porty : Line_Position := portyp; + portx : Column_Position := portxp; + + -- f[x] returns max[x - 1, 0] + function f (y : Line_Position) return Line_Position is + begin + if y > 0 then + return y - 1; + else + return y; -- 0 + end if; + end f; + + function f (x : Column_Position) return Column_Position is + begin + if x > 0 then + return x - 1; + else + return x; -- 0 + end if; + end f; + + function greater (y1, y2 : Line_Position) return Integer is + begin + if y1 > y2 then + return 1; + else + return 0; + end if; + end greater; + + function greater (x1, x2 : Column_Position) return Integer is + begin + if x1 > x2 then + return 1; + else + return 0; + end if; + end greater; + + + pymax : Line_Position; + basey : Line_Position := 0; + pxmax : Column_Position; + basex : Column_Position := 0; + c : Key_Code; + scrollers : Boolean := True; + before, after : timestruct; + timing : Boolean := True; + + package floatio is new Ada.Text_IO.Float_IO (Long_Float); + begin + Get_Size (pad, pymax, pxmax); + Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll! + + c := Key_Refresh; + loop + -- During shell-out, the user may have resized the window. Adjust + -- the port size of the pad to accommodate this. Ncurses + -- automatically resizes all of the normal windows to fit on the + -- new screen. + if top_x > Columns then + top_x := Columns; + end if; + if portx > Columns then + portx := Columns; + end if; + if top_y > Lines then + top_y := Lines; + end if; + if porty > Lines then + porty := Lines; + end if; + + case c is + when Key_Refresh | Character'Pos ('?') => + if c = Key_Refresh then + Erase; + else -- '?' + show_panner_legend := not show_panner_legend; + end if; + panner_legend (Lines - 4); + panner_legend (Lines - 3); + panner_legend (Lines - 2); + panner_legend (Lines - 1); + when Character'Pos ('t') => + timing := not timing; + if not timing then + panner_legend (Lines - 1); + end if; + when Character'Pos ('s') => + scrollers := not scrollers; + + -- Move the top-left corner of the pad, keeping the + -- bottom-right corner fixed. + when Character'Pos ('h') => + -- increase-columns: move left edge to left + if top_x <= 0 then + Beep; + else + panner_v_cleanup (top_y, top_x, porty); + top_x := top_x - 1; + end if; + + when Character'Pos ('j') => + -- decrease-lines: move top-edge down + if top_y >= porty then + Beep; + else + if top_y /= 0 then + panner_h_cleanup (top_y - 1, f (top_x), portx); + end if; + top_y := top_y + 1; + end if; + when Character'Pos ('k') => + -- increase-lines: move top-edge up + if top_y <= 0 then + Beep; + else + top_y := top_y - 1; + panner_h_cleanup (top_y, top_x, portx); + end if; + + when Character'Pos ('l') => + -- decrease-columns: move left-edge to right + if top_x >= portx then + Beep; + else + if top_x /= 0 then + panner_v_cleanup (f (top_y), top_x - 1, porty); + end if; + top_x := top_x + 1; + end if; + + -- Move the bottom-right corner of the pad, keeping the + -- top-left corner fixed. + when Key_Insert_Char => + -- increase-columns: move right-edge to right + if portx >= pxmax or portx >= Columns then + Beep; + else + panner_v_cleanup (f (top_y), portx - 1, porty); + portx := portx + 1; + -- C had ++portx instead of portx++, weird. + end if; + when Key_Insert_Line => + -- increase-lines: move bottom-edge down + if porty >= pymax or porty >= Lines then + Beep; + else + panner_h_cleanup (porty - 1, f (top_x), portx); + porty := porty + 1; + end if; + + when Key_Delete_Char => + -- decrease-columns: move bottom edge up + if portx <= top_x then + Beep; + else + portx := portx - 1; + panner_v_cleanup (f (top_y), portx, porty); + end if; + + when Key_Delete_Line => + -- decrease-lines + if porty <= top_y then + Beep; + else + porty := porty - 1; + panner_h_cleanup (porty, f (top_x), portx); + end if; + when Key_Cursor_Left => + -- pan leftwards + if basex > 0 then + basex := basex - 1; + else + Beep; + end if; + when Key_Cursor_Right => + -- pan rightwards + -- if (basex + portx - (pymax > porty) < pxmax) + if (basex + portx - + Column_Position (greater (pymax, porty)) < pxmax) then + -- if basex + portx < pxmax or + -- (pymax > porty and basex + portx - 1 < pxmax) then + basex := basex + 1; + else + Beep; + end if; + + when Key_Cursor_Up => + -- pan upwards + if basey > 0 then + basey := basey - 1; + else + Beep; + end if; + + when Key_Cursor_Down => + -- pan downwards + -- same as if (basey + porty - (pxmax > portx) < pymax) + if (basey + porty - + Line_Position (greater (pxmax, portx)) < pymax) then + -- if (basey + porty < pymax) or + -- (pxmax > portx and basey + porty - 1 < pymax) then + basey := basey + 1; + else + Beep; + end if; + + when Character'Pos ('H') | + Key_Home | + Key_Find => + basey := 0; + + when Character'Pos ('E') | + Key_End | + Key_Select => + basey := pymax - porty; + if basey < 0 then -- basey := max(basey, 0); + basey := 0; + end if; + + when others => + Beep; + end case; + + -- more writing off the screen. + -- Interestingly, the exception is not handled if + -- we put a block around this. + -- delcare --begin + if top_y /= 0 and top_x /= 0 then + Add (Line => top_y - 1, Column => top_x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + end if; + if top_x /= 0 then + do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty); + end if; + if top_y /= 0 then + do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); + end if; + -- exception when Curses_Exception => null; end; + + -- in C was ... pxmax > portx - 1 + if scrollers and pxmax >= portx then + declare + length : Column_Position := portx - top_x - 1; + lowend, highend : Column_Position; + begin + -- Instead of using floats, I'll use integers only. + lowend := top_x + (basex * length) / pxmax; + highend := top_x + ((basex + length) * length) / pxmax; + + do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), + lowend); + if highend < portx then + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => True); + do_h_line (porty - 1, lowend, Blank2, highend + 1); + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => False); + do_h_line (porty - 1, highend + 1, + ACS_Map (ACS_Horizontal_Line), portx); + end if; + end; + else + do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); + end if; + + if scrollers and pymax >= porty then + declare + length : Line_Position := porty - top_y - 1; + lowend, highend : Line_Position; + begin + lowend := top_y + (basey * length) / pymax; + highend := top_y + ((basey + length) * length) / pymax; + + do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), + lowend); + if highend < porty then + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => True); + do_v_line (lowend, portx - 1, Blank2, highend + 1); + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => False); + do_v_line (highend + 1, portx - 1, + ACS_Map (ACS_Vertical_Line), porty); + end if; + end; + else + do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty); + end if; + + if top_y /= 0 then + Add (Line => top_y - 1, Column => portx - 1, + Ch => ACS_Map (ACS_Upper_Right_Corner)); + end if; + if top_x /= 0 then + Add (Line => porty - 1, Column => top_x - 1, + Ch => ACS_Map (ACS_Lower_Left_Corner)); + end if; + declare + begin + -- Here is another place where it is possible + -- to write to the corner of the screen. + Add (Line => porty - 1, Column => portx - 1, + Ch => ACS_Map (ACS_Lower_Right_Corner)); + exception + when Curses_Exception => null; + end; + + before := gettime; + + Refresh_Without_Update; + + declare + -- the C version allows the panel to have a zero height + -- wich raise the exception + begin + Refresh_Without_Update + ( + pad, + basey, basex, + top_y, top_x, + porty - Line_Position (greater (pxmax, portx)) - 1, + portx - Column_Position (greater (pymax, porty)) - 1); + exception + when Curses_Exception => null; + end; + + Update_Screen; + + if timing then declare + s : String (1 .. 7); + elapsed : Long_Float; + begin + after := gettime; + elapsed := (Long_Float (after.seconds - before.seconds) + + Long_Float (after.microseconds - before.microseconds) + / 1.0e6); + Move_Cursor (Line => Lines - 1, Column => Columns - 20); + floatio.Put (s, elapsed, Aft => 3, Exp => 0); + Add (Str => s); + Refresh; + end; + end if; + + c := pgetc (pad); + exit when c = Key_Exit; + + end loop; + + Allow_Scrolling (Mode => True); + + end panner; + + Gridsize : constant := 3; + Gridcount : Integer := 0; + + Pad_High : constant Line_Count := 200; + Pad_Wide : constant Column_Count := 200; + panpad : Window := New_Pad (Pad_High, Pad_Wide); +begin + if panpad = Null_Window then + Cannot ("cannot create requested pad"); + return; + end if; + + for i in 0 .. Pad_High - 1 loop + for j in 0 .. Pad_Wide - 1 loop + if i mod Gridsize = 0 and j mod Gridsize = 0 then + if i = 0 or j = 0 then + Add (panpad, '+'); + else + -- depends on ASCII? + Add (panpad, + Ch => Character'Val (Character'Pos ('A') + + Gridcount mod 26)); + Gridcount := Gridcount + 1; + end if; + elsif i mod Gridsize = 0 then + Add (panpad, '-'); + elsif j mod Gridsize = 0 then + Add (panpad, '|'); + else + declare + -- handle the write to the lower right corner error + begin + Add (panpad, ' '); + exception + when Curses_Exception => null; + end; + end if; + end loop; + end loop; + panner_legend (Lines - 4); + panner_legend (Lines - 3); + panner_legend (Lines - 2); + panner_legend (Lines - 1); + + Set_KeyPad_Mode (panpad, True); + -- Make the pad (initially) narrow enough that a trace file won't wrap. + -- We'll still be able to widen it during a test, since that's required + -- for testing boundaries. + + panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access); + + Delete (panpad); + End_Windows; -- Hmm, Erase after End_Windows + Erase; +end ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_pad.ads b/Ada95/samples/ncurses2-demo_pad.ads new file mode 100644 index 00000000..b996263c --- /dev/null +++ b/Ada95/samples/ncurses2-demo_pad.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_panels.adb b/Ada95/samples/ncurses2-demo_panels.adb new file mode 100644 index 00000000..9988a9f1 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_panels.adb @@ -0,0 +1,379 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Panels.User_Data; + +with ncurses2.genericPuts; + +procedure ncurses2.demo_panels (nap_mseci : Integer) is + use Int_IO; + + function mkpanel (color : Color_Number; + rows : Line_Count; + cols : Column_Count; + tly : Line_Position; + tlx : Column_Position) return Panel; + procedure rmpanel (pan : in out Panel); + procedure pflush; + procedure wait_a_while (msec : Integer); + procedure saywhat (text : String); + procedure fill_panel (pan : Panel); + + nap_msec : Integer := nap_mseci; + + function mkpanel (color : Color_Number; + rows : Line_Count; + cols : Column_Count; + tly : Line_Position; + tlx : Column_Position) return Panel is + win : Window; + pan : Panel := Null_Panel; + begin + win := New_Window (rows, cols, tly, tlx); + if Null_Window /= win then + pan := New_Panel (win); + if pan = Null_Panel then + Delete (win); + elsif Has_Colors then + declare + fg, bg : Color_Number; + begin + if color = Blue then + fg := White; + else + fg := Black; + end if; + bg := color; + Init_Pair (Color_Pair (color), fg, bg); + Set_Background (win, (Ch => ' ', + Attr => Normal_Video, + Color => Color_Pair (color))); + end; + else + Set_Background (win, (Ch => ' ', + Attr => (Bold_Character => True, + others => False), + Color => Color_Pair (color))); + end if; + end if; + return pan; + end mkpanel; + + procedure rmpanel (pan : in out Panel) is + win : Window := Panel_Window (pan); + begin + Delete (pan); + Delete (win); + end rmpanel; + + procedure pflush is + begin + Update_Panels; + Update_Screen; + end pflush; + + procedure wait_a_while (msec : Integer) is + begin + -- The C version had some #ifdef blocks here + if nap_msec = 1 then + Getchar; + else + Nap_Milli_Seconds (nap_msec); + end if; + end wait_a_while; + + procedure saywhat (text : String) is + begin + Move_Cursor (Line => Lines - 1, Column => 0); + Clear_To_End_Of_Line; + Add (Str => text); + end saywhat; + + -- from sample-curses_demo.adb + type User_Data is new String (1 .. 2); + type User_Data_Access is access all User_Data; + package PUD is new Panels.User_Data (User_Data, User_Data_Access); + + use PUD; + + procedure fill_panel (pan : Panel) is + win : Window := Panel_Window (pan); + num : Character := Get_User_Data (pan) (2); + tmp6 : String (1 .. 6) := "-panx-"; + maxy : Line_Count; + maxx : Column_Count; + + begin + Move_Cursor (win, 1, 1); + tmp6 (5) := num; + Add (win, Str => tmp6); + Clear_To_End_Of_Line (win); + Box (win); + Get_Size (win, maxy, maxx); + for y in 2 .. maxy - 2 loop + for x in 1 .. maxx - 2 loop + Move_Cursor (win, y, x); + Add (win, num); + end loop; + end loop; + end fill_panel; + + modstr : array (0 .. 5) of String (1 .. 5) := + ("test ", + "TEST ", + "(**) ", + "*()* ", + "<--> ", + "LAST " + ); + + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + -- the C version said register int y, x; + tmpb : BS.Bounded_String; + +begin + Refresh; + + for y in 0 .. Integer (Lines - 2) loop + for x in 0 .. Integer (Columns - 1) loop + myPut (tmpb, (y + x) mod 10); + myAdd (Str => tmpb); + end loop; + end loop; + for y in 0 .. 4 loop + declare + p1, p2, p3, p4, p5 : Panel; + U1 : User_Data_Access := new User_Data'("p1"); + U2 : User_Data_Access := new User_Data'("p2"); + U3 : User_Data_Access := new User_Data'("p3"); + U4 : User_Data_Access := new User_Data'("p4"); + U5 : User_Data_Access := new User_Data'("p5"); + + begin + p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0); + Set_User_Data (p1, U1); + p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4, + Columns / 10); + Set_User_Data (p2, U2); + p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2, + Columns / 9); + Set_User_Data (p3, U3); + p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2, + Columns / 3); + Set_User_Data (p4, U4); + p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2, + Columns / 2 - 2); + Set_User_Data (p5, U5); + + fill_panel (p1); + fill_panel (p2); + fill_panel (p3); + fill_panel (p4); + fill_panel (p5); + Hide (p4); + Hide (p5); + pflush; + saywhat ("press any key to continue"); + wait_a_while (nap_msec); + + saywhat ("h3 s1 s2 s4 s5; press any key to continue"); + Move (p1, 0, 0); + Hide (p3); + Show (p1); + Show (p2); + Show (p4); + Show (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("s1; press any key to continue"); + Show (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("s2; press any key to continue"); + Show (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("m2; press any key to continue"); + Move (p2, Lines / 3 + 1, Columns / 8); + pflush; + wait_a_while (nap_msec); + + saywhat ("s3;"); + Show (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("m3; press any key to continue"); + Move (p3, Lines / 4 + 1, Columns / 15); + pflush; + wait_a_while (nap_msec); + + saywhat ("b3; press any key to continue"); + Bottom (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("s4; press any key to continue"); + Show (p4); + pflush; + wait_a_while (nap_msec); + + saywhat ("s5; press any key to continue"); + Show (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("t3; press any key to continue"); + Top (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("t1; press any key to continue"); + Top (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("t2; press any key to continue"); + Top (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("t3; press any key to continue"); + Top (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("t4; press any key to continue"); + Top (p4); + pflush; + wait_a_while (nap_msec); + + for itmp in 0 .. 5 loop + declare + w4 : Window := Panel_Window (p4); + w5 : Window := Panel_Window (p5); + begin + + saywhat ("m4; press any key to continue"); + Move_Cursor (w4, Lines / 8, 1); + Add (w4, modstr (itmp)); + Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8)); + Move_Cursor (w5, Lines / 6, 1); + Add (w5, modstr (itmp)); + pflush; + wait_a_while (nap_msec); + + saywhat ("m5; press any key to continue"); + Move_Cursor (w4, Lines / 6, 1); + Add (w4, modstr (itmp)); + Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6); + Move_Cursor (w5, Lines / 8, 1); + Add (w5, modstr (itmp)); + pflush; + wait_a_while (nap_msec); + end; + end loop; + + saywhat ("m4; press any key to continue"); + Move (p4, Lines / 6, 6 * (Columns / 8)); + -- Move(p4, Lines / 6, itmp * (Columns / 8)); + pflush; + wait_a_while (nap_msec); + + saywhat ("t5; press any key to continue"); + Top (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("t2; press any key to continue"); + Top (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("t1; press any key to continue"); + Top (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("d2; press any key to continue"); + rmpanel (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("h3; press any key to continue"); + Hide (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("d1; press any key to continue"); + rmpanel (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("d4; press any key to continue"); + rmpanel (p4); + pflush; + wait_a_while (nap_msec); + + saywhat ("d5; press any key to continue"); + rmpanel (p5); + pflush; + wait_a_while (nap_msec); + if (nap_msec = 1) then + exit; + else + nap_msec := 100; + end if; + + end; + end loop; + + Erase; + End_Windows; + +end ncurses2.demo_panels; diff --git a/Ada95/samples/ncurses2-demo_panels.ads b/Ada95/samples/ncurses2-demo_panels.ads new file mode 100644 index 00000000..eb2878c8 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_panels.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_panels (nap_mseci : Integer); diff --git a/Ada95/samples/ncurses2-flushinp_test.adb b/Ada95/samples/ncurses2-flushinp_test.adb new file mode 100644 index 00000000..9ea98e15 --- /dev/null +++ b/Ada95/samples/ncurses2-flushinp_test.adb @@ -0,0 +1,135 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with ncurses2.util; use ncurses2.util; + +procedure ncurses2.flushinp_test (win : Window) is + + procedure Continue (win : Window); + + procedure Continue (win : Window) is + begin + Set_Echo_Mode (False); + Move_Cursor (win, 10, 1); + Add (win, 10, 1, " Press any key to continue"); + Refresh (win); + Getchar (win); + end Continue; + + h, by, sh : Line_Position; + w, bx, sw : Column_Position; + + subWin : Window; + +begin + Clear (win); + Get_Size (win, h, w); + Get_Window_Position (win, by, bx); + sw := w / 3; + sh := h / 3; + subWin := Sub_Window (win, sh, sw, by + h - sh - 2, bx + w - sw - 2); + + if Has_Colors then + Init_Pair (2, Cyan, Blue); + Change_Background (subWin, + Attributed_Character'(Ch => ' ', Color => 2, + Attr => Normal_Video)); + end if; + + Set_Character_Attributes (subWin, + (Bold_Character => True, others => False)); + Box (subWin); + Add (subWin, 2, 1, "This is a subwindow"); + Refresh (win); + + Set_Cbreak_Mode (True); + Add (win, 0, 1, "This is a test of the flushinp() call."); + + Add (win, 2, 1, "Type random keys for 5 seconds."); + Add (win, 3, 1, + "These should be discarded (not echoed) after the subwindow " & + "goes away."); + Refresh (win); + + for i in 0 .. 4 loop + Move_Cursor (subWin, 1, 1); + Add (subWin, Str => "Time = "); + Add (subWin, Str => Integer'Image (i)); + Refresh (subWin); + Nap_Milli_Seconds (1000); + Flush_Input; + end loop; + + Delete (subWin); + Erase (win); + Flash_Screen; + Refresh (win); + Nap_Milli_Seconds (1000); + + Add (win, 2, 1, + Str => "If you were still typing when the window timer expired,"); + Add (win, 3, 1, + "or else you typed nothing at all while it was running,"); + Add (win, 4, 1, + "test was invalid. You'll see garbage or nothing at all. "); + Add (win, 6, 1, "Press a key"); + Move_Cursor (win, 9, 10); + Refresh (win); + Set_Echo_Mode (True); + Getchar (win); + Flush_Input; + Add (win, 12, 0, + "If you see any key other than what you typed, flushinp() is broken."); + Continue (win); + + Move_Cursor (win, 9, 10); + Delete_Character (win); + Refresh (win); + Move_Cursor (win, 12, 0); + Clear_To_End_Of_Line; + Add (win, + "What you typed should now have been deleted; if not, wdelch() " & + "failed."); + Continue (win); + + Set_Cbreak_Mode (True); + +end ncurses2.flushinp_test; diff --git a/Ada95/samples/ncurses2-flushinp_test.ads b/Ada95/samples/ncurses2-flushinp_test.ads new file mode 100644 index 00000000..5376c94a --- /dev/null +++ b/Ada95/samples/ncurses2-flushinp_test.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; + +procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window); diff --git a/Ada95/samples/ncurses2-genericputs.adb b/Ada95/samples/ncurses2-genericputs.adb new file mode 100644 index 00000000..f17b2098 --- /dev/null +++ b/Ada95/samples/ncurses2-genericputs.adb @@ -0,0 +1,126 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Strings.Bounded; use Ada.Strings.Bounded; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; + + +package body ncurses2.genericPuts is + + procedure myGet (Win : in Window := Standard_Window; + Str : out BS.Bounded_String; + Len : in Integer := -1) + is + use BS; + function Wgetnstr (Win : Window; + Str : char_array; + Len : int) return int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + N : Integer := Len; + Txt : char_array (0 .. size_t (Max_Length)); + xStr : String (1 .. Max_Length); + Cnt : Natural; + begin + if N < 0 then + N := Max_Length; + end if; + if N > Max_Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, xStr, Cnt, True); + Str := To_Bounded_String (xStr (1 .. Cnt)); + end myGet; + + + + procedure myPut (Str : out BS.Bounded_String; + i : Integer; + Base : in Number_Base := 10) is + package Int_IO is new Integer_IO (Integer); use Int_IO; + tmp : String (1 .. BS.Max_Length); + begin + Put (tmp, i, Base); + Str := To_Bounded_String (tmp); + Trim (Str, Ada.Strings.Trim_End'(Ada.Strings.Left)); + end myPut; + + procedure myAdd (Str : BS.Bounded_String) is + begin + Add (Str => To_String (Str)); + end myAdd; + + -- from ncurses-aux + procedure Fill_String (Cp : in chars_ptr; + Str : out BS.Bounded_String) + is + -- Fill the string with the characters referenced by the + -- chars_ptr. + -- + Len : Natural; + begin + if Cp /= Null_Ptr then + Len := Natural (Strlen (Cp)); + if Max_Length < Len then + raise Constraint_Error; + end if; + declare + S : String (1 .. Len); + begin + S := Value (Cp); + Str := To_Bounded_String (S); + end; + else + Str := Null_Bounded_String; + end if; + + end Fill_String; + +end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-genericputs.ads b/Ada95/samples/ncurses2-genericputs.ads new file mode 100644 index 00000000..eec7eba6 --- /dev/null +++ b/Ada95/samples/ncurses2-genericputs.ads @@ -0,0 +1,73 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Strings.Bounded; +use Ada.Strings.Bounded; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Terminal_Interface.Curses; + + +generic + Max : Natural; + -- type mystring is private; + -- type myint is +package ncurses2.genericPuts is + package BS is new + Ada.Strings.Bounded.Generic_Bounded_Length (Max); + use BS; + + + procedure myGet (Win : in Terminal_Interface.Curses.Window + := Terminal_Interface.Curses.Standard_Window; + Str : out BS.Bounded_String; + Len : in Integer := -1); + + procedure myPut (Str : out BS.Bounded_String; + i : Integer; + Base : in Number_Base := 10); + -- the default should be Ada.Text_IO.Integer_IO.Default_Base + -- but Default_Base is hidden in the generic so doesn't exist! + procedure myAdd (Str : BS.Bounded_String); + + procedure Fill_String (Cp : in chars_ptr; Str : out BS.Bounded_String); +end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-getch.ads b/Ada95/samples/ncurses2-getch.ads new file mode 100644 index 00000000..21a09f31 --- /dev/null +++ b/Ada95/samples/ncurses2-getch.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.adb b/Ada95/samples/ncurses2-getch_test.adb new file mode 100644 index 00000000..d786d496 --- /dev/null +++ b/Ada95/samples/ncurses2-getch_test.adb @@ -0,0 +1,251 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Character input test +-- test the keypad feature + +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Ada.Characters.Handling; +with Ada.Strings.Bounded; + +with ncurses2.genericPuts; + +procedure ncurses2.getch_test is + use Int_IO; + + function mouse_decode (ep : Mouse_Event) return String; + + function mouse_decode (ep : Mouse_Event) return String is + Y : Line_Position; + X : Column_Position; + Button : Mouse_Button; + State : Button_State; + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); + use BS; + buf : Bounded_String := To_Bounded_String (""); + begin + -- Note that these bindings do not allow + -- two button states, + -- The C version can print {click-1, click-3} for example. + -- They also don't have the 'id' or z coordinate. + Get_Event (ep, Y, X, Button, State); + + -- TODO Append (buf, "id "); from C version + Append (buf, "at ("); + Append (buf, Column_Position'Image (X)); + Append (buf, ", "); + Append (buf, Line_Position'Image (Y)); + Append (buf, ") state"); + Append (buf, Mouse_Button'Image (Button)); + + Append (buf, " = "); + Append (buf, Button_State'Image (State)); + return To_String (buf); + end mouse_decode; + + + buf : String (1 .. 1024); -- TODO was BUFSIZE + n : Integer; + c : Key_Code; + blockflag : Timeout_Mode := Blocking; + firsttime : Boolean := True; + tmp2 : Event_Mask; + tmp6 : String (1 .. 6); + tmp20 : String (1 .. 20); + x : Column_Position; + y : Line_Position; + tmpx : Integer; + incount : Integer := 0; +begin + Refresh; + tmp2 := Start_Mouse (All_Events); + Add (Str => "Delay in 10ths of a second ( for blocking input)? "); + Set_Echo_Mode (SwitchOn => True); + Get (Str => buf); + + Set_Echo_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => False); + + if Ada.Characters.Handling.Is_Digit (buf (1)) then + Get (Item => n, From => buf, Last => tmpx); + Set_Timeout_Mode (Mode => Delayed, Amount => n * 100); + blockflag := Delayed; + end if; + + c := Character'Pos ('?'); + Set_Raw_Mode (SwitchOn => True); + loop + if not firsttime then + Add (Str => "Key pressed: "); + Put (tmp6, Integer (c), 8); + Add (Str => tmp6); + Add (Ch => ' '); + if c = Key_Mouse then declare + event : Mouse_Event; + begin + event := Get_Mouse; + Add (Str => "KEY_MOUSE, "); + Add (Str => mouse_decode (event)); + Add (Ch => newl); + end; + elsif c >= Key_Min then + Key_Name (c, tmp20); + Add (Str => tmp20); + -- I used tmp and got bitten by the length problem:-> + Add (Ch => newl); + elsif c > 16#80# then -- TODO fix, use constant if possible + declare + c2 : Character := Character'Val (c mod 16#80#); + begin + if Ada.Characters.Handling.Is_Graphic (c2) then + Add (Str => "M-"); + Add (Ch => c2); + else + Add (Str => "M-"); + Add (Str => Un_Control ((Ch => c2, + Color => Color_Pair'First, + Attr => Normal_Video))); + end if; + Add (Str => " (high-half character)"); + Add (Ch => newl); + end; + else declare + c2 : Character := Character'Val (c mod 16#80#); + begin + if Ada.Characters.Handling.Is_Graphic (c2) then + Add (Ch => c2); + Add (Str => " (ASCII printable character)"); + Add (Ch => newl); + else + Add (Str => Un_Control ((Ch => c2, + Color => Color_Pair'First, + Attr => Normal_Video))); + Add (Str => " (ASCII control character)"); + Add (Ch => newl); + end if; + end; + end if; + -- TODO I am not sure why this was in the C version + -- the delay statement scroll anyway. + Get_Cursor_Position (Line => y, Column => x); + if y >= Lines - 1 then + Move_Cursor (Line => 0, Column => 0); + end if; + Clear_To_End_Of_Line; + end if; + + firsttime := False; + if c = Character'Pos ('g') then + declare + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + timedout : Boolean := False; + boundedbuf : Bounded_String; + begin + Add (Str => "getstr test: "); + Set_Echo_Mode (SwitchOn => True); + -- Note that if delay mode is set + -- Get can raise an exception. + -- The C version would print the string it had so far + -- also TODO get longer length string, like the C version + declare begin + myGet (Str => boundedbuf); + exception when Curses_Exception => + Add (Str => "Timed out."); + Add (Ch => newl); + timedout := True; + end; + -- note that the Ada Get will stop reading at 1024. + if not timedout then + Set_Echo_Mode (SwitchOn => False); + Add (Str => " I saw '"); + myAdd (Str => boundedbuf); + Add (Str => "'."); + Add (ch => newl); + end if; + end; + elsif c = Character'Pos ('s') then + ShellOut (True); + elsif c = Character'Pos ('x') or c = Character'Pos ('q') or + (c = Key_None and blockflag = Blocking) then + exit; + elsif c = Character'Pos ('?') then + Add (Str => "Type any key to see its keypad value. Also:"); + Add (Ch => newl); + Add (Str => "g -- triggers a getstr test"); + Add (Ch => newl); + Add (Str => "s -- shell out"); + Add (Ch => newl); + Add (Str => "q -- quit"); + Add (Ch => newl); + Add (Str => "? -- repeats this help message"); + Add (Ch => newl); + end if; + + loop + c := Getchar; + exit when c /= Key_None; + if blockflag /= Blocking then + Put (tmp6, incount); -- argh string length! + Add (Str => tmp6); + Add (Str => ": input timed out"); + Add (Ch => newl); + else + Put (tmp6, incount); + Add (Str => tmp6); + Add (Str => ": input error"); + Add (Ch => newl); + exit; + end if; + incount := incount + 1; + end loop; + end loop; + + tmp2 := Start_Mouse (No_Events); + Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored + Set_Raw_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => True); + Erase; + End_Windows; +end ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.ads b/Ada95/samples/ncurses2-getch_test.ads new file mode 100644 index 00000000..78a0a48c --- /dev/null +++ b/Ada95/samples/ncurses2-getch_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getopt.adb b/Ada95/samples/ncurses2-getopt.adb new file mode 100644 index 00000000..93f17139 --- /dev/null +++ b/Ada95/samples/ncurses2-getopt.adb @@ -0,0 +1,168 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- A simplified version of the GNU getopt function +-- copyright Free Software Foundtion + +with Ada.Strings.Fixed; +with Ada.Strings.Bounded; +with Ada.Text_IO; use Ada.Text_IO; + +package body ncurses2.getopt is + + opterr : Character := Character'Val (1); + optopt : Character := '?'; + initialized : Boolean := False; + + nextchar : Natural := 0; + + -- Ncurses doesn't use the non option elements so we are spared + -- the job of computing those. + + -- also the user is not allowed to modify argv or argc + -- Doing so is Erroneous execution. + + -- longoptions are not handled. + + procedure Qgetopt (retval : out Integer; + argc : Integer; + argv : stringfunc; + -- argv will be the Argument function. + optstring : String; + optind : in out Integer; + -- ignored for ncurses, must be initialized to 1 by + -- the caller + Optarg : out stringa + -- a garbage colector would be useful here. + ) is + + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); + use BS; + optargx : Bounded_String; + begin + + if argc < optind then + retval := -1; + return; + end if; + + optargx := To_Bounded_String (""); + + if nextchar = 0 then + + if argv (optind) = "--" then + -- the rest are non-options, we ignore them + retval := -1; + return; + end if; + + if argv (optind)(1) /= '-' or argv (optind)'Length = 1 then + optind := optind + 1; + Optarg := new String'(argv (optind)); + retval := 1; + return; + end if; + + nextchar := 2; -- skip the one hyphen. + end if; + + -- Look at and handle the next short option-character. + declare + c : Character := argv (optind) (nextchar); + temp : Natural := + Ada.Strings.Fixed.Index (optstring, String'(1 => c)); + begin + if temp = 0 or c = ':' then + Put_Line (Standard_Error, + argv (optind) & ": invalid option -- " & c); + optopt := c; + c := '?'; + return; + end if; + + if optstring (temp + 1) = ':' then + if optstring (temp + 2) = ':' then + -- This is an option that accepts an argument optionally. + if nextchar /= argv (optind)'Length then + optargx := To_Bounded_String + (argv (optind) (nextchar .. argv (optind)'Length)); + else + Optarg := null; + end if; + else + -- This is an option that requires an argument. + if nextchar /= argv (optind)'Length then + optargx := To_Bounded_String + (argv (optind) (nextchar .. argv (optind)'Length)); + optind := optind + 1; + elsif optind = argc then + Put_Line (Standard_Error, + argv (optind) & + ": option requires an argument -- " & c); + optopt := c; + if optstring (1) = ':' then + c := ':'; + else + c := '?'; + end if; + else + -- increment it again when taking next ARGV-elt as argument. + optind := optind + 1; + optargx := To_Bounded_String (argv (optind)); + optind := optind + 1; + end if; + end if; + nextchar := 0; + else -- no argument for the option + if nextchar = argv (optind)'Length then + optind := optind + 1; + nextchar := 0; + else + nextchar := nextchar + 1; + end if; + end if; + + retval := Character'Pos (c); + Optarg := new String'(To_String (optargx)); + return; + end; + end Qgetopt; + +end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-getopt.ads b/Ada95/samples/ncurses2-getopt.ads new file mode 100644 index 00000000..0bd6952a --- /dev/null +++ b/Ada95/samples/ncurses2-getopt.ads @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package ncurses2.getopt is + + type stringa is access String; + + type stringfunc is access + function (n : Positive) return String; + + + procedure Qgetopt (retval : out Integer; + argc : Integer; + argv : stringfunc; + optstring : String; + optind : in out Integer; + -- ignored for ncurses, must be initialized to 0 + -- by the caller + Optarg : out stringa + -- a garbage collector would be useful here. + ); +end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-m.adb b/Ada95/samples/ncurses2-m.adb new file mode 100644 index 00000000..d4f2b8a0 --- /dev/null +++ b/Ada95/samples/ncurses2-m.adb @@ -0,0 +1,460 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- TODO use Default_Character where appropriate + +-- This is an Ada version of ncurses +-- I translated this because it tests the most features. + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; + +with Ada.Text_IO; use Ada.Text_IO; + +with Ada.Characters.Latin_1; +-- with Ada.Characters.Handling; + +with Ada.Command_Line; use Ada.Command_Line; + +with Ada.Strings.Unbounded; + + +with ncurses2.util; use ncurses2.util; +with ncurses2.getch_test; +with ncurses2.attr_test; +with ncurses2.color_test; +with ncurses2.demo_panels; +with ncurses2.color_edit; +with ncurses2.slk_test; +with ncurses2.acs_display; +with ncurses2.color_edit; +with ncurses2.acs_and_scroll; +with ncurses2.flushinp_test; +with ncurses2.test_sgr_attributes; +with ncurses2.menu_test; +with ncurses2.demo_pad; +with ncurses2.demo_forms; +with ncurses2.overlap_test; +with ncurses2.trace_set; + +with ncurses2.getopt; use ncurses2.getopt; + +package body ncurses2.m is + use Int_IO; + + function To_trace (n : Integer) return Trace_Attribute_Set; + procedure usage; + procedure Set_Terminal_Modes; + function Do_Single_Test (c : Character) return Boolean; + + function To_trace (n : Integer) return Trace_Attribute_Set is + a : Trace_Attribute_Set := (others => False); + m : Integer; + rest : Integer; + begin + m := n mod 2; + if 1 = m then + a.Times := True; + end if; + rest := n / 2; + + m := rest mod 2; + if 1 = m then + a.Tputs := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Update := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Cursor_Move := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Character_Output := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Virtual_Puts := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Input_Events := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.TTY_State := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Internal_Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Character_Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Termcap_TermInfo := True; + end if; + + return a; + end To_trace; + + -- these are type Stdscr_Init_Proc; + + function rip_footer ( + Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, rip_footer); + + function rip_footer ( + Win : Window; + Columns : Column_Count) return Integer is + begin + Set_Background (Win, (Ch => ' ', + Attr => (Reverse_Video => True, others => False), + Color => 0)); + Erase (Win); + Move_Cursor (Win, 0, 0); + Add (Win, "footer:" & Columns'Img & " columns"); + Refresh_Without_Update (Win); + return 0; -- Curses_OK; + end rip_footer; + + + function rip_header ( + Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, rip_header); + + function rip_header ( + Win : Window; + Columns : Column_Count) return Integer is + begin + Set_Background (Win, (Ch => ' ', + Attr => (Reverse_Video => True, others => False), + Color => 0)); + Erase (Win); + Move_Cursor (Win, 0, 0); + Add (Win, "header:" & Columns'Img & " columns"); + -- 'Img is a GNAT extention + Refresh_Without_Update (Win); + return 0; -- Curses_OK; + end rip_header; + + procedure usage is + -- type Stringa is access String; + use Ada.Strings.Unbounded; + -- tbl : constant array (Positive range <>) of Stringa := ( + tbl : constant array (Positive range <>) of Unbounded_String + := ( + To_Unbounded_String ("Usage: ncurses [options]"), + To_Unbounded_String (""), + To_Unbounded_String ("Options:"), + To_Unbounded_String (" -a f,b set default-colors " & + "(assumed white-on-black)"), + To_Unbounded_String (" -d use default-colors if terminal " & + "supports them"), + To_Unbounded_String (" -e fmt specify format for soft-keys " & + "test (e)"), + To_Unbounded_String (" -f rip-off footer line " & + "(can repeat)"), + To_Unbounded_String (" -h rip-off header line " & + "(can repeat)"), + To_Unbounded_String (" -s msec specify nominal time for " & + "panel-demo (default: 1, to hold)"), + To_Unbounded_String (" -t mask specify default trace-level " & + "(may toggle with ^T)") + ); + begin + for n in tbl'Range loop + Put_Line (Standard_Error, To_String (tbl (n))); + end loop; + -- exit(EXIT_FAILURE); + -- TODO should we use Set_Exit_Status and throw and exception? + end usage; + + procedure Set_Terminal_Modes is begin + Set_Raw_Mode (SwitchOn => False); + Set_Cbreak_Mode (SwitchOn => True); + Set_Echo_Mode (SwitchOn => False); + Allow_Scrolling (Mode => True); + Use_Insert_Delete_Line (Do_Idl => True); + Set_KeyPad_Mode (SwitchOn => True); + end Set_Terminal_Modes; + + + nap_msec : Integer := 1; + + function Do_Single_Test (c : Character) return Boolean is + begin + case c is + when 'a' => + getch_test; + when 'b' => + attr_test; + when 'c' => + if not Has_Colors then + Cannot ("does not support color."); + else + color_test; + end if; + when 'd' => + if not Has_Colors then + Cannot ("does not support color."); + elsif not Can_Change_Color then + Cannot ("has hardwired color values."); + else + color_edit; + end if; + when 'e' => + slk_test; + when 'f' => + acs_display; + when 'o' => + demo_panels (nap_msec); + when 'g' => + acs_and_scroll; + when 'i' => + flushinp_test (Standard_Window); + when 'k' => + test_sgr_attributes; + when 'm' => + menu_test; + when 'p' => + demo_pad; + when 'r' => + demo_forms; + when 's' => + overlap_test; + when 't' => + trace_set; + when '?' => + null; + when others => return False; + end case; + return True; + end Do_Single_Test; + + + command : Character; + my_e_param : Soft_Label_Key_Format := Four_Four; + assumed_colors : Boolean := False; + default_colors : Boolean := False; + default_fg : Color_Number := White; + default_bg : Color_Number := Black; + -- nap_msec was an unsigned long integer in the C version, + -- yet napms only takes an int! + + c : Integer; + c2 : Character; + optind : Integer := 1; -- must be initialized to one. + type stringa is access String; + optarg : getopt.stringa; + + length : Integer; + tmpi : Integer; + + package myio is new Ada.Text_IO.Integer_IO (Integer); + use myio; + + save_trace : Integer := 0; + save_trace_set : Trace_Attribute_Set; + + function main return Integer is + begin + loop + Qgetopt (c, Argument_Count, Argument'Access, + "a:de:fhs:t:", optind, optarg); + exit when c = -1; + c2 := Character'Val (c); + case c2 is + when 'a' => + -- Ada doesn't have scanf, it doesn't even have a + -- regular expression library. + assumed_colors := True; + myio.Get (optarg.all, Integer (default_fg), length); + myio.Get (optarg.all (length + 2 .. optarg.all'Length), + Integer (default_bg), length); + when 'd' => + default_colors := True; + when 'e' => + myio.Get (optarg.all, tmpi, length); + if Integer (tmpi) > 3 then + usage; + return 1; + end if; + my_e_param := Soft_Label_Key_Format'Val (tmpi); + when 'f' => + Rip_Off_Lines (-1, rip_footer'Access); + when 'h' => + Rip_Off_Lines (1, rip_header'Access); + when 's' => + myio.Get (optarg.all, nap_msec, length); + when 't' => + myio.Get (optarg.all, save_trace, length); + when others => + usage; + return 1; + end case; + end loop; + + -- the C version had a bunch of macros here. + + -- if (!isatty(fileno(stdin))) + -- isatty is not available in the standard Ada so skip it. + save_trace_set := To_trace (save_trace); + Trace_On (save_trace_set); + + + Init_Soft_Label_Keys (my_e_param); + + Init_Screen; + Set_Background (Ch => (Ch => Blank, + Attr => Normal_Video, + Color => Color_Pair'First)); + + if Has_Colors then + Start_Color; + if default_colors then + Use_Default_Colors; + elsif assumed_colors then + Assume_Default_Colors (default_fg, default_bg); + end if; + end if; + + Set_Terminal_Modes; + Save_Curses_Mode (Curses); + + End_Windows; + + -- TODO add macro #if blocks. + Put_Line ("Welcome to " & Curses_Version & ". Press ? for help."); + + loop + Put_Line ("This is the ncurses main menu"); + Put_Line ("a = keyboard and mouse input test"); + Put_Line ("b = character attribute test"); + Put_Line ("c = color test pattern"); + Put_Line ("d = edit RGB color values"); + Put_Line ("e = exercise soft keys"); + Put_Line ("f = display ACS characters"); + Put_Line ("g = display windows and scrolling"); + Put_Line ("i = test of flushinp()"); + Put_Line ("k = display character attributes"); + Put_Line ("m = menu code test"); + Put_Line ("o = exercise panels library"); + Put_Line ("p = exercise pad features"); + Put_Line ("q = quit"); + Put_Line ("r = exercise forms code"); + Put_Line ("s = overlapping-refresh test"); + Put_Line ("t = set trace level"); + Put_Line ("? = repeat this command summary"); + + Put ("> "); + Flush; + + command := Ada.Characters.Latin_1.NUL; + -- get_input: + -- loop + declare + Ch : Character; + begin + Get (Ch); + -- TODO if read(ch) <= 0 + -- TODO ada doesn't have an Is_Space function + command := Ch; + -- TODO if ch = '\n' or '\r' are these in Ada? + end; + -- end loop get_input; + + declare + begin + if Do_Single_Test (command) then + Flush_Input; + Set_Terminal_Modes; + Reset_Curses_Mode (Curses); + Clear; + Refresh; + End_Windows; + if command = '?' then + Put_Line ("This is the ncurses capability tester."); + Put_Line ("You may select a test from the main menu by " & + "typing the"); + Put_Line ("key letter of the choice (the letter to left " & + "of the =)"); + Put_Line ("at the > prompt. The commands `x' or `q' will " & + "exit."); + end if; + -- continue; --why continue in the C version? + end if; + exception + when Curses_Exception => End_Windows; + end; + + exit when command = 'q'; + end loop; + return 0; -- TODO ExitProgram(EXIT_SUCCESS); + end main; + +end ncurses2.m; + + + + + + + diff --git a/Ada95/samples/ncurses2-m.ads b/Ada95/samples/ncurses2-m.ads new file mode 100644 index 00000000..c32d895d --- /dev/null +++ b/Ada95/samples/ncurses2-m.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package ncurses2.m is + function main return Integer; +end ncurses2.m; diff --git a/Ada95/samples/ncurses2-menu_test.adb b/Ada95/samples/ncurses2-menu_test.adb new file mode 100644 index 00000000..0b96315e --- /dev/null +++ b/Ada95/samples/ncurses2-menu_test.adb @@ -0,0 +1,165 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; + +procedure ncurses2.menu_test is + function menu_virtualize (c : Key_Code) return Menu_Request_Code; + procedure xAdd (l : Line_Position; c : Column_Position; s : String); + + function menu_virtualize (c : Key_Code) return Menu_Request_Code is + begin + case c is + when Character'Pos (newl) | Key_Exit => + return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO + when Character'Pos ('u') => + return M_ScrollUp_Line; + when Character'Pos ('d') => + return M_ScrollDown_Line; + when Character'Pos ('b') | Key_Next_Page => + return M_ScrollUp_Page; + when Character'Pos ('f') | Key_Previous_Page => + return M_ScrollDown_Page; + when Character'Pos ('n') | Key_Cursor_Down => + return M_Next_Item; + when Character'Pos ('p') | Key_Cursor_Up => + return M_Previous_Item; + when Character'Pos (' ') => + return M_Toggle_Item; + when Key_Mouse => + return c; + when others => + Beep; + return c; + end case; + end menu_virtualize; + + MENU_Y : constant Line_Count := 8; + MENU_X : constant Column_Count := 8; + + type String_Access is access String; + + animals : constant array (Positive range <>) of String_Access := + (new String'("Lions"), + new String'("Tigers"), + new String'("Bears"), + new String'("(Oh my!)"), + new String'("Newts"), + new String'("Platypi"), + new String'("Lemurs")); + + items_a : Item_Array_Access := new Item_Array (1 .. animals'Last + 1); + + tmp : Event_Mask; + procedure xAdd (l : Line_Position; c : Column_Position; s : String) is + begin + Add (Line => l, Column => c, Str => s); + end xAdd; + + mrows : Line_Count; + mcols : Column_Count; + + menuwin : Window; + + m : Menu; + + c1 : Key_Code; + + c : Driver_Result; + r : Menu_Request_Code; +begin + tmp := Start_Mouse; + xAdd (0, 0, "This is the menu test:"); + xAdd (2, 0, " Use up and down arrow to move the select bar."); + xAdd (3, 0, " 'n' and 'p' act like arrows."); + xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); + xAdd (5, 0, " Press return to exit."); + Refresh; + + for i in animals'Range loop + items_a (i) := New_Item (animals (i).all); + end loop; + items_a (animals'Last + 1) := Null_Item; + + m := New_Menu (items_a); + + Set_Format (m, Line_Position (animals'Last + 1) / 2, 1); + Scale (m, mrows, mcols); + + menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X); + Set_Window (m, menuwin); + Set_KeyPad_Mode (menuwin, True); + Box (menuwin); -- 0,0? + + Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); + + Post (m); + + loop + c1 := Getchar (menuwin); + r := menu_virtualize (c1); + c := Driver (m, r); + exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND? + if c = Request_Denied then + Beep; + end if; + -- continue ? + end loop; + + Move_Cursor (Line => Lines - 2, Column => 0); + Add (Str => "You chose: "); + Add (Str => Name (Current (m))); + Add (Ch => newl); + Pause; -- the C version didn't use Pause, it spelled it out + + Post (m, False); -- unpost, not clear :-( + declare begin + Delete (menuwin); + exception when Curses_Exception => null; end; + -- menuwin has children so will raise the exception. + + Delete (m); + + tmp := Start_Mouse (No_Events); +end ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-menu_test.ads b/Ada95/samples/ncurses2-menu_test.ads new file mode 100644 index 00000000..17e5b16b --- /dev/null +++ b/Ada95/samples/ncurses2-menu_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb new file mode 100644 index 00000000..5d3fc6d5 --- /dev/null +++ b/Ada95/samples/ncurses2-overlap_test.adb @@ -0,0 +1,156 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +-- test effects of overlapping windows + +procedure ncurses2.overlap_test is + + procedure fillwin (win : Window; ch : Character); + procedure crosswin (win : Window; ch : Character); + + procedure fillwin (win : Window; ch : Character) is + y1 : Line_Position; + x1 : Column_Position; + begin + Get_Size (win, y1, x1); + for y in 0 .. y1 - 1 loop + Move_Cursor (win, y, 0); + for x in 0 .. x1 - 1 loop + Add (win, Ch => ch); + end loop; + end loop; + exception + when Curses_Exception => null; + -- write to lower right corner + end fillwin; + + procedure crosswin (win : Window; ch : Character) is + y1 : Line_Position; + x1 : Column_Position; + begin + Get_Size (win, y1, x1); + for y in 0 .. y1 - 1 loop + for x in 0 .. x1 - 1 loop + if (((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) + or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3)))) then + Move_Cursor (win, y, x); + Add (win, Ch => ch); + end if; + end loop; + end loop; + end crosswin; + + -- In a 24x80 screen like some xterms are, the instructions will + -- be overwritten. + ch : Character; + win1 : Window := New_Window (9, 20, 3, 3); + win2 : Window := New_Window (9, 20, 9, 16); +begin + Set_Raw_Mode (SwitchOn => True); + Refresh; + Move_Cursor (Line => 0, Column => 0); + Add (Str => "This test shows the behavior of wnoutrefresh() with " & + "respect to"); + Add (Ch => newl); + Add (Str => "the shared region of two overlapping windows A and B. "& + "The cross"); + Add (Ch => newl); + Add (Str => "pattern in each window does not overlap the other."); + Add (Ch => newl); + + Move_Cursor (Line => 18, Column => 0); + Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " & + "then A, then doupdaute"); + Add (Ch => newl); + Add (Str => "c = fill window A with letter A. d = fill window B " & + "with letter B."); + Add (Ch => newl); + Add (Str => "e = cross pattern in window A. f = cross pattern " & + "in window B."); + Add (Ch => newl); + Add (Str => "g = clear window A. h = clear window B."); + Add (Ch => newl); + Add (Str => "i = overwrite A onto B. j = overwrite " & + "B onto A."); + Add (Ch => newl); + Add (Str => "^Q/ESC = terminate test."); + + loop + ch := Code_To_Char (Getchar); + exit when ch = CTRL ('Q') or ch = CTRL ('['); -- QUIT or ESCAPE + case ch is + when 'a' => -- refresh window A first, then B + Refresh_Without_Update (win1); + Refresh_Without_Update (win2); + Update_Screen; + when 'b' => -- refresh window B first, then A + Refresh_Without_Update (win2); + Refresh_Without_Update (win1); + Update_Screen; + when 'c' => -- fill window A so it's visible + fillwin (win1, 'A'); + when 'd' => -- fill window B so it's visible + fillwin (win2, 'B'); + when 'e' => -- cross test pattern in window A + crosswin (win1, 'A'); + when 'f' => -- cross test pattern in window B + crosswin (win2, 'B'); + when 'g' => -- clear window A + Clear (win1); + Move_Cursor (win1, 0, 0); + when 'h' => -- clear window B + Clear (win2); + Move_Cursor (win2, 0, 0); + when 'i' => -- overwrite A onto B + Overwrite (win1, win2); + when 'j' => -- overwrite B onto A + Overwrite (win2, win1); + when others => null; + end case; + end loop; + + Delete (win2); + Delete (win1); + Erase; + End_Windows; +end ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-overlap_test.ads b/Ada95/samples/ncurses2-overlap_test.ads new file mode 100644 index 00000000..ce6e3e69 --- /dev/null +++ b/Ada95/samples/ncurses2-overlap_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-slk_test.adb b/Ada95/samples/ncurses2-slk_test.adb new file mode 100644 index 00000000..77ca2843 --- /dev/null +++ b/Ada95/samples/ncurses2-slk_test.adb @@ -0,0 +1,171 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Strings.Unbounded; +with Interfaces.C; +with Terminal_Interface.Curses.Aux; + +procedure ncurses2.slk_test is + procedure myGet (Win : in Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : in Integer := -1); + + procedure myGet (Win : in Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : in Integer := -1) + is + use Ada.Strings.Unbounded; + use Interfaces.C; + use Terminal_Interface.Curses.Aux; + + function Wgetnstr (Win : Window; + Str : char_array; + Len : int) return int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + Txt : char_array (0 .. 10); + begin + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, 8) = Curses_Err then + raise Curses_Exception; + end if; + Str := To_Unbounded_String (To_Ada (Txt, True)); + end myGet; + + + use Int_IO; + + use Ada.Strings.Unbounded; + + c : Key_Code; + buf : Unbounded_String; + c2 : Character; + fmt : Label_Justification := Centered; + tmp : Integer; + +begin + c := CTRL ('l'); + loop + Move_Cursor (Line => 0, Column => 0); + c2 := Code_To_Char (c); + case c2 is + when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') + Erase; + Switch_Character_Attribute (Attr => (Bold_Character => True, + others => False)); + Add (Line => 0, Column => 20, + Str => "Soft Key Exerciser"); + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + + Move_Cursor (Line => 2, Column => 0); + P ("Available commands are:"); + P (""); + P ("^L -- refresh screen"); + P ("a -- activate or restore soft keys"); + P ("d -- disable soft keys"); + P ("c -- set centered format for labels"); + P ("l -- set left-justified format for labels"); + P ("r -- set right-justified format for labels"); + P ("[12345678] -- set label; labels are numbered 1 through 8"); + P ("e -- erase stdscr (should not erase labels)"); + P ("s -- test scrolling of shortened screen"); + P ("x, q -- return to main menu"); + P (""); + P ("Note: if activating the soft keys causes your terminal to"); + P ("scroll up one line, your terminal auto-scrolls when anything"); + P ("is written to the last screen position. The ncurses code"); + P ("does not yet handle this gracefully."); + Refresh; + Restore_Soft_Label_Keys; + + when 'a' => + Restore_Soft_Label_Keys; + when 'e' => + Clear; + when 's' => + Add (Line => 20, Column => 0, + Str => "Press Q to stop the scrolling-test: "); + loop + c := Getchar; + c2 := Code_To_Char (c); + exit when c2 = 'Q'; + -- c = ERR? + -- TODO when c is not a character (arrow key) + -- the behavior is different from the C version. + Add (Ch => c2); + end loop; + when 'd' => + Clear_Soft_Label_Keys; + when 'l' => + fmt := Left; + when 'c' => + fmt := Centered; + when 'r' => + fmt := Right; + when '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' => + Add (Line => 20, Column => 0, + Str => "Please enter the label value: "); + Set_Echo_Mode (SwitchOn => True); + myGet (Str => buf); + Set_Echo_Mode (SwitchOn => False); + tmp := ctoi (c2); + Set_Soft_Label_Key (Label_Number (tmp), To_String (buf), fmt); + Refresh_Soft_Label_Keys; + Move_Cursor (Line => 20, Column => 0); + Clear_To_End_Of_Line; + when 'x' | 'q' => + exit; + -- the C version needed a goto, ha ha + -- breaks exit the case not the loop because fall-throuh + -- happens in C! + when others => + Beep; + end case; + c := Getchar; + -- TODO exit when c = EOF + end loop; + Erase; + End_Windows; +end ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-slk_test.ads b/Ada95/samples/ncurses2-slk_test.ads new file mode 100644 index 00000000..51e95871 --- /dev/null +++ b/Ada95/samples/ncurses2-slk_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.adb b/Ada95/samples/ncurses2-test_sgr_attributes.adb new file mode 100644 index 00000000..9948dc59 --- /dev/null +++ b/Ada95/samples/ncurses2-test_sgr_attributes.adb @@ -0,0 +1,186 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with ncurses2.util; use ncurses2.util; + + +-- Graphic-rendition test (adapted from vttest) + +procedure ncurses2.test_sgr_attributes is + + procedure xAdd (l : Line_Position; c : Column_Position; s : String); + + procedure xAdd (l : Line_Position; c : Column_Position; s : String) is + begin + Add (Line => l, Column => c, Str => s); + end xAdd; + + normal, current : Attributed_Character; +begin + for pass in reverse Boolean loop + if pass then + normal := (Ch => ' ', Attr => Normal_Video, Color => 0); + else + normal := (Ch => ' ', Attr => + (Reverse_Video => True, others => False), Color => 0); + end if; + + -- Use non-default colors if possible to exercise bce a little + if Has_Colors then + Init_Pair (1, White, Blue); + normal.Color := 1; + end if; + Set_Background (Ch => normal); + Erase; + xAdd (1, 20, "Graphic rendition test pattern:"); + + xAdd (4, 1, "vanilla"); + + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + Set_Background (Ch => current); + xAdd (4, 40, "bold"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + Set_Background (Ch => current); + xAdd (6, 6, "underline"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + Set_Background (Ch => current); + xAdd (6, 45, "bold underline"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (8, 1, "blink"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + Set_Background (Ch => current); + xAdd (8, 40, "bold blink"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (10, 6, "underline blink"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (10, 45, "bold underline blink"); + + current := normal; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (12, 1, "negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (12, 40, "bold negative"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (14, 6, "underline negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (14, 45, "bold underline negative"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (16, 1, "blink negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (16, 40, "bold blink negative"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (18, 6, "underline blink negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (18, 45, "bold underline blink negative"); + + Set_Background (Ch => normal); + Move_Cursor (Line => Lines - 2, Column => 1); + if pass then + Add (Str => "Dark"); + else + Add (Str => "Light"); + end if; + Add (Str => " background. "); + Clear_To_End_Of_Line; + Pause; + end loop; + + Set_Background (Ch => Blank2); + Erase; + End_Windows; + +end ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.ads b/Ada95/samples/ncurses2-test_sgr_attributes.ads new file mode 100644 index 00000000..24111809 --- /dev/null +++ b/Ada95/samples/ncurses2-test_sgr_attributes.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb new file mode 100644 index 00000000..10b605a7 --- /dev/null +++ b/Ada95/samples/ncurses2-trace_set.adb @@ -0,0 +1,481 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.trace_set -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; + +with Ada.Strings.Bounded; + +-- interactively set the trace level + +procedure ncurses2.trace_set is + + function menu_virtualize (c : Key_Code) return Menu_Request_Code; + function subset (super, sub : Trace_Attribute_Set) return Boolean; + function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; + function trace_num (tlevel : Trace_Attribute_Set) return String; + function tracetrace (tlevel : Trace_Attribute_Set) return String; + function run_trace_menu (m : Menu) return Boolean; + + function menu_virtualize (c : Key_Code) return Menu_Request_Code is + begin + case c is + when Character'Pos (newl) | Key_Exit => + return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO + when Character'Pos ('u') => + return M_ScrollUp_Line; + when Character'Pos ('d') => + return M_ScrollDown_Line; + when Character'Pos ('b') | Key_Next_Page => + return M_ScrollUp_Page; + when Character'Pos ('f') | Key_Previous_Page => + return M_ScrollDown_Page; + when Character'Pos ('n') | Key_Cursor_Down => + return M_Next_Item; + when Character'Pos ('p') | Key_Cursor_Up => + return M_Previous_Item; + when Character'Pos (' ') => + return M_Toggle_Item; + when Key_Mouse => + return c; + when others => + Beep; + return c; + end case; + end menu_virtualize; + + + type string_a is access String; + type tbl_entry is record + name : string_a; + mask : Trace_Attribute_Set; + end record; + + t_tbl : constant array (Positive range <>) of tbl_entry := + ( + (new String'("Disable"), + Trace_Disable), + (new String'("Times"), + Trace_Attribute_Set'(Times => True, others => False)), + (new String'("Tputs"), + Trace_Attribute_Set'(Tputs => True, others => False)), + (new String'("Update"), + Trace_Attribute_Set'(Update => True, others => False)), + (new String'("Cursor_Move"), + Trace_Attribute_Set'(Cursor_Move => True, others => False)), + (new String'("Character_Output"), + Trace_Attribute_Set'(Character_Output => True, others => False)), + (new String'("Ordinary"), + Trace_Ordinary), + (new String'("Calls"), + Trace_Attribute_Set'(Calls => True, others => False)), + (new String'("Virtual_Puts"), + Trace_Attribute_Set'(Virtual_Puts => True, others => False)), + (new String'("Input_Events"), + Trace_Attribute_Set'(Input_Events => True, others => False)), + (new String'("TTY_State"), + Trace_Attribute_Set'(TTY_State => True, others => False)), + (new String'("Internal_Calls"), + Trace_Attribute_Set'(Internal_Calls => True, others => False)), + (new String'("Character_Calls"), + Trace_Attribute_Set'(Character_Calls => True, others => False)), + (new String'("Termcap_TermInfo"), + Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)), + (new String'("Maximium"), + Trace_Maximum) + ); + + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300); + + + function subset (super, sub : Trace_Attribute_Set) return Boolean is + begin + if + (super.Times or not sub.Times) and + (super.Tputs or not sub.Tputs) and + (super.Update or not sub.Update) and + (super.Cursor_Move or not sub.Cursor_Move) and + (super.Character_Output or not sub.Character_Output) and + (super.Calls or not sub.Calls) and + (super.Virtual_Puts or not sub.Virtual_Puts) and + (super.Input_Events or not sub.Input_Events) and + (super.TTY_State or not sub.TTY_State) and + (super.Internal_Calls or not sub.Internal_Calls) and + (super.Character_Calls or not sub.Character_Calls) and + (super.Termcap_TermInfo or not sub.Termcap_TermInfo) and + True then + return True; + else + return False; + end if; + end subset; + + function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is + retval : Trace_Attribute_Set := Trace_Disable; + begin + retval.Times := (a.Times or b.Times); + retval.Tputs := (a.Tputs or b.Tputs); + retval.Update := (a.Update or b.Update); + retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move); + retval.Character_Output := (a.Character_Output or b.Character_Output); + retval.Calls := (a.Calls or b.Calls); + retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts); + retval.Input_Events := (a.Input_Events or b.Input_Events); + retval.TTY_State := (a.TTY_State or b.TTY_State); + retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls); + retval.Character_Calls := (a.Character_Calls or b.Character_Calls); + retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo); + + return retval; + end trace_or; + + -- Print the hexadecimal value of the mask so + -- users can set it from the command line. + + function trace_num (tlevel : Trace_Attribute_Set) return String is + result : Integer := 0; + m : Integer := 1; + begin + + if tlevel.Times then + result := result + m; + end if; + m := m * 2; + + if tlevel.Tputs then + result := result + m; + end if; + m := m * 2; + + if tlevel.Update then + result := result + m; + end if; + m := m * 2; + + if tlevel.Cursor_Move then + result := result + m; + end if; + m := m * 2; + + if tlevel.Character_Output then + result := result + m; + end if; + m := m * 2; + + if tlevel.Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Virtual_Puts then + result := result + m; + end if; + m := m * 2; + + if tlevel.Input_Events then + result := result + m; + end if; + m := m * 2; + + if tlevel.TTY_State then + result := result + m; + end if; + m := m * 2; + + if tlevel.Internal_Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Character_Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Termcap_TermInfo then + result := result + m; + end if; + m := m * 2; + return result'Img; + end trace_num; + + + function tracetrace (tlevel : Trace_Attribute_Set) return String is + + use BS; + buf : Bounded_String := To_Bounded_String (""); + begin + -- The C version prints the hexadecimal value of the mask, we + -- won't do that here because this is Ada. + + if tlevel = Trace_Disable then + Append (buf, "Trace_Disable"); + else + + + if subset (tlevel, + Trace_Attribute_Set'(Times => True, others => False)) then + Append (buf, "Times"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Tputs => True, others => False)) then + Append (buf, "Tputs"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Update => True, others => False)) then + Append (buf, "Update"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Cursor_Move => True, + others => False)) then + Append (buf, "Cursor_Move"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Character_Output => True, + others => False)) then + Append (buf, "Character_Output"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Ordinary) then + Append (buf, "Ordinary"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Calls => True, others => False)) then + Append (buf, "Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Virtual_Puts => True, + others => False)) then + Append (buf, "Virtual_Puts"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Input_Events => True, + others => False)) then + Append (buf, "Input_Events"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(TTY_State => True, + others => False)) then + Append (buf, "TTY_State"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Internal_Calls => True, + others => False)) then + Append (buf, "Internal_Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Character_Calls => True, + others => False)) then + Append (buf, "Character_Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Termcap_TermInfo => True, + others => False)) then + Append (buf, "Termcap_TermInfo"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Maximum) then + Append (buf, "Maximium"); + Append (buf, ", "); + end if; + end if; + + if To_String (buf) (Length (buf) - 1) = ',' then + Delete (buf, Length (buf) - 1, Length (buf)); + end if; + + return To_String (buf); + end tracetrace; + + function run_trace_menu (m : Menu) return Boolean is + i, p : Item; + changed : Boolean; + c, v : Key_Code; + begin + loop + changed := False; + c := Getchar (Get_Window (m)); + v := menu_virtualize (c); + case Driver (m, v) is + when Unknown_Request => + return False; + when others => + i := Current (m); + if i = Menus.Items (m, 1) then -- the first item + for n in t_tbl'First + 1 .. t_tbl'Last loop + if Value (i) then + Set_Value (i, False); + changed := True; + end if; + end loop; + else + for n in t_tbl'First + 1 .. t_tbl'Last loop + p := Menus.Items (m, n); + if Value (p) then + Set_Value (Menus.Items (m, 1), False); + changed := True; + exit; + end if; + end loop; + end if; + if not changed then + return True; + end if; + end case; + end loop; + end run_trace_menu; + + nc_tracing, mask : Trace_Attribute_Set; + pragma Import (C, nc_tracing, "_nc_tracing"); + items_a : Item_Array_Access := + new Item_Array (t_tbl'First .. t_tbl'Last + 1); + mrows : Line_Count; + mcols : Column_Count; + menuwin : Window; + menu_y : constant Line_Position := 8; + menu_x : constant Column_Position := 8; + ip : Item; + m : Menu; + newtrace : Trace_Attribute_Set; +begin + Add (Line => 0, Column => 0, Str => "Interactively set trace level:"); + Add (Line => 2, Column => 0, + Str => " Press space bar to toggle a selection."); + Add (Line => 3, Column => 0, + Str => " Use up and down arrow to move the select bar."); + Add (Line => 4, Column => 0, + Str => " Press return to set the trace level."); + Add (Line => 6, Column => 0, Str => "(Current trace level is "); + Add (Str => tracetrace (nc_tracing) & " numerically: " & + trace_num (nc_tracing)); + Add (Ch => ')'); + + Refresh; + + for n in t_tbl'Range loop + items_a (n) := New_Item (t_tbl (n).name.all); + end loop; + items_a (t_tbl'Last + 1) := Null_Item; + + m := New_Menu (items_a); + + Set_Format (m, 16, 2); + Scale (m, mrows, mcols); + + Switch_Options (m, (One_Valued => True, others => False), On => False); + menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x); + Set_Window (m, menuwin); + Set_KeyPad_Mode (menuwin, SwitchOn => True); + Box (menuwin); + + Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); + + Post (m); + + for n in t_tbl'Range loop + ip := Items (m, n); + mask := t_tbl (n).mask; + if mask = Trace_Disable then + Set_Value (ip, nc_tracing = Trace_Disable); + elsif subset (sub => mask, super => nc_tracing) then + Set_Value (ip, True); + end if; + end loop; + + while run_trace_menu (m) loop + null; + end loop; + + newtrace := Trace_Disable; + for n in t_tbl'Range loop + ip := Items (m, n); + if Value (ip) then + mask := t_tbl (n).mask; + newtrace := trace_or (newtrace, mask); + end if; + end loop; + + Trace_On (newtrace); + Trace_Put ("trace level interactively set to " & + tracetrace (nc_tracing)); + + Move_Cursor (Line => Lines - 4, Column => 0); + Add (Str => "Trace level is "); + Add (Str => tracetrace (nc_tracing)); + Add (Ch => newl); + Pause; -- was just Add(); Getchar + + Post (m, False); + -- menuwin has subwindows I think, which makes an error. + declare begin + Delete (menuwin); + exception when Curses_Exception => null; end; + + -- free_menu(m); + -- free_item() +end ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-trace_set.ads b/Ada95/samples/ncurses2-trace_set.ads new file mode 100644 index 00000000..7bbf8ca5 --- /dev/null +++ b/Ada95/samples/ncurses2-trace_set.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.trace_set -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-util.adb b/Ada95/samples/ncurses2-util.adb new file mode 100644 index 00000000..907dcef9 --- /dev/null +++ b/Ada95/samples/ncurses2-util.adb @@ -0,0 +1,199 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Text_IO; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +pragma Warnings (Off); +with Terminal_Interface.Curses.Aux; +pragma Warnings (On); + +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; + +with Ada.Text_IO; use Ada.Text_IO; + +with Interfaces.C; +with Interfaces.C.Strings; + +with Ada.Characters.Handling; + +with ncurses2.genericPuts; + + +package body ncurses2.util is + + -- #defines from C + -- #define CTRL(x) ((x) & 0x1f) + function CTRL (c : Character) return Key_Code is + begin + return Character'Pos (c) mod 16#20#; + -- uses a property of ASCII + -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# + end CTRL; + + function CTRL (c : Character) return Character is + begin + return Character'Val (Character'Pos (c) mod 16#20#); + -- uses a property of ASCII + -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# + end CTRL; + + save_trace : Trace_Attribute_Set; + -- Common function to allow ^T to toggle trace-mode in the middle of a test + -- so that trace-files can be made smaller. + function Getchar (win : Window := Standard_Window) return Key_Code is + c : Key_Code; + begin + -- #ifdef TRACE + c := Get_Keystroke (win); + while c = CTRL ('T') loop + -- if _nc_tracing in C + if Current_Trace_Setting /= Trace_Disable then + save_trace := Current_Trace_Setting; + Trace_Put ("TOGGLE-TRACING OFF"); + Current_Trace_Setting := Trace_Disable; + else + Current_Trace_Setting := save_trace; + end if; + Trace_On (Current_Trace_Setting); + if Current_Trace_Setting /= Trace_Disable then + Trace_Put ("TOGGLE-TRACING ON"); + end if; + end loop; + -- #else c := Get_Keystroke; + return c; + end Getchar; + + procedure Getchar (win : Window := Standard_Window) is + x : Key_Code; + begin + x := Getchar (win); + end Getchar; + + + procedure Pause is + begin + Move_Cursor (Line => Lines - 1, Column => 0); + Add (Str => "Press any key to continue... "); + Getchar; + end Pause; + + + procedure Cannot (s : String) is + use Interfaces.C; + use Interfaces.C.Strings; + use Terminal_Interface.Curses.Aux; + function getenv (x : char_array) return chars_ptr; + pragma Import (C, getenv, "getenv"); + tmp1 : char_array (0 .. 10); + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + + tmpb : BS.Bounded_String; + + Length : size_t; + begin + To_C ("TERM", tmp1, Length); + Fill_String (getenv (tmp1), tmpb); + Add (Ch => newl); + myAdd (Str => "This " & tmpb & " terminal " & s); + Pause; + end Cannot; + + procedure ShellOut (message : Boolean) is + use Interfaces.C; + Txt : char_array (0 .. 10); + Length : size_t; + procedure system (x : char_array); + pragma Import (C, system, "system"); + begin + To_C ("sh", Txt, Length); + if message then + Add (Str => "Shelling out..."); + end if; + Save_Curses_Mode (Mode => Curses); + End_Windows; + system (Txt); + if message then + Add (Str => "returned from shellout."); + Add (Ch => newl); + end if; + Refresh; + end ShellOut; + + + + function Is_Digit (c : Key_Code) return Boolean is + begin + if c >= 16#100# then + return False; + else + return Ada.Characters.Handling.Is_Digit (Character'Val (c)); + end if; + end Is_Digit; + + procedure P (s : String) is + begin + Add (Str => s); + Add (Ch => newl); + end P; + + + function Code_To_Char (c : Key_Code) return Character is + begin + if c > Character'Pos (Character'Last) then + return Character'Val (0); + -- maybe raise exception? + else + return Character'Val (c); + end if; + end Code_To_Char; + + -- This was untestable due to a bug in GNAT (3.12p) + -- Hmm, what bug? I don't remember. + function ctoi (c : Character) return Integer is + begin + return Character'Pos (c) - Character'Pos ('0'); + end ctoi; + +end ncurses2.util; diff --git a/Ada95/samples/ncurses2-util.ads b/Ada95/samples/ncurses2-util.ads new file mode 100644 index 00000000..6c81e83e --- /dev/null +++ b/Ada95/samples/ncurses2-util.ads @@ -0,0 +1,79 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Text_IO; +package ncurses2.util is + + Blank : constant Character := ' '; + Blank2 : constant Attributed_Character := + (Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First); + + + newl : constant Character := Character'Val (10); + + function CTRL (c : Character) return Key_Code; + + function CTRL (c : Character) return Character; + + function Getchar (win : Window := Standard_Window) return Key_Code; + + procedure Getchar (win : Window := Standard_Window); + + procedure Pause; + + + procedure Cannot (s : String); + + procedure ShellOut (message : Boolean); + + + package Int_IO is new Ada.Text_IO.Integer_IO (Integer); + + + function Is_Digit (c : Key_Code) return Boolean; + + procedure P (s : String); + + function Code_To_Char (c : Key_Code) return Character; + function ctoi (c : Character) return Integer; +end ncurses2.util; + diff --git a/Ada95/samples/ncurses2.ads b/Ada95/samples/ncurses2.ads new file mode 100644 index 00000000..2fe01970 --- /dev/null +++ b/Ada95/samples/ncurses2.ads @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package ncurses2 is + pragma Pure (ncurses2); +end ncurses2; diff --git a/Ada95/samples/rain.adb b/Ada95/samples/rain.adb index f2814049..f769733c 100644 --- a/Ada95/samples/rain.adb +++ b/Ada95/samples/rain.adb @@ -33,9 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Laurent Pautet 1997 (modified by J.Pfeifer) +-- Author: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.4 $ +-- $Revision: 1.5 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- diff --git a/Ada95/samples/rain.ads b/Ada95/samples/rain.ads index 5180a598..7eccb485 100644 --- a/Ada95/samples/rain.ads +++ b/Ada95/samples/rain.ads @@ -33,9 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Laurent Pautet 1997 (modified by J.Pfeifer) +-- Author: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.4 $ +-- $Revision: 1.5 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- diff --git a/Ada95/samples/sample-curses_demo-attributes.adb b/Ada95/samples/sample-curses_demo-attributes.adb index 1a329e7b..03b6e741 100644 --- a/Ada95/samples/sample-curses_demo-attributes.adb +++ b/Ada95/samples/sample-curses_demo-attributes.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-curses_demo-attributes.ads b/Ada95/samples/sample-curses_demo-attributes.ads index ec0fb8cd..dc70abb9 100644 --- a/Ada95/samples/sample-curses_demo-attributes.ads +++ b/Ada95/samples/sample-curses_demo-attributes.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Attributes is diff --git a/Ada95/samples/sample-curses_demo-mouse.adb b/Ada95/samples/sample-curses_demo-mouse.adb index e526f598..7d80bfd8 100644 --- a/Ada95/samples/sample-curses_demo-mouse.adb +++ b/Ada95/samples/sample-curses_demo-mouse.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-curses_demo-mouse.ads b/Ada95/samples/sample-curses_demo-mouse.ads index 93781709..e7774f2b 100644 --- a/Ada95/samples/sample-curses_demo-mouse.ads +++ b/Ada95/samples/sample-curses_demo-mouse.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Mouse is diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb index 0c708551..60965f96 100644 --- a/Ada95/samples/sample-curses_demo.adb +++ b/Ada95/samples/sample-curses_demo.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-curses_demo.ads b/Ada95/samples/sample-curses_demo.ads index 32d2bb0b..d90da475 100644 --- a/Ada95/samples/sample-curses_demo.ads +++ b/Ada95/samples/sample-curses_demo.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo is diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb index 8701925d..96978183 100644 --- a/Ada95/samples/sample-explanation.adb +++ b/Ada95/samples/sample-explanation.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.12 $ +-- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and @@ -317,7 +318,7 @@ package body Sample.Explanation is Reset (F); Outer : loop - exit when not Next_Line; + exit Outer when not Next_Line; if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last) and then Buffer (1) = '#' then loop diff --git a/Ada95/samples/sample-explanation.ads b/Ada95/samples/sample-explanation.ads index 24a0e177..50ec3fb0 100644 --- a/Ada95/samples/sample-explanation.ads +++ b/Ada95/samples/sample-explanation.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and diff --git a/Ada95/samples/sample-form_demo-aux.adb b/Ada95/samples/sample-form_demo-aux.adb index 06a03b88..c7874df3 100644 --- a/Ada95/samples/sample-form_demo-aux.adb +++ b/Ada95/samples/sample-form_demo-aux.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads index 69ff2c15..99334eaa 100644 --- a/Ada95/samples/sample-form_demo-aux.ads +++ b/Ada95/samples/sample-form_demo-aux.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-form_demo-handler.adb b/Ada95/samples/sample-form_demo-handler.adb index a3a17d4a..4cf1fab3 100644 --- a/Ada95/samples/sample-form_demo-handler.adb +++ b/Ada95/samples/sample-form_demo-handler.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Form_Demo.Aux; diff --git a/Ada95/samples/sample-form_demo-handler.ads b/Ada95/samples/sample-form_demo-handler.ads index 07c2940e..912a6bf2 100644 --- a/Ada95/samples/sample-form_demo-handler.ads +++ b/Ada95/samples/sample-form_demo-handler.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb index b8548bfc..ff779c6d 100644 --- a/Ada95/samples/sample-form_demo.adb +++ b/Ada95/samples/sample-form_demo.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-form_demo.ads b/Ada95/samples/sample-form_demo.ads index 1ef37964..b9ebed6c 100644 --- a/Ada95/samples/sample-form_demo.ads +++ b/Ada95/samples/sample-form_demo.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Form_Demo is diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb index 94d22a6d..8009ab62 100644 --- a/Ada95/samples/sample-function_key_setting.adb +++ b/Ada95/samples/sample-function_key_setting.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads index e9db6cd0..fb56b21d 100644 --- a/Ada95/samples/sample-function_key_setting.ads +++ b/Ada95/samples/sample-function_key_setting.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb index c299c79f..78bb76d0 100644 --- a/Ada95/samples/sample-header_handler.adb +++ b/Ada95/samples/sample-header_handler.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Calendar; use Ada.Calendar; diff --git a/Ada95/samples/sample-header_handler.ads b/Ada95/samples/sample-header_handler.ads index 7a7c0b98..f3a3314e 100644 --- a/Ada95/samples/sample-header_handler.ads +++ b/Ada95/samples/sample-header_handler.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb index 9cbc7c12..8942921c 100644 --- a/Ada95/samples/sample-helpers.adb +++ b/Ada95/samples/sample-helpers.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads index 36ca4075..c8ee9cb6 100644 --- a/Ada95/samples/sample-helpers.ads +++ b/Ada95/samples/sample-helpers.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb index 062a676b..92b9ccd4 100644 --- a/Ada95/samples/sample-keyboard_handler.adb +++ b/Ada95/samples/sample-keyboard_handler.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; diff --git a/Ada95/samples/sample-keyboard_handler.ads b/Ada95/samples/sample-keyboard_handler.ads index 454c934b..be9f8f8c 100644 --- a/Ada95/samples/sample-keyboard_handler.ads +++ b/Ada95/samples/sample-keyboard_handler.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-manifest.ads b/Ada95/samples/sample-manifest.ads index 6ac180cf..5422ef91 100644 --- a/Ada95/samples/sample-manifest.ads +++ b/Ada95/samples/sample-manifest.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo-aux.adb b/Ada95/samples/sample-menu_demo-aux.adb index f1363d80..9b428813 100644 --- a/Ada95/samples/sample-menu_demo-aux.adb +++ b/Ada95/samples/sample-menu_demo-aux.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads index d1211985..5171aebb 100644 --- a/Ada95/samples/sample-menu_demo-aux.ads +++ b/Ada95/samples/sample-menu_demo-aux.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo-handler.adb b/Ada95/samples/sample-menu_demo-handler.adb index e7b1bf8a..b203cc24 100644 --- a/Ada95/samples/sample-menu_demo-handler.adb +++ b/Ada95/samples/sample-menu_demo-handler.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Menu_Demo.Aux; diff --git a/Ada95/samples/sample-menu_demo-handler.ads b/Ada95/samples/sample-menu_demo-handler.ads index bb31639d..d1b7cde4 100644 --- a/Ada95/samples/sample-menu_demo-handler.ads +++ b/Ada95/samples/sample-menu_demo-handler.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb index 640c25cb..8793db24 100644 --- a/Ada95/samples/sample-menu_demo.adb +++ b/Ada95/samples/sample-menu_demo.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo.ads b/Ada95/samples/sample-menu_demo.ads index dda0180f..40b1e922 100644 --- a/Ada95/samples/sample-menu_demo.ads +++ b/Ada95/samples/sample-menu_demo.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Menu_Demo is diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb index 11e42268..15c55e95 100644 --- a/Ada95/samples/sample-my_field_type.adb +++ b/Ada95/samples/sample-my_field_type.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; diff --git a/Ada95/samples/sample-my_field_type.ads b/Ada95/samples/sample-my_field_type.ads index 0fac5e39..78665039 100644 --- a/Ada95/samples/sample-my_field_type.ads +++ b/Ada95/samples/sample-my_field_type.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb index 158b9358..0cd370eb 100644 --- a/Ada95/samples/sample-text_io_demo.adb +++ b/Ada95/samples/sample-text_io_demo.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Elementary_Functions; diff --git a/Ada95/samples/sample-text_io_demo.ads b/Ada95/samples/sample-text_io_demo.ads index 5c31c7bb..e35ce102 100644 --- a/Ada95/samples/sample-text_io_demo.ads +++ b/Ada95/samples/sample-text_io_demo.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Text_IO_Demo is diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index 3544b097..0e445568 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; diff --git a/Ada95/samples/sample.ads b/Ada95/samples/sample.ads index d438f74a..588c2114 100644 --- a/Ada95/samples/sample.ads +++ b/Ada95/samples/sample.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample is diff --git a/Ada95/samples/status.adb b/Ada95/samples/status.adb index 8e4cd423..e81355ea 100644 --- a/Ada95/samples/status.adb +++ b/Ada95/samples/status.adb @@ -33,9 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.5 $ +-- $Revision: 1.6 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- diff --git a/Ada95/samples/status.ads b/Ada95/samples/status.ads index 600b2123..e34c95c4 100644 --- a/Ada95/samples/status.ads +++ b/Ada95/samples/status.ads @@ -33,9 +33,11 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- diff --git a/Ada95/samples/tour.adb b/Ada95/samples/tour.adb index 60a3d0ae..b2cc6cfe 100644 --- a/Ada95/samples/tour.adb +++ b/Ada95/samples/tour.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample; use Sample; diff --git a/Ada95/samples/tour.ads b/Ada95/samples/tour.ads index 2675e30d..b0a81c8e 100644 --- a/Ada95/samples/tour.ads +++ b/Ada95/samples/tour.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure Tour; diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in index d0069973..a9c70817 100644 --- a/Ada95/src/Makefile.in +++ b/Ada95/src/Makefile.in @@ -26,10 +26,11 @@ # authorization. # ############################################################################## # -# Author: Juergen Pfeifer 1996 +# Author: Juergen Pfeifer, 1996 +# Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en # # Version Control -# $Revision: 1.22 $ +# $Revision: 1.26 $ # .SUFFIXES: @@ -72,6 +73,7 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ RANLIB = @RANLIB@ ################################################################################ ADA = @cf_ada_compiler@ +ADAPREP = gnatprep ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) ADAMAKE = @cf_ada_make@ @@ -86,6 +88,10 @@ ABASE = $(ALIB)-curses LIBALIS=$(ALIB).ali \ $(ABASE)-aux.ali \ $(ABASE).ali \ + $(ABASE)-terminfo.ali \ + $(ABASE)-termcap.ali \ + $(ABASE)-putwin.ali \ + $(ABASE)-trace.ali \ $(ABASE)-mouse.ali \ $(ABASE)-panels.ali \ $(ABASE)-menus.ali \ @@ -122,6 +128,10 @@ GENALIS=$(ABASE)-menus-menu_user_data.ali \ LIBOBJS=$(ALIB).o \ $(ABASE)-aux.o \ $(ABASE).o \ + $(ABASE)-terminfo.o \ + $(ABASE)-termcap.o \ + $(ABASE)-putwin.o \ + $(ABASE)-trace.o \ $(ABASE)-mouse.o \ $(ABASE)-panels.o \ $(ABASE)-menus.o \ @@ -182,7 +192,7 @@ mostlyclean :: rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a clean :: mostlyclean - rm -f $(LIBALIS) $(GENALIS) $(LIBOBJS) $(GENOBJS) + rm -f $(LIBALIS) $(GENALIS) $(LIBOBJS) $(GENOBJS) $(ABASE)-trace.adb distclean :: clean rm -f Makefile @@ -203,6 +213,34 @@ $(ABASE).o: $(srcdir)/$(ABASE).adb $(BASEDEPS) $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE).adb +$(ABASE)-terminfo.o: \ + $(ABASE)-terminfo.ads \ + $(srcdir)/$(ABASE)-terminfo.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-terminfo.adb + + +$(ABASE)-termcap.o: \ + $(ABASE)-termcap.ads \ + $(srcdir)/$(ABASE)-termcap.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-termcap.adb + + +$(ABASE)-putwin.o: \ + $(ABASE)-putwin.ads \ + $(srcdir)/$(ABASE)-putwin.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-putwin.adb + + +$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p + rm -f $@ + $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ $(srcdir)/$(ABASE)-trace.adb_p $@ + +$(ABASE)-trace.o: \ + $(ABASE)-trace.ads \ + $(ABASE)-trace.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(ABASE)-trace.adb + + $(ABASE)-mouse.o: \ $(ABASE)-mouse.ads \ $(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS) diff --git a/Ada95/src/terminal_interface-curses-aux.adb b/Ada95/src/terminal_interface-curses-aux.adb index 2e974c4a..bcf83875 100644 --- a/Ada95/src/terminal_interface-curses-aux.adb +++ b/Ada95/src/terminal_interface-curses-aux.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Aux is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb index 1cbf1782..bd42d3f9 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads index d5281e6d..f4eadf9e 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Alpha is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb index 2e82305e..2f2d44d4 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads index 209117b3..4e165fea 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb index d4f376dd..89972d4f 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.5 $ +-- $Revision: 1.6 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads index 870a3a46..7bff22f4 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb index c4286af0..d0273294 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.5 $ +-- $Revision: 1.6 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads index 04b0bfe8..b9c1b00d 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C.Strings; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb index 077ba321..621f4c7c 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads index edef251c..75652cc4 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IntField is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb index 263e50e2..60a403bc 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads index 63a1bbfb..11398c06 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb index 0e2d5c2f..bd3daf26 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads index d5f126b6..cbb6b00c 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.Numeric is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb index a9b4984a..a699f0af 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; use Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads index af192938..635f37ba 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface.Curses.Forms.Field_Types.RegExp is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb index cd9cd3db..2d8f60c0 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads index f8523071..c9a2abd5 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb index aa923c4d..5f82b098 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads index f93a904f..4cca2a4d 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb index dccaf9d2..7b83be65 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-forms-field_user_data.adb b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb index 711cfbba..04b09660 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_user_data.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; diff --git a/Ada95/src/terminal_interface-curses-forms-form_user_data.adb b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb index b6fff13c..3b897faa 100644 --- a/Ada95/src/terminal_interface-curses-forms-form_user_data.adb +++ b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- | diff --git a/Ada95/src/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb index 669ac5f3..b9be41a8 100644 --- a/Ada95/src/terminal_interface-curses-forms.adb +++ b/Ada95/src/terminal_interface-curses-forms.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.20 $ +-- $Revision: 1.21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; diff --git a/Ada95/src/terminal_interface-curses-menus-item_user_data.adb b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb index 98a22a5f..56199d10 100644 --- a/Ada95/src/terminal_interface-curses-menus-item_user_data.adb +++ b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb index 00670dd3..83a3f95e 100644 --- a/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb +++ b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; diff --git a/Ada95/src/terminal_interface-curses-menus.adb b/Ada95/src/terminal_interface-curses-menus.adb index 92ae0f9c..87097ce1 100644 --- a/Ada95/src/terminal_interface-curses-menus.adb +++ b/Ada95/src/terminal_interface-curses-menus.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.20 $ +-- $Revision: 1.21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; diff --git a/Ada95/src/terminal_interface-curses-mouse.adb b/Ada95/src/terminal_interface-curses-mouse.adb index 8a7499ac..c2b52a05 100644 --- a/Ada95/src/terminal_interface-curses-mouse.adb +++ b/Ada95/src/terminal_interface-curses-mouse.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.16 $ +-- $Revision: 1.17 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; diff --git a/Ada95/src/terminal_interface-curses-panels-user_data.adb b/Ada95/src/terminal_interface-curses-panels-user_data.adb index c5658c50..fb2c9546 100644 --- a/Ada95/src/terminal_interface-curses-panels-user_data.adb +++ b/Ada95/src/terminal_interface-curses-panels-user_data.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; diff --git a/Ada95/src/terminal_interface-curses-panels.adb b/Ada95/src/terminal_interface-curses-panels.adb index 5d42226a..f0d246ad 100644 --- a/Ada95/src/terminal_interface-curses-panels.adb +++ b/Ada95/src/terminal_interface-curses-panels.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; diff --git a/Ada95/src/terminal_interface-curses-putwin.adb b/Ada95/src/terminal_interface-curses-putwin.adb new file mode 100644 index 00000000..545ccaa0 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-putwin.adb @@ -0,0 +1,78 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.PutWin -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.2 $ +-- Binding Version 01.00 + +with Ada.Streams.Stream_IO.C_Streams; +with Interfaces.C_Streams; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.PutWin is + + package ICS renames Interfaces.C_Streams; + package ACS renames Ada.Streams.Stream_IO.C_Streams; + use type C_Int; + + procedure Put_Window (Win : Window; + File : Ada.Streams.Stream_IO.File_Type) is + function putwin (Win : Window; f : ICS.FILEs) return C_Int; + pragma Import (C, putwin, "putwin"); + + R : constant C_Int := putwin (Win, ACS.C_Stream (File)); + begin + if R /= Curses_Ok then + raise Curses_Exception; + end if; + end Put_Window; + + function Get_Window (File : Ada.Streams.Stream_IO.File_Type) + return Window is + function getwin (f : ICS.FILEs) return Window; + pragma Import (C, getwin, "getwin"); + + W : constant Window := getwin (ACS.C_Stream (File)); + begin + if W = Null_Window then + raise Curses_Exception; + else + return W; + end if; + end Get_Window; + +end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-putwin.ads b/Ada95/src/terminal_interface-curses-putwin.ads new file mode 100644 index 00000000..94220789 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-putwin.ads @@ -0,0 +1,51 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.PutWin -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.2 $ +-- Binding Version 01.00 + +with Ada.Streams.Stream_IO; + +package Terminal_Interface.Curses.PutWin is + + procedure Put_Window (Win : Window; + File : Ada.Streams.Stream_IO.File_Type); + + function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window; + +end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-termcap.adb b/Ada95/src/terminal_interface-curses-termcap.adb new file mode 100644 index 00000000..732a3fd6 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-termcap.adb @@ -0,0 +1,164 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Termcap -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.4 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; + +package body Terminal_Interface.Curses.Termcap is + + function Get_Entry (Name : String) return Boolean + is + function tgetent (name : char_array; val : char_array) + return C_Int; + pragma Import (C, tgetent, "tgetent"); + NameTxt : char_array (0 .. Name'Length); + Length : size_t; + ignored : char_array (0 .. 0) := (0 => nul); + result : C_Int; + begin + To_C (Name, NameTxt, Length); + result := tgetent (char_array (ignored), NameTxt); + if result = -1 then + raise Curses_Exception; + else + return Boolean'Val (result); + end if; + end Get_Entry; + +------------------------------------------------------------------------------ + function Get_Flag (Name : String) return Boolean + is + function tgetflag (id : char_array) return C_Int; + pragma Import (C, tgetflag, "tgetflag"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + if tgetflag (Txt) = 0 then + return False; + else + return True; + end if; + end Get_Flag; + +------------------------------------------------------------------------------ + procedure Get_Number (Name : in String; + Value : out Integer; + Result : out Boolean) + is + function tgetnum (id : char_array) return C_Int; + pragma Import (C, tgetnum, "tgetnum"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + Value := Integer (tgetnum (Txt)); + if Value = -1 then + Result := False; + else + Result := True; + end if; + end Get_Number; + +------------------------------------------------------------------------------ + procedure Get_String (Name : String; + Value : out String; + Result : out Boolean) + is + function tgetstr (id : char_array; + buf : char_array) return chars_ptr; + pragma Import (C, tgetstr, "tgetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + type t is new char_array (0 .. 1024); -- does it need to be 1024? + Return_Buffer : t := (0 => nul); + begin + To_C (Name, Txt, Length); + Txt2 := tgetstr (Txt, char_array (Return_Buffer)); + if Txt2 = Null_Ptr then + Result := False; + else + Value := Fill_String (Txt2); + Result := True; + end if; + end Get_String; + + function Get_String (Name : String) return Boolean + is + function tgetstr (Id : char_array; + buf : char_array) return chars_ptr; + pragma Import (C, tgetstr, "tgetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + type t is new char_array (0 .. 1024); -- does it need to be 1024? + Phony_Txt : t := (0 => nul); + begin + To_C (Name, Txt, Length); + Txt2 := tgetstr (Txt, char_array (Phony_Txt)); + if Txt2 = Null_Ptr then + return False; + else + return True; + end if; + end Get_String; + +------------------------------------------------------------------------------ + function TGoto (Cap : String; + Col : Column_Position; + Row : Line_Position) return Termcap_String is + function tgoto (cap : char_array; + col : C_Int; + row : C_Int) return chars_ptr; + pragma Import (C, tgoto); + Txt : char_array (0 .. Cap'Length); + Length : size_t; + begin + To_C (Cap, Txt, Length); + return Termcap_String (Fill_String + (tgoto (Txt, C_Int (Col), C_Int (Row)))); + end TGoto; + + +end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-termcap.ads b/Ada95/src/terminal_interface-curses-termcap.ads new file mode 100644 index 00000000..189891ff --- /dev/null +++ b/Ada95/src/terminal_interface-curses-termcap.ads @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Termcap -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.2 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package Terminal_Interface.Curses.Termcap is + pragma Preelaborate (Terminal_Interface.Curses.Termcap); + + -- |===================================================================== + -- | Man page curs_termcap.3x + -- |===================================================================== + -- Not implemented: tputs (see curs_terminfo) + + type Termcap_String is new String; + + -- | + function TGoto (Cap : String; + Col : Column_Position; + Row : Line_Position) return Termcap_String; + -- AKA: tgoto() + + -- | + function Get_Entry (Name : String) return Boolean; + -- AKA: tgetent() + + -- | + function Get_Flag (Name : String) return Boolean; + -- AKA: tgetflag() + + -- | + procedure Get_Number (Name : String; + Value : out Integer; + Result : out Boolean); + -- AKA: tgetnum() + + -- | + procedure Get_String (Name : String; + Value : out String; + Result : out Boolean); + function Get_String (Name : String) return Boolean; + -- Returns True if the string is found. + -- AKA: tgetstr() + +end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-terminfo.adb b/Ada95/src/terminal_interface-curses-terminfo.adb new file mode 100644 index 00000000..25a8eb0a --- /dev/null +++ b/Ada95/src/terminal_interface-curses-terminfo.adb @@ -0,0 +1,162 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Terminfo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.2 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Ada.Unchecked_Conversion; + +package body Terminal_Interface.Curses.Terminfo is + + + function Is_MinusOne_Pointer (P : in chars_ptr) return Boolean; + + function Is_MinusOne_Pointer (P : in chars_ptr) return Boolean is + type Weird_Address is new System.Storage_Elements.Integer_Address; + Invalid_Pointer : constant Weird_Address := -1; + function To_Weird is new Ada.Unchecked_Conversion + (Source => chars_ptr, Target => Weird_Address); + begin + if To_Weird (P) = Invalid_Pointer then + return True; + else + return False; + end if; + end Is_MinusOne_Pointer; + pragma Inline (Is_MinusOne_Pointer); + +------------------------------------------------------------------------------ + function Get_Flag (Name : String) return Boolean + is + function tigetflag (id : char_array) return Curses_Bool; + pragma Import (C, tigetflag); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + if tigetflag (Txt) = Curses_Bool (Curses_True) then + return True; + else + return False; + end if; + end Get_Flag; + +------------------------------------------------------------------------------ + procedure Get_String (Name : String; + Value : out Terminfo_String; + Result : out Boolean) + is + function tigetstr (id : char_array) return chars_ptr; + pragma Import (C, tigetstr, "tigetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + begin + To_C (Name, Txt, Length); + Txt2 := tigetstr (Txt); + if Txt2 = Null_Ptr then + Result := False; + elsif Is_MinusOne_Pointer (Txt2) then + raise Curses_Exception; + else + Value := Terminfo_String (Fill_String (Txt2)); + Result := True; + end if; + end Get_String; + +------------------------------------------------------------------------------ + function Has_String (Name : String) return Boolean + is + function tigetstr (id : char_array) return chars_ptr; + pragma Import (C, tigetstr, "tigetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + begin + To_C (Name, Txt, Length); + Txt2 := tigetstr (Txt); + if Txt2 = Null_Ptr then + return False; + elsif Is_MinusOne_Pointer (Txt2) then + raise Curses_Exception; + else + return True; + end if; + end Has_String; + +------------------------------------------------------------------------------ + function Get_Number (Name : String) return Integer is + function tigetstr (s : char_array) return C_Int; + pragma Import (C, tigetstr); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + return Integer (tigetstr (Txt)); + end Get_Number; + +------------------------------------------------------------------------------ + procedure Put_String (Str : Terminfo_String; + affcnt : Natural := 1; + putc : putctype := null) is + function tputs (str : char_array; + affcnt : C_Int; + putc : putctype) return C_Int; + function putp (str : char_array) return C_Int; + pragma Import (C, tputs); + pragma Import (C, putp); + Txt : char_array (0 .. Str'Length); + Length : size_t; + Err : C_Int; + begin + To_C (String (Str), Txt, Length); + if putc = null then + Err := putp (Txt); + else + Err := tputs (Txt, C_Int (affcnt), putc); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Put_String; + +end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-terminfo.ads b/Ada95/src/terminal_interface-curses-terminfo.ads new file mode 100644 index 00000000..ced5d4ea --- /dev/null +++ b/Ada95/src/terminal_interface-curses-terminfo.ads @@ -0,0 +1,82 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Terminfo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.2 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Interfaces.C; + +package Terminal_Interface.Curses.Terminfo is + pragma Preelaborate (Terminal_Interface.Curses.Terminfo); + + -- |===================================================================== + -- | Man page curs_terminfo.3x + -- |===================================================================== + -- Not implemented: setupterm, setterm, set_curterm, del_curterm, + -- restartterm, tparm, putp, vidputs, vidattr, + -- mvcur + + type Terminfo_String is new String; + + -- | + procedure Get_String (Name : String; + Value : out Terminfo_String; + Result : out Boolean); + function Has_String (Name : String) return Boolean; + -- AKA: tigetstr() + + -- | + function Get_Flag (Name : String) return Boolean; + -- AKA: tigetflag() + + -- | + function Get_Number (Name : String) return Integer; + -- AKA: tigetnum() + + type putctype is access function (c : Interfaces.C.int) + return Interfaces.C.int; + pragma Convention (C, putctype); + + -- | + procedure Put_String (Str : Terminfo_String; + affcnt : Natural := 1; + putc : putctype := null); + -- AKA: tputs() + +end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.adb b/Ada95/src/terminal_interface-curses-text_io-aux.adb index 812f6622..d7fff5bb 100644 --- a/Ada95/src/terminal_interface-curses-text_io-aux.adb +++ b/Ada95/src/terminal_interface-curses-text_io-aux.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO.Aux is diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.ads b/Ada95/src/terminal_interface-curses-text_io-aux.ads index 63a741fd..eaa68cb2 100644 --- a/Ada95/src/terminal_interface-curses-text_io-aux.ads +++ b/Ada95/src/terminal_interface-curses-text_io-aux.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ private package Terminal_Interface.Curses.Text_IO.Aux is diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.adb b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb index a804ec65..4eb6a6d7 100644 --- a/Ada95/src/terminal_interface-curses-text_io-complex_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.ads b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads index 47146266..64a84908 100644 --- a/Ada95/src/terminal_interface-curses-text_io-complex_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Complex_Types; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb index d70a73f1..d3a70dda 100644 --- a/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads index 60ac66b7..2b76feed 100644 --- a/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb index 7abeffe7..4ad47043 100644 --- a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads index 3c13424c..2bcee123 100644 --- a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb index 760acb2b..493450a7 100644 --- a/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads index 77f5743f..6ca314dc 100644 --- a/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.adb b/Ada95/src/terminal_interface-curses-text_io-float_io.adb index 47fe94a1..ee3cb224 100644 --- a/Ada95/src/terminal_interface-curses-text_io-float_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.ads b/Ada95/src/terminal_interface-curses-text_io-float_io.ads index e46170e6..35d47b80 100644 --- a/Ada95/src/terminal_interface-curses-text_io-float_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.adb b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb index 43d03a9f..fee7e0eb 100644 --- a/Ada95/src/terminal_interface-curses-text_io-integer_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.ads b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads index cd3b01b5..ba6cb145 100644 --- a/Ada95/src/terminal_interface-curses-text_io-integer_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.adb b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb index 75bd624a..0d107aa1 100644 --- a/Ada95/src/terminal_interface-curses-text_io-modular_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.ads b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads index 32920775..a539ac61 100644 --- a/Ada95/src/terminal_interface-curses-text_io-modular_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb index cf7614b4..01076921 100644 --- a/Ada95/src/terminal_interface-curses-text_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is diff --git a/Ada95/src/terminal_interface-curses-text_io.ads b/Ada95/src/terminal_interface-curses-text_io.ads index 02c3b7d5..d5192248 100644 --- a/Ada95/src/terminal_interface-curses-text_io.ads +++ b/Ada95/src/terminal_interface-curses-text_io.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-trace.adb_p b/Ada95/src/terminal_interface-curses-trace.adb_p new file mode 100644 index 00000000..a61ef4d4 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-trace.adb_p @@ -0,0 +1,92 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Trace -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en +-- Version Control: +-- $Revision: 1.3 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +#if ADA_TRACE then +with Interfaces.C; use Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Ada.Unchecked_Conversion; +#end if; + +package body Terminal_Interface.Curses.Trace is + +#if ADA_TRACE then + type C_TraceType is new C_UInt; + + function TraceAda_To_TraceC is new + Ada.Unchecked_Conversion (Source => Trace_Attribute_Set, + Target => C_TraceType); + + procedure Trace_On (x : Trace_Attribute_Set) is + procedure traceC (y : C_TraceType); + pragma Import (C, traceC, "trace"); + begin + traceC (TraceAda_To_TraceC (x)); + end Trace_On; + + -- 75. (12) A C function that takes a variable number of arguments can + -- correspond to several Ada subprograms, taking various specific + -- numbers and types of parameters. + + procedure Trace_Put (str : String) is + procedure tracef (format : char_array; s : char_array); + pragma Import (C, tracef, "_tracef"); + Txt : char_array (0 .. str'Length); + Length : size_t; + formatstr : constant String := "%s" & ASCII.Nul; + formattxt : char_array (0 .. formatstr'Length); + begin + To_C (formatstr, formattxt, Length); + To_C (str, Txt, Length); + tracef (formattxt, Txt); + end Trace_Put; +#else + procedure Trace_On (x : Trace_Attribute_Set) is + begin + null; + end Trace_On; + + procedure Trace_Put (str : String) is + begin + null; + end Trace_Put; +#end if; + +end Terminal_Interface.Curses.Trace; diff --git a/Ada95/src/terminal_interface-curses.adb b/Ada95/src/terminal_interface-curses.adb index 698f1c65..f196f3b5 100644 --- a/Ada95/src/terminal_interface-curses.adb +++ b/Ada95/src/terminal_interface-curses.adb @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.26 $ +-- $Revision: 1.28 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; @@ -89,6 +90,27 @@ package body Terminal_Interface.Curses is function W_Get_Short is new W_Get_Element (C_Short); function W_Get_Byte is new W_Get_Element (Interfaces.C.unsigned_char); + function Get_Flag (Win : Window; + Offset : Natural) return Boolean; + + function Get_Flag (Win : Window; + Offset : Natural) return Boolean + is + Res : C_Int; + begin + case Sizeof_bool is + when 1 => Res := C_Int (W_Get_Byte (Win, Offset)); + when 2 => Res := C_Int (W_Get_Short (Win, Offset)); + when 4 => Res := C_Int (W_Get_Int (Win, Offset)); + when others => raise Curses_Exception; + end case; + + case Res is + when 0 => return False; + when others => return True; + end case; + end Get_Flag; + ------------------------------------------------------------------------------ function Key_Name (Key : in Real_Key_Code) return String is @@ -404,9 +426,8 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.char; function Waddnstr (Win : Window; - Str : Char_Ptr; + Str : char_array; Len : C_Int := -1) return C_Int; pragma Import (C, Waddnstr, "waddnstr"); @@ -414,7 +435,7 @@ package body Terminal_Interface.Curses is Length : size_t; begin To_C (Str, Txt, Length); - if Waddnstr (Win, Txt (Txt'First)'Access, C_Int (Len)) = Curses_Err then + if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; end Add; @@ -436,9 +457,8 @@ package body Terminal_Interface.Curses is Str : in Attributed_String; Len : in Integer := -1) is - type Chtype_Ptr is access all Attributed_Character; function Waddchnstr (Win : Window; - Str : Chtype_Ptr; + Str : chtype_array; Len : C_Int := -1) return C_Int; pragma Import (C, Waddchnstr, "waddchnstr"); @@ -449,7 +469,7 @@ package body Terminal_Interface.Curses is end loop; Txt (Str'Length) := Default_Character; if Waddchnstr (Win, - Txt (Txt'First)'Access, + Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; @@ -616,6 +636,26 @@ package body Terminal_Interface.Curses is return Real_Key_Code (Natural (Key_F0) + Natural (Key)); end Function_Key_Code; ------------------------------------------------------------------------------ + procedure Standout (Win : Window := Standard_Window; + On : Boolean := True) + is + function wstandout (Win : Window) return C_Int; + pragma Import (C, wstandout, "wstandout"); + function wstandend (Win : Window) return C_Int; + pragma Import (C, wstandend, "wstandend"); + + Err : C_Int; + begin + if On then + Err := wstandout (Win); + else + Err := wstandend (Win); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Standout; + procedure Switch_Character_Attribute (Win : in Window := Standard_Window; Attr : in Character_Attribute_Set := Normal_Video; @@ -858,6 +898,13 @@ package body Terminal_Interface.Curses is end if; end Set_KeyPad_Mode; + function Get_KeyPad_Mode (Win : in Window := Standard_Window) + return Boolean + is + begin + return Get_Flag (Win, Offset_use_keypad); + end Get_KeyPad_Mode; + procedure Half_Delay (Amount : in Half_Delay_Amount) is function Halfdelay (Amount : C_Int) return C_Int; @@ -1036,21 +1083,11 @@ package body Terminal_Interface.Curses is end if; end Allow_Scrolling; - function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean + function Scrolling_Allowed (Win : Window := Standard_Window) + return Boolean is - Res : C_Int; begin - case Sizeof_bool is - when 1 => Res := C_Int (W_Get_Byte (Win, Offset_scroll)); - when 2 => Res := C_Int (W_Get_Short (Win, Offset_scroll)); - when 4 => Res := C_Int (W_Get_Int (Win, Offset_scroll)); - when others => raise Curses_Exception; - end case; - - case Res is - when 0 => return False; - when others => return True; - end case; + return Get_Flag (Win, Offset_scroll); end Scrolling_Allowed; procedure Set_Scroll_Region @@ -1636,9 +1673,8 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.char; function Winsnstr (Win : Window; - Str : Char_Ptr; + Str : char_array; Len : Integer := -1) return C_Int; pragma Import (C, Winsnstr, "winsnstr"); @@ -1646,7 +1682,7 @@ package body Terminal_Interface.Curses is Length : size_t; begin To_C (Str, Txt, Length); - if Winsnstr (Win, Txt (Txt'First)'Access, Len) = Curses_Err then + if Winsnstr (Win, Txt, Len) = Curses_Err then raise Curses_Exception; end if; end Insert; @@ -1658,11 +1694,10 @@ package body Terminal_Interface.Curses is Str : in String; Len : in Integer := -1) is - type Char_Ptr is access all Interfaces.C.char; function Mvwinsnstr (Win : Window; Line : C_Int; Column : C_Int; - Str : Char_Ptr; + Str : char_array; Len : C_Int) return C_Int; pragma Import (C, Mvwinsnstr, "mvwinsnstr"); @@ -1670,8 +1705,7 @@ package body Terminal_Interface.Curses is Length : size_t; begin To_C (Str, Txt, Length); - if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), - Txt (Txt'First)'Access, C_Int (Len)) + if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len)) = Curses_Err then raise Curses_Exception; end if; @@ -1723,14 +1757,13 @@ package body Terminal_Interface.Curses is Str : out Attributed_String; Len : in Integer := -1) is - type Chtype_Ptr is access all Attributed_Character; function Winchnstr (Win : Window; - Str : Chtype_Ptr; + Str : chtype_array; -- out Len : C_Int) return C_Int; pragma Import (C, Winchnstr, "winchnstr"); N : Integer := Len; - Txt : chtype_array (0 .. Str'Length); + Txt : chtype_array (0 .. Str'Length) := (0 => Default_Character); Cnt : Natural := 0; begin if N < 0 then @@ -1739,7 +1772,7 @@ package body Terminal_Interface.Curses is if N > Str'Length then raise Constraint_Error; end if; - if Winchnstr (Win, Txt (Txt'First)'Access, C_Int (N)) = Curses_Err then + if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then raise Curses_Exception; end if; for To in Str'Range loop @@ -1823,9 +1856,8 @@ package body Terminal_Interface.Curses is Text : in String; Fmt : in Label_Justification := Left) is - type Char_Ptr is access all Interfaces.C.char; function Slk_Set (Label : C_Int; - Txt : Char_Ptr; + Txt : char_array; Fmt : C_Int) return C_Int; pragma Import (C, Slk_Set, "slk_set"); @@ -1833,10 +1865,8 @@ package body Terminal_Interface.Curses is Len : size_t; begin To_C (Text, Txt, Len); - if Slk_Set (C_Int (Label), - Txt (Txt'First)'Access, - C_Int (Label_Justification'Pos (Fmt))) - = Curses_Err then + if Slk_Set (C_Int (Label), Txt, + C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then raise Curses_Exception; end if; end Set_Soft_Label_Key; @@ -1995,8 +2025,7 @@ package body Terminal_Interface.Curses is procedure Define_Key (Definition : in String; Key : in Special_Key_Code) is - type Char_Ptr is access all Interfaces.C.char; - function Defkey (Def : Char_Ptr; + function Defkey (Def : char_array; Key : C_Int) return C_Int; pragma Import (C, Defkey, "define_key"); @@ -2004,7 +2033,7 @@ package body Terminal_Interface.Curses is Length : size_t; begin To_C (Definition, Txt, Length); - if Defkey (Txt (Txt'First)'Access, C_Int (Key)) = Curses_Err then + if Defkey (Txt, C_Int (Key)) = Curses_Err then raise Curses_Exception; end if; end Define_Key; @@ -2410,5 +2439,123 @@ package body Terminal_Interface.Curses is Column := Column_Position (X); end if; end Transform_Coordinates; +------------------------------------------------------------------------------ + procedure Use_Default_Colors is + function C_Use_Default_Colors return C_Int; + pragma Import (C, C_Use_Default_Colors, "use_default_colors"); + Err : constant C_Int := C_Use_Default_Colors; + begin + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Use_Default_Colors; + + procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; + Back : Color_Number := Default_Color) + is + function C_Assume_Default_Colors (Fore : C_Int; + Back : C_Int) return C_Int; + pragma Import (C, C_Assume_Default_Colors, "assume_default_colors"); + + Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore), + C_Int (Black)); + begin + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Assume_Default_Colors; +------------------------------------------------------------------------------ + function Curses_Version return String + is + function curses_versionC return chars_ptr; + pragma Import (C, curses_versionC, "curses_version"); + Result : constant chars_ptr := curses_versionC; + begin + return Fill_String (Result); + end Curses_Version; +------------------------------------------------------------------------------ + function Use_Extended_Names (Enable : Boolean) return Boolean + is + function use_extended_namesC (e : Curses_Bool) return C_Int; + pragma Import (C, use_extended_namesC, "use_extended_names"); + + Res : constant C_Int := + use_extended_namesC (Curses_Bool (Boolean'Pos (Enable))); + begin + if Res = C_Int (Curses_Bool_False) then + return False; + else + return True; + end if; + end Use_Extended_Names; +------------------------------------------------------------------------------ + procedure Screen_Dump_To_File (Filename : in String) + is + function scr_dump (f : char_array) return C_Int; + pragma Import (C, scr_dump, "scr_dump"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_dump (Txt) then + raise Curses_Exception; + end if; + end Screen_Dump_To_File; + + procedure Screen_Restore_From_File (Filename : in String) + is + function scr_restore (f : char_array) return C_Int; + pragma Import (C, scr_restore, "scr_restore"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_restore (Txt) then + raise Curses_Exception; + end if; + end Screen_Restore_From_File; + + procedure Screen_Init_From_File (Filename : in String) + is + function scr_init (f : char_array) return C_Int; + pragma Import (C, scr_init, "scr_init"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_init (Txt) then + raise Curses_Exception; + end if; + end Screen_Init_From_File; + + procedure Screen_Set_File (Filename : in String) + is + function scr_set (f : char_array) return C_Int; + pragma Import (C, scr_set, "scr_set"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_set (Txt) then + raise Curses_Exception; + end if; + end Screen_Set_File; +------------------------------------------------------------------------------ + procedure Resize (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count) is + function wresize (win : Window; + lines : C_Int; + columns : C_Int) return C_Int; + pragma Import (C, wresize); + begin + if wresize (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns)) = Curses_Err then + raise Curses_Exception; + end if; + end Resize; +------------------------------------------------------------------------------ end Terminal_Interface.Curses; + diff --git a/Ada95/src/terminal_interface.ads b/Ada95/src/terminal_interface.ads index 89544bb0..c7c0984d 100644 --- a/Ada95/src/terminal_interface.ads +++ b/Ada95/src/terminal_interface.ads @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 +-- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Terminal_Interface is diff --git a/INSTALL b/INSTALL index 26d57374..a1c56ebb 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ --- $Id: INSTALL,v 1.46 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +-- $Id: INSTALL,v 1.56 2002/09/01 22:42:11 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -47,7 +47,7 @@ REQUIREMENTS: You will need the following in order to build and install ncurses under UNIX: - * ANSI C compiler (gcc is recommended) + * ANSI C compiler (gcc, for instance) * sh (bash will do) * awk (mawk or gawk will do) * sed @@ -106,6 +106,16 @@ INSTALLATION PROCEDURE: libncurses.la (libtool) + If you configure using the --enable-widec option, a "w" is appended to the + library names (e.g., libncursesw.a), and the resulting libraries support + wide-characters, e.g., via a UTF-8 locale. The corresponding header files + are compatible with the non-wide-character configuration; wide-character + features are provided by ifdef's in the header files. The wide-character + library interfaces are not binary-compatible with the non-wide-character + version. Building and running the wide-character code relies on a fairly + recent implementation of libiconv. We have built this configuration on + Linux using libiconv, sometimes requiring libutf8. + If you do not specify any models, the normal and debug libraries will be configured. Typing `configure' with no arguments is equivalent to: @@ -158,6 +168,9 @@ INSTALLATION PROCEDURE: databases are SVr4-compatible, but most seem to be. Exceptions include DEC's Digital Unix (formerly known as OSF/1). + It is possible to configure ncurses to use other terminfo database formats. + A few are provided as examples in the include-directory (see --with-caps). + The ncurses program is designed specifically to test the ncurses library. You can use it to verify that the screen highlights work correctly, that cursor addressing and window scrolling works OK, etc. @@ -189,14 +202,14 @@ INSTALLATION PROCEDURE: with tbl(1) by specifying the configure option --with-manpage-tbl. If the system already has a curses library that you need to keep using - for some bizarre binary-compatibility reason, you'll need to distinguish - between it and ncurses. If ncurses is installed outside the standard - directories (/usr/include and /usr/lib) then all your users will need - to use the -I option to compile programs and -L to link them. + you'll need to distinguish between it and ncurses. See the discussion of + --disable-overwrite. If ncurses is installed outside the standard + directories (/usr/include and /usr/lib) then all your users will need to + use the -I option to compile programs and -L to link them. - If you have BSD curses installed in your system and you accidentally + If you have another curses installed in your system and you accidentally compile using its curses.h you'll end up with a large number of - undefined symbols at link time. _waddbytes is one of them. + undefined symbols at link time. IF YOU DO NOT HAVE ROOT: Change directory to the `progs' subdirectory and run the `capconvert' script. This script will deduce various things @@ -221,26 +234,6 @@ INSTALLATION PROCEDURE: which may be supported by C++. IF YOU USE THIS OPTION, BE ADVISED THAT YOU MAY NOT BE ABLE TO COMPILE (OR RUN) NCURSES APPLICATIONS WITH C++. -7. If you're running an older Linux, you must either (a) tell Linux that the - console terminal type is `linux' or (b) make a link to or copy of the - linux entry in the appropriate place under your terminfo directory, named - `console'. All 1.3 and many 1.2 distributions (including Yggdrasil and - Red Hat) already have the console type set to `linux'. - - The way to change the wired-in console type depends on the configuration - of your system. This may involve editing /etc/inittab, /etc/ttytype, - /etc/profile and other such files. - - Warning: this is not for the fainthearted, if you mess up your console - getty entries you can make your system unusable! However, if you are - a distribution maker, this is the right thing to do (see the note for - integrators near the end of this file). - - The easier way is to link or copy l/linux to c/console under your terminfo - directory. Note: this will go away next time you do `make install.data' - and you'll have to redo it. There is no need to have entries for all - possible screen sizes, ncurses will figure out the size automatically. - SUMMARY OF CONFIGURE OPTIONS: ---------------------------- @@ -277,7 +270,9 @@ SUMMARY OF CONFIGURE OPTIONS: Use only built-in data. The ncurses libraries normally read terminfo and termcap data from disk. You can configure ncurses to have a built-in database, aka "fallback" entries. Embedded applications may - have no need for an external database. + have no need for an external database. Some, but not all of the + programs are useful in this configuration, e.g., reset and tput versus + infocmp and tic. --disable-ext-funcs Disable function-extensions. Configure ncurses without the functions @@ -444,13 +439,18 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-widec Compile with experimental wide-character code. This makes a different version of the libraries (e.g., libncursesw.so), which stores - characters in 16-bits. We provide a simple UTF-8 driver and test - program to use this feature with terminals that can display UTF-8. + 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 symbolic link to equate libncurses.so with libncursesw.so + NOTE: the Ada95 binding may be built against either version of the the + ncurses library, but you must decide which: the binding installs the + same set of files for either version. Currently (2002/6/22) it does + not use the extended features from the wide-character code, so it is + probably better to not install the binding for that configuration. + --enable-xmc-glitch Compile-in support experimental xmc (magic cookie) code. @@ -464,6 +464,46 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-bool=TYPE + If --without-cxx is specified, override the type used for the "bool" + declared in curses.h (normally the type is automatically chosen to + correspond with that in , or defaults to platform-specific + sizes). + + --with-build-cc=XXX + If cross-compiling, specify a host C compiler, which is needed to + compile a few utilties which generate source modules for ncurses. + If you do not give this option, the configure script checks if the + $BUILD_CC variable is set, and otherwise defaults to gcc or cc. + + --with-build-cflags=XXX + If cross-compiling, specify the host C compiler-flags. You might need + to do this if the target compiler has unusual flags which confuse the + host compiler. + + --with-build-cppflags=XXX + If cross-compiling, specify the host C preprocesor-flags. You might + need to do this if the target compiler has unusual flags which confuse + the host compiler. + + --with-build-ldflags=XXX + If cross-compiling, specify the host linker-flags. You might need to + do this if the target linker has unusual flags which confuse the host + compiler. + + --with-build-libs=XXX + If cross-compiling, the host libraries. You might need to do this if + the target environment requires unusual libraries. + + --with-caps=XXX + Specify an alternate terminfo capabilities file, which makes the + configure script look for "include/Caps.XXX". A few systems, e.g., + AIX 4.x use the same overall file-format as ncurses for terminfo + data, but use different alignments within the tables to support + legacy applications. For those systems, you can configure ncurses + to use a terminfo database which is compatible with the native + applications. + --with-database=XXX Specify the terminfo source file to install. Usually you will wish to install ncurses' default (misc/terminfo.src). Certain systems @@ -532,6 +572,19 @@ SUMMARY OF CONFIGURE OPTIONS: by running them through tbl to generate tables understandable by nroff. + --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. + 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 + cfgetospeed(), which returns a speed_t for this reason). In practice, + applications that required knowledge of the ospeed variable, i.e., + 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). @@ -573,6 +626,10 @@ SUMMARY OF CONFIGURE OPTIONS: (libtinfo). This is done to accommodate applications that use only the latter. The terminfo library is about half the size of the total. + --with-termpath=XXX + Specify a search-list of termcap files which will be compiled into the + ncurses library (default: /etc/termcap:/usr/share/misc/termcap) + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -616,6 +673,41 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: + 5.3 (pre-release) + Interface changes: + + + change type for bool used in headers to NCURSES_BOOL, which usually + is the same as the compiler's definition for 'bool'. + + + add all but two functions for X/Open curses wide-character support. + These are only available if the library is configured using the + --enable-widec option. Missing functions are + pecho_wchar() + slk_wset() + + + add environment variable $NCURSES_ASSUMED_COLORS to modify the + assume_default_colors() extension. + + Added extensions: + is_term_resized() + resize_term() + Added internal functions: + _nc_altcharset_name() debug + _nc_rootname() + _nc_trace_ttymode() debug + _nc_varargs() debug + _nc_wgetch() + Removed internal functions: + _nc_background() + Modified internal functions: + _nc_freeall() debug + + 5.2 (October 21, 2000) + Interface changes: + + + revert termcap ospeed variable to 'short' (see discussion of the + --with-ospeed configure option). + 5.1 (July 8, 2000) Interface changes: diff --git a/MANIFEST b/MANIFEST index 24368e57..869e3bdb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -18,10 +18,52 @@ ./Ada95/gen/terminal_interface-curses-mouse.ads.m4 ./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.ads.m4 ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt +./Ada95/samples/ncurses.adb +./Ada95/samples/ncurses2-acs_and_scroll.adb +./Ada95/samples/ncurses2-acs_and_scroll.ads +./Ada95/samples/ncurses2-acs_display.adb +./Ada95/samples/ncurses2-acs_display.ads +./Ada95/samples/ncurses2-attr_test.adb +./Ada95/samples/ncurses2-attr_test.ads +./Ada95/samples/ncurses2-color_edit.adb +./Ada95/samples/ncurses2-color_edit.ads +./Ada95/samples/ncurses2-color_test.adb +./Ada95/samples/ncurses2-color_test.ads +./Ada95/samples/ncurses2-demo_forms.adb +./Ada95/samples/ncurses2-demo_forms.ads +./Ada95/samples/ncurses2-demo_pad.adb +./Ada95/samples/ncurses2-demo_pad.ads +./Ada95/samples/ncurses2-demo_panels.adb +./Ada95/samples/ncurses2-demo_panels.ads +./Ada95/samples/ncurses2-flushinp_test.adb +./Ada95/samples/ncurses2-flushinp_test.ads +./Ada95/samples/ncurses2-genericputs.adb +./Ada95/samples/ncurses2-genericputs.ads +./Ada95/samples/ncurses2-getch.ads +./Ada95/samples/ncurses2-getch_test.adb +./Ada95/samples/ncurses2-getch_test.ads +./Ada95/samples/ncurses2-getopt.adb +./Ada95/samples/ncurses2-getopt.ads +./Ada95/samples/ncurses2-m.adb +./Ada95/samples/ncurses2-m.ads +./Ada95/samples/ncurses2-menu_test.adb +./Ada95/samples/ncurses2-menu_test.ads +./Ada95/samples/ncurses2-overlap_test.adb +./Ada95/samples/ncurses2-overlap_test.ads +./Ada95/samples/ncurses2-slk_test.adb +./Ada95/samples/ncurses2-slk_test.ads +./Ada95/samples/ncurses2-test_sgr_attributes.adb +./Ada95/samples/ncurses2-test_sgr_attributes.ads +./Ada95/samples/ncurses2-trace_set.adb +./Ada95/samples/ncurses2-trace_set.ads +./Ada95/samples/ncurses2-util.adb +./Ada95/samples/ncurses2-util.ads +./Ada95/samples/ncurses2.ads ./Ada95/samples/rain.adb ./Ada95/samples/rain.ads ./Ada95/samples/sample-curses_demo-attributes.adb @@ -95,6 +137,12 @@ ./Ada95/src/terminal_interface-curses-mouse.adb ./Ada95/src/terminal_interface-curses-panels-user_data.adb ./Ada95/src/terminal_interface-curses-panels.adb +./Ada95/src/terminal_interface-curses-putwin.adb +./Ada95/src/terminal_interface-curses-putwin.ads +./Ada95/src/terminal_interface-curses-termcap.adb +./Ada95/src/terminal_interface-curses-termcap.ads +./Ada95/src/terminal_interface-curses-terminfo.adb +./Ada95/src/terminal_interface-curses-terminfo.ads ./Ada95/src/terminal_interface-curses-text_io-aux.adb ./Ada95/src/terminal_interface-curses-text_io-aux.ads ./Ada95/src/terminal_interface-curses-text_io-complex_io.adb @@ -113,6 +161,7 @@ ./Ada95/src/terminal_interface-curses-text_io-modular_io.ads ./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 @@ -229,6 +278,12 @@ ./doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm ./doc/html/ada/terminal_interface-curses-panels__adb.htm ./doc/html/ada/terminal_interface-curses-panels__ads.htm +./doc/html/ada/terminal_interface-curses-putwin__adb.htm +./doc/html/ada/terminal_interface-curses-putwin__ads.htm +./doc/html/ada/terminal_interface-curses-termcap__adb.htm +./doc/html/ada/terminal_interface-curses-termcap__ads.htm +./doc/html/ada/terminal_interface-curses-terminfo__adb.htm +./doc/html/ada/terminal_interface-curses-terminfo__ads.htm ./doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm ./doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm ./doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm @@ -247,6 +302,8 @@ ./doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm ./doc/html/ada/terminal_interface-curses-text_io__adb.htm ./doc/html/ada/terminal_interface-curses-text_io__ads.htm +./doc/html/ada/terminal_interface-curses-trace__adb.htm +./doc/html/ada/terminal_interface-curses-trace__ads.htm ./doc/html/ada/terminal_interface-curses__adb.htm ./doc/html/ada/terminal_interface-curses__ads.htm ./doc/html/ada/terminal_interface__ads.htm @@ -255,28 +312,41 @@ ./doc/html/index.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html +./doc/html/man/curs_add_wch.3x.html +./doc/html/man/curs_add_wchstr.3x.html ./doc/html/man/curs_addch.3x.html ./doc/html/man/curs_addchstr.3x.html ./doc/html/man/curs_addstr.3x.html +./doc/html/man/curs_addwstr.3x.html ./doc/html/man/curs_attr.3x.html ./doc/html/man/curs_beep.3x.html ./doc/html/man/curs_bkgd.3x.html +./doc/html/man/curs_bkgrnd.3x.html ./doc/html/man/curs_border.3x.html +./doc/html/man/curs_border_set.3x.html ./doc/html/man/curs_clear.3x.html ./doc/html/man/curs_color.3x.html ./doc/html/man/curs_delch.3x.html ./doc/html/man/curs_deleteln.3x.html ./doc/html/man/curs_extend.3x.html +./doc/html/man/curs_get_wch.3x.html +./doc/html/man/curs_get_wstr.3x.html +./doc/html/man/curs_getcchar.3x.html ./doc/html/man/curs_getch.3x.html ./doc/html/man/curs_getstr.3x.html ./doc/html/man/curs_getyx.3x.html +./doc/html/man/curs_in_wch.3x.html +./doc/html/man/curs_in_wchstr.3x.html ./doc/html/man/curs_inch.3x.html ./doc/html/man/curs_inchstr.3x.html ./doc/html/man/curs_initscr.3x.html ./doc/html/man/curs_inopts.3x.html +./doc/html/man/curs_ins_wch.3x.html +./doc/html/man/curs_ins_wstr.3x.html ./doc/html/man/curs_insch.3x.html ./doc/html/man/curs_insstr.3x.html ./doc/html/man/curs_instr.3x.html +./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html @@ -407,21 +477,31 @@ ./form/fty_regex.c ./form/headers ./form/llib-lform +./form/llib-lformw ./form/modules ./include/Caps +./include/Caps.aix4 +./include/Caps.hpux11 +./include/Caps.keys +./include/Caps.osf1r5 +./include/Caps.uwin ./include/MKhashsize.sh +./include/MKkey_defs.sh ./include/MKncurses_def.sh ./include/MKparametrized.sh ./include/MKterm.h.awk.in ./include/Makefile.in ./include/capdefaults.c ./include/curses.h.in +./include/curses.tail +./include/curses.wide ./include/edit_cfg.sh ./include/headers ./include/nc_alloc.h ./include/nc_panel.h ./include/ncurses_cfg.hin ./include/ncurses_defs +./include/ncurses_dll.h ./include/term_entry.h ./include/termcap.h.in ./include/tic.h @@ -431,28 +511,41 @@ ./man/Makefile.in ./man/captoinfo.1m ./man/clear.1 +./man/curs_add_wch.3x +./man/curs_add_wchstr.3x ./man/curs_addch.3x ./man/curs_addchstr.3x ./man/curs_addstr.3x +./man/curs_addwstr.3x ./man/curs_attr.3x ./man/curs_beep.3x ./man/curs_bkgd.3x +./man/curs_bkgrnd.3x ./man/curs_border.3x +./man/curs_border_set.3x ./man/curs_clear.3x ./man/curs_color.3x ./man/curs_delch.3x ./man/curs_deleteln.3x ./man/curs_extend.3x +./man/curs_get_wch.3x +./man/curs_get_wstr.3x +./man/curs_getcchar.3x ./man/curs_getch.3x ./man/curs_getstr.3x ./man/curs_getyx.3x +./man/curs_in_wch.3x +./man/curs_in_wchstr.3x ./man/curs_inch.3x ./man/curs_inchstr.3x ./man/curs_initscr.3x ./man/curs_inopts.3x +./man/curs_ins_wch.3x +./man/curs_ins_wstr.3x ./man/curs_insch.3x ./man/curs_insstr.3x ./man/curs_instr.3x +./man/curs_inwstr.3x ./man/curs_kernel.3x ./man/curs_mouse.3x ./man/curs_move.3x @@ -545,6 +638,7 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu +./menu/llib-lmenuw ./menu/m_attribs.c ./menu/m_cursor.c ./menu/m_driver.c @@ -605,6 +699,7 @@ ./mkinstalldirs ./ncurses/Makefile.in ./ncurses/README +./ncurses/README.IZ ./ncurses/SigAction.h ./ncurses/base/MKkeyname.awk ./ncurses/base/MKlib_gen.sh @@ -695,9 +790,11 @@ ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses +./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk ./ncurses/tinfo/MKfallback.sh +./ncurses/tinfo/MKkeys_list.sh ./ncurses/tinfo/MKnames.awk ./ncurses/tinfo/README ./ncurses/tinfo/access.c @@ -715,7 +812,6 @@ ./ncurses/tinfo/getenv_num.c ./ncurses/tinfo/home_terminfo.c ./ncurses/tinfo/init_keytry.c -./ncurses/tinfo/keys.list ./ncurses/tinfo/lib_acs.c ./ncurses/tinfo/lib_baudrate.c ./ncurses/tinfo/lib_cur_term.c @@ -753,6 +849,8 @@ ./ncurses/trace/trace_buf.c ./ncurses/trace/trace_tries.c ./ncurses/trace/trace_xnames.c +./ncurses/trace/varargs.c +./ncurses/trace/visbuf.c ./ncurses/tty/MKexpanded.sh ./ncurses/tty/hardscroll.c ./ncurses/tty/hashmap.c @@ -763,9 +861,26 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c +./ncurses/widechar/lib_box_set.c +./ncurses/widechar/lib_cchar.c +./ncurses/widechar/lib_erasewchar.c +./ncurses/widechar/lib_get_wch.c +./ncurses/widechar/lib_get_wstr.c +./ncurses/widechar/lib_hline_set.c +./ncurses/widechar/lib_in_wch.c +./ncurses/widechar/lib_in_wchnstr.c +./ncurses/widechar/lib_ins_nwstr.c +./ncurses/widechar/lib_ins_wch.c +./ncurses/widechar/lib_inwstr.c +./ncurses/widechar/lib_unget_wch.c +./ncurses/widechar/lib_vid_attr.c +./ncurses/widechar/lib_vline_set.c +./ncurses/widechar/lib_wacs.c +./ncurses/widechar/lib_wunctrl.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel +./panel/llib-lpanelw ./panel/modules ./panel/p_above.c ./panel/p_below.c diff --git a/Makefile.glibc b/Makefile.glibc index 780650a0..2535e9f3 100644 --- a/Makefile.glibc +++ b/Makefile.glibc @@ -219,12 +219,14 @@ libncurses-routines = \ trace/trace_buf \ trace/trace_tries \ trace/trace_xnames \ + trace/varargs \ + trace/visbuf \ tty/hardscroll \ tty/hashmap \ tty/lib_mvcur \ tty/lib_tstp \ - tty/lib_vidattr \ tty/lib_twait \ + tty/lib_vidattr \ tty/tty_update \ unctrl diff --git a/Makefile.in b/Makefile.in index 9489e9fe..7a30d322 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.20 2000/08/19 19:11:56 tom Exp $ +# $Id: Makefile.in,v 1.22 2001/10/27 18:17:22 tom Exp $ ############################################################################## # Copyright (c) 1998 Free Software Foundation, Inc. # # # @@ -69,7 +69,7 @@ preinstall : @ echo ' lib directory: '$(libdir) @ echo ' include directory: '$(includedir) @ echo ' man directory: '$(mandir) - @ echo ' terminfo directory: '$(ticdir) +@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir) @ echo '' @ test "$(includedir)" = "$(prefix)/include" || \ echo '** Include-directory is not in a standard location' @@ -87,6 +87,7 @@ clean \ distclean \ mostlyclean \ realclean \ +depend \ sources \ uninstall \ install :: diff --git a/NEWS b/NEWS index 796c894d..8ce31076 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ --- $Id: NEWS,v 1.602 2000/10/21 00:42:11 tom Exp $ +-- $Id: NEWS,v 1.714 2002/10/12 22:35:42 tom Exp $ This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. @@ -6,6 +6,1205 @@ 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. +20021012 5.3 release for upload to ftp.gnu.org + + modify ifdef's in etip.h.in to allow the etip.h header to compile + with gcc 3.2 (patch by Dimitar Zhekov ). + + add logic to setupterm() to make it like initscr() and newterm(), + by checking for $NCURSES_TRACE environment variable and enabling + the debug trace in that case. + + modify setupterm() to ensure that it initializes the baudrate, for + applications such as tput (report by Frank Henigman). + + modify definition of bits used for command-line and library debug + traces to avoid overlap, using new definition TRACE_SHIFT to relate + the two. + + document tput's interpretation of parameterized strings according to + whether parameters are given, etc. (discussion with Robert De Bath). + +20021005 pre-release + + correct winnwstr() to account for non-character cells generated when + a double-width character is added (report by Michael Bienia + ). + + modify _nc_viswbuf2n() to provide better results using wctomb(). + + correct logic in _nc_varargs() which broke tracing of parameters for + formats such as "%.*s". + + correct scale factor in linux-c and linux-c-nc terminfo entries + (report Floyd Davidson). + + change tic -A option to -t, add the same option to infocmp for + consistency. + + correct "%c" implementation in lib_tparm.c, which did not map a null + character to a 128 (cf: 980620) (patch by Frank Henigman + ). + +20020928 pre-release + + modify MKkey_defs.sh to check for POSIX sort -k option, use that if + it is found, to accommodate newer utility which dropped the + compatibility support for +number options (reported by Andrey A + Chernov). + + modify linux terminfo entry to use color palette feature from + linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson). + + restore original color definitions in endwin() if init_color() was + used, and resume those colors on the next doupdate() or refresh() + (report by Tomasz Wasiak ). + + improve debug-traces by modifying MKlib_gen.sh to generate calls + to returnBool() and returnAttr(). + + add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace + of waddnstr() and similar functions to match the parameters as used. + + add/use _nc_retrace_bool() and _nc_retrace_unsigned(). + + correct type used by _nc_retrace_chtype(). + + add debug traces to some functions in lib_mouse.c + + modify lib_addch.c to handle non-spacing characters. + + correct parameter of RemAttr() in lib_bkgd.c, which caused the c++ + demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629). + + correct width computed in _tracedump(), which did not account for + the attributes (broken in 20010602). + + modify test/tracemunch to replace addresses for windows other than + curscr, newscr and stdscr with window0, window1, etc. + +20020921 pre-release + + redid fix for edit_man.sed path. + + workaround for Cygwin bug which makes subprocess writes to stdout + result in core dump. + + documented getbegx(), etc. + + minor fixes to configure script to use '%' consistently as a sed + delimiter rather than '@'. + > 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. + +20020914 pre-release + + modified curses.h so that if the wide-character version is installed + overwriting /usr/include/curses.h, and if it relied on libutf8.h, + then applications that use that header for wide-character support + must define HAVE_LIBUTF8_H. + + modify putwin(), getwin() and dupwin() to allow them to operate on + pads (request by Philippe Blain). + + correct attribute-merging in wborder(), broken in 20020216 (report + by Tomasz Wasiak ). + > 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. + +20020907 pre-release + + change configure script to allow install of widec-character + (ncursesw) headers to overwrite normal (ncurses) headers, since the + latter is a compatible subset of the former. + + fix path of edit_man.sed in configure script, needed to regenerate + html manpages on Debian. + + 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: + + 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 + confusion. + + modify lib_tparm.c, absorb really_get_space() into get_space(). + + modify getwin() and dupwin() to copy the _notimeout, _idlok and + _idcok window fields. + + better fix for _nc_set_type(), using typeMalloc(). + +20020901 pre-release + + change minor version to 3, i.e., ncurses 5.3 + + update config.guess, config.sub + + retest build with each configure option; minor ifdef fixes. + + make keyname() return a null pointer rather than "UNKNOWN STRING" to + match XSI. + + modify handling of wide line-drawing character functions to use the + normal line-drawing characters when not in UTF-8 locale. + + add check/fix to comp_parse.c to suppress warning about missing acsc + string. This happens in configurations where raw termcap information + is processed; tic already does this and other checks. + + modify tic's check for ich/ich1 versus rmir/smir to only warn about + ich1, to match xterm patch #70 notes. + + moved information for ripped-off lines into SCREEN struct to allow + use in resizeterm(). + + add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS + (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: + + 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). + + prevent dupwin() from duplicating a pad. + + prevent putwin() from writing a pad. + + use typeRealloc() or typeMalloc() in preference to direct calls on + _nc_doalloc(). + +20020824 + + add a check in kgetch() for cooked characters in the fifo to avoid + calling fifo_push() when a KEY_RESIZE is available (report/analysis + by Sam Varshavchik ). + + fix an overlooked case for bugzilla #68199 (Philippe Blain). + + ensure clearerr() is called before using ferror() e.g., in + lib_screen.c (report by Philippe Blain). + +20020817 + + modify lib_screen.c and lib_newwin.c to maintain the SCREEN-specific + pointers for curscr/stdscr/newscr when scr_save() and scr_restore() + modify the global curscr/stdscr/newscr variables. Fixes Redhat + bugzilla #68199 dated 2002-07-07. + + add checks for null pointer in calls to tparm() and tgoto() based on + FreeBSD bug report. If ncurses were built with termcap support, and + the first call to tgoto() were a zero-length string, the result would + be a null pointer, which was not handled properly. + + correct a typo in terminfo.head, which gave the octal code for colon + rather than comma. + + remove the "tic -u" option from 20020810, since it did not account + for nested "tc=" clauses, and when that was addressed, was still + unsatisfactory. + +20020810 + + add tic -A option to suppress capabilities which are commented out + when translating to termcap. + + add tic -u option to provide older behavior of "tc=" clauses. + + modified tic to expand all but the final "tc=" clause in a termcap + entry, to accommodate termcap libraries which do not handle multiple + tc clauses. + + correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by + Philippe Blain). + + remove a couple of redundant uses of A_ATTRIBUTES in expressions + using AttrOf(), which already incorporates that mask (report by + Philippe Blain). + + document TABSIZE variable. + + add NCURSES_ASSUMED_COLORS environment variable, to allow users to + override compiled-in default black-on-white assumption used in + assume_default_colors(). + + correct an off-by-one comparison against max_colors in COLORFGBG + logic. + + correct a use of uninitialized memory found by valgrind (reported by + Olaf Buddenhagen ). + + modified wresize() to ensure that a failed realloc will not corrupt + the window structure, and to make subwindows fit within the resized + window (completes Debian #87678, #101699) + +20020803 + + fix an off-by-one in lib_pad.c check for limits of pad (patch by + Philippe Blain). + + revise logic for BeOS in lib_twait.c altered in 20011013 to restore + logic used by lib_getch.c's support for GPM or EMX mouse (report by + Philippe Blain) + + remove NCURSES_CONST from several prototypes in curses.wide, to make + the --enable-const --enable-widec configure options to work together + (report by George Goffe ). + +20020727 + + finish no-leak checking in cardfile.c, using this for testing changes + to resizeterm(). + + simplify _nc_freeall() using delscreen(). + +20020720 + + check error-return from _nc_set_tty_mode() in _nc_initscr() and + reset_prog_mode() (report/patch by Philippe Blain). + + regenerate configure using patch for autoconf 2.52, to address + problem with identifying C++ bool type. + + correct/improve logic to produce an exit status for errors in tput, + which did not exit with an error when told to put a string not in the + current terminfo entry (report by David Gomez ). + + modify configure script AC_OUTPUT() call to work around defect in + autoconf 2.52 which adds an ifdef'd include to the generated + configure definitions. + + remove fstat() check from scr_init(), which also fixes a missing + include for from 20020713 (reported by David Ellement, + fix suggested by Philippe Blain). + + update curs_scanw.3x manpage to note that XSI curses differs from + SVr4 curses: return-values are incompatible. + + correct several prototypes in manpages which used const + inconsistently with the curses.h file, and removed spurious const's + in a few places from curses.h, e.g., for wbkgd() (report by Glenn + Maynard ). + + change internal type used by tparm() to long, to work with LP64 model. + + modify nc_alloc.h to allow building with g++, for testing. + +20020713 + + add resize-handling to cardfile.c test program. + + altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. (More + work must be done on this, but it works well enough to integrate). + + improve a limit-check in lib_refresh.c + + remove check in lib_screen.c relating dumptime to file's modification + times, since that would not necessarily work for remotely mounted + filesystems. + + modify lrtest to simplify debugging changes to resizeterm, e.g., + t/T commands to enable/disable tracing. + + updated status of multibyte support in TO-DO. + + update contact info in source-files (patch by Juergen Pfeifer). + +20020706 + + add Caps.hpux11, as an example. + + modify version_filter(), used to implement -R option for tic and + infocmp, to use computed array offsets based on the Caps.* file which + is actually configured, rather than constants which correspond to + the Caps file. + + reorganized lib_raw.c to avoid updating SP and cur_term state if the + functions fail (reported by Philippe Blain). + + add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc. + +20020629 + + correct parameters to setcchar() in ncurses.c (cf: 20020406). + + set locale in most test programs (view.c and ncurses.c were the + only ones). + + add configure option --with-build-cppflags (report by Maksim A + Nikulin ). + + correct a typo in wide-character logic for lib_bkgnd.c (Philippe + Blain). + + modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when + in UTF-8 locale. Wide-character functions use Unicode values, while + narrow-character functions use the terminfo data. + + fix a couple of places in Ada95/samples which did not compile with + gnat 3.14 + + modify mkinstalldirs so the DOS-pathname case is locale-independent. + + fix locale problem in MKlib_gen.sh by forcing related variables to + POSIX (C), using same approach as autoconf (set variables only if + they were set before). Update MKterminfo.sh and MKtermsort.sh to + match. + +20020622 + + add charset to generated html. + + add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy + -TD + + add rxvt-16color, ibm+16color entries -TD + + modify check in --disable-overwrite option so that it is used by + default unless the --prefix/$prefix value is not /usr, in attempt to + work around packagers, e.g., for Sun's freeware, who do not read the + INSTALL notes. + +20020615 + + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function + key code in get_wch(). + + extended resize-handling in test/ncurses 'a' menu to the entire + stack of windows created with 'w' commands. + + improve $COLORFGBG feature by interpreting an out-of-range color + value as an SGR 39 or 49, for foreground/background respectively. + + correct a typo in configure --enable-colorfgbg option, and move it + to the experimental section (cf: 20011208). + +20020601 + + add logic to dump_entry.c to remove function-key definitions that do + not fit into the 1023-byte limit for generated termcaps. This makes + hds200 fit. + + more improvements to tic's warnings, including logic to ignore + differences between delay values in sgr strings. + + move definition of KEY_RESIZE into MKkeydefs.sh script, to + accommodate Caps.osf1r5 which introduced a conflicting definition. + +20020525 + + add simple resize-handling in test/ncurses.c 'a' menu. + + fixes in keyname() and _tracechar() to handle negative values. + + make tic's warnings about mismatches in sgr strings easier to follow. + + correct tic checks for number of parameters in smgbp and smglp. + + improve scoansi terminfo entry, and add scoansi-new entry -TD + + add pcvt25-color terminfo entry -TD + + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen + Hurd in newsgroup lucky.freebsd.bugs) -TD + + add entrypoint _nc_trace_ttymode(), use this to distinguish the + Ottyb and Nttyb members of terminal (aka cur_term), for tracing. + +20020523 + + correct and simplify logic for lib_pad.c change in 20020518 (reported + by Mike Castle). + +20020518 + + fix lib_pad.c for case of drawing a double-width character which + falls off the left margin of the pad (patch by Kriang Lerdsuwanakij + ) + + modify configure script to work around broken gcc 3.1 "--version" + option, which adds unnecessary trash to the requested information. + + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP + (reported by Ben Decker ). + +20020511 + + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- + character versions as well. + + implement erasewchar(), killwchar() based on erasechar() and + killchar(). + + modify erasechar() and killchar() to return ERR if the value was + VDISABLE. + + correct a bug in wresize() in handling subwindows (based on patch by + Roger Gammans , report by Scott Beck + ). + + improve test/tclock.c by making the second-hand update more often + if gettimeofday() is available. + +20020429 + + workaround for Solaris sed with MKlib_gen.sh (reported by Andy + Tsouladze ). + +20020427 + + correct return-value from getcchar(), making it consistent with + Solaris and Tru64. + + reorder loops that generate makefile rules for different models vs + subsets so configure --with-termlib works again. This was broken by + logic added to avoid duplicate rules in changes to accommodate cygwin + dll's (reported by George.R.Goffe@seagate.com). + + update config.guess, config.sub + +20020421 + + modify ifdef's in write_entry.c to allow use of symbolic links on + platforms with no hard links, e.g., BeOS. + + modify a few includes to allow compile with BeOS, which has stdbool.h + with a conflicting definition for 'bool' versus its OS.h definition. + + amend MKlib_gen.sh to work with gawk, which defines 'func' as an + alias for 'function'. + +20020420 + + correct form of prototype for ripoffline(). + + modify MKlib_gen.sh to test that all functions marked as implemented + can be linked. + +20020413 + + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + + implement wgetn_wstr(). + + implement win_wchnstr(). + + remove redefinition of unget_wch() in lib_gen.c (reported by + Jungshik Shin ). + +20020406 + + modified several of the test programs to allow them to compile with + vendor curses implementations (Solaris, AIX). + +20020323 + + modified test/configure to allow configuring against ncursesw. + + change WACS_xxx definition to use address, to work like Tru64 curses. + +20020317 + + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate + effect of echo/noecho and meta modes. + + add 'A' test to ncurses.c to demonstrate wget_wch() and related + functions. + + add manpage: curs_get_wch.3x + + implement unget_wch(). + + implement wget_wch(). + +20020310 + + regenerated html manpages. + + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + + implement wins_wch(). + + implement win_wch(). + + implement wins_nwstr(), wins_wstr(). + +20020309 + + add manpages: curs_addwstr.3x, curs_winwstr.3x + + implement winnwstr(), winwstr(). + +20020223 + + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + + document wunctrl, key_name. + + implement key_name(). + + remove const's in lib_box.c incorrectly leftover after splitting off + lib_box_set.c + + update llib-lncurses, llib-ncursesw, fix configure script related to these. + +20020218 + + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted + in spurious symlinks on install. + +20020216 + + implement whline_set(), wvline_set(), add manpage curs_border_set. + + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of + box() and box_set() functions. + + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() + given UTF-8 string equivalents of WACS_xxx symbols. + + minor fixes to several manpages based on groff -ww output. + + add descriptions of external variables of termcap interface to + the manpage (report by Bruce Evans ). + > patches by Bernhard Rosenkraenzer: + + correct configure option --with-bool, which was executed as + --with-ospeed. + + add quotes for parameters of --with-bool and --with-ospeed configure + options. + > patch by Sven Verdoolaege (report by Gerhard Haering + ): + + correct typos in definitions of several wide-character macros: + waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, + mvwaddwstr. + + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition + of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris + +20020209 + + implement wide-acs characters for UTF-8 locales. When in UTF-8 + locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c + to demonstrate. + + correct prototype in keybound manpage (noted from a Debian mailing + list item). + +20020202 + + add several cases to the wscanw() example in testcurs.c, showing the + format. + + implement a simple vsscanf() fallback function which uses the %n + conversion to help parse the input data (prompted by discussion with + Albert Chin-A-Young). + + modify mk-1st.awk and test/Makefile.in to add $(LDFLAGS) when making + shared libraries, and to use $(CFLAGS) when linking test programs + (patch by Albert Chin-A-Young). + + add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). + + add entrypoints to resizeterm.c which provide better control over the + process: is_term_resized() and resize_term(). The latter restores + the original design of resizeterm() before KEY_RESIZE was added in + 970906. Do this to accommodate 20010922 changes to view.c, but allow + for programs with their own sigwinch handler, such as lynx (reported + by Russell Ruby ). + +20020127 + + fix a typo in change to mk-1st.awk, which broke the shared-library + makefile rules (reported by Martin Mokrejs). + +20020126 + + update config.guess, config.sub + + finish changes needed to build dll's on cygwin. + + fix a typo in mvwchat() macro (reported by Cy ). + + add configure check for mbstate_t, needed for wide-character + configuration. On some platforms we must include to + define this (reported by Daniel Jacobowitz). + + incorporate some of the changes needed to build dll's on cygwin. + +20020112a + + workaround for awk did not work with mawk, adjusted shell script. + +20020112 + + add Caps.osf1r5, as an example. + + modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without picking + up extraneous trailing blanks (adapted from patch by Daniel + Jacobowitz ). + + modify generated curses.h to ifdef-out prototypes for extensions if + they are disabled, and to define curses_version() as a string in that + case. This is needed to make the programs such as tic build in that + configuration. + + modified generated headers.sh to remove a gzip'd version of the + target file if it exists, in case non-gzip'd manpages are installed + into a directory where gzip'd ones exist. In that case, the latter + would be found. + + corrected a redundant initialization of signal handlers from 20010922 + changes. + + clarified bug-reporting address in terminfo.src (report by John H + DuBois III ). + > several fixes from Robert Joop: + + do not use "-v" option of awk in MKkey_defs.sh because it does not + work with SunOS nawk. + + modify definitions for libutf8 in curses.h to avoid redefinition + warnings for mblen + + quoted references to compiler in shell command in misc/Makefile, in + case it uses multiple tokens. + +20011229 + + restore special case from 20010922 changes to omit SA_RESTART when + setting up SIGWINCH handler, which is needed to allow wgetch() to be + interrupted by that signal. + + update configure macro CF_WITH_PATHLIST, to omit some double quotes + not needed with autoconf 2.52 + + revert configure script to autoconf 2.13 patched with + autoconf-2.13-19990117.patch.gz (or later) + from + ftp://invisible-island.net/autoconf/ + because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 + (report by David Ellement ). This also fixes a + different problem configuring with Mac OS X (reported by Marc Smith + ). + +20011222 + + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from + term.h + + move prototype for _nc_vsscanf() into curses.h.in to omit + HAVE_VSSCANF symbol from curses.h, which was dependent upon the + ncurses_cfg.h file which is not installed. + + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, + to work with broken linker configuration, e.g., cygwin (report by + Robert Joop ). + + make napms() call _nc_timed_wait() rather than poll() or select(), + to work around broken implementations of these on cygwin. + +20011218 + + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete + by Sven Verdoolaege's rewrite of wide-character support. This makes + libncursesw incompatible again, but makes the header files almost the + same as in the narrow-character configuration. + + simplify definitions that combine wide/narrow versions of bkgd, etc., + to eliminate differences between the wide/narrow versions of curses.h + + correct typo in configure macro CF_FUNC_VSSCANF + + correct location of call to _nc_keypad() from 20011215 changes which + prevented keypad() from being disabled (reported by Lars Hecking). + +20011215 + + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions + better, e.g., by adding a 'w' command to create new windows which + may have different keypad() settings. + + corrected logic of keypad() by adding internal screen state to track + whether the terminal's keypad-mode has been set. Use this in + wgetch() to update the keypad-mode according to whether the + associated window's keypad-mode has been set with keypad(). This + corrects a related problem restoring terminal state after handling + SIGTSTP (reported by Mike Castle). + + regenerate configure using patch for autoconf 2.52 + autoconf-2.52-patch.gz + at + ftp://invisible-island.net/autoconf/ + + update config.guess, config.sub from + http://subversions.gnu.org/cgi-bin/viewcvs/config/config/ + + minor changes to quoting in configure script to allow it to work + with autoconf 2.52 + +20011208 + + modify final checks in lib_setup.c for line and col values, making + them independent. + + modify acs_map[] if configure --broken-linker is specified, to make + it use a function rather than an array (prompted by an incorrect + implementation in cygwin package). + + correct spelling of configure option --enable-colorfgbg, which + happened to work if --with-develop was set (noted in cygwin package + for ncurses). + + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop + 6 update 1 C++ 5.2 (patch by Sullivan N Beck ). + + add configure checks to see if ncurses' fallback vsscanf() will + compile either of the special cases for FILE structs, and if not, + force it to the case which simply returns an error (report by + Sullivan N Beck indicates that Solaris 8 with + 64-bits does not allow access to FILE's fields). + + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in + the ncurses library if no better substitute for this can be found + in the C++ runtime. + + modify the build to name dynamic libraries according to the + convention used on OS X and Darwin. Rather than something like + libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. + There are a few additional minor fixes, such as setting the library + version and compatibility version numbers (patch by Jason Evans + ). + + use 'sh' to run mkinstalldirs, to work around problems with buggy + versions of 'make' on OS/2 (report by John Polterak ). + + correct typo in manpage description of curs_set() (Debian #121548). + + replace the configure script existence-check for mkstemp() by one + that checks if the function works, needed for older glibc and + AmigaOS. + +20011201 + + modify script that generates fallbacks.c to compile a temporary + copy of the terminfo source in case the host does not contain all of + the entries requested for fallbacks (request by Greg Roelofs). + + modify configure script to accommodate systems such as Mac OS X whose + header defines a 'bool' type inconsistent with ncurses, + which normally makes 'bool' consistent with C++. Include + from curses.h to force consistent usage, define a new type + NCURSES_BOOL and related that to the exported 'bool' as either a + typedef or definition, according to whether is present + (based on a bug report for tin 1.5.9 by Aaron Adams ). + +20011124 + + added/updated terminfo entries for M$ telnet and KDE konsole -TD + +20011117 + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add putty terminfo entry -TD + + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since + this may not otherwise be defined to make test/view.c compile. + +20011110 + + review/correct several missing/generated items in curses.wide, sorted + the lists to make subsequent diff's easier to track. + +20011103 + + add manual pages for add_wch(), echo_wchar(), getcchar(), + mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + + implement wecho_wchar() + + modify _tracedump() to handle wide-characters by mapping them to '?' + and control-characters to '.', to make the trace file readable. Also + dynamically allocate the buffer used by _tracedump() for formatting + the results. + + modify T_CALLED/T_RETURN macros to ease balancing call/return lines + in a trace by using curly braces. + + implement _nc_viscbuf(), for tracing cchar_t arrays. + + correct trace-calls in setcchar() and getcchar() functions, which + traced the return values but not the entry to each function. + + correct usage message in test/view.c, which still mentioned -u flag. + +20011027 + + modify configure script to allow building with termcap only, or with + fallbacks only. In this case, we do not build tic and toe. + + add configure --with-termpath option, to override default TERMPATH + value of /etc/termcap:/usr/share/misc/termcap. + + cosmetic change to tack: make menu descriptions agree with menu + titles. + +20011020 + + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), + to ensure that if the parameter of wscrl() is larger than the size of + the scrolling region, then the scrolling region will be cleared + (report by Ben Kohlen ). + + add trace/varargs.c, using this to trace parameters in lib_printw.c + + implement _tracecchar_t2() and _tracecchar_t(). + + split-out trace/visbuf.c + + correct typo in lib_printw.c changes from 20010922 (report by Mike + Castle). + +20011013 + + modify run_tic.sh to check if the build is a cross-compile. In that + case, do not use the build's tic to install the terminfo database + (report by Rafael Rodriguez Velilla ). + + modify mouse click resolution so that mouseinterval(-1) will disable + it, e.g., to handle touchscreens via a slow connection (request by + Byron Stanoszek ). + + correct mouseinterval() default value shown in curs_mouse.3x + + remove conflicting definition of mouse_trafo() (reported by Lars + Hecking, using gcc 2.95.3). + +20011001 + + simpler fix for signal_name(), to replace the one overlooked in + 20010929 (reported by Larry Virden). + +20010929 + + add -i option to view.c, to test ncurses' check for non-default + signal handler for SIGINT, etc. + + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun + ). + + modify tset to restore original I/O modes if an error is encountered. + Also modify to use buffered stderr consistently rather than mixing + with write(). + + change signal_name() function to use if-then-else rather than case + statement, since signal-values aren't really integers (reported by + Larry Virden). + + add limit checks in wredrawln(), fixing a problem where lynx was + repainting a pad which was much larger than the screen. + +20010922 + + fix: PutRange() was counting the second part of a wide character as + part of a run, resulting in a cursor position that was one too far + (patch by Sven Verdoolaege). + + modify resizeterm() to not queue a KEY_RESIZE if there was no + SIGWINCH, thereby separating the two styles of SIGWINCH handling + in test/view.c + + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + + eliminate several static buffers in the terminfo compiler, using + allocated buffers. + + modify MKkeyname.awk so that keyname() does not store its result into + a static buffer that is overwritten by the next call. + + reorganize the output of infocmp -E and -e options to compile cleanly + with gcc -Wwrite-strings warnings. + + remove redefinition of chgat/wchgat/mvwchgat from curses.wide + +20010915 + + add label to test/view.c, showing the name of the last key or signal + that made the screen repaint, to make it clearer when a sigwinch + does this. + + use ExitProgram() consistently in the test-programs to make it + simpler to test leaks with dmalloc, etc. + + move hashtab static data out of hashmap.c into SCREEN struct. + + make NO_LEAK code compile with revised WINDOWLIST structs. + +20010908 + + modify tgetent() to check if exit_attribute_mode resets the alternate + character set, and if so, attempt to adjust the copy of the termcap + "me" string which it will return to eliminate that part. In + particular, 'screen' would lose track of line-drawing characters + (report by Frederic L W Meunier <0@pervalidus.net>, analysis by + Michael Schroeder). + +20010901 + + specify DOCTYPE in html manpages. + + add missing macros for several "generated" functions: attr_get(), + attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and + mouse_trafo(). + + modify view.c to agree with non-experimental status of ncurses' + sigwinch handler: + + change the sense of the -r option, making it default to ncurses' + sigwinch handler. + + add a note explaining what functions are unsafe in a signal + handler. + + add a -c option, to set color display, for testing. + + unset $data variable in MKterminfo.sh script, to address potential + infinite loop if shell malfunction (report by Samuel Mikes + , for bash 2.05.0 on a Linux 2.0.36 system). + + change kbs in mach terminfo entries to ^? (Marcus Brinkmann + ). + + correct logic for COLORFGBG environment variable: if rxvt is compiled + with xpm support, the variable has three fields, making it slightly + incompatible with itself. In either case, the background color is + the last field. + +20010825 + + move calls to def_shell_mode() and def_prog_mode() before loop with + callbacks in lib_set_term.c, since the c++ demo otherwise initialized + the tty modes before saving them (patch by John David Anglin + ). + + duplicate logic used to initialize trace in newterm(), in initscr() + to avoid confusing trace of initscr(). + + simplify allocation of WINDOW and WINDOWLIST structs by making the + first a part of the second rather than storing a pointer. This saves + a call to malloc for each window (discussion with Philippe Blain). + + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe + Blain). + + modify c++/Makefile.in to accommodate archive programs that are + different for C++ than for C, and add cases for vendor's C++ + compilers on Solaris and IRIX (report by Albert Chin-A-Young). + + correct manpage description of criteria for deciding if the terminal + supports xterm mouse controls. + + add several configure script options to aid with cross-compiling: + --with-build-cc, --with-build-cflags, --with-build-ldflags, and + --with-build-libs (request by Greg Roelofs). + + change criteria for deciding if configure is cross-compiling from + host/build mismatch to host/target mismatch (request by Greg Roelofs + ). + + correct logic for infocmp -e and -E options which writes the data for + the ext_Names[] array. This is needed if one constructs a fallback + table for a terminfo entry which uses extended termcap names, e.g., + AX in a color xterm. + + fix undefined NCURSES_PATHSEP when configure --disable-database + option is given. + +20010811 + + fix for VALID_BOOLEAN() macro when char is not signed. + + modify 'clean' rule for C++ binding to work with Sun compiler, which + caches additional information in a subdirectory of the objects. + + added llib-ncursesw. + +20010804 + + add Caps.keys example for experimental extended function keys + (adapted from a patch by Ilya Zakharevich). + + correct parameter types of vidputs() and vidattr() to agree with + header files (report by William P Setzer). + + fix typos in several man-pages (patch by William P Setzer). + + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure + macro, which made ncurses C++ binding fail to build with other + C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + + workaround for bug in HPUX 11.x C compiler: add a blank after + NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + + ignore blank lines in Caps* files in MKkey_defs.sh script (report by + Albert Chin-A-Young). + + correct definition of key_end in Caps.aix4, which left KEY_END + undefined (report by Albert Chin-A-Young). + + remove a QNX-specific fallback prototype for vsscanf(), which is + obsolete with QNX RTP. + + review/fix some of the T() and TR() macro calls, having noticed that + there was no data for delwin() in a trace of dialog because there was + no returnVoid call for wtimeout(). Also, traces in lib_twait.c are + now selected under TRACE_IEVENT rather than TRACE_CALLS. + +20010728 + + add a _nc_access() check before opening files listed via $TERMPATH. + + using modified man2html, regenerate some of the html manpages to fix + broken HREF's where the link was hyphenated. + +20010721 + + add some limit/pointer checks to -S option of tputs. + + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries + (Benjamin C W Sittler). + + add a note in curs_termcap.3x regarding a defect in the XSI + description of tgetent (based on a discussion with Urs Jansen + regarding the HPUX 11.x implementation, whose termcap interface is + not compatible with existing termcap programs). + + modify manhtml rule in dist.mk to preserve copyright notice on the + generated files, as well as to address HTML style issues reported by + tidy and weblint. Regenerated/updated corresponding html files. + + comment out use of Protected_Character and related rarely used + attributes in ncurses Ada95 test/demo to compile with wide-character + configuration. + +20010714 + + implement a simple example in C++ demo to test scanw(). + + corrected stdio function used to implement scanw() in cursesw.cc + + correct definition of RemAttr() macro from 20010602 changes, which + caused C++ SillyDemo to not show line-drawing characters. + + modify C++ binding, adding getKey() which can be overridden by user + to substitute functions other than getch() for keyboard processing + of forms and menus (patch by Juergen Pfeifer). + +20010707 + + fix some of the trace calls which needed modification to work with + new wide-character structures. + + modify magic-cookie code in tty_update.c to compile with new + wide-character structures (report by ). + + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if + compiling for wide-character configuration. + + make addwnstr() handle non-spacing characters (patch by Sven + Verdoolaege). + +20010630 + + add configure check to define _GNU_SOURCE, needed to prop up glibc + header files. + + split-out include/curses.wide to solve spurious redefinitions caused + by defining _GNU_SOURCE, and move includes for before + to work around misdefinition of ERR in glibc 2.1.3 header + file. + + extended ospeed change to NetBSD and OpenBSD -TD + + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it + work properly for termcap applications (patch by Andrey A Chernov). + +20010623 + + correct an overlooked CharOf/UChar instance (reports by Eugene Lee + , Sven Verdoolaege). + + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) + +20010618 + + change overlooked several CharOf/UChar instances. + > several patches from Sven Verdoolaege: + + correct a typo in wunctrl(), which made it appear that botwc() was + needed (no such function: use btowc()). + + reimplement wide-character demo in test/view.c, using new functions. + + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). + +20010616 + + add parentheses in macros for malloc in test.priv.h, fixes an + expression in view.c (report by Wolfgang Gutjahr ). + + add Caps.uwin, as an example. + + change the way curses.h is generated, making the list of function + key definitions extracted from the Caps file. + + add #undef's before possible redefinition of ERR and OK in curses.h + + modify logic in tic, toe, tput and tset which checks for basename of + argv[0] to work properly on systems such as OS/2 which have + case-independent filenames and/or program suffixes, e.g., ".ext". + +20010609 + + add a configure check, if --enable-widec is specified, for putwc(), + which may be in libutf8. + + remove some unnecessary text from curs_extend.3x and + default_colors.3x which caused man-db to make incorrect symbolic + links (Debian bug report #99550). + + add configure check if cast for _IO_va_list is needed to compile + C++ vscan code (Debian bug report #97945). + > several patches from Sven Verdoolaege: + + correct code that used non-standard auto-initialization of a struct, + which gcc allows (report by Larry Virden). + + use putwc() in PUTC() macro. + + make addstr() work for the special case where the codeset is + non-stateful (eg. UTF-8), as well as stateful codesets. + +20010603 + + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes + from 20010602 (report by Mike Castle). + +20010602 + + modify mvcur() to avoid emitting newline characters when nonl() mode + is set. Normally this is not a problem since the actual terminal + mode is set to suppress nl/crlf translations, however it is useful to + allow the caller to manipulate the terminal mode to avoid staircasing + effects after spawning a process which writes messages (for lynx + 2.8.4) -TD + > several patches from Sven Verdoolaege : + + remove redundant type-conversion in fifo_push() + + correct definition of addwstr() macro in curses.h.in + + remove _nc_utf8_outch() + + rename most existing uses of CharOf() to UChar(), e.g., where it is + used to prevent sign-extension in ctype macros. + + change some chtype's to attr_t's where the corresponding variables + are used to manipulate attributes. + + UpdateAttr() was applied to both attributes (attr_t) and characters + (chtype). Modify macro and calls to it to make these distinct. + + add CharEq() macro, use in places where wide-character configuration + implementation uses a struct for cchar_t. + + moved struct ldat into curses.priv.h, to hide implementation details. + + change CharOf() macro to use it for masking A_CHARTEXT data from + chtype's. + + add L() macro to curses.priv.h, for long-character literals. + + replace several assignments from struct ldat entries to chtype or + char values with combinations of CharOf() and AttrOf() macros. + + add/use intermediate ChAttrOf() and ChCharOf() macros where we know + we are using chtype data. + + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() + and SetAttr(). + + add/use SetChar() macro, to change a cchar_t based on a character and + attributes. + + convert most internal use of chtype to NCURSES_CH_T, to simplify use + of cchar_t for wide-character configuration. Similarly, use ARG_CH_T + where a pointer would be more useful. + + add stubs for tracing cchar_t values. + + add/use macro ISBLANK() + + add/use constructors for cchar_t's: NewChar(), NewChar2(). + + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate + passing cchar_t's by address. + + add/use PUTC_DATA, PUTC() macros. + + for wide-character configuration, move the window background data to + the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED + is defined or not, the offsets in the struct will not change. + + modify addch() to work with wide-characters. + + mark several wide-character functions as generated in curses.h.in + + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), + wborder_set() and waddnwstr(). + +20010526 + + add experimental --with-caps=XXX option to customize to similar + terminfo database formats such as AIX 4.x + + add Caps.aix4 as an example. + + modify Caps to add columns for the the KEY_xxx symbols. + + modify configure --with-widec to suppress overwrite of libcurses.so + and curses.h + + add checks to toe.c to avoid being confused by files and directories + where we would expect the reverse, e.g., source-files in the + top-level terminfo levels as is the case for AIX. + +20010519 + + add top-level 'depend' rule for the C sources, assuming that the + makedepend program is available. As a side-effect, this makes + the generated sources, as in "make sources" (prompted by a report + by Mike Castle that "make -j" fails because the resulting parallel + processes race to generate ncurses/names.c). + + modify configure script so that --disable-overwrite option's action + to add a symbolic link for libcurses applies to the static library as + well as the shared library when both are configured (report by Felix + Natter ). + + add ELKS terminfo entries (Federico Bianchi + ) + + add u6 (CSR) to Eterm (Michael Jennings). + +20010512 + + modify test/ncurses.c to work with xterm-256color, which has fewer + color pairs than colors*colors (report by David Ellement + ). + +20010505 + + corrected screen.xterm-xfree86 entry. + + update comment in Caps regarding IBM (AIX) function-key definitions. + +20010421 + + modify c++/Makefile.in to link with libncurses++w.a when configured + for wide-characters (patch by Sven Verdoolaege). + + add check in _nc_trace_buf() to refrain from freeing a null pointer. + + improve CF_PROG_INSTALL macro using CF_DIRNAME. + + update config.guess, config.sub from autoconf 2.49e (alpha). + +20010414 + + add secondary check in tic.c, similar_sgr() to see if the reason + for mismatch was that the individual capabilities used a time-delay + while sgr did not. Used this to cleanup mismatches, e.g., in vt100, + and remove time-delay from Apple_Terminal entries. + + add Apple_Terminal terminfo entries (Benjamin C W Sittler + ). + + correct definitions of shifted editing keys for xterm-xfree86 -TD + + fix a bug in test/bs.c from 20010407 (patch by Erik Sigra). + + prevent relative_move() from doing an overwrite if it detects 8-bit + characters when configured for UTF-8 (reported by Sven Verdoolaege + ). + +20010407 + + add configure checks for strstream.h vscan function, and similar + stdio-based function which may be used in C++ binding for gcc 3.0 + (reports by George Goffe, Lars Hecking, Mike Castle). + + rewrite parts of configure.in which used changequote(). That feature + is broken in the latest autoconf alphas (e.g., 2.49d). + + 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 ): + + no ships were ever placed in the last row or in the last column. + This made the game very easy to win, because you never had to waste + any shots there, but the computer did. + + the squares around a sunken ship that belonged to the player were not + displayed as already hit by the computer, like it does for the + player. + +20010331 + + add some examples of customizing screen's terminfo: + screen.xterm-xfree86, screen.xterm-r6, screen.teraterm -TD + + modify screen's terminfo entry to match the khome/kend in screen + 3.09.08 (Debian bug report #92215). + + correct a memory leak in forms library (report by Stefan Vogtner + , patch by Juergen Pfeifer). + +20010324 + + change symbols used to guard against repeated includes to begin + consistently with "NCURSES_" rather than a leading underscore. There + are other symbols defined in the header files which begin with a + leading underscore, but they are part of the legacy interface. + + reorder includes in c++ binding so that rcs identifiers can be + compiled-in. + + add .cc.ii rule to c++ makefile, to get preprocessor output for + debugging. + + correct configure script handling of @keyword@ substitutions when the + --with-manpage-renames option is given (cf: 20000715, fixes Debian + bug #89939). + + report stack underflow/overflow in tparm() when tic -cv option is + given. + + remove spurious "%|" operator from xterm-xfree86 terminfo entry, + (reported by Adam Costello , Debian bug #89222). + +20010310 + + cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc + 2.95.2, and correcting some conflicting color pair initializations. + + add missing copyright notice for cursesw.h + + review, make minor fixes for use of '::' for referring to C-language + interface from C++ binding. + + modify configure check for g++ library slightly to accommodate + nonstandard version number, e.g., -2.7 (report by Ronald Ho + ). + + add configure check for c++ header, replace hardcoded + ifdef. + + workaround for pre-release of gcc 3.0 libstdc++, which has dropped + vscan from strstreambuf to follow standard, use wrapper for C vscanf + instead (report by George Goffe and Matt Taggart + , fixes Debian . + +20010303 + + modify interface of _nc_get_token() to pass 'silent' parameter to it, + to make quieter loading of /etc/termcap (patch by Todd C Miller). + + correct a few typos in curs_slk.3x and curs_outopts.3x manpages + (patch by Todd C Miller). + +20010224 + + compiler-warning fixes (reported by Nelson Beebe). + +20010210 + + modify screen terminfo entry to use new 3.9.8 feature allowing xterm + mouse controls -TD + +20010203 + + broaden patterns used to match OS/2 EMX in configure script to cover + variant used in newer config.guess/config.sub + + remove changequote() calls from configure script, since this feature + is broken in the autoconf 2.49c alpha, maintainers decline to fix. + + remove macro callPutChar() from tty_update.c, since this is no longer + needed (reported by Philippe Blain). + + add a null-pointer check in tic.c to handle the case when the input + file is really empty. Modify the next_char() function in comp_scan.c + to allow arbitrarily long lines, and incidentally supply a newline to + files that do not end in a newline. These changes improve tic's + recovery from attempts to read binary files, e.g., its output from + the terminfo database (reported by Bernhard Rosenkraenzer). + +20010127 + + revert change to c++/demo.cc from 20001209, which changed definition + of main() apparently to accommodate cygwin linker, but broke the demo + program. + + workaround for broken egcs 2.91.66 which calls member functions + (i.e., lines() and colors() of NCursesWindow before calling its + constructor. Add calls to initialize() in a few constructors which + did not do this already. + + use the GNAT preprocessor to make the necessary switch between TRACE + and NO_TRACE configurations (patch by Juergen Pfeifer). + > patches by Bernhard Rosenkraenzer: + + modify kterm terminfo entry to use SCS sequence to support alternate + character set (it does not work with SI/SO). + + --with-ospeed=something didn't work. configure.in checked for a + $enableval where it should check for $withval. Also, + ncurses/llib-lncurses still had a hardcoded short. + +20010114 + + correction to my merge of Tom Riddle's patch that broke tic in some + conditions (reported by Enoch Wexler ) -TD + +20010113 + + modify view.c to test halfdelay(). Like other tests, this recognizes + the 's' and space commands for stopping/starting polled input, shows + a freerunning clock in the header. If given a parameter to 's', that + makes view.c use halfdelay() with that parameter rather than + nodelay(). + + fix to allow compile with the experimental configure option + --disable-hashmap. + + modify postprocess_termcap() to avoid overwriting key_backspace, + key_left, key_down when processing a non-base entry (report/patch by + Tom Riddle). + + modify _nc_wrap_entry(), adding option to reallocate the string + table, needed in _nc_merge_entry() when merging termcap entries. + (adapted from report/patch by Tom Riddle ). + + modify a few configure script macros to keep $CFLAGS used only for + compiler options, preprocessor options in $CPPFLAGS. + +20001230 + + correct marker positions in lrtest.c after receiving a sigwinch. + + fix ifdef's in ncurses.c to build against pre-5.2 for testing. + + fixes to tclock for resizing behavior, redundant computation (report + and patch by A M Kuchling ). + +20001216 + + improved scoansi terminfo entry -TD + + modify configure script and makefile in Ada95/src to compile a stub + for the trace functions when ncurses does not provide those. + +20001209 + + 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'). + +20001202 + + correct prototypes for some functions in curs_termcap.3x, matching + termcap.h, which matches X/Open. + > patch by Juergen Pfeifer: + + a revised version of the Ada enhancements sent in by "H. + Nanosecond", aka Eugene V Melaragno . This + patch includes + - small fixes to the existing ncurses binding + - addition of some more low-level functions to the binding, including + termcap and terminfo functions + - An Ada implementation of the "ncurses" test application originally + written in C. + +20001125 + + modify logic in lib_setup.c to allow either lines or columns value + from terminfo to be used if the screen size cannot be determined + dynamically rather than requiring both (patch by Ehud Karni + ). + + add check in lib_tgoto.c's is_termcap() function to reject null or + empty strings (reported by Valentin Nechayev to + freebsd-bugs). + + add definition from configure script that denotes the path-separator, + which is normally a colon. The path-separator is a semicolon on + OS/2 EMX and similar systems which may use a colon within pathnames. + + alter logic to set default for --disable-overwrite option to set it + to 'yes' if the --prefix/$prefix value is not /usr/local, thereby + accommodating the most common cause of problems: gcc's nonstandard + search rules. Other locations such as /usr/local/ncurses will + default to overwriting (report by Lars Hecking ). + +20001118 + + modify default for --disable-overwrite configure option to disable + if the --prefix or $prefix value is not /usr. + + add cygwin to systems for which ncurses is installed by default into + /usr rather than /usr/local. + +20001111 + + minor optimization in comp_error.c and lib_termname.c, using + strncat() to replace strncpy() (patch by Solar Designer). + + add a use_terminfo_vars() check for $HOME/.termcap, and check for + geteuid() to use_terminfo_vars() (patch by Solar Designer + ). + + improved cygwin terminfo entry, based on patch by + . + + modify _nc_write_entry() to allow for the possibility that linking + aliases on a filesystem that ignores case would not succeed because + the source and destination differ only by case, e.g., NCR260VT300WPP0 + on cygwin (report by Neil Zanella). + + fix a typo in the curs_deleteln.3x man page (patch by Bernhard + Rosenkraenzer ). + +20001104 + + add configure option --with-ospeed to assist packagers in transition + to 5.3 change to ospeed type. + + add/use CharOf() macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., Solaris. + + change trace output to binary format. + + correct a missing quote adjustment in CF_PATH_SYNTAX autoconf + macro, for OS/2 EMX configuration. + + rearrange a few configure macros, moving preprocessor options to + $CPPFLAGS (a now-obsolete version of autoconf did not consistently + use $CPPFLAGS in both the compile and preprocessor checks). + + add a check in relative_move() to guard against buffer overflow in + the overwrite logic. + +20001028 + + add message to configure script showing g++ version. + + resync config.guess, config.sub + + modify lib_delwin.c, making it return ERR if the window did not exist + (suggested by Neil Zanella). + + add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this + to test/review ncurses library. (Would use lclint, but it doesn't + work). + + reorganized knight.c to avoid forward references. Correct screen + updates when backtracking, especially to the first cell. Add F/B/a + commands. + 20001021 5.2 release for upload to ftp.gnu.org + update generated html files from manpages. + modify dist.mk to use edit_man.sh to substitute autoconf'd variables @@ -82,7 +1281,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. (see assume_default_colors()). + rename configure option --enable-hashmap --disable-hashmap, and reorder the configure options, splitting the experimental and - development + development + add configure option --disable-root-environ, which tells ncurses to disregard $TERMINFO and similar environment variables if the current user is root, or running setuid/setgid (based on discussion with @@ -95,7 +1294,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. longer than 10000 (report by Jouko Pynnonen). + rewrote limit checks in lib_mvcur.c using new functions _nc_safe_strcat(), etc. Made other related changes to check lengths - used for strcat/strcpy (report by Jouko Pynnonen ). + used for strcat/strcpy (report by Jouko Pynnonen + ). 20000930 + modify several descriptions, including those for setaf, setab, in @@ -118,7 +1318,7 @@ 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. + save/restore bracketed the sequence for resetting video attributes. The cursor restore would undo that (from a NetBSD bug report by John Hawkinson ). + using parameter check added to tic, corrected 27 typos in @@ -138,6 +1338,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the expected number of parameters. + add error checking to infocmp's -v and -m options to ensure that the option value is indeed a number. + + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH + handler is setup. Separated the old/new sigaction data for SIGTSTP + from the other signals. 20000917 + add S0, E0 extensions to screen's terminfo entry, which is another @@ -161,7 +1364,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. which had the effect of ignoring p9 in set_attributes (sgr), breaking alternate character set (reported by Piotr Majka ). + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile - with Sun WorkShop compilers since these tokens were empty (cf: + with Sun WorkShop compilers since these tokens were empty (cf: 20000902, reported by Albert Chin-A-Young). 20000909 @@ -182,8 +1385,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add private entrypoint _nc_basename(), use to consolidate related code in progs, as well as accommodating OS/2 EMX pathnames. + remove NCURSES_CONST line from edit_cfg.sh to compensate for its - removal (except via AC_SUBST) from configure.in, making --enable-const - work again (reported by Juergen Pfeifer). + removal (except via AC_SUBST) from configure.in, making + --enable-const work again (reported by Juergen Pfeifer). + regen'd configure to pick up "hpux*" change from 20000902. 20000902 @@ -461,7 +1664,7 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 20000513 + the tack program knows how to use smcup and rmcup but the "show caps that can be tested" feature did not reflect this knowledge. Correct - the display in the menu tack/test/edit/c (patch by Daniel Weaver). + the display in the menu tack/test/edit/c (patch by Daniel Weaver). + xterm-16color does allow bold+colors, removed ncv#32 from that terminfo entry. @@ -469,8 +1672,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which broke check for screen's AX capability (reported by Valeriy E Ushakov ). - + change man2html rule in dist.mk to workaround bug in some man-programs - that ignores locale when rendering hyphenation. + + change man2html rule in dist.mk to workaround bug in some + man-programs that ignores locale when rendering hyphenation. + change web- and ftp-site to dickey.his.com 20000429 @@ -1021,7 +2224,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 990821 pre-release + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + minor corrections to beterm terminfo entry. - + modify lib_setup.c to reject values of $TERM which have a '/' in them. + + modify lib_setup.c to reject values of $TERM which have a '/' in + them. + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more than one is on BeOS. That would break a switch statement. + add configure macro CF_LINK_FUNCS to detect and work around BeOS's @@ -1047,11 +2251,11 @@ Changes since 1.9.9e are recorded by Thomas Dickey. wrefresh(). Whenever a window changes its background attribute to something different than newscr's background attribute, the whole window is touched to force a copy to newscr. This is an unwanted - side-effect of wrefresh() and it is actually not necessary. A changed - background attribute affects only further outputs of background it - doesn't mean anything to the current content of the window. So there - is no need to force a copy. (reported by Frank Heckenbach - ). + side-effect of wrefresh() and it is actually not necessary. A + changed background attribute affects only further outputs of + background it doesn't mean anything to the current content of the + window. So there is no need to force a copy. (reported by Frank + Heckenbach ). + an upward compatible enhancement of the NCursesPad class in the C++ binding. It allows one to add a "viewport" window to a pad and then to use panning to view the pad through the viewport window. @@ -1098,7 +2302,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. settings in cur_term, which happens when curses and termcap calls are mixed (from report by Bjorn Helgaas ). + suppress initialization of key-tries in _nc_keypad() if we are only - disabling keypad mode, e.g., in endwin() called when keypad() was not. + disabling keypad mode, e.g., in endwin() called when keypad() was + not. + modify the Ada95 makefile to ensure that always the Ada files from the development tree are used for building and not the eventually installed ones (patch by Juergen Pfeifer). @@ -1156,8 +2361,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add a null-pointer check for SP in lib_vidattr.c to logic that checks for magic cookies. + improve fallback declaration of 'bool' when the --without-cxx option - is given, by using a 'char' on i386 and related hosts (from discussion - with Alexander Lukyanov). + is given, by using a 'char' on i386 and related hosts (from + discussion with Alexander Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by @@ -1208,7 +2413,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. > patch by Juergen Pfeifer: + modify menu creation to not inherit status flag from the default menu which says that the associated marker string has been allocated and - should be freed (bug reported by Marek Paliwoda" ) + should be freed (bug reported by Marek Paliwoda" + ) 990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + minor fixes to xterm-xfree86 terminfo entry - TD. @@ -1468,7 +2674,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Otherwise, a relative path in $TERMINFO would confuse tic (from a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). - + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes + + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur + changes + add Mathew Vernon's mach console entries to terminfo.src + more changes, moving functions, as part of Alexander's restructuring. + modify configure script for GNU/Hurd share-library support, introduce @@ -1592,8 +2799,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. with --srcdir option. + modify infocmp "-r" option to remove limit on formatted termcap output, which makes it more like Solaris' version. - + modify captoinfo to treat no-argument case more like Solaris' version, - which uses the contents of $TERMCAP as the entry to format. + + modify captoinfo to treat no-argument case more like Solaris' + version, which uses the contents of $TERMCAP as the entry to format. + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty (patch by Alexander V Lukyanov). @@ -1664,8 +2871,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + improve integration of hashmap scrolling code, by adding oldhash and newhash data to SP struct. + invoke del_curterm from delscreen. - + modify del_curterm to set cur_term to null if it matches the function's - parameter which is deleted. + + modify del_curterm to set cur_term to null if it matches the + function's parameter which is deleted. + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and exit_insert_mode combination, adjusting InsCharCost to check enter_insert_mode, exit_insert_mode and insert_padding. Add @@ -1673,8 +2880,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. to the SP struct. 980912 - + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for consistent - treatment. + + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for + consistent treatment. + modify ncurses to restore output to unbuffered on endwin, and resume buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + corrected HTML version numbers (according to the W3C validator, they @@ -1714,8 +2921,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Jaeger). 980815 - + modify lib_setup.c to eliminate unneeded include of when - termios is not used (patch by Todd C Miller). + + modify lib_setup.c to eliminate unneeded include of + when termios is not used (patch by Todd C Miller). + add function _nc_doalloc, to ensure that failed realloc calls do not leak memory (reported by Todd C Miller). + improved ncsa-telnet terminfo entry. @@ -1764,8 +2971,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. the search path to /usr/lib (reported by Dan Nelson). + add -soname option when building shared libraries on OpenBSD 2.x (request by QingLong). - + add configure options --with-manpage-format and --with-manpage-renames - (request by QingLong). + + add configure options --with-manpage-format and + --with-manpage-renames (request by QingLong). + correct conversion of CANCELLED_NUMERIC in write_object(), which was omitting the high-order byte, producing a 254 in the compiled terminfo. @@ -2087,7 +3294,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + workaround a quoting problem on SunOS with tar-copy.sh + correct init_pair() calls in worm.c to work when use_default_colors() is not available. - + include in CF_SYS_TIME_SELECT to work with FreeBSD 2.1.5 + + include in CF_SYS_TIME_SELECT to work with FreeBSD + 2.1.5 + add ncv capability to FreeBSD console (cons25w), making reverse work with color. + correct sense of configure-test for sys/time.h inclusion with @@ -2098,8 +3306,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + remove shared-library loader flags from test/Makefile.in, etc. + simplify test/configure.in using new version of autoconf to create test/ncurses_cfg.h - + suppress suffix rules in test/Makefile.in, provide explicit dependency - to work with --srcdir option and less capable 'make' programs. + + suppress suffix rules in test/Makefile.in, provide explicit + dependency to work with --srcdir option and less capable 'make' + programs. > adapted from patch for QNX by Xiaodan Tang: + initialize %P and %g variables set/used in tparm, and also ensure that empty strings don't return a null result from tparam_internal @@ -2352,7 +3561,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. NeXT (reported by Francisco A. Tomei Torres). 971101 - + force mandatory padding in bell and flash_screen, as specified in XSI. + + force mandatory padding in bell and flash_screen, as specified in + XSI. + don't allow padding_baud_rate to override mandatory delays (reported by Daniel Weaver). + modify delay_output() to use _nc_timed_wait() if no baudrate has been @@ -2486,8 +3696,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + add configure script to generate c++/etip.h + add configure --with-develop option, to enable by default most of the experimental options (requested by Alexander V. Lukyanov). - + rename 'deinstall' to 'uninstall', following GNU convention (suggested - by Alexander V. Lukyanov). + + rename 'deinstall' to 'uninstall', following GNU convention + (suggested by Alexander V. Lukyanov). > patches by Alexander V. Lukyanov: + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last line of the screen, since carriage return will not cause a newline. @@ -2580,7 +3790,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by Chris Johns ) > patches by Juergen Pfeifer: - + simplified, made minor corrections to Ada95 binding to form fieldtype. + + simplified, made minor corrections to Ada95 binding to form + fieldtype. + The C++ binding has been enhanced: + Improve NCursesWindow class: added additional methods to cover more ncurses functionality. Make refresh() and noutrefresh() @@ -2985,7 +4196,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. - + rewrote the newdemo banner so it's readable (reported by Hugh Daniel). + + rewrote the newdemo banner so it's readable (reported by Hugh + Daniel). + tidy up exit from hashtest (reported by Hugh Daniel). + restore check for ^Q in ncurses 'g' test broken in 970510 (reported by Hugh Daniel) @@ -3049,8 +4261,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 970517 + suppress check for pre-existing ncurses header if the --prefix option is specified. - + add configure options "--with-system-type" and "--with-system-release" - to assist in checking the generated makefiles. + + add configure options "--with-system-type" and + "--with-system-release" to assist in checking the generated + makefiles. + add configure option "--enable-rpath" to allow installers to specify that programs linked against shared libraries will have their library path embedded, allowing installs into nonstandard locations. @@ -3089,12 +4302,13 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + modify ncurses 'g' test to allow mouse input + modify default xterm description to include mouse. + modify configure script to add -Wwrite-strings if gcc warnings are - enabled while configuring --enable-const (and fixed related warnings). + enabled while configuring --enable-const (and fixed related + warnings). + add toggle, status display for keypad mode to ncurses 'g' test to verify that keypad and scrollok are not inherited from parent window during a call to newwin. - + correction to MKexpanded.sh to make it work when configure --srcdir is - used (reported by H.J.Lu). + + correction to MKexpanded.sh to make it work when configure --srcdir + is used (reported by H.J.Lu). + revise test for bool-type, ensuring that it checks if builtin.h is available before including it, adding test for sizeof(bool) equal to sizeof(short), and warning user if the size cannot be determined @@ -3114,8 +4328,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. 970505 4.1 pre-release + regenerate the misc directory html dumps without the link list, which is not useful. - + correct dependency in form directory makefile which caused unnecessary - recompiles. + + correct dependency in form directory makefile which caused + unnecessary recompiles. + correct substitution for ABI_VERSION in test-makefile + modify install rules for shared-library targets to remove the target before installing, since some install programs do not properly handle @@ -3223,8 +4437,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + check for C++ builtin.h header + correct computation of absolute-path for $INSTALL that dropped "-c" parameter from the expression. - + rename config.h to ncurses_cfg.h to avoid naming-conflict when ncurses - is integrated into larger systems (from diffs by H.J.Lu for libc). + + rename config.h to ncurses_cfg.h to avoid naming-conflict when + ncurses is integrated into larger systems (from diffs by H.J.Lu for + libc). + correct inequality in lib_doupdate.c that caused a single-char to not be updated when the char on the right-margin was not blank, idcok() was true (patch by Alexander V. Lukyanov 970124, also reported by @@ -3595,7 +4810,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). + correct limit-checking in wenclose() (Juergen Pfeifer). - + correction to Peter Wemm's newwin change (Thomas Fehr ). + + correction to Peter Wemm's newwin change (Thomas Fehr + ). + corrections to logic that combines colors and attributes; they must not be OR'd (Juergen Pfeifer, extending from report/patch by Rick Marshall). @@ -3820,8 +5036,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. Ju"rgen Fluk ) + corrected calls on _nc_render so that background character is set as per XSI. - + corrected wbkgdset macro (XSI allows background character to be null), - and tests that use it. + + corrected wbkgdset macro (XSI allows background character to be + null), and tests that use it. + more corrections to terminfo (xterm & rxvt) + undid change to mcprint prototype (cannot use size_t in curses.h because not all systems declare it in the headers that we can safely @@ -3889,8 +5105,9 @@ Changes since 1.9.9e are recorded by Thomas Dickey. msgwin needed scrollok set. + corrected last change to IDcTransformLine logic to avoid conflict between PutRange and InsStr - + modified run_tic.sh to not use /usr/tmp (reported by David MacKenzie), - and further revised it and aclocal.m4 to use $TMPDIR if set. + + modified run_tic.sh to not use /usr/tmp (reported by David + MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if + set. + corrected off-by-one in RoomFor call in read_entry.c 960622 - snapshot @@ -3958,8 +5175,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + corrected missing INSTALL_DATA in misc/Makefile.in + flush output when changing cursor-visibility (Rick Marshall) - + fix a minor bug in the _nc_ripoff() routine and improve error checking - when creating the label window (Juergen Pfeifer). + + fix a minor bug in the _nc_ripoff() routine and improve error + checking when creating the label window (Juergen Pfeifer). + enhancement to the control over the new PC-style soft key format. allow caller now to select whether or not one wants to have the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). @@ -4062,7 +5279,8 @@ Changes since 1.9.9e are recorded by Thomas Dickey. + autogenerate development header-dependencies (config.h, *.priv.h) + corrected single-column formatting of "use=" (e.g., in tic) + modify tic to read full terminfo-names - + corrected divide-by-zero that caused hang (or worse) when redirecting output + + corrected divide-by-zero that caused hang (or worse) when redirecting + output + modify tic to generate directories only as-needed (and corrected instance of use of data from function that had already returned). @@ -4271,10 +5489,10 @@ Changes since 1.9.9e are recorded by Thomas Dickey. takes a trace mask argument. The trace masks, defined in curses.h, are as follows: - #define TRACE_DISABLE 0x00 /* turn off tracing */ - #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ - #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ - #define TRACE_MAXIMUM 0x0f /* maximum trace level */ + #define TRACE_DISABLE 0x00 /* turn off tracing */ + #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ + #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ + #define TRACE_MAXIMUM 0x0f /* maximum trace level */ More trace masks may be added, or these may be changed, in future releases. * The pad code has been improved and the pad test code in test/ncurses.c has @@ -4562,7 +5780,7 @@ available separately from netcom.com:pub/zmbenhal/ * New scrolling code. * fixed bug that reversed the sense of nl() and nonl(). -#### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### +#### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### * more support for color and graphics see test/ for examples. * fixed various files to allow correct update after shelling out. * more fixes for updates. diff --git a/README.emx b/README.emx index 3f3d526a..0605e67b 100644 --- a/README.emx +++ b/README.emx @@ -1,4 +1,4 @@ --- $Id: README.emx,v 1.4 2000/09/16 19:28:28 tom Exp $ +-- $Id: README.emx,v 1.6 2002/09/07 17:03:19 tom Exp $ -- Author: Thomas Dickey ------------------------------------------------------------------------------- @@ -16,13 +16,13 @@ the EMX development tools, of course. Get these programs to start: Apply the autoconf patches from - http://dickey.his.com/autoconf - ftp://dickey.his.com/autoconf + http://invisible-island.net/autoconf + ftp://invisible-island.net/autoconf These are ordered by date: - autoconf-2.13-20000819.patch.gz - autoconf-2.13-20000819-emx.patch.gz + 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, diff --git a/TO-DO b/TO-DO index 21e8ee0c..e99051f5 100644 --- a/TO-DO +++ b/TO-DO @@ -1,4 +1,4 @@ --- $Id: TO-DO,v 1.39 1998/07/12 00:25:39 tom Exp $ +-- $Id: TO-DO,v 1.41 2002/08/31 21:32:43 tom Exp $ SHORT-TERM TO-DO ITEMS: @@ -7,12 +7,6 @@ Known Problems: * GNAT does not put libraries in the correct order, so a build only links properly if you use shared libraries since -lncurses is first. -* XPG4 specifies that the enhanced features are not available unless the - _XOPEN_SOURCE_EXTENDED test macro is defined by the application. Ncurses uses - this macro (incorrectly) to address a dependency upon wchar_t. The functions - which use wchar_t are not implemented, so the effect of the test macro is - pointless. - * 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. @@ -37,6 +31,9 @@ Known Problems: * The window classes defined in the c++ subdirectory need documentation. Some C++ programmer could earn a lot of good karma by doing this... +* The resizeterm() function does not handle ripped-off lines such as that + done for the slk_XXX functions. + Portability (or lack thereof): * Users of older System V UNIXes (but not Solaris, and probably not SVr4) @@ -86,6 +83,8 @@ Untested features: label_on, plab_norm, lab_f*) has not been tested. The label_format and lab_f* capabilities aren't presently used. +* The wide-character input functions need testing. + LONGER-TERM TO-DO ITEMS: 1. Extended COSE conformance @@ -95,68 +94,9 @@ 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. -Here are page references to all material involving wide or multi-byte -characters in Issue 4 of the XSI Curses standard, with notes on their -status in this implementation: - - Page 1 (1.1.2) New Features discussion of internationalization. - Page 12 (2.4): Definition of cchar_t, wchar_t. - Page 16 (3.3.2): Introduction of multi-column characters. - Page 17-18 (3.3.5): Description of non-spacing characters. - Page 19-21 (3.4.2): Basic character operations. - Page 34 (addnstr): These should now call underlying wide- -character functions, and do (through waddnstr) if _XOPEN_SOURCE_EXTENDED is on). - Page 35 (addnwstr): wide-character add-string functions. All macros -except waddnwstr() which is not yet defined. - Page 36 (add_wch): wide-character add-char functions. All macros -except wadd_wch() which is not yet defined. - Page 39 (attr_get): implemented -- we've just made the current- -attributes field of the window an attr_t. - Page 43 (bkgrnd): None of these are implemented. - Page 45 (border_set): Neither of these is implemented. - Page 47 (box_set): box_set implemented as macro, but the underlying -wborder_set() is not yet defined. - Page 78 (echo_wchar): echo_wchar() implemented as macro, underlying -wecho_wchar() not yet implemented. - Page 81 (erasechar): Neither entry point is implemented. - Page 87 (getbkgrnd): Not implemented. - Page 88 (getcchar): Not implemented. - Page 93 (getn_wstr): All implemented (as macros) except the -underlying wgetn_wstr(). - Page 97 (get_wch): All implemented (as macros) except the -underlying wget_wch(). - Page 99 (get_wstr): Xref to page 93. - Page 105 (hline_set): All implemented (as macros) except the -underlying whline_set(), wvline_set(). - Page 114 (innstr): Multi-byte character-completeness check is -not implemented. - Page 115 (innwstr): All implemented (as macros) except the -underlying winnw_str(). - Page 119 (insnstr): Implementation may not be correct for multi-byte -characters. - Page 120 (ins_nwstr): Not implemented. - Page 121 (insstr): Xref to page 119. - Page 122 (instr): Xref to page 119. - Page 123 (ins_wch): Not implemented. - Page 124 (ins_wstr): Xref to page 120. - Page 126 (in_wch): Not implemented. - Page 127 (in_wchnstr): Not implemented. - Page 128 (inwstr): Xref to page 115. - Page 133 (killwchar): killwchar not implemented. - Page 158 (pechochar): pecho_wchar() not implemented. - Page 176 (setcchar): Not implemented. - Page 181 (slk_attroff): slk_wset not implemented. - Page 200 (ungetch): unget_wch() not implemented. - Page 203 (vidattr): vid_attr() and vid_puts() not implemented. - Page 206 (vline_set): Xref to page 105. - Page 214 (wunctrl): Not implemented. - Page 216 (curses.h): cchar_t, wint_t, wchar_t references. - Page 220 (curses.h): KEY_CODE_YES - -Basically, the macro superstructure is there but the core is absent. We -need better multi-locale support guarantees from the OS to finish this. -If you are working on internationalization support, please contact us so -we can cooperate. +Current status: + pecho_wchar() not implemented. + slk_wset not implemented. 2. DOS port diff --git a/aclocal.m4 b/aclocal.m4 index 6782f0fb..19f9bd58 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2000 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2000,2001,2002 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -26,12 +26,12 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl Author: Thomas E. Dickey 1996,1997,1998,1999,2000 +dnl Author: Thomas E. Dickey 1996,1997,1998,1999,2000,2001 dnl -dnl $Id: aclocal.m4,v 1.238 2000/10/20 22:57:49 tom Exp $ +dnl $Id: aclocal.m4,v 1.285 2002/09/21 23:59:01 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl -dnl See http://dickey.his.com/autoconf/ for additional information. +dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- @@ -55,16 +55,52 @@ elif test "$includedir" != "/usr/include"; then fi fi AC_SUBST(ACPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +AC_DEFUN([CF_ADD_CFLAGS], +[ +cf_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $1 +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(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="$CPPFLAGS $cf_new_cppflags" +fi + ])dnl dnl --------------------------------------------------------------------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) -AC_CACHE_VAL(cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi @@ -80,7 +116,7 @@ for cf_arg in "-DCC_HAS_PROTOS" \ "-Aa -D_HPUX_SOURCE" \ -Xc do - CFLAGS="$cf_save_CFLAGS $cf_arg" + CF_ADD_CFLAGS($cf_arg) AC_TRY_COMPILE( [ #ifndef CC_HAS_PROTOS @@ -95,12 +131,12 @@ choke me [cf_cv_ansi_cc="$cf_arg"; break]) done CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" ]) -AC_MSG_RESULT($cf_cv_ansi_cc) if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CFLAGS="$CFLAGS $cf_cv_ansi_cc" + CF_ADD_CFLAGS($cf_cv_ansi_cc) else AC_DEFINE(CC_HAS_PROTOS) fi @@ -131,6 +167,9 @@ dnl Treat the configuration-variable specially here, since we're directly dnl substituting its value (i.e., 1/0). AC_DEFUN([CF_BOOL_DECL], [ +AC_CHECK_HEADER(stdbool.h, + cf_cv_header_stdbool_h=1, + cf_cv_header_stdbool_h=0) AC_MSG_CHECKING([for builtin bool type]) AC_CACHE_VAL(ifelse($1,,cf_cv_builtin_bool,[$1]),[ AC_TRY_COMPILE([ @@ -148,6 +187,9 @@ fi dnl --------------------------------------------------------------------------- dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type). dnl Don't bother looking for bool.h, since it's been deprecated. +dnl +dnl If the current compiler is C rather than C++, we get the bool definition +dnl from . AC_DEFUN([CF_BOOL_SIZE], [ AC_MSG_CHECKING([for size of bool]) @@ -156,6 +198,9 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[ AC_TRY_RUN([ #include #include + +#if defined(__cplusplus) + #ifdef HAVE_GXX_BUILTIN_H #include #elif HAVE_GPP_BUILTIN_H @@ -163,6 +208,15 @@ AC_CACHE_VAL(cf_cv_type_of_bool,[ #elif HAVE_BUILTIN_H #include #endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + main() { FILE *fp = fopen("cf_test.out", "w"); @@ -179,15 +233,21 @@ main() exit(0); } ], - [cf_cv_type_of_bool=`cat cf_test.out`], + [cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi], [cf_cv_type_of_bool=unknown], [cf_cv_type_of_bool=unknown]) ]) rm -f cf_test.out AC_MSG_RESULT($cf_cv_type_of_bool) if test "$cf_cv_type_of_bool" = unknown ; then - AC_MSG_WARN(Assuming unsigned for type of bool) - cf_cv_type_of_bool=unsigned + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + AC_MSG_WARN(Assuming $NCURSES_BOOL for type of bool) + cf_cv_type_of_bool=$NCURSES_BOOL fi ])dnl dnl --------------------------------------------------------------------------- @@ -207,7 +267,7 @@ 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*) + openbsd*|netbsd*|freebsd*|linux*|cygwin*) prefix=/usr ;; *) prefix=$ac_default_prefix @@ -286,7 +346,7 @@ test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && AC_MSG_RESULT("Configuring for $cf_cv_system_name") +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) @@ -298,14 +358,10 @@ 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 (I would use AC_CACHE_CHECK here, but it will not work when called in a -dnl loop from CF_SYS_ERRLIST). -dnl dnl $1 = the name to check AC_DEFUN([CF_CHECK_ERRNO], [ -AC_MSG_CHECKING(if external $1 is declared) -AC_CACHE_VAL(cf_cv_dcl_$1,[ +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ AC_TRY_COMPILE([ #ifdef HAVE_STDLIB_H #include @@ -314,16 +370,12 @@ AC_CACHE_VAL(cf_cv_dcl_$1,[ #include #include ], [long x = (long) $1], - [eval 'cf_cv_dcl_'$1'=yes'], - [eval 'cf_cv_dcl_'$1'=no']) + [cf_cv_dcl_$1=yes], + [cf_cv_dcl_$1=no]) ]) -eval 'cf_result=$cf_cv_dcl_'$1 -AC_MSG_RESULT($cf_result) - -if test "$cf_result" = no ; then - eval 'cf_result=DECL_'$1 - CF_UPPER(cf_result,$cf_result) +if test "$cf_cv_dcl_$1" = no ; then + CF_UPPER(cf_result,decl_$1) AC_DEFINE_UNQUOTED($cf_result) fi @@ -337,22 +389,18 @@ dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ -AC_MSG_CHECKING(if external $1 exists) -AC_CACHE_VAL(cf_cv_have_$1,[ +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ AC_TRY_LINK([ #undef $1 extern $2 $1; ], [$1 = 2], - [eval 'cf_cv_have_'$1'=yes'], - [eval 'cf_cv_have_'$1'=no'])]) - -eval 'cf_result=$cf_cv_have_'$1 -AC_MSG_RESULT($cf_result) + [cf_cv_have_$1=yes], + [cf_cv_have_$1=no]) +]) -if test "$cf_result" = yes ; then - eval 'cf_result=HAVE_'$1 - CF_UPPER(cf_result,$cf_result) +if test "$cf_cv_have_$1" = yes ; then + CF_UPPER(cf_result,have_$1) AC_DEFINE_UNQUOTED($cf_result) fi @@ -363,8 +411,9 @@ 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 "$CXX" = yes ; then +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 { @@ -384,18 +433,102 @@ 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 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 "dirname" is not portable, so we fake it with a shell script. +AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's:/[[^/]]*$::'`])dnl +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) - DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" done for cf_dir in $DIRS_TO_MAKE do @@ -519,6 +652,49 @@ 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 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 Test for availability of useful gcc __attribute__ directives to quiet @@ -545,7 +721,6 @@ EOF if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) - changequote(,)dnl cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <>)dnl -cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ - sed -e 's/[^0-9 \.]//g' | $AWK '{print $<<1>>;}'` +cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e 's/[[^0-9 \.]]//g' | $AWK '{print $[1];}'` case $cf_cv_gnat_version in - 3.1[1-9]*|3.[2-9]*|[4-9].*) + 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) cf_cv_prog_gnat_correct=yes ;; *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. @@ -685,7 +857,7 @@ case $cf_cv_gnat_version in ;; esac case $cf_cv_gnat_version in - 3.1*|[4-9].*) + 3.1*|[[4-9]].*) cf_compile_generics=generics cf_generic_objects="\$(GENOBJS)" ;; @@ -693,9 +865,36 @@ case $cf_cv_gnat_version in cf_generic_objects= ;; esac -changequote([, ])dnl ]) 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 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. @@ -780,12 +979,32 @@ AC_MSG_RESULT($cf_cv_have_isascii) test "$cf_cv_have_isascii" = yes && AC_DEFINE(HAVE_ISASCII) ])dnl dnl --------------------------------------------------------------------------- +dnl Check for libutf8 +AC_DEFUN([CF_LIBUTF8], +[ +AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[ + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +AC_TRY_LINK([ +#include ],[putwc(0,0);], + [cf_cv_libutf8=yes], + [cf_cv_libutf8=no]) + LIBS="$cf_save_LIBS" +]) + +if test "$cf_cv_libutf8" = yes ; then + AC_DEFINE(HAVE_LIBUTF8_H) + LIBS="-lutf8 $LIBS" +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set AC_DEFUN([CF_LIB_PREFIX], [ case $cf_cv_system_name in - os2) LIB_PREFIX='' ;; + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; *) LIB_PREFIX='lib' ;; esac ifelse($1,,,[$1=$LIB_PREFIX]) @@ -811,43 +1030,70 @@ for cf_dir in $SRC_SUBDIRS do if test -f $srcdir/$cf_dir/modules; then - cf_libs_to_make= + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= for cf_item in $CF_LIST_MODELS do CF_LIB_SUFFIX($cf_item,cf_suffix) if test $cf_item = shared ; then if test "$cf_cv_do_symlinks" = yes ; then case "$cf_cv_shlib_version" in #(vi - rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi - abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; esac fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue + fi fi - cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" done if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" case "$LIB_SUBSETS" in #(vi termlib+*) #(vi ;; *) #(vi - cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g` - cf_libs_to_make="$cf_item $cf_libs_to_make" + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" ;; esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` fi - sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \ + sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \ + -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \ + -e "s%@SHARED_LIB@%$SHARED_LIB%" \ $cf_dir/Makefile >$cf_dir/Makefile.out mv $cf_dir/Makefile.out $cf_dir/Makefile $AWK -f $srcdir/mk-0th.awk \ - name=$cf_dir \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - for cf_item in $CF_LIST_MODELS + for cf_subset in $cf_subsets do - echo 'Appending rules for '$cf_item' model ('$cf_dir')' + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" CF_UPPER(CF_ITEM,$cf_item) CF_LIB_SUFFIX($cf_item,cf_suffix) CF_OBJ_SUBDIR($cf_item,cf_subdir) @@ -867,8 +1113,6 @@ do cf_depend="$cf_depend $cf_reldir/curses.priv.h" fi - for cf_subset in $LIB_SUBSETS - do $AWK -f $srcdir/mk-1st.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -878,6 +1122,7 @@ do suffix=$cf_suffix \ subset=$cf_subset \ ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ @@ -885,7 +1130,11 @@ do depend="$cf_depend" \ target="$target" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - test $cf_dir = ncurses && WITH_OVERWRITE=no + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ $AWK -f $srcdir/mk-2nd.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -895,6 +1144,7 @@ do srcdir=$srcdir \ echo=$WITH_ECHO \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" done done fi @@ -950,11 +1200,11 @@ done cat >> Makefile <> Makefile <>headers.sh <>$cf_dir/Makefile <>$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 @@ -1114,6 +1378,8 @@ AC_DEFUN([CF_LIB_SUFFIX], profile) $2='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) $2='.dll' ;; + darwin*) $2='.dylib' ;; hpux*) $2='.sl' ;; *) $2='.so' ;; esac @@ -1146,18 +1412,15 @@ 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 - changequote(,)dnl cat >conftest.$ac_ext <&5 1>/dev/null fi rm -f conftest.$ac_ext data.o - changequote(,)dnl cat >conftest.$ac_ext <&5 1>/dev/null @@ -1194,7 +1456,12 @@ EOF LIBS="$cf_saveLIBS" ]) AC_MSG_RESULT($cf_cv_link_dataonly) -test "$cf_cv_link_dataonly" = no && AC_DEFINE(BROKEN_LINKER) + +if test "$cf_cv_link_dataonly" = no ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +fi + ])dnl dnl --------------------------------------------------------------------------- dnl Most Unix systems have both link and symlink, a few don't have symlink. @@ -1258,12 +1525,12 @@ dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], [ -AC_MSG_CHECKING([for makeflags variable]) -AC_CACHE_VAL(cf_cv_makeflags,[ +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ cf_cv_makeflags='' for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' do cat >cf_makeflags.tmp <man/edit_man.sed + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed fi fi -AC_MSG_RESULT($cf_manpage_renames) +AC_MSG_RESULT($MANPAGE_RENAMES) +AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- dnl Some people expect each tool to make all aliases for manpages in the @@ -1418,10 +1689,10 @@ AC_MSG_CHECKING(for manpage symlinks) AC_ARG_WITH(manpage-symlinks, [ --with-manpage-symlinks specify manpage-symlinks], - [cf_manpage_symlinks=$withval], - [cf_manpage_symlinks=yes]) + [MANPAGE_SYMLINKS=$withval], + [MANPAGE_SYMLINKS=yes]) -AC_MSG_RESULT($cf_manpage_symlinks) +AC_MSG_RESULT($MANPAGE_SYMLINKS) ])dnl dnl --------------------------------------------------------------------------- dnl This option causes manpages to be run through tbl(1) to generate tables @@ -1432,10 +1703,10 @@ AC_MSG_CHECKING(for manpage tbl) AC_ARG_WITH(manpage-tbl, [ --with-manpage-tbl specify manpage processing with tbl], - [cf_manpage_tbl=$withval], - [cf_manpage_tbl=no]) + [MANPAGE_TBL=$withval], + [MANPAGE_TBL=no]) -AC_MSG_RESULT($cf_manpage_tbl) +AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- dnl Try to determine if the man-pages on the system are compressed, and if @@ -1455,7 +1726,7 @@ CF_MANPAGE_TBL cf_prefix="$prefix" fi - case "$cf_manpage_form" in # (vi + case "$MANPAGE_FORMAT" in # (vi *formatted*) # (vi cf_subdir='$mandir/cat' cf_format=yes @@ -1468,13 +1739,13 @@ CF_MANPAGE_TBL test ! -d man && mkdir man cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP + < \$i | sed -f edit_man.sed >\$TMP CF_EOF else cat >>man/edit_man.sh <\$TMP + < \$i >\$TMP CF_EOF fi -if test $cf_manpage_tbl = yes ; then +if test $MANPAGE_TBL = yes ; then cat >>man/edit_man.sh <\$TMP.out mv \$TMP.out \$TMP @@ -1579,7 +1857,7 @@ cat >>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh < +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [mbstate_t state], + [cf_cv_mbstate_t=no], + [AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [mbstate_t value], + [cf_cv_mbstate_t=yes], + [cf_cv_mbstate_t=unknown])])]) + +if test "$cf_cv_mbstate_t" = yes ; then + AC_DEFINE(NEED_WCHAR_H) +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + AC_DEFINE(HAVE_MBSTATE_T) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. AC_DEFUN([CF_MIXEDCASE_FILENAMES], @@ -1709,6 +2017,54 @@ AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- +dnl Check for a working mkstemp. This creates two files, checks that they are +dnl successfully created and distinct (AmigaOS apparently fails on the last). +AC_DEFUN([CF_MKSTEMP],[ +AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ +rm -f conftest* +AC_TRY_RUN([ +#include +#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 Compute the object-directory name from the given model name AC_DEFUN([CF_OBJ_SUBDIR], [ @@ -1717,33 +2073,52 @@ AC_DEFUN([CF_OBJ_SUBDIR], normal) $2='objects' ;; debug) $2='obj_g' ;; profile) $2='obj_p' ;; - shared) $2='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + $2='objects' ;; + *) + $2='obj_s' ;; + esac + esac +])dnl +dnl --------------------------------------------------------------------------- +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 Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the -dnl result begins with 'NONE'. This is necessary to workaround autoconf's +dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ case ".[$]$1" in #(vi -./*) #(vi +.\[$]\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; -.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX +.[[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@` + $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi .NONE/*) - $1=`echo [$]$1 | sed -e s@NONE@$ac_default_prefix@` + $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%` ;; *) - AC_ERROR(expected a pathname) + ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl @@ -1756,8 +2131,9 @@ PROG_EXT= case $cf_cv_system_name in os2*) # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@ - CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__" + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` PROG_EXT=".exe" ;; @@ -1766,6 +2142,7 @@ cygwin*) ;; esac AC_SUBST(PROG_EXT) +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -1777,10 +2154,8 @@ case $INSTALL in /*) ;; *) -changequote({{,}})dnl - cf_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'` + CF_DIRNAME(cf_dir,$INSTALL) test -z "$cf_dir" && cf_dir=. -changequote([,])dnl INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's:^.*/::'` ;; esac @@ -1834,12 +2209,16 @@ dnl dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi dnl version when making symbolic links. dnl +dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library +dnl version numbers are infix (ex: libncurses..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= + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" @@ -1880,10 +2259,25 @@ AC_DEFUN([CF_SHARED_OPTS], CFLAGS="$cf_save_CFLAGS" fi + cf_cv_shlib_version_infix=no + case $cf_cv_system_name in beos*) MK_SHARED_LIB='$(CC) -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; + cygwin*) + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared -Wl,--out-implib=$(IMPORT_LIB) -Wl,--export-all-symbols -o $(SHARED_LIB)' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + ;; + darwin*) + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $[@]` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi + cf_cv_shlib_version_infix=yes + ;; hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then @@ -1911,8 +2305,8 @@ AC_DEFUN([CF_SHARED_OPTS], ;; linux*|gnu*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-Wl,-rpath," @@ -1934,8 +2328,8 @@ AC_DEFUN([CF_SHARED_OPTS], CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' if test "$cf_cv_shlib_version" = auto; then @@ -1951,16 +2345,16 @@ AC_DEFUN([CF_SHARED_OPTS], # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). - MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`' + MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $[@]`' case $host_os in osf4*) - MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-rpath" @@ -1998,7 +2392,7 @@ AC_DEFUN([CF_SHARED_OPTS], MK_SHARED_LIB='$(LD) -dy -G -h `basename $[@] .$(REL_VERSION)`.$(ABI_VERSION) -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R `pwd`/lib:\$(libdir)" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" @@ -2062,13 +2456,13 @@ 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_CFLAGS="$CFLAGS" + cf_save_CPPFLAGS="$CPPFLAGS" for cf_opts in "" "NEED_PTEM_H" do - CFLAGS="$cf_save_CFLAGS" - test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" + CPPFLAGS="$cf_save_CPPFLAGS" + test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" AC_TRY_COMPILE([#include #ifdef HAVE_TERMIOS_H #include @@ -2105,7 +2499,7 @@ do [cf_cv_sizechange=yes], [cf_cv_sizechange=no]) - CFLAGS="$cf_save_CFLAGS" + 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" @@ -2183,11 +2577,11 @@ do fi done AC_MSG_RESULT($cf_cv_src_modules) -TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS" +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARGS) -PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS" +PROG_ARGS="-L${LIB_DIR} $PROG_ARGS" AC_SUBST(PROG_ARGS) SRC_SUBDIRS="man include" @@ -2195,7 +2589,8 @@ for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS misc test" +SRC_SUBDIRS="$SRC_SUBDIRS test" +test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= @@ -2288,7 +2683,7 @@ if test "$ISC" = yes ; then AC_CHECK_HEADERS( sys/termio.h ) fi if test "$ac_cv_header_termios_h" = yes ; then - case "$CFLAGS" in + case "$CFLAGS $CPPFLAGS" in *-D_POSIX_SOURCE*) termios_bad=dunno ;; *) termios_bad=maybe ;; @@ -2329,15 +2724,14 @@ dnl --------------------------------------------------------------------------- dnl Get the version-number for use in shared-library naming, etc. AC_DEFUN([CF_SUBST_NCURSES_VERSION], [ -changequote(,)dnl -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]*//'`" -changequote([,])dnl +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 -AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)) +cf_cv_timestamp=`date` +AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)) dnl We need these values in the generated headers AC_SUBST(NCURSES_MAJOR) AC_SUBST(NCURSES_MINOR) @@ -2347,6 +2741,7 @@ AC_SUBST(cf_cv_rel_version) AC_SUBST(cf_cv_abi_version) AC_SUBST(cf_cv_cc_bool_type) AC_SUBST(cf_cv_builtin_bool) +AC_SUBST(cf_cv_header_stdbool_h) AC_SUBST(cf_cv_type_of_bool)dnl ])dnl dnl --------------------------------------------------------------------------- @@ -2471,62 +2866,12 @@ dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ -changequote(,)dnl $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` -changequote([,])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl Compute the shift-mask that we'll use for wide-character indices. We use -dnl all but the index portion of chtype for storing attributes. -AC_DEFUN([CF_WIDEC_SHIFT], -[ -AC_REQUIRE([CF_TYPEOF_CHTYPE]) -AC_MSG_CHECKING([for number of bits in chtype]) -AC_CACHE_VAL(cf_cv_shift_limit,[ - AC_TRY_RUN([ -#include -int main() -{ - FILE *fp = fopen("cf_test.out", "w"); - if (fp != 0) { - int n; - unsigned TYPEOF_CHTYPE x = 1L; - for (n = 0; ; n++) { - unsigned long y = (x >> n); - if (y != 1 || x == 0) - break; - x <<= 1; - } - fprintf(fp, "%d", n); - fclose(fp); - } - exit(0); -} - ], - [cf_cv_shift_limit=`cat cf_test.out`], - [cf_cv_shift_limit=32], - [cf_cv_shift_limit=32]) - rm -f cf_test.out - ]) -AC_MSG_RESULT($cf_cv_shift_limit) -AC_SUBST(cf_cv_shift_limit) - -AC_MSG_CHECKING([for width of character-index]) -AC_CACHE_VAL(cf_cv_widec_shift,[ -if test ".$with_widec" = ".yes" ; then - cf_attrs_width=39 - if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null ) - then - cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width` - else - cf_cv_widec_shift=16 - fi -else - cf_cv_widec_shift=8 -fi -]) -AC_MSG_RESULT($cf_cv_widec_shift) -AC_SUBST(cf_cv_widec_shift) +dnl Use AC_VERBOSE w/o the warnings +AC_DEFUN([CF_VERBOSE], +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG ])dnl dnl --------------------------------------------------------------------------- dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just @@ -2553,12 +2898,14 @@ dnl $2 = help-text dnl $3 = environment variable to set dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message +dnl $6 = flag to tell if we want to define or substitute dnl AC_DEFUN([CF_WITH_PATHLIST],[ +AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do @@ -2568,6 +2915,18 @@ do done IFS="$ac_save_ifs" -eval $3="$cf_dst_path" +ifelse($6,define,[ +# Strip single quotes from the value, e.g., when it was supplied as a literal +# for $4 or $5. +case $cf_dst_path in #(vi +\'*) + cf_dst_path=`echo $cf_dst_path |sed -e s/\'// -e s/\'\$//` + ;; +esac +cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'` +]) + +eval '$3="$cf_dst_path"' AC_SUBST($3)dnl + ])dnl diff --git a/announce.html.in b/announce.html.in index 58be91d0..403e6762 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,10 +1,10 @@ -Announcing ncurses @VERSION@ +Announcing ncurses @VERSION@ Pre-Release @@ -22,8 +22,11 @@ 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 should port easily to -any ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!

+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), @@ -34,331 +37,171 @@ The ncurses distribution is available via anonymous FTP at the GNU distribution site ftp://ftp.gnu.org/pub/gnu/ncurses.
It is also available at -ftp://dickey.his.com/ncurses. +ftp://invisible-island.net/ncurses.

Release Notes

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

Interface changes:

    -
  • change type of ospeed variable back to - short to match its use in legacy applications. It was - altered after ncurses 4.2 to speed_t to repair a type - mismatch which was introduced after 1.9.4 in 1995. The principal - users of termcap continued to use short, which is - not the same size. -

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

  • remove a private function _nc_can_clear_with(), which - was built with the configure --enable-expanded option but not used. - -
  • add several private functions (prefixed with "_nc_") for tracing - chtype values in the debug library, and for better - access and buffer limit checking. -
-New features and improvements: -
    -
  • rewrote tgoto() to make it better support existing - termcap applications which use hardcoded strings rather than obtain - all of their information from the termcap file. If the string does - not appear to be a terminfo string (i.e., does not refer to a "%p" - parameter, or terminfo-style padding), and termcap support is configured, tgoto() - will interpret it as termcap. Otherwise, as before, it will use - tparm(). - -
  • to ensure that the tgoto() changes work properly, - added checks to tic which report capabilities that do - not reference the expected number of parameters. - -
  • new configure script options: -
      -
    • option --disable-root-environ adds runtime checks - which tell ncurses to disregard $TERMINFO and similar environment - variables if the current user is root, or running setuid/setgid. - -
    • option --disable-assumed-color allows you to use the - pre-5.1 convention of default colors used for color-pair 0 to be - configured (see assume_default_colors()). - -
    • implement configure script options that transform installed - program names, e.g., --program-prefix, including the - manpage names and cross references. +
    • change type for bool used in headers to NCURSES_BOOL, + which usually is the same as the compiler's definition for + bool. -
    • option --with-database allows you to specify a - different terminfo source-file to install. On OS/2 EMX, the - default is misc/emx.src, otherwise misc/terminfo.src +
    • add all but two functions for X/Open curses wide-character support. + These are only available if the library is configured using the + --enable-widec option. Missing functions are +
        +
      • pecho_wchar() +
      • slk_wset() +
      -
    • option --with-default-terminfo-dir allows you to - specify the default terminfo database directory. - -
    • option --with-libtool allows you to build with - libtool.

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

    • option --with-manpage-tbl causes the manpages to be - preprocessed by tbl(1) prior to installation, - -
    • option --without-curses-h causes the installation - process to install curses.h as ncurses.h and make appropriate - changes to headers and manpages. -
    - -
  • modified configure script options: -
      -
    • change symbol used by the --install-prefix configure - option from INSTALL_PREFIX to DESTDIR - (the latter has become common usage although the name is - misleading). - -
    • modify ld -rpath options (e.g., Linux, and Solaris) - to use an absolute pathname for the build tree's lib directory, - avoiding confusion with directories relative to the current one - with the installed programs. - -
    • modified misc/run_tic.in to use - tic -o, to eliminate dependency on - $TERMINFO variable for installs. -
    +
  • add environment variable $NCURSES_ASSUMED_COLORS to + modify the assume_default_colors() extension. -
  • terminfo database: +
+New features and improvements: +
    +
  • Improved support for termcap applications:
      -
    • updated xterm terminfo entries to match XFree86 xterm patch #146. - -
    • added amiga-vnc, - Matrix Orbital, and - QNX qansi to misc/terminfo.src. +
    • add logic to dump_entry.c to remove function-key definitions that do + not fit into the 1023-byte limit for generated termcaps. This makes + hds200 fit. -
    • added os2 entry to misc/emx.src. +
    • modify tgetent() to check if exit_attribute_mode resets the alternate + character set, and if so, attempt to adjust the copy of the termcap + "me" string which it will return to eliminate that part. In + particular, 'screen' would lose track of line-drawing characters. -
    • add S0 and E0 extensions to screen's terminfo entry - since otherwise the FreeBSD port makes it pass termcap equivalents - to tgoto, which would be misinterpreted by older - versions of ncurses. -
    +
  • add check/fix to comp_parse.c to suppress warning about missing acsc + string. This happens in configurations where raw termcap information + is processed; tic already does this and other checks. -
  • improvements to program usability: -
      -
    • modify programs to use curses_version() string to - report the version of ncurses with which they are compiled rather - than the NCURSES_VERSION string. The function returns the patch - level in addition to the major and minor version numbers. +
    • add tic -A option to suppress capabilities which are commented out + when translating to termcap. -
    • modify tput program so it can be renamed or invoked via a link as - 'reset' or 'init', producing the same effect as tput reset or tput init. +
    • modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it + work properly for termcap applications (patch by Andrey A Chernov). -
    • add error checking to infocmp's -v and -m options to ensure that - the option value is indeed a number.
    -
  • improved performance: -
      -
    • replace a lookup table in lib_vidattr.c used to decode - no_color_video with a logic expression which is faster. -
    +
  • add a call to _nc_keypad() in keypad() to accommodate applications + such as nvi, which use curses for output but not for input (fixes + Debian #131263, cf: 20011215). +
  • correct logic for COLORFGBG environment variable: if rxvt is compiled + with xpm support, the variable has three fields, making it slightly + incompatible with itself. In either case, the background color is + the last field.
Major bug fixes:
    -
  • correct manlinks.sed script introduced in ncurses 5.1 - to avoid using ERE "\+", which is not understood by standard versions - of sed. This happens to work with GNU sed, - but is not portable, and was the initial motivation for this release. - -
  • remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. - This differed from the "hpux*" case by using reversed symbolic - links, which made the 5.1 version not match the configuration of - 5.0 shared libraries. - -
  • guard against corrupt terminfo data: -
      -
    • modify tparm() to disallow arithmetic on strings, - analyze the varargs list to read strings as strings and numbers as - numbers. - -
    • modify tparm()'s internal function - spop() to treat a null pointer as an empty string. - -
    • modify parse_format() in lib_tparm.c to ignore - precision if it is longer than 10000. - -
    • rewrote limit checks in lib_mvcur.c using new functions - _nc_safe_strcat(), etc. Made other related changes to - check lengths used for strcat() and - strcpy(). -
    - -
  • corrections to screen optimization: -
      -
    • added special case in lib_vidattr.c to reset underline and - standout for devices that have no sgr0 defined. - -
    • change handling of non_dest_scroll_region in - tty_update.c to clear text after it is shifted in rather than before - shifting out. Also correct row computation. +
    • rewrote limit-checks in wscrl() and associated _nc_scroll_window(), + to ensure that if the parameter of wscrl() is larger than the size of + the scrolling region, then the scrolling region will be cleared. -
    • modify rs2 capability in xterm-r6 and similar entries - where cursor save/restore bracketed the sequence for resetting video - attributes. The cursor restore would undo that. -
    - -
  • UTF-8 support: -
      -
    • when checking LC_ALL, LC_CTYPE, and LANG environment variables - for UTF-8 locale, ignore those which are set to an empty value, as - per SUSV2. - -
    • encode 0xFFFD in UTF-8 with 3 bytes, not 2. - -
    • modify _nc_utf8_outch() to avoid sign-extension when - checking for out-of-range value. -
    - -
  • other library fixes: -
      -
    • added checks for an empty $HOME environment - variable, to avoid retrieving terminfo descriptions from - ./.terminfo . - -
    • change functions _nc_parse_entry() and - postprocess_termcap() to avoid using - strtok(), because it is non-reentrant. - -
    • initialize fds[] array to 0's in - _nc_timed_wait(); apparently poll() only - sets the revents members of that array when there is - activity corresponding to the related file. - -
    • add a check for null pointer in Make_Enum_Type(). - -
    • fix a heap problem with the c++ binding. +
    • modify tset to restore original I/O modes if an error is encountered. + Also modify to use buffered stderr consistently rather than mixing + with write(). -
    • correct missing includes for <string.h> in several places, - including the C++ binding. This is not noted by gcc unless we use - the -fno-builtin option. -
    +
  • move calls to def_shell_mode() and def_prog_mode() before loop with + callbacks in lib_set_term.c, since the c++ demo otherwise initialized + the tty modes before saving them. -
  • several fixes for tic: -
      -
    • add a check for empty buffers returned by fgets() in - comp_scan.c next_char() function, in case - tic is run on a non-text file (fixes a core dump). +
    • modified wresize() to ensure that a failed realloc will not corrupt + the window structure, and to make subwindows fit within the resized + window. -
    • modify tic to verify that its inputs are really files, - in case someone tries to read a directory (or - /dev/zero). +
    • altered resizeterm() to avoid having it fail when a child window + cannot be resized because it would be larger than its parent. -
    • correct an uninitialized parameter to open_tempfile() - in tic.c which made "tic -I" give an ambiguous error message about - tmpnam. +
    • correct/improve logic to produce an exit status for errors in tput, + which did not exit with an error when told to put a string not in the + current terminfo entry. -
    • correct logic in adjust_cancels(), which did not check - both alternatives when reclassifying an extended name between - boolean, number and string, causing an infinite loop in - tic. -
    +
  • modify behavior of can_clear_with() so that if an application is + running in a non-bce terminals with default colors enabled, it + returns true, allowing the user to select/paste text without picking + up extraneous trailing blanks. -
  • using new checks in tic for parameter counts in - capability strings, found/fixed several errors both in the - terminfo database and in the include/Caps file. -
      -
    • modified several terminfo capability strings, including the - definitions for setaf, setab, in include/Caps to indicate that the - entries are parameterized. This information is used to tell which - strings are translated when converting to termcap. This fixes a - problem where the generated termcap would contain a spurious "%p1" - for the terminfo "%p1%d". - -
    • correct parameter counts in include/Caps for dclk as well as some - printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. -
    +
  • add a check in relative_move() to guard against buffer overflow in + the overwrite logic. -
  • various fixes for install scripts used to support configure - --srcdir and --with-install-prefix. +
  • add some limit/pointer checks to -S option of tputs. -
  • correct several mismatches between manpage filename and ".TH" - directives, renaming dft_fgbg.3x to default_colors.3x and - menu_attribs.3x to menu_attributes.3x. +
  • modify mvcur() to avoid emitting newline characters when nonl() mode + is set. Normally this is not a problem since the actual terminal + mode is set to suppress nl/crlf translations, however it is useful to + allow the caller to manipulate the terminal mode to avoid staircasing + effects after spawning a process which writes messages (for lynx + 2.8.4).
Portability:
  • configure script:
      -
    • newer config.guess, config.sub, including changes to support OS/2 - EMX. The configure script for OS/2 EMX still relies on a patch - since there is no (working) support for that platform in the main - autoconf distribution. +
    • modify check in --disable-overwrite option so that it is used by + default unless the --prefix/$prefix value is not /usr, in attempt to + work around packagers who do not read the INSTALL notes. -
    • make configure script checks on variables $GCC and - $GXX consistently compare against 'yes' rather than - test if they are nonnull, since either may be set to the - corresponding name of the C or C++ compiler. +
    • correct a typo in configure --enable-colorfgbg option, and move it + to the experimental section (cf: 20011208). -
    • change configure script to use AC_CANONICAL_SYSTEM rather than - AC_CANONICAL_HOST, which means that configure --target - will set a default program-prefix. +
    • modify configure script to allow building with termcap only, or with + fallbacks only. In this case, we do not build tic and toe. -
    • modify the check for big-core to force a couple of memory - accesses, which may work as needed for older/less-capable machines - (if not, there's still the explicit configure option). +
    • modify run_tic.sh to check if the build is a cross-compile. In that + case, do not use the build's tic to install the terminfo database. -
    • modify configure test for tcgetattr() to allow for - old implementations, e.g., on BeOS, which only defined it as a - macro. +
    • modify c++/Makefile.in to accommodate archive programs that are + different for C++ than for C, and add cases for vendor's C++ + compilers on Solaris and IRIX. -
    • add configure check for filesystems (such as OS/2 EMX) which do - not distinguish between upper/lowercase filenames, use this to fix - tags rules in makefiles. +
    • add several configure script options to aid with cross-compiling: + --with-build-cc, --with-build-cflags, --with-build-ldflags, and + --with-build-libs. -
    • add MKncurses_def.sh to generate fallback definitions for - ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in - code to consistently use "#if" rather than "#ifdef". +
    • add experimental --with-caps=XXX option to customize to similar + terminfo database formats such as AIX 4.x -
    • change most remaining unquoted parameters of test in - configure script to use quotes, for instance fixing a problem in the - --disable-database option. - -
    • modify scripts so that "make install.data" works on OS/2 EMX. - -
    • modify scripts and makefiles so the Ada95 directory builds on - OS/2 EMX. -
    +
  • add configure option --with-ospeed to assist packagers in transition + to 5.3 change to ospeed type. +
  • library:
      -
    • replaced case-statement in _nc_tracebits() for CSIZE - with a table to simplify working around implementations that define - random combinations of the related macros to zero. +
    • implement a simple vsscanf() fallback function which uses the %n + conversion to help parse the input data. -
    • improved OS/2 mouse support by retrying as a 2-button mouse if code - fails to set up a 3-button mouse. +
    • various fixes to build/work with different implementations of + vsscanf(). -
    • added private entrypoint _nc_basename(), used to - consolidate related code in progs, as well as accommodating OS/2 EMX - pathnames. +
    • add/use macro to suppress sign-extension of char type on + platforms where this is a problem in ctype macros, e.g., Solaris. -
    • alter definition of NCURSES_CONST to make it non-empty. +
    • finish changes needed to build dll's on cygwin. -
    • redefine 'TEXT' in menu.h for AMIGA, since it is reported to have - an (unspecified) symbol conflict. +
    • add #undef's before possible redefinition of ERR and OK in curses.h
  • programs:
      -
    • modified progs/tset.c and tack/sysdep.c to build with sgttyb - interface if neither termio or termios is available. Tested this - with FreeBSD 2.1.5 (which does have termios - but the sgttyb does - work). -
    +
  • modify ifdef's in write_entry.c to allow use of symbolic links on + platforms with no hard links, e.g., BeOS. + +
  • modify _nc_write_entry() to allow for the possibility that linking + aliases on a filesystem that ignores case would not succeed because + the source and destination differ only by case, e.g., NCR260VT300WPP0 + on cygwin. +
  • modify logic in tic, toe, tput and tset which checks for basename of + argv[0] to work properly on systems such as OS/2 which have + case-independent filenames and/or program suffixes, e.g., ".ext". +

    Features of Ncurses

    @@ -474,23 +317,23 @@ including (versions starting with those noted):
    cdk
    Curses Development Kit
    -http://www.vexus.ca/CDK.html +http://invisible-island.net/cdk.
    -http://dickey.his.com/cdk. +http://www.vexus.ca/CDK.html
    ded
    directory-editor
    -http://dickey.his.com/ded. +http://invisible-island.net/ded.
    dialog
    the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux.
    -http://dickey.his.com/dialog. +http://invisible-island.net/dialog.
    lynx
    the character-screen WWW browser
    http://lynx.isc.org/release. -
    Midnight Commander 4.1 +
    Midnight Commander
    file manager
    www.gnome.org/mc/. @@ -528,7 +371,7 @@ as well as some that use ncurses for the terminfo support alone:
    vile
    vi-like-emacs
    -http://dickey.his.com/vile. +http://invisible-island.net/vile.

    @@ -543,7 +386,7 @@ HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim and Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. +Jürgen Pfeifer. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -561,7 +404,7 @@ 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://dickey.his.com/ncurses. +ftp://invisible-island.net/ncurses.

    Future Plans

      diff --git a/c++/Makefile.in b/c++/Makefile.in index 63049945..9555320e 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.56 2000/10/15 00:43:38 tom Exp $ +# $Id: Makefile.in,v 1.64 2002/01/19 20:25:31 NIIBE.Yutaka Exp $ ############################################################################## -# Copyright (c) 1998,1999 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -55,9 +55,13 @@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ AR_OPTS = @AR_OPTS@ + +CXX_AR = @CXX_AR@ +CXX_AR_OPTS = @CXX_AR_OPTS@ RANLIB = @RANLIB@ CXX = @CXX@ +CPP = @CPP@ CXXFLAGS = @CXXFLAGS@ CXXLIBS = @CXXLIBS@ @@ -87,9 +91,9 @@ LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ -LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) -l$(LIBROOT) +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ -LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib -L$(libdir) ../lib/$(LIBNAME) +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME) LINK_NORMAL = $(LINK_FLAGS) LINK_DEBUG = $(LINK_FLAGS) LINK_PROFILE = $(LINK_FLAGS) @@ -116,6 +120,8 @@ all :: demo$x sources : $(AUTO_SRC) +depend : + # Build a conventional library for installing, since a shared library would # pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct # dependencies. @@ -130,7 +136,7 @@ LIB_OBJS = \ $(MODEL)/cursesmain.o ../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) - $(AR) $(AR_OPTS) $@ $? + $(CXX_AR) $(CXX_AR_OPTS) $@ $? $(RANLIB) $@ ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) @@ -153,7 +159,7 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ install \ install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir) @@ -164,9 +170,10 @@ uninstall.libs:: -$(LIBTOOL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace clean :: mostlyclean + -rm -rf $(MODEL)/SunWS_cache -$(LIBTOOL) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(LIB_OBJS:.o=.lo) $(OBJS_DEMO) -rm -rf .libs diff --git a/c++/README-first b/c++/README-first index eb37ac67..747fb1e7 100644 --- a/c++/README-first +++ b/c++/README-first @@ -55,4 +55,4 @@ Authors of first ncurses based release (NCursesWindow, NCursesPanel): and Anatoly Ivasyuk Author of this release: - Juergen Pfeifer + Juergen Pfeifer http://www.familiepfeifer.de/Contact.aspx?Lang=en diff --git a/c++/cursesapp.cc b/c++/cursesapp.cc index eaaadc7e..5b7ab5c0 100644 --- a/c++/cursesapp.cc +++ b/c++/cursesapp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,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 * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -#include "cursesapp.h" #include "internal.h" +#include "cursesapp.h" -MODULE_ID("$Id: cursesapp.cc,v 1.6 1999/10/30 23:59:37 tom Exp $") +MODULE_ID("$Id: cursesapp.cc,v 1.9 2002/07/06 15:47:52 juergen Exp $") void NCursesApplication::init(bool bColors) { diff --git a/c++/cursesapp.h b/c++/cursesapp.h index f13fd1bd..3eb25d03 100644 --- a/c++/cursesapp.h +++ b/c++/cursesapp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,17 +28,18 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: cursesapp.h,v 1.5 1999/05/16 17:29:59 juergen Exp $ +// $Id: cursesapp.h,v 1.8 2002/07/06 15:47:52 juergen Exp $ -#ifndef _CURSESAPP_H -#define _CURSESAPP_H +#ifndef NCURSES_CURSESAPP_H_incl +#define NCURSES_CURSESAPP_H_incl #include -class NCursesApplication { +class NCURSES_IMPEXP NCursesApplication { public: typedef struct _slk_link { // This structure is used to maintain struct _slk_link* prev; // a stack of SLKs @@ -160,4 +161,4 @@ public: }; -#endif // _CURSESAPP_H +#endif // NCURSES_CURSESAPP_H_incl diff --git a/c++/cursesf.cc b/c++/cursesf.cc index a3b066cb..aff7b4f8 100644 --- a/c++/cursesf.cc +++ b/c++/cursesf.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,15 +28,16 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ +#include "internal.h" #include "cursesf.h" #include "cursesapp.h" -#include "internal.h" -MODULE_ID("$Id: cursesf.cc,v 1.11 2000/06/09 16:15:40 juergen Exp $") - +MODULE_ID("$Id: cursesf.cc,v 1.15 2002/07/06 15:47:52 juergen Exp $") + NCursesFormField::~NCursesFormField () { if (field) OnError(::free_field (field)); @@ -54,16 +55,16 @@ NCursesForm::mapFields(NCursesFormField* nfields[]) { 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; @@ -104,7 +105,7 @@ NCursesForm::InitForm(NCursesFormField* nfields[], bool with_frame, bool autoDelete_Fields) { int mrows, mcols; - + keypad(TRUE); meta(TRUE); @@ -115,24 +116,24 @@ NCursesForm::InitForm(NCursesFormField* nfields[], 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); + OnError(E_NO_ROOM); sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); ::set_form_sub(form, sub->w); b_sub_owner = TRUE; @@ -161,14 +162,14 @@ NCursesForm::~NCursesForm() { if (b_autoDelete) { if (cnt>0) { for (int i=0; i <= cnt; i++) - delete my_fields[i]; + delete my_fields[i]; } delete[] my_fields; } ::free_form(form); // It's essential to do this after free_form() - delete[] fields; + delete[] fields; } } @@ -186,7 +187,7 @@ NCursesForm::setSubWindow(NCursesWindow& nsub) { /* 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 + * so in C++ providing a hook is done simply by * implementing a virtual method in a derived class */ void @@ -228,7 +229,7 @@ NCursesForm::On_Field_Termination(NCursesFormField& field) { } // call the form driver and do basic error checking. -int +int NCursesForm::driver (int c) { int res = ::form_driver (form, c); switch (res) { @@ -244,15 +245,15 @@ NCursesForm::driver (int c) { } void NCursesForm::On_Request_Denied(int c) const { - beep(); + ::beep(); } void NCursesForm::On_Invalid_Field(int c) const { - beep(); + ::beep(); } void NCursesForm::On_Unknown_Command(int c) const { - beep(); + ::beep(); } static const int CMD_QUIT = MAX_COMMAND + 1; @@ -266,8 +267,8 @@ NCursesForm::operator()(void) { post(); show(); refresh(); - - while (((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { + + while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); @@ -295,7 +296,7 @@ NCursesForm::operator()(void) { // code c into a form request code. // The default implementation provides a hopefully straightforward // mapping for the most common keystrokes and form requests. -int +int NCursesForm::virtualize(int c) { switch(c) { @@ -318,7 +319,7 @@ NCursesForm::virtualize(int c) { 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('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 @@ -341,7 +342,7 @@ NCursesForm::virtualize(int c) { case CTRL('N') : return(REQ_NEXT_CHOICE); case CTRL('P') : return(REQ_PREV_CHOICE); - + default: return(c); } @@ -362,7 +363,7 @@ bool UserDefinedFieldType::fcheck(FIELD *f, const void *u) { bool UserDefinedFieldType::ccheck(int c, const void *u) { NCursesFormField* F = (NCursesFormField*)u; assert(F != 0); - UserDefinedFieldType* udf = + UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); assert(udf != 0); return udf->char_check(c); @@ -383,7 +384,7 @@ FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = 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* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); assert(udf != 0); return udf->next(*F); @@ -392,7 +393,7 @@ bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) { 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* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); assert(udf != 0); return udf->previous(*F); @@ -408,7 +409,7 @@ public: UserDefinedFieldType::makearg, NULL, NULL); - if (code==E_OK) + if (code==E_OK) code = ::set_fieldtype_arg (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, UserDefinedFieldType::makearg, diff --git a/c++/cursesf.h b/c++/cursesf.h index 40f41461..abd2a7dc 100644 --- a/c++/cursesf.h +++ b/c++/cursesf.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: cursesf.h,v 1.12 2000/07/15 21:08:25 tom Exp $ +// $Id: cursesf.h,v 1.17 2002/07/06 15:47:52 juergen Exp $ -#ifndef _CURSESF_H -#define _CURSESF_H +#ifndef NCURSES_CURSESF_H_incl +#define NCURSES_CURSESF_H_incl 1 #include #include @@ -47,11 +48,11 @@ extern "C" { // The abstract base class for buitin and user defined Fieldtypes. // ------------------------------------------------------------------------- // -class NCursesFormField; // forward declaration +class NCURSES_IMPEXP NCursesFormField; // forward declaration // Class to represent builtin field types as well as C++ written new // fieldtypes (see classes UserDefineFieldType... -class NCursesFieldType { +class NCURSES_IMPEXP NCursesFieldType { friend class NCursesFormField; protected: @@ -80,7 +81,7 @@ public: // The class representing a forms field, wrapping the lowlevel FIELD struct // ------------------------------------------------------------------------- // -class NCursesFormField { +class NCURSES_IMPEXP NCursesFormField { friend class NCursesForm; protected: @@ -265,7 +266,7 @@ public: OnError(::set_field_buffer(field,buffer,val)); } - // Retrieve the value of a fields buffer. The defaukt buffer is nr. 0 + // Retrieve the value of a fields buffer. The default buffer is nr. 0 inline char* value(int buffer = 0) const { return ::field_buffer(field,buffer); } @@ -288,7 +289,7 @@ public: // The class representing a form, wrapping the lowlevel FORM struct // ------------------------------------------------------------------------- // -class NCursesForm : public NCursesPanel { +class NCURSES_IMPEXP NCursesForm : public NCursesPanel { protected: FORM* form; // the lowlevel structure @@ -541,7 +542,7 @@ public: // data belongs to some class T. Use T as template argument // to create a UserField. // ------------------------------------------------------------------------- -template class NCursesUserField : public NCursesFormField +template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField { public: NCursesUserField (int rows, @@ -574,7 +575,7 @@ public: // The same mechanism is used to attach user data to a form // ------------------------------------------------------------------------- // -template class NCursesUserForm : public NCursesForm +template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm { protected: // 'Internal' constructor, builds an object without association to a @@ -637,7 +638,7 @@ public: // Builtin Fieldtypes // ------------------------------------------------------------------------- // -class Alpha_Field : public NCursesFieldType { +class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType { private: int min_field_width; @@ -652,7 +653,7 @@ public: } }; -class Alphanumeric_Field : public NCursesFieldType { +class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType { private: int min_field_width; @@ -667,7 +668,7 @@ public: } }; -class Integer_Field : public NCursesFieldType { +class NCURSES_IMPEXP Integer_Field : public NCursesFieldType { private: int precision; long lower_limit, upper_limit; @@ -684,7 +685,7 @@ public: } }; -class Numeric_Field : public NCursesFieldType { +class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType { private: int precision; double lower_limit, upper_limit; @@ -701,7 +702,7 @@ public: } }; -class Regular_Expression_Field : public NCursesFieldType { +class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType { private: char* regex; @@ -712,8 +713,8 @@ private: public: Regular_Expression_Field(const char *expr) : NCursesFieldType(TYPE_REGEXP) { - regex = new char[1+::strlen(expr)]; - (strcpy)(regex,expr); + regex = new char[1 + ::strlen(expr)]; + (::strcpy)(regex,expr); } ~Regular_Expression_Field() { @@ -721,7 +722,7 @@ public: } }; -class Enumeration_Field : public NCursesFieldType { +class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType { private: char** list; int case_sensitive; @@ -742,7 +743,7 @@ public: } }; -class IPV4_Address_Field : public NCursesFieldType { +class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType { private: void set(NCursesFormField& f) { OnError(::set_field_type(f.get_field(),fieldtype)); @@ -757,7 +758,7 @@ public: // Abstract base class for User-Defined Fieldtypes // ------------------------------------------------------------------------- // -class UserDefinedFieldType : public NCursesFieldType { +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 @@ -793,7 +794,7 @@ public: // Abstract base class for User-Defined Fieldtypes with Choice functions // ------------------------------------------------------------------------- // -class UserDefinedFieldType_With_Choice : public UserDefinedFieldType { +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 @@ -820,5 +821,5 @@ public: } }; -#endif // _CURSESF_H +#endif // NCURSES_CURSESF_H_incl diff --git a/c++/cursesm.cc b/c++/cursesm.cc index 3b4dbd58..f1ff5766 100644 --- a/c++/cursesm.cc +++ b/c++/cursesm.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,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 * @@ -28,21 +28,22 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ +#include "internal.h" #include "cursesm.h" #include "cursesapp.h" -#include "internal.h" -MODULE_ID("$Id: cursesm.cc,v 1.12 1999/10/30 23:59:37 tom Exp $") - +MODULE_ID("$Id: cursesm.cc,v 1.17 2002/07/06 15:47:52 juergen Exp $") + NCursesMenuItem::~NCursesMenuItem() { if (item) OnError(::free_item(item)); } -bool +bool NCursesMenuItem::action() { return FALSE; }; @@ -50,7 +51,7 @@ NCursesMenuItem::action() { NCursesMenuCallbackItem::~NCursesMenuCallbackItem() { } -bool +bool NCursesMenuCallbackItem::action() { if (p_fct) return p_fct (*this); @@ -60,7 +61,7 @@ NCursesMenuCallbackItem::action() { /* 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 + * so in C++ providing a hook is done simply by * implementing a virtual method in a derived class */ void @@ -91,21 +92,21 @@ NCursesMenu::itm_term(MENU *m) { 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); + delete[] ::menu_items(menu); return items; } @@ -114,7 +115,7 @@ NCursesMenu::InitMenu(NCursesMenuItem* nitems[], bool with_frame, bool autoDelete_Items) { int mrows, mcols; - + keypad(TRUE); meta(TRUE); @@ -125,24 +126,24 @@ NCursesMenu::InitMenu(NCursesMenuItem* nitems[], 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); + OnError(E_NO_ROOM); sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); ::set_menu_sub(menu, sub->w); b_sub_owner = TRUE; @@ -180,14 +181,14 @@ NCursesMenu::~NCursesMenu() { if (b_autoDelete) { if (cnt>0) { for (int i=0; i <= cnt; i++) - delete my_items[i]; + delete my_items[i]; } delete[] my_items; } ::free_menu(menu); // It's essential to do this after free_menu() - delete[] itms; + delete[] itms; } } @@ -218,7 +219,7 @@ NCursesMenu::set_pattern (const char *pat) { } // call the menu driver and do basic error checking. -int +int NCursesMenu::driver (int c) { int res = ::menu_driver (menu, c); switch (res) { @@ -243,7 +244,7 @@ static const int CMD_ACTION = MAX_COMMAND + 2; // The default implementation provides a hopefully straightforward // mapping for the most common keystrokes and menu requests. // ------------------------------------------------------------------------- -int +int NCursesMenu::virtualize(int c) { switch(c) { case CTRL('X') : return(CMD_QUIT); // eXit @@ -291,8 +292,8 @@ NCursesMenu::operator()(void) { show(); refresh(); - while (!b_action && ((drvCmnd = virtualize((c=getch()))) != CMD_QUIT)) { - + while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + switch((err=driver(drvCmnd))) { case E_REQUEST_DENIED: On_Request_Denied(c); @@ -363,21 +364,20 @@ NCursesMenu::On_Item_Termination(NCursesMenuItem& item) { void NCursesMenu::On_Request_Denied(int c) const { - beep(); + ::beep(); } void NCursesMenu::On_Not_Selectable(int c) const { - beep(); + ::beep(); } void NCursesMenu::On_No_Match(int c) const { - beep(); + ::beep(); } void NCursesMenu::On_Unknown_Command(int c) const { - beep(); + ::beep(); } - diff --git a/c++/cursesm.h b/c++/cursesm.h index 26e0b4ce..8873eca3 100644 --- a/c++/cursesm.h +++ b/c++/cursesm.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: cursesm.h,v 1.13 1999/10/30 23:59:37 tom Exp $ +// $Id: cursesm.h,v 1.16 2002/07/06 15:47:52 juergen Exp $ -#ifndef _CURSESM_H -#define _CURSESM_H +#ifndef NCURSES_CURSESM_H_incl +#define NCURSES_CURSESM_H_incl 1 #include @@ -46,7 +47,7 @@ extern "C" { // This wraps the ITEM type of // ------------------------------------------------------------------------- // -class NCursesMenuItem { +class NCURSES_IMPEXP NCursesMenuItem { friend class NCursesMenu; protected: @@ -135,7 +136,7 @@ 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 NCursesMenuCallbackItem : public NCursesMenuItem { +class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem { private: ITEMCALLBACK* p_fct; @@ -156,7 +157,7 @@ public: // This wraps the MENU type of // ------------------------------------------------------------------------- // -class NCursesMenu : public NCursesPanel { +class NCURSES_IMPEXP NCursesMenu : public NCursesPanel { protected: MENU *menu; @@ -514,7 +515,7 @@ public: // to create a UserItem. // ------------------------------------------------------------------------- // -template class NCursesUserItem : public NCursesMenuItem +template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem { public: NCursesUserItem (const char* p_name, @@ -541,7 +542,7 @@ public: // The same mechanism is used to attach user data to a menu // ------------------------------------------------------------------------- // -template class NCursesUserMenu : public NCursesMenu +template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu { protected: NCursesUserMenu( int lines, @@ -589,4 +590,4 @@ public: } }; -#endif // _CURSESM_H +#endif // NCURSES_CURSESM_H_incl diff --git a/c++/cursesmain.cc b/c++/cursesmain.cc index 09400b8d..7a3721dd 100644 --- a/c++/cursesmain.cc +++ b/c++/cursesmain.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -#include "cursesapp.h" #include "internal.h" +#include "cursesapp.h" -MODULE_ID("$Id: cursesmain.cc,v 1.5 1999/05/16 17:31:22 juergen Exp $") +MODULE_ID("$Id: cursesmain.cc,v 1.9 2002/07/06 15:47:52 juergen Exp $") /* This is the default implementation of main() for a NCursesApplication. * You only have to instantiate a static NCursesApplication object in your @@ -45,7 +46,13 @@ int main(int argc, char* argv[]) NCursesApplication* A = NCursesApplication::getApplication(); if (!A) return(1); - A->handleArgs(argc,argv); - ::endwin(); - return((*A)()); + else { + int res; + + A->handleArgs(argc,argv); + ::endwin(); + res = (*A)(); + ::endwin(); + return(res); + } } diff --git a/c++/cursesp.cc b/c++/cursesp.cc index 50095d3d..2e6931b1 100644 --- a/c++/cursesp.cc +++ b/c++/cursesp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,14 +28,15 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1993,1997 * + * Author: Juergen Pfeifer, 1993, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -#include "cursesp.h" #include "internal.h" +#include "cursesp.h" #include -MODULE_ID("$Id: cursesp.cc,v 1.16 2000/07/15 21:08:13 tom Exp $") +MODULE_ID("$Id: cursesp.cc,v 1.20 2002/07/13 11:35:08 juergen Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -75,7 +76,7 @@ NCursesPanel::redraw() { int NCursesPanel::refresh() { ::update_panels(); - return doupdate(); + return ::doupdate(); } int @@ -116,9 +117,14 @@ NCursesPanel::label(const char *tLabel, const char *bLabel) { void NCursesPanel::centertext(int row,const char *label) { if (label) { - int x = (maxx() - strlen(label)) / 2; + 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/c++/cursesp.h b/c++/cursesp.h index 6293dd10..f5295e41 100644 --- a/c++/cursesp.h +++ b/c++/cursesp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -#ifndef _CURSESP_H -#define _CURSESP_H +#ifndef NCURSES_CURSESP_H_incl +#define NCURSES_CURSESP_H_incl 1 -// $Id: cursesp.h,v 1.12 1999/10/31 00:00:02 tom Exp $ +// $Id: cursesp.h,v 1.17 2002/07/06 15:47:52 juergen Exp $ #include @@ -42,7 +43,7 @@ extern "C" { # include } -class NCursesPanel : public NCursesWindow { +class NCURSES_IMPEXP NCursesPanel : public NCursesWindow { protected: PANEL *p; static NCursesPanel *dummy; @@ -79,6 +80,9 @@ protected: // If err is equal to the curses error indicator ERR, an error handler // is called. + // Get a keystroke. Default implementation calls getch() + virtual int getKey(void); + public: NCursesPanel(int lines, int cols, @@ -215,4 +219,4 @@ public: // Associate the user panel with the user data pointed to by p_UserData. }; -#endif // _CURSESP_H +#endif // NCURSES_CURSESP_H_incl diff --git a/c++/cursespad.cc b/c++/cursespad.cc index b82d3939..815f51ce 100644 --- a/c++/cursespad.cc +++ b/c++/cursespad.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,14 +28,15 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1999 * + * Author: Juergen Pfeifer, 1999 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ +#include "internal.h" #include "etip.h" #include "cursesw.h" -#include "internal.h" -MODULE_ID("$Id: cursespad.cc,v 1.2 1999/09/11 23:25:54 tom Exp $") +MODULE_ID("$Id: cursespad.cc,v 1.6 2002/09/22 19:32:55 tom Exp $") NCursesPad::NCursesPad(int lines, int cols) : NCursesWindow(), @@ -53,7 +54,8 @@ NCursesPad::NCursesPad(int lines, int cols) } -int NCursesPad::driver (int key) { +int NCursesPad::driver (int key) +{ // Default implementation switch(key) { case KEY_UP: @@ -79,7 +81,8 @@ int NCursesPad::driver (int key) { } -void NCursesPad::operator()(void) { +void NCursesPad::operator()(void) +{ NCursesWindow* W = Win(); if ((NCursesWindow*)0 != W) { @@ -164,7 +167,8 @@ void NCursesPad::operator()(void) { } -int NCursesPad::refresh() { +int NCursesPad::refresh() +{ int res = noutrefresh(); if (res==OK && ((NCursesWindow*)0 != viewWin)) { res = (viewWin->refresh()); @@ -172,7 +176,8 @@ int NCursesPad::refresh() { return(res); } -int NCursesPad::noutrefresh() { +int NCursesPad::noutrefresh() +{ int res = OK; NCursesWindow* W = Win(); if ((NCursesWindow*)0 != W) { @@ -210,7 +215,8 @@ void NCursesPad::setSubWindow(NCursesWindow& sub) viewSub = ⊂ } -void NCursesFramedPad::OnOperation(int pad_req) { +void NCursesFramedPad::OnOperation(int pad_req) +{ NCursesWindow* W = Win(); NCursesWindow* Win = getWindow(); diff --git a/c++/cursesw.cc b/c++/cursesw.cc index b61a7056..905a7b52 100644 --- a/c++/cursesw.cc +++ b/c++/cursesw.cc @@ -19,13 +19,14 @@ modified by Ulrich Drepper (drepper@karlsruhe.gmd.de) and Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) - modified by Juergen Pfeifer (juergen.pfeifer@gmx.net) + modified by Juergen Pfeifer + Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en */ -#include "cursesw.h" #include "internal.h" +#include "cursesw.h" -MODULE_ID("$Id: cursesw.cc,v 1.17 2000/09/02 18:55:31 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.25 2002/07/06 15:47:52 juergen Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -36,6 +37,14 @@ MODULE_ID("$Id: cursesw.cc,v 1.17 2000/09/02 18:55:31 tom Exp $") long NCursesWindow::count = 0L; bool NCursesWindow::b_initialized = FALSE; +/* + * The ncurses library has a fallback for vsscanf(), which may work... + */ +#if !(USE_STRSTREAM_VSCAN || USE_STRSTREAM_VSCAN_CAST) +# undef USE_STDIO_VSCAN +# define USE_STDIO_VSCAN 1 +#endif + #if defined(__GNUG__) # ifndef _IO_va_list # define _IO_va_list char * @@ -45,43 +54,56 @@ bool NCursesWindow::b_initialized = FALSE; int NCursesWindow::scanw(const char* fmt, ...) { -#if defined(__GNUG__) - va_list args; - va_start(args, fmt); + int result = ERR; char buf[BUFSIZ]; - int result = wgetstr(w, buf); - if (result == OK) { + + 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)); - result = ss.vscan(fmt, (_IO_va_list)args); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = OK; +#endif + va_end(args); } - va_end(args); return result; -#else - return ERR; -#endif } int NCursesWindow::scanw(int y, int x, const char* fmt, ...) { -#if defined(__GNUG__) - va_list args; - va_start(args, fmt); + int result = ERR; char buf[BUFSIZ]; - int result = wmove(w, y, x); - if (result == OK) { - result = wgetstr(w, buf); - if (result == OK) { + + 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)); - result = ss.vscan(fmt, (_IO_va_list)args); + if (ss.vscan(fmt, (_IO_va_list)args) != -1) + result = OK; +#endif + va_end(args); } } - va_end(args); return result; -#else - return ERR; -#endif } @@ -91,7 +113,7 @@ NCursesWindow::printw(const char * fmt, ...) va_list args; va_start(args, fmt); char buf[BUFSIZ]; - vsprintf(buf, fmt, args); + ::vsprintf(buf, fmt, args); va_end(args); return waddstr(w, buf); } @@ -102,10 +124,10 @@ NCursesWindow::printw(int y, int x, const char * fmt, ...) { va_list args; va_start(args, fmt); - int result = wmove(w, y, x); + int result = ::wmove(w, y, x); if (result == OK) { char buf[BUFSIZ]; - vsprintf(buf, fmt, args); + ::vsprintf(buf, fmt, args); result = waddstr(w, buf); } va_end(args); @@ -142,8 +164,7 @@ NCursesWindow::initialize() { } NCursesWindow::NCursesWindow() { - if (!b_initialized) - initialize(); + initialize(); w = (WINDOW *)0; init(); @@ -154,8 +175,7 @@ NCursesWindow::NCursesWindow() { NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x) { - if (!b_initialized) - initialize(); + initialize(); w = ::newwin(lines, cols, begin_y, begin_x); if (w == 0) { @@ -170,8 +190,7 @@ NCursesWindow::NCursesWindow(int lines, int cols, int begin_y, int begin_x) NCursesWindow::NCursesWindow(WINDOW* &window) { - if (!b_initialized) - initialize(); + initialize(); w = window; init(); @@ -183,6 +202,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window) 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(); @@ -208,6 +228,7 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c, 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"); @@ -244,6 +265,7 @@ 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; @@ -323,7 +345,7 @@ NCursesWindow::~NCursesWindow() } if (alloced && w != 0) - delwin(w); + ::delwin(w); if (alloced) { --count; @@ -364,7 +386,7 @@ NCursesWindow::getcolor(int getback) const short fore, back; if (colorInitialized==COLORS_ARE_REALLY_THERE) { - if (pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back)) + if (::pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back)) err_handler("Can't get color pair"); } else { @@ -396,7 +418,7 @@ int NCursesWindow::setpalette(short fore, short back, short pair) { if (colorInitialized==COLORS_ARE_REALLY_THERE) - return init_pair(pair, fore, back); + return ::init_pair(pair, fore, back); else return OK; } diff --git a/c++/cursesw.h b/c++/cursesw.h index 8091194c..5383399d 100644 --- a/c++/cursesw.h +++ b/c++/cursesw.h @@ -1,19 +1,42 @@ // * This makes emacs happy -*-Mode: C++;-*- -#ifndef _CURSESW_H -#define _CURSESW_H - -// $Id: cursesw.h,v 1.18 1999/10/23 15:16:53 tom Exp $ +/**************************************************************************** + * 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. * + ****************************************************************************/ + +#ifndef NCURSES_CURSESW_H_incl +#define NCURSES_CURSESW_H_incl 1 + +// $Id: cursesw.h,v 1.28 2001/07/15 01:17:56 tom Exp $ #include #include #include -#ifdef __MWERKS__ -/* This is a bogus check, stringstream is actually ANSI C++ standard, - * but old compilers like GCC don't have it, and new compilers like Metrowerks - * don't have strstream - */ -#include -#else + +#if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) #include #endif @@ -118,7 +141,7 @@ inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } #undef clearok #define clearok UNDEF(clearok) #else -extern "C" int clearok(WINDOW*, bool); +extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); #endif #ifdef clrtobot @@ -152,7 +175,7 @@ inline int UNDEF(erase)() { return erase(); } #endif #ifdef flushok -inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { +inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { return flushok(_win, _bf); } #undef flushok #define flushok UNDEF(flushok) @@ -185,49 +208,49 @@ inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str,n); } #endif #ifdef mvwinnstr -inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { +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) { +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) { +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) { +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) { +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) { +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) { +inline int UNDEF(insnstr)(const char *_str, int n) { return insnstr(_str,n); } #undef insnstr #define insnstr UNDEF(insnstr) @@ -254,7 +277,7 @@ inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str,n); } #endif #ifdef getyx -inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { +inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { getyx(win, y, x); } #undef getyx #define getyx UNDEF(getyx) @@ -301,7 +324,7 @@ inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } #undef leaveok #define leaveok UNDEF(leaveok) #else -extern "C" int leaveok(WINDOW* win, bool bf); +extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); #endif #ifdef move @@ -340,9 +363,9 @@ inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } #define scrollok UNDEF(scrollok) #else #if defined(__NCURSES_H) -extern "C" int scrollok(WINDOW*, bool); +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); #else -extern "C" int scrollok(WINDOW*, char); +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); #endif #endif @@ -365,7 +388,7 @@ inline int UNDEF(standout)() { return standout(); } #endif #ifdef subpad -inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) +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) @@ -434,7 +457,7 @@ inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } #endif #ifdef chgat -inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) { +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) @@ -442,7 +465,7 @@ inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) { #ifdef mvchgat inline int UNDEF(mvchgat)(int y, int x, int n, - attr_t attr, short color, const void *opts) { + attr_t attr, short color, const void *opts) { return mvchgat(y,x,n,attr,color,opts); } #undef mvchgat #define mvchgat UNDEF(mvchgat) @@ -450,7 +473,7 @@ inline int UNDEF(mvchgat)(int y, int x, int n, #ifdef mvwchgat inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts) { + attr_t attr, short color, const void *opts) { return mvwchgat(win,y,x,n,attr,color,opts); } #undef mvwchgat #define mvwchgat UNDEF(mvwchgat) @@ -538,7 +561,7 @@ inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) #endif #ifdef mvwinch -inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { +inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { return mvwinch(win, y, x);} #undef mvwinch #define mvwinch UNDEF(mvwinch) @@ -671,18 +694,18 @@ inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } * */ -class NCursesWindow +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(); - + void init(); + short getcolor(int getback) const; static int setpalette(short fore, short back, short pair); @@ -700,15 +723,15 @@ protected: // 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. @@ -718,18 +741,18 @@ protected: 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', by & bx are + char absrel = 'a');// if `a', begin_y & begin_x are // absolute screen pos, else if `r', they are relative to par origin NCursesWindow(NCursesWindow& par,// parent window @@ -751,31 +774,31 @@ public: 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. + // 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 defered until ncurses gets initialized. + // creation of the window is deferred until ncurses gets initialized. // The initialization function is then called. // ------------------------------------------------------------------------- // terminal status // ------------------------------------------------------------------------- - int lines() const { return LINES; } + int lines() const { initialize(); return LINES; } // Number of lines on terminal, *not* window - int cols() const { return COLS; } + int cols() const { initialize(); return COLS; } // Number of cols on terminal, *not* window - int tabsize() const { return TABSIZE; } + 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(); } + int colors() const { return NumberOfColors(); } // Number of available colors - + // ------------------------------------------------------------------------- // window status // ------------------------------------------------------------------------- @@ -797,25 +820,25 @@ public: int maxy() const { return w->_maxy; } // Largest y coord in window - short getcolor() const; + short getcolor() const; // Actual color pair - short foreground() const { return getcolor(0); } + short foreground() const { return getcolor(0); } // Actual foreground color - short background() const { return getcolor(1); } + short background() const { return getcolor(1); } // Actual background color - int setpalette(short fore, short back); + int setpalette(short fore, short back); // Set color palette entry - int setcolor(short pair); + int setcolor(short pair); // Set actually used palette entry - + // ------------------------------------------------------------------------- // window positioning // ------------------------------------------------------------------------- - virtual int mvwin(int begin_y, int begin_x) { + virtual int mvwin(int begin_y, int begin_x) { return ::mvwin(w,begin_y,begin_x); } // Move window to new position with the new position as top left corner. // This is virtual because it is redefined in NCursesPanel. @@ -827,12 +850,12 @@ public: // Move cursor the this position void getyx(int& y, int& x) const { ::getyx(w, y, x); } - // Get current position of the cursor + // Get current position of the cursor - int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { + 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 // ------------------------------------------------------------------------- @@ -842,13 +865,13 @@ public: 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) { + 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) { + 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. @@ -864,8 +887,7 @@ public: // as described above. int scanw(const char* fmt, ...) - // Perform a scanw function from the window. This only works if you're - // using the GNU C++ compiler. + // Perform a scanw function from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 2, 3))); #else @@ -874,18 +896,18 @@ public: int scanw(int y, int x, const char* fmt, ...) // Move the cursor to the requested position and then perform a scanw - // from the window. This nly works if you're using the GNU C++ compiler. + // from the window. #if __GNUG__ >= 2 __attribute__ ((format (scanf, 4, 5))); #else ; #endif - + // ------------------------------------------------------------------------- // output // ------------------------------------------------------------------------- int addch(const chtype ch) { return ::waddch(w, ch); } - // Put attributed character to the window. + // Put attributed character to the window. int addch(int y, int x, const chtype ch) { return ::mvwaddch(w,y,x,ch); } @@ -895,10 +917,10 @@ public: 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) { + int addstr(const char* str, int n=-1) { return ::waddnstr(w, (char*)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. + // 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,(char*)str,n); } @@ -907,7 +929,7 @@ public: int printw(const char* fmt, ...) // Do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 2, 3))); #else ; @@ -915,7 +937,7 @@ public: int printw(int y, int x, const char * fmt, ...) // Move the cursor and then do a formatted print to the window. -#if __GNUG__ >= 2 +#if (__GNUG__ >= 2) && !defined(printf) __attribute__ ((format (printf, 4, 5))); #else ; @@ -939,7 +961,7 @@ public: 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. @@ -949,7 +971,7 @@ public: // 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() @@ -957,7 +979,7 @@ public: 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; @@ -995,10 +1017,10 @@ public: // ------------------------------------------------------------------------- // borders // ------------------------------------------------------------------------- - int box(chtype vert=0, chtype hor=0) { + int box(chtype vert=0, chtype hor=0) { return ::wborder(w, vert, vert, hor, hor, 0, 0 ,0, 0); } // Draw a box around the window with the given vertical and horizontal - // drawing characters. If you specifiy a zero as character, curses will try + // drawing characters. If you specify a zero as character, curses will try // to find a "nice" character. int border(chtype left=0, chtype right=0, @@ -1016,7 +1038,7 @@ public: // ------------------------------------------------------------------------- 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. + // 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); } @@ -1029,7 +1051,7 @@ public: 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 // ------------------------------------------------------------------------- @@ -1050,7 +1072,7 @@ public: // Clear to the end of the line. int delch() { return ::wdelch(w); } - // Delete character under the cursor. + // 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 @@ -1090,18 +1112,18 @@ public: int untouchwin() { return ::wtouchln(w,0,height(),0); } // Mark the whole window as unmodified. - int touchln(int s, int cnt, bool changed=TRUE) { + 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 { + bool is_linetouched(int line) const { return (::is_linetouched(w,line) ? TRUE:FALSE); } - // Return TRUE if line is marked as changed, FALSE otherwise + // Return TRUE if line is marked as changed, FALSE otherwise - bool is_wintouched() const { + bool is_wintouched() const { return (::is_wintouched(w) ? TRUE:FALSE); } - // Return TRUE if window is marked as changed, FALSE otherwise + // 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 @@ -1141,7 +1163,7 @@ public: 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. + // 7-Bit characters are generated. int standout() { return ::wstandout(w); } // Enable "standout" attributes @@ -1158,9 +1180,9 @@ public: // doupdate(). This is redefined in NCursesPanel. virtual int noutrefresh() { return ::wnoutrefresh(w); } - // Propagate the changes in this window to the virtual screen. This is + // Propagate the changes in this window to the virtual screen. This is // redefined in NCursesPanel. - + // ------------------------------------------------------------------------- // multiple window control // ------------------------------------------------------------------------- @@ -1207,7 +1229,7 @@ public: // ------------------------------------------------------------------------- // We leave this here for compatibility reasons. // ------------------------------------------------------------------------- -class NCursesColorWindow : public NCursesWindow { +class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow { public: NCursesColorWindow(WINDOW* &window) // useful only for stdscr : NCursesWindow(window) { @@ -1228,8 +1250,8 @@ public: 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(); } + absrel ) { // relative to par origin + useColors(); } }; // These enum definitions really belong inside the NCursesPad class, but only @@ -1251,7 +1273,7 @@ public: // Pad Support. We allow an association of a pad with a "real" window // through which the pad may be viewed. // ------------------------------------------------------------------------- -class NCursesPad : public NCursesWindow { +class NCURSES_IMPEXP NCursesPad : public NCursesWindow { private: NCursesWindow* viewWin; // the "viewport" window NCursesWindow* viewSub; // the "viewport" subwindow @@ -1301,7 +1323,7 @@ public: 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. @@ -1326,7 +1348,7 @@ public: return ::pnoutrefresh(w,pminrow,pmincol, sminrow,smincol,smaxrow,smaxcol); } - // Does the same like refresh() but without calling doupdate(). + // 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. @@ -1343,7 +1365,7 @@ public: // 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 NCursesFramedPad : public NCursesPad { +class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad { protected: virtual void OnOperation(int pad_req); @@ -1372,4 +1394,4 @@ public: }; -#endif // _CURSESW_H +#endif // NCURSES_CURSESW_H_incl diff --git a/c++/cursslk.cc b/c++/cursslk.cc index 236d3a55..2107625b 100644 --- a/c++/cursslk.cc +++ b/c++/cursslk.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,26 +28,27 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ +#include "internal.h" #include "cursslk.h" #include "cursesapp.h" -#include "internal.h" #include -MODULE_ID("$Id: cursslk.cc,v 1.6 2000/07/15 21:07:50 tom Exp $") +MODULE_ID("$Id: cursslk.cc,v 1.10 2002/07/13 11:35:08 juergen Exp $") void Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) { delete[] label; label = new char[1 + ::strlen(text)]; - (strcpy)(label,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::Label_Layout Soft_Label_Key_Set::format = None; void Soft_Label_Key_Set::init() { diff --git a/c++/cursslk.h b/c++/cursslk.h index 1598b063..ab6a9c0f 100644 --- a/c++/cursslk.h +++ b/c++/cursslk.h @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,20 +28,21 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: cursslk.h,v 1.5 1999/05/16 17:30:08 juergen Exp $ +// $Id: cursslk.h,v 1.8 2002/07/06 15:47:52 juergen Exp $ -#ifndef _CURSSLK_H -#define _CURSSLK_H +#ifndef NCURSES_CURSSLK_H_incl +#define NCURSES_CURSSLK_H_incl #include -class Soft_Label_Key_Set { +class NCURSES_IMPEXP Soft_Label_Key_Set { public: // This inner class represents the attributes of a Soft Label Key (SLK) - class Soft_Label_Key { + class NCURSES_IMPEXP Soft_Label_Key { friend class Soft_Label_Key_Set; public: typedef enum { Left=0, Center=1, Right=2 } Justification; @@ -83,10 +84,10 @@ public: } Label_Layout; private: - static long count; // Number of Key Sets - static Label_Layout format; // Layout of the Key Sets - static int num_labels; // Number Of Labels in Key Sets - bool b_attrInit; // Are attributes initialized + 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 @@ -126,12 +127,12 @@ public: // This constructor assumes, that you already constructed a Key Set // with a layout by the constructor above. This layout will be reused. - Soft_Label_Key_Set(); + NCURSES_IMPEXP Soft_Label_Key_Set(); virtual ~Soft_Label_Key_Set(); // Get Label# i. Label counting starts with 1! - Soft_Label_Key& operator[](int i); + NCURSES_IMPEXP Soft_Label_Key& operator[](int i); // Retrieve number of Labels inline int labels() const { return num_labels; } @@ -202,4 +203,4 @@ public: } }; -#endif // _CURSSLK_H +#endif // NCURSES_CURSSLK_H_incl diff --git a/c++/demo.cc b/c++/demo.cc index 088dc2fb..047e4b24 100644 --- a/c++/demo.cc +++ b/c++/demo.cc @@ -4,9 +4,10 @@ * written by Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) * * Demo code for NCursesMenu and NCursesForm written by - * Juergen Pfeifer + * Juergen Pfeifer + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * - * $Id: demo.cc,v 1.18 1999/09/11 18:57:54 tom Exp $ + * $Id: demo.cc,v 1.22 2002/07/06 15:47:52 juergen Exp $ */ #include "cursesapp.h" @@ -19,7 +20,7 @@ extern "C" unsigned int sleep(unsigned int); -#undef index // needed for NeXT +#undef index // needed for NeXT // // ------------------------------------------------------------------------- @@ -140,7 +141,7 @@ template class MyAction : public NCursesUserItem { public: MyAction (const char* p_name, - const T* p_UserData) + const T* p_UserData) : NCursesUserItem(p_name, (const char*)0, p_UserData) {}; @@ -170,7 +171,7 @@ class Label : public NCursesFormField { public: Label(const char* title, - int row, int col) + int row, int col) : NCursesFormField(1,(int)::strlen(title),row,col) { set_value(title); options_off(O_EDIT|O_ACTIVE); @@ -293,18 +294,18 @@ public: for (int i=0; i < PADSIZE; i++) { for (int j=0; j < PADSIZE; j++) { - if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { - if (i==0 || j==0) - FP.addch('+'); - else - FP.addch((chtype)('A' + (gridcount++ % 26))); - } - else if (i % GRIDSIZE == 0) - FP.addch('-'); - else if (j % GRIDSIZE == 0) - FP.addch('|'); - else - FP.addch(' '); + if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { + if (i==0 || j==0) + FP.addch('+'); + else + FP.addch((chtype)('A' + (gridcount++ % 26))); + } + else if (i % GRIDSIZE == 0) + FP.addch('-'); + else if (j % GRIDSIZE == 0) + FP.addch('|'); + else + FP.addch(' '); } } @@ -324,6 +325,49 @@ public: options_off(O_SELECTABLE); } }; + +// +// ------------------------------------------------------------------------- +// +class ScanAction : public NCursesMenuItem +{ +public: + ScanAction(const char* s) : NCursesMenuItem(s) { + } + + bool action() { + NCursesPanel *std = new NCursesPanel(); + + NCursesPanel *w = new NCursesPanel(std->lines() - 2, std->cols() - 2, 1, 1); + w->box(); + w->refresh(); + + NCursesPanel *s = new NCursesPanel(w->lines() - 6, w->cols() - 6, 3, 3); + s->scrollok(TRUE); + ::echo(); + + s->printw("Enter decimal integers. The running total will be shown\n"); + int value = -1; + int result = 0; + while (value != 0) { + value = 0; + s->scanw("%d", &value); + if (value != 0) { + s->printw("%d: ", result += value); + } + s->refresh(); + } + s->printw("\nPress any key to continue..."); + s->getch(); + + delete s; + delete w; + delete std; + ::noecho(); + return FALSE; + } +}; + // // ------------------------------------------------------------------------- // @@ -346,7 +390,7 @@ public: I[2] = new MyAction ("Silly", u); I[3] = new FormAction("Form"); I[4] = new PadAction("Pad"); - I[5] = new PassiveItem("Six"); + I[5] = new ScanAction("Scan"); I[6] = new QuitItem(); I[7] = new NCursesMenuItem(); // Terminating empty item diff --git a/c++/edit_cfg.sh b/c++/edit_cfg.sh index efea8332..e0c18225 100755 --- a/c++/edit_cfg.sh +++ b/c++/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.8 2000/07/01 16:07:37 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/08 20:44:59 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -42,10 +42,13 @@ for name in \ ETIP_NEEDS_MATH_EXCEPTION \ ETIP_NEEDS_MATH_H \ HAVE_BUILTIN_H \ - HAVE_GXX_BUILTIN_H \ HAVE_GPP_BUILTIN_H \ + HAVE_GXX_BUILTIN_H \ + HAVE_STRSTREAM_H \ HAVE_TYPEINFO \ - HAVE_VALUES_H + HAVE_VALUES_H \ + USE_STRSTREAM_VSCAN \ + USE_STRSTREAM_VSCAN_CAST do mv $2 $2.bak if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) diff --git a/c++/etip.h.in b/c++/etip.h.in index 985cd1eb..d41c7d43 100644 --- a/c++/etip.h.in +++ b/c++/etip.h.in @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,14 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: etip.h.in,v 1.13 1999/09/12 02:01:59 tom Exp $ +// $Id: etip.h.in,v 1.24 2002/10/12 22:33:07 Dimitar.Zhekov Exp $ -#ifndef _ETIP_H -#define _ETIP_H +#ifndef NCURSES_ETIP_H_incl +#define NCURSES_ETIP_H_incl 1 // These are substituted at configure/build time #ifndef HAVE_BUILTIN_H @@ -49,6 +50,10 @@ #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 @@ -69,6 +74,14 @@ #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 @@ -104,6 +117,8 @@ # include #endif +#include + extern "C" { #if HAVE_VALUES_H # include @@ -122,11 +137,11 @@ extern "C" { #endif // Forward Declarations -class NCursesPanel; -class NCursesMenu; -class NCursesForm; +class NCURSES_IMPEXP NCursesPanel; +class NCURSES_IMPEXP NCursesMenu; +class NCURSES_IMPEXP NCursesForm; -class NCursesException +class NCURSES_IMPEXP NCursesException { public: const char *message; @@ -145,30 +160,30 @@ public: } }; -class NCursesPanelException : public NCursesException +class NCURSES_IMPEXP NCursesPanelException : public NCursesException { public: const NCursesPanel* p; - NCursesPanelException (const char *msg, int err) : + NCursesPanelException (const char *msg, int err) : NCursesException (msg, err), p ((NCursesPanel*)0) {}; NCursesPanelException (const NCursesPanel* panel, const char *msg, - int err) : + int err) : NCursesException (msg, err), p (panel) {}; - NCursesPanelException (int err) : + NCursesPanelException (int err) : NCursesException ("panel library error", err), p ((NCursesPanel*)0) {}; NCursesPanelException (const NCursesPanel* panel, - int err) : + int err) : NCursesException ("panel library error", err), p (panel) {}; @@ -179,30 +194,30 @@ public: }; -class NCursesMenuException : public NCursesException +class NCURSES_IMPEXP NCursesMenuException : public NCursesException { public: const NCursesMenu* m; - NCursesMenuException (const char *msg, int err) : + NCursesMenuException (const char *msg, int err) : NCursesException (msg, err), m ((NCursesMenu *)0) {}; NCursesMenuException (const NCursesMenu* menu, const char *msg, - int err) : + int err) : NCursesException (msg, err), m (menu) {}; - NCursesMenuException (int err) : + NCursesMenuException (int err) : NCursesException ("menu library error", err), m ((NCursesMenu *)0) {}; NCursesMenuException (const NCursesMenu* menu, - int err) : + int err) : NCursesException ("menu library error", err), m (menu) {}; @@ -213,30 +228,30 @@ public: }; -class NCursesFormException : public NCursesException +class NCURSES_IMPEXP NCursesFormException : public NCursesException { public: const NCursesForm* f; - NCursesFormException (const char *msg, int err) : + NCursesFormException (const char *msg, int err) : NCursesException (msg, err), f ((NCursesForm*)0) {}; NCursesFormException (const NCursesForm* form, const char *msg, - int err) : + int err) : NCursesException (msg, err), f (form) {}; - NCursesFormException (int err) : + NCursesFormException (int err) : NCursesException ("form library error", err), f ((NCursesForm*)0) {}; NCursesFormException (const NCursesForm* form, - int err) : + int err) : NCursesException ("form library error", err), f (form) {}; @@ -247,27 +262,31 @@ public: }; -#if !(defined(__GNUG__)||defined(__SUNPRO_CC)) +#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) # include extern "C" void exit(int); #endif inline void THROW(const NCursesException *e) { -#if defined(__GNUG__) +#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 +#endif } #define THROWS(s) -#endif // _ETIP_H +#endif // NCURSES_ETIP_H_incl diff --git a/c++/internal.h b/c++/internal.h index 67bc3ff2..d680d144 100644 --- a/c++/internal.h +++ b/c++/internal.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,13 +28,16 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1997 * + * Author: Juergen Pfeifer, 1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -// $Id: internal.h,v 1.6 2000/09/02 18:22:23 tom Exp $ +// $Id: internal.h,v 1.9 2002/07/13 11:35:08 juergen Exp $ -#ifndef _CPLUS_INTERNAL_H -#define _CPLUS_INTERNAL_H 1 +#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; @@ -44,4 +47,4 @@ #define CTRL(x) ((x) & 0x1f) -#endif +#endif // NCURSES_CPLUS_INTERNAL_H diff --git a/config.guess b/config.guess index b100dbe1..9f4e5a6d 100755 --- a/config.guess +++ b/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -version='2000-06-13' +timestamp='2002-08-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,38 +24,50 @@ version='2000-06-13' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Written by Per Bothner . -# Please send patches to . +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# +# don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of this system. +Output the configuration name of the system \`$me' is run on. Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; @@ -64,9 +76,7 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; @@ -78,70 +88,95 @@ if test $# != 0; then exit 1 fi -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; +unset files' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) +# (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - i?86:OS/2:*:*) - echo "i386-unknown-os2" - exit 0;; *:NetBSD:*:*) - # Netbsd (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-cbm ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - *) machine=${UNAME_MACHINE}-unknown ;; + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; esac - # The Operating System including object format. - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -149,6 +184,45 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -157,6 +231,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. + eval $set_cc_for_build cat <$dummy.s .data \$Lformat: @@ -184,7 +259,7 @@ main: EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then - case `./$dummy` in + case `$dummy` in 0-0) UNAME_MACHINE="alpha" ;; @@ -203,9 +278,15 @@ EOF 2-307) UNAME_MACHINE="alphaev67" ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; esac fi - rm -f $dummy.s $dummy + rm -f $dummy.s $dummy && rmdir $tmpdir echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) @@ -218,31 +299,13 @@ EOF echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 + echo m68k-unknown-sysv4 exit 0;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -250,7 +313,7 @@ EOF arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - SR2?01:HI-UX/MPP:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) @@ -264,6 +327,10 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -292,7 +359,7 @@ EOF echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) @@ -306,9 +373,6 @@ EOF aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -335,18 +399,6 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -363,6 +415,7 @@ EOF echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ @@ -385,11 +438,20 @@ EOF } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; @@ -434,14 +496,23 @@ EOF *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) + i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include @@ -453,8 +524,8 @@ EOF exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -462,9 +533,9 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -472,7 +543,7 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=4.${UNAME_RELEASE} + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; @@ -498,11 +569,28 @@ EOF echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - sed 's/^ //' << EOF >$dummy.c + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include @@ -535,13 +623,19 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` - rm -f $dummy.c $dummy + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) + eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int @@ -567,8 +661,8 @@ EOF exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -577,7 +671,7 @@ EOF 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; - *9??*:MPE/iX:*:*) + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) @@ -586,7 +680,7 @@ EOF hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; - i?86:OSF1:*:*) + i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else @@ -596,9 +690,6 @@ EOF parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; - hppa*:OpenBSD:*:*) - echo hppa-unknown-openbsd - exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; @@ -617,41 +708,34 @@ EOF C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3E:*:*:*) + CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) @@ -661,10 +745,19 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -672,6 +765,12 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -693,223 +792,139 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; - *:Linux:*:*) - + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g - s/.*supported emulations: *// + s/.*supported targets: *// s/ .*// p'` - case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - i?86linux) + a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 - ;; - elf_i?86) - echo "${UNAME_MACHINE}-pc-linux" - exit 0 - ;; - i?86coff) + exit 0 ;; + coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 - ;; - sparclinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - armlinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32arm*) - echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" - exit 0 - ;; - armelf_linux*) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; - m68klinux) - echo "${UNAME_MACHINE}-unknown-linux-gnuaout" - exit 0 - ;; - elf32ppc | elf32ppclinux) - # Determine Lib Version - cat >$dummy.c < -#if defined(__GLIBC__) -extern char __libc_version[]; -extern char __libc_release[]; -#endif -main(argc, argv) - int argc; - char *argv[]; -{ -#if defined(__GLIBC__) - printf("%s %s\n", __libc_version, __libc_release); -#else - printf("unkown\n"); -#endif - return 0; -} -EOF - LIBC="" - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null - if test "$?" = 0 ; then - ./$dummy | grep 1\.99 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.c $dummy - echo powerpc-unknown-linux-gnu${LIBC} - exit 0 - ;; - shelf_linux) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - cat <$dummy.s - .data - \$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main - main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - LIBC="" - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - esac - - objdump --private-headers $dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c < /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - elif test "${UNAME_MACHINE}" = "s390"; then - echo s390-ibm-linux && exit 0 - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - fi ;; -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions -# are messed up and put the nodename in both sysname and nodename. - i?86:DYNIX/ptx:4*:*) + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; - i?86:UNIX_SV:4.2MP:2.*) + i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, @@ -917,7 +932,7 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} @@ -925,34 +940,33 @@ EOF echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; - i?86:*:5:7*) - # Fixed at (any) Pentium or better - UNAME_MACHINE=i586 - if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then - echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; - i?86:*:3.2:*) + i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i?86:*DOS:*:*) + i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) @@ -978,9 +992,12 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -991,21 +1008,24 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; @@ -1023,8 +1043,8 @@ EOF echo ns32k-sni-sysv fi exit 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) @@ -1036,10 +1056,14 @@ EOF # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -1064,6 +1088,9 @@ EOF SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; @@ -1074,28 +1101,74 @@ EOF echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-W:NONSTOP_KERNEL:*:*) + NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +eval $set_cc_for_build cat >$dummy.c < @@ -1182,11 +1255,24 @@ main () #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif #if defined (alliant) && defined (i860) @@ -1197,8 +1283,8 @@ main () } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir # Apollos put the system type in the environment. @@ -1233,8 +1319,9 @@ fi cat >&2 < in order to provide the needed information to handle your system. -config.guess version = $version +config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` @@ -1270,7 +1357,7 @@ exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" +# time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/config.sub b/config.sub index f8ec622e..b0222f7e 100755 --- a/config.sub +++ b/config.sub @@ -1,9 +1,9 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -# Free Software Foundation, Inc. +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. -version='2000-07-06' +timestamp='2002-08-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -29,7 +29,8 @@ version='2000-07-06' # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Please send patches to . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -60,16 +61,30 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS Canonicalize a configuration name. Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; @@ -78,9 +93,7 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" + echo "$me: invalid option $1$help" exit 1 ;; *local*) @@ -105,7 +118,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -122,9 +135,6 @@ esac ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in - -os2) - basic_machine=`echo $1 | sed -e 's/86-.*/86/'` - ;; -sun*os*) # Prevent following clause from handling this invalid input. ;; @@ -148,6 +158,14 @@ case $os in os=-vxworks basic_machine=$1 ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; -hiux*) os=-hiuxwe2 ;; @@ -206,22 +224,46 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ - | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ - | hppa64 \ - | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ - | alphaev6[78] \ - | we32k | ns16k | clipper | i370 | sh | sh[34] \ - | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ - | mips64orion | mips64orionel | mipstx39 | mipstx39el \ - | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ - | mips64vr5000 | miprs64vr5000el | mcore \ - | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr) + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -229,13 +271,13 @@ case $basic_machine in basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86) + i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -244,28 +286,56 @@ case $basic_machine in exit 1 ;; # Recognize the basic CPU types with company name. - # FIXME: clean up the formatting here. - vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ - | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ - | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ - | hppa2.0n-* | hppa64-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ - | alphaev6[78]-* \ - | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ - | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ - | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ - | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ - | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-*) + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -302,14 +372,14 @@ case $basic_machine in os=-sysv ;; amiga | amiga-*) - basic_machine=m68k-cbm + basic_machine=m68k-unknown ;; amigaos | amigados) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) - basic_machine=m68k-cbm + basic_machine=m68k-unknown os=-sysv4 ;; apollo68) @@ -328,6 +398,10 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -348,16 +422,8 @@ case $basic_machine in basic_machine=c38-convex os=-bsd ;; - cray | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray + cray | j90) + basic_machine=j90-cray os=-unicos ;; crds | unos) @@ -372,6 +438,14 @@ case $basic_machine in decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola @@ -413,6 +487,10 @@ case $basic_machine in basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -488,19 +566,19 @@ case $basic_machine in basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) + i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; - i[34567]86v4*) + i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; - i[34567]86v) + i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; - i[34567]86sol2) + i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; @@ -512,14 +590,6 @@ case $basic_machine in basic_machine=i386-unknown os=-vsta ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -545,6 +615,10 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; @@ -552,14 +626,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -574,8 +640,12 @@ case $basic_machine in basic_machine=m68k-rom68k os=-coff ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; msdos) - basic_machine=i386-unknown + basic_machine=i386-pc os=-msdos ;; mvs) @@ -639,6 +709,10 @@ case $basic_machine in basic_machine=i960-intel os=-mon960 ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; @@ -649,6 +723,10 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -671,45 +749,59 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2) - basic_machine=i786-pc + basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -720,10 +812,22 @@ case $basic_machine in rtpc | rtpc-*) basic_machine=romp-ibm ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; sa29200) basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; sequent) basic_machine=i386-sequent ;; @@ -731,7 +835,7 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; - sparclite-wrs) + sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -797,8 +901,16 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; t3e) - basic_machine=t3e-cray + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) @@ -811,6 +923,10 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; tower | tower-32) basic_machine=m68k-ncr ;; @@ -835,8 +951,8 @@ case $basic_machine in os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -857,13 +973,17 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - xmp) - basic_machine=xmp-cray - os=-unicos + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim @@ -884,13 +1004,6 @@ case $basic_machine in op60c) basic_machine=hppa1.1-oki ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; romp) basic_machine=romp-ibm ;; @@ -900,19 +1013,26 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; - sh3 | sh4) - base_machine=sh-unknown + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown ;; - sparc | sparcv9) + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -931,6 +1051,9 @@ case $basic_machine in basic_machine=c4x-none os=-coff ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 @@ -987,15 +1110,19 @@ case $os in | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit*) + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in - x86-* | i[34567]86-*) + x86-* | i*86-*) ;; *) os=-nto$os @@ -1006,7 +1133,6 @@ case $os in os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -os2 \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; @@ -1043,16 +1169,22 @@ case $os in -acis*) os=-aos ;; + -atheos*) + os=-atheos + ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; + -nova*) + os=-rtmk-nova + ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; - -nsk) + -nsk*) os=-nsk ;; # Preserve the version number of sinix5. @@ -1089,8 +1221,8 @@ case $os in -xenix) os=-xenix ;; - -*mint | -*MiNT) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint ;; -none) ;; @@ -1123,7 +1255,11 @@ case $basic_machine in arm*-semi) os=-aout ;; - pdp11-*) + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1150,6 +1286,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or32-*) + os=-coff + ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; @@ -1213,25 +1352,25 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) @@ -1297,7 +1436,7 @@ case $basic_machine in -ptx*) vendor=sequent ;; - -vxsim* | -vxworks*) + -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) @@ -1309,9 +1448,12 @@ case $basic_machine in -mpw* | -macos*) vendor=apple ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; + -vos*) + vendor=stratus + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; @@ -1322,7 +1464,7 @@ exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" +# time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/configure b/configure index c18a988f..c20c60f3 100755 --- a/configure +++ b/configure @@ -1,30 +1,120 @@ #! /bin/sh - -# From configure.in Revision: 1.220 - - - +# From configure.in Revision: 1.274 . # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13.20000819 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by Autoconf 2.52.20011227. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -# Defaults: -ac_help= +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="ncurses/base/lib_initscr.c" # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -33,10 +123,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -50,17 +145,16 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -68,59 +162,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -129,175 +223,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF -cat <&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -451,98 +416,98 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=ncurses/base/lib_initscr.c +test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then @@ -553,13 +518,408 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -570,57 +930,118 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:933: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:944: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:952: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:968: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:972: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:978: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:980: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:982: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:1001: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:1003: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:1023: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:1026: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' else - ac_n= ac_c='\c' ac_t= + ac_path_separator=: fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh - - - +ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin" 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} -echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)" 1>&6 - - - - - - - +cf_cv_timestamp=`date` +echo "$as_me:1043: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do @@ -632,106 +1053,101 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:1063: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:1073: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1077: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1086: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:1090: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1095: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1102: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:1111: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1116: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess ; then - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. + echo "$as_me:1124: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:1133: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1138: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:675: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:696: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:714: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && +test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" @@ -739,33 +1155,35 @@ else system_name="`(hostname) 2>/dev/null`" fi fi -test -n "$system_name" && cat >> confdefs.h <>confdefs.h <&6 +if test "${cf_cv_system_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_system_name="$system_name" fi - test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6 +test -n "$cf_cv_system_name" && echo "$as_me:1169: result: Configuring for $cf_cv_system_name" >&5 +echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then - echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6 - { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; } + echo "$as_me:1173: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 +echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 + { { echo "$as_me:1175: error: \"Please remove config.cache and try again.\"" >&5 +echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} + { (exit 1); exit 1; }; } fi - # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - echo "configure: warning: overriding system type to $withval" 1>&2 + { echo "$as_me:1183: WARNING: overriding system type to $withval" >&5 +echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval -fi - +fi; # We need a configure script only when compiling as part of GNU C library. # Here we have to generate one of the files we need while compiling. @@ -783,8 +1201,7 @@ if test "${enable_add_ons+set}" = set; then glibc_add_on=yes else glibc_add_on= -fi - +fi; if test x"$glibc_add_on" = "xyes" ; then rm -f $srcdir/Banner @@ -802,23 +1219,24 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo $ac_n "checking for prefix""... $ac_c" 1>&6 -echo "configure:807: checking for prefix" >&5 +echo "$as_me:1222: checking for prefix" >&5 +echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict - openbsd*|netbsd*|freebsd*|linux*) + openbsd*|netbsd*|freebsd*|linux*|cygwin*) prefix=/usr ;; *) prefix=$ac_default_prefix ;; esac fi -echo "$ac_t""$prefix" 1>&6 +echo "$as_me:1234: result: $prefix" >&5 +echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo $ac_n "checking for default include-directory""... $ac_c" 1>&6 -echo "configure:822: checking for default include-directory" >&5 +echo "$as_me:1238: checking for default include-directory" >&5 +echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ $includedir \ @@ -840,219 +1258,583 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$ac_t""$includedir" 1>&6 +echo "$as_me:1261: result: $includedir" >&5 +echo "${ECHO_T}$includedir" >&6 fi - ### Checks for programs. -# Extract the first word of "gcc", so it can be a program name with args. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1274: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1289: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1297: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1300: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:852: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:1309: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1324: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1332: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1335: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1348: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1363: found $ac_dir/$ac_word" >&5 +break +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:1371: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1374: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1383: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1398: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1406: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1409: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC else - echo "$ac_t""no" 1>&6 + CC="$ac_cv_prog_CC" fi +fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:882: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:1422: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1442: found $ac_dir/$ac_word" >&5 +break +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" + set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:1464: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:1467: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:933: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1478: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1493: found $ac_dir/$ac_word" >&5 +break +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:1501: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + echo "$as_me:1504: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:965: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1517: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1532: found $ac_dir/$ac_word" >&5 +break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1540: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1543: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -cat > conftest.$ac_ext << EOF + test -n "$ac_ct_CC" && break +done -#line 976 "configure" + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1555: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:1560:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1563: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1566: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1568: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1571: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1573: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1576: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1580 "configure" #include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1596: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1599: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1602: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1625: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1631: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1636: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1642: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1645: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1652: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1007: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1012: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes +echo "$as_me:1660: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1667: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1669: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1672: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1674: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1677: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - ac_cv_prog_gcc=no -fi + { { echo "$as_me:1693: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +rm -f conftest$ac_cv_exeext +echo "$as_me:1699: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1705: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1711 "configure" +#include "confdefs.h" + +int +main () +{ -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1723: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1726: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else - GCC= + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1738: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } fi -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1040: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1745: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1749: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + cat >conftest.$ac_ext <<_ACEOF +#line 1755 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1773: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1776: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1779: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1791: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1797: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1803 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1818: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1821: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1824: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +echo "$as_me:1834: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -1066,186 +1848,458 @@ else CFLAGS= fi fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1861: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1864: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1867: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1870: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1882 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1895: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1898: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1901: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1904: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1914 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1926: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1929: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1932: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1935: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi -if test "$GCC" = yes ; then - echo $ac_n "checking version of gcc""... $ac_c" 1>&6 -echo "configure:1073: checking version of gcc" >&5 - eval "$CC --version" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi -if test "$host" != $build; then - for ac_prog in $CC gcc cc +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +GCC_VERSION=none +if test "$GCC" = yes ; then + echo "$as_me:1964: checking version of gcc" >&5 +echo $ECHO_N "checking version of gcc... $ECHO_C" >&6 + GCC_VERSION="`${CC} --version|head -1`" + echo "$as_me:1967: result: $GCC_VERSION" >&5 +echo "${ECHO_T}$GCC_VERSION" >&6 +fi + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_CPPFLAGS='$(CPPFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + +# Check whether --with-build-cc or --without-build-cc was given. +if test "${with_build_cc+set}" = set; then + withval="$with_build_cc" + BUILD_CC="$withval" +else + for ac_prog in $CC gcc cc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1082: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:1990: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_BUILD_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BUILD_CC"; then ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_BUILD_CC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_BUILD_CC="$ac_prog" +echo "$as_me:2005: found $ac_dir/$ac_word" >&5 +break +done + fi fi -BUILD_CC="$ac_cv_prog_BUILD_CC" +BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$ac_t""$BUILD_CC" 1>&6 + echo "$as_me:2013: result: $BUILD_CC" >&5 +echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:2016: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$BUILD_CC" && break + test -n "$BUILD_CC" && break done -else - BUILD_CC="$CC" +fi; + +# Check whether --with-build-cflags or --without-build-cflags was given. +if test "${with_build_cflags+set}" = set; then + withval="$with_build_cflags" + BUILD_CFLAGS="$withval" +fi; + +# Check whether --with-build-cppflags or --without-build-cppflags was given. +if test "${with_build_cppflags+set}" = set; then + withval="$with_build_cppflags" + BUILD_CPPFLAGS="$withval" +fi; + +# Check whether --with-build-ldflags or --without-build-ldflags was given. +if test "${with_build_ldflags+set}" = set; then + withval="$with_build_ldflags" + BUILD_LDFLAGS="$withval" +fi; + +# Check whether --with-build-libs or --without-build-libs was given. +if test "${with_build_libs+set}" = set; then + withval="$with_build_libs" + BUILD_LIBS="$withval" +fi; fi -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1116: checking how to run the C preprocessor" >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:2055: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 2076 "configure" #include "confdefs.h" #include -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then + Syntax error +_ACEOF +if { (eval echo "$as_me:2081: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2087: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 2110 "configure" #include "confdefs.h" -#include -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : +#include +_ACEOF +if { (eval echo "$as_me:2114: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2120: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 2167 "configure" #include "confdefs.h" #include -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then + Syntax error +_ACEOF +if { (eval echo "$as_me:2172: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2178: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* + # Broken: fails on valid input. +continue fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 2201 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2205: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2211: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break fi - CPP="$ac_cv_prog_CPP" +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - ac_cv_prog_CPP="$CPP" + { { echo "$as_me:2239: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } fi -echo "$ac_t""$CPP" 1>&6 -if test $ac_cv_prog_gcc = yes; then - echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1197: checking whether ${CC-cc} needs -traditional" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:2251: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 2258 "configure" #include "confdefs.h" #include Autoconf TIOCGETP -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then - rm -rf conftest* ac_cv_prog_gcc_traditional=yes else - rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* - if test $ac_cv_prog_gcc_traditional = no; then - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 2273 "configure" #include "confdefs.h" #include Autoconf TCGETA -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then - rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi - -echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 +echo "$as_me:2286: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1243: checking for POSIXized ISC" >&5 +echo "$as_me:2293: checking for POSIXized ISC" >&5 +echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$ac_t""yes" 1>&6 + echo "$as_me:2298: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF @@ -1255,19 +2309,20 @@ EOF CC="$CC -Xp" fi else - echo "$ac_t""no" 1>&6 + echo "$as_me:2312: result: no" >&5 +echo "${ECHO_T}no" >&6 ISC= fi - -echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:1265: checking for ${CC-cc} option to accept ANSI C" >&5 -if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:2317: checking for ${CC-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 +if test "${cf_cv_ansi_cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + 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 @@ -1283,9 +2338,39 @@ for cf_arg in "-DCC_HAS_PROTOS" \ "-Aa -D_HPUX_SOURCE" \ -Xc do - CFLAGS="$cf_save_CFLAGS $cf_arg" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 2373 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -1294,56 +2379,105 @@ choke me #endif #endif -int main() { +int +main () +{ int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; -; return 0; } -EOF -if { (eval echo configure:1305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2394: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2397: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2400: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2403: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext done CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" fi - -echo "$ac_t""$cf_cv_ansi_cc" 1>&6 +echo "$as_me:2416: result: $cf_cv_ansi_cc" >&5 +echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CFLAGS="$CFLAGS $cf_cv_ansi_cc" + +cf_new_cflags= +cf_new_cppflags= +for cf_add_cflags in $cf_cv_ansi_cc +do + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case "$CPPFLAGS" in + *$cf_add_cflags) #(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 + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + else - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define CC_HAS_PROTOS 1 EOF fi fi - if test "$cf_cv_ansi_cc" = "no"; then - { echo "configure: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2461: 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" >&5 +echo "$as_me: 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" 1>&2; exit 1; } + c. use a wrapper such as unproto" >&2;} + { (exit 1); exit 1; }; } fi - - PROG_EXT= case $cf_cv_system_name in os2*) # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@ - CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__" + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"` PROG_EXT=".exe" ;; @@ -1352,7 +2486,9 @@ cygwin*) ;; esac - +test -n "$PROG_EXT" && cat >>confdefs.h <&6 -echo "configure:1366: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LDCONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:2500: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_LDCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$LDCONFIG" in - /*) + case $LDCONFIG in + [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a dos path. - ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$LDPATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LDCONFIG="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$LDPATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_LDCONFIG="$ac_dir/$ac_word" + echo "$as_me:2517: found $ac_dir/$ac_word" >&5 + break +fi +done + ;; esac fi -LDCONFIG="$ac_cv_path_LDCONFIG" +LDCONFIG=$ac_cv_path_LDCONFIG + if test -n "$LDCONFIG"; then - echo "$ac_t""$LDCONFIG" 1>&6 + echo "$as_me:2528: result: $LDCONFIG" >&5 +echo "${ECHO_T}$LDCONFIG" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:2531: result: no" >&5 +echo "${ECHO_T}no" >&6 fi ;; esac - -echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6 -echo "configure:1403: checking if you want to ensure bool is consistent with C++" >&5 +echo "$as_me:2538: checking if you want to ensure bool is consistent with C++" >&5 +echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6 # Check whether --with-cxx or --without-cxx was given. if test "${with_cxx+set}" = set; then @@ -1407,142 +2544,208 @@ if test "${with_cxx+set}" = set; then cf_with_cxx=$withval else cf_with_cxx=yes -fi - -echo "$ac_t""$cf_with_cxx" 1>&6 +fi; +echo "$as_me:2548: result: $cf_with_cxx" >&5 +echo "${ECHO_T}$cf_with_cxx" >&6 if test "X$cf_with_cxx" = Xno ; then CXX="" GXX="" else - for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1423: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:2564: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" +echo "$as_me:2579: found $ac_dir/$ac_word" >&5 +break +done + fi fi -CXX="$ac_cv_prog_CXX" +CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$ac_t""$CXX" 1>&6 + echo "$as_me:2587: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:2590: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$CXX" && break + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2603: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CXX="$ac_prog" +echo "$as_me:2618: found $ac_dir/$ac_word" >&5 +break done -test -n "$CXX" || CXX="gcc" - - -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1455: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 - -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross -cat > conftest.$ac_ext << EOF +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:2626: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:2629: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -#line 1466 "configure" + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + +# Provide some information about the compiler. +echo "$as_me:2641:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:2644: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:2647: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2649: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:2652: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:2654: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:2657: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:2660: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2666 "configure" #include "confdefs.h" -int main(){return(0);} -EOF -if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cxx_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cxx_cross=no - else - ac_cv_prog_cxx_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 -if test $ac_cv_prog_cxx_works = no; then - echo "$ac_t""You don't have any C++ compiler, too bad" 1>&6; cf_with_cxx=no; CXX=""; GXX=""; -fi -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1497: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 -cross_compiling=$ac_cv_prog_cxx_cross - -echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1502: checking whether we are using GNU C++" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gxx=yes -else - ac_cv_prog_gxx=no -fi -fi -echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2681: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2684: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2687: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2690: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:2702: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:2708: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2714 "configure" +#include "confdefs.h" -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi +int +main () +{ -ac_test_CXXFLAGS="${CXXFLAGS+set}" -ac_save_CXXFLAGS="$CXXFLAGS" -CXXFLAGS= -echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1530: checking whether ${CXX-g++} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2726: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2729: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2732: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2735: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else - ac_cv_prog_cxx_g=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +echo "$as_me:2745: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" + CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" @@ -1556,21 +2759,112 @@ else CXXFLAGS= fi fi +for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 2772 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2785: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2788: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2791: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2794: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 2804 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2816: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2819: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2822: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2825: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi +GXX_VERSION=none if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in + echo "$as_me:2851: checking version of g++" >&5 +echo $ECHO_N "checking version of g++... $ECHO_C" >&6 + GXX_VERSION="`${CXX-g++} --version|head -1`" + echo "$as_me:2854: result: $GXX_VERSION" >&5 +echo "${ECHO_T}$GXX_VERSION" >&6 + case $GXX_VERSION in 1*|2.[0-6]*) - GXX=""; CXX=""; ac_cv_prog_gxx=no + GXX=""; CXX=""; ac_cv_cxx_compiler_gnu=no cf_cxx_library=no - echo No: templates do not work + { echo "$as_me:2860: WARNING: templates do not work" >&5 +echo "$as_me: WARNING: templates do not work" >&2;} ;; esac fi -echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6 -echo "configure:1574: checking if you want to build C++ binding and demo" >&5 +echo "$as_me:2866: checking if you want to build C++ binding and demo" >&5 +echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6 # Check whether --with-cxx-binding or --without-cxx-binding was given. if test "${with_cxx_binding+set}" = set; then @@ -1578,12 +2872,12 @@ if test "${with_cxx_binding+set}" = set; then cf_with_cxx_binding=$withval else cf_with_cxx_binding=$cf_with_cxx -fi - -echo "$ac_t""$cf_with_cxx_binding" 1>&6 +fi; +echo "$as_me:2876: result: $cf_with_cxx_binding" >&5 +echo "${ECHO_T}$cf_with_cxx_binding" >&6 -echo $ac_n "checking if you want to build with Ada95""... $ac_c" 1>&6 -echo "configure:1587: checking if you want to build with Ada95" >&5 +echo "$as_me:2879: checking if you want to build with Ada95" >&5 +echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6 # Check whether --with-ada or --without-ada was given. if test "${with_ada+set}" = set; then @@ -1591,12 +2885,12 @@ if test "${with_ada+set}" = set; then cf_with_ada=$withval else cf_with_ada=yes -fi - -echo "$ac_t""$cf_with_ada" 1>&6 +fi; +echo "$as_me:2889: result: $cf_with_ada" >&5 +echo "${ECHO_T}$cf_with_ada" >&6 -echo $ac_n "checking if you want to build programs such as tic""... $ac_c" 1>&6 -echo "configure:1600: checking if you want to build programs such as tic" >&5 +echo "$as_me:2892: checking if you want to build programs such as tic" >&5 +echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6 # Check whether --with-progs or --without-progs was given. if test "${with_progs+set}" = set; then @@ -1604,12 +2898,12 @@ if test "${with_progs+set}" = set; then cf_with_progs=$withval else cf_with_progs=yes -fi - -echo "$ac_t""$cf_with_progs" 1>&6 +fi; +echo "$as_me:2902: result: $cf_with_progs" >&5 +echo "${ECHO_T}$cf_with_progs" >&6 -echo $ac_n "checking if you wish to install curses.h""... $ac_c" 1>&6 -echo "configure:1613: checking if you wish to install curses.h" >&5 +echo "$as_me:2905: checking if you wish to install curses.h" >&5 +echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6 # Check whether --with-curses-h or --without-curses-h was given. if test "${with_curses_h+set}" = set; then @@ -1617,9 +2911,9 @@ if test "${with_curses_h+set}" = set; then with_curses_h=$withval else with_curses_h=yes -fi - -echo "$ac_t""$with_curses_h" 1>&6 +fi; +echo "$as_me:2915: result: $with_curses_h" >&5 +echo "${ECHO_T}$with_curses_h" >&6 modules_to_build="ncurses" if test "X$cf_with_progs" != Xno ; then @@ -1627,83 +2921,82 @@ modules_to_build="$modules_to_build progs tack" fi modules_to_build="$modules_to_build panel menu form" -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed for ac_prog in mawk gawk nawk awk do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1655: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:2941: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AWK="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:2956: found $ac_dir/$ac_word" >&5 +break +done + fi fi -AWK="$ac_cv_prog_AWK" +AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$ac_t""$AWK" 1>&6 + echo "$as_me:2964: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:2967: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$AWK" && break + test -n "$AWK" && break done -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1685: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:2974: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftestmake <<\EOF + cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi -rm -f conftestmake +rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:2994: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$ac_t""no" 1>&6 + echo "$as_me:2998: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -1714,31 +3007,39 @@ fi # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1723: checking for a BSD compatible install" >&5 +echo "$as_me:3015: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do + IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 @@ -1748,26 +3049,26 @@ else ;; esac done - IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:3064: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' @@ -1775,16 +3076,16 @@ case $INSTALL in /*) ;; *) - cf_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'` + cf_dir=`echo $INSTALL | sed -e 's:/[^/]*$::'` test -z "$cf_dir" && cf_dir=. INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's:^.*/::'` ;; esac -echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:1786: checking for long file names" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3085: checking for long file names" >&5 +echo $ECHO_N "checking for long file names... $ECHO_C" >&6 +if test "${ac_cv_sys_long_file_names+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: @@ -1798,40 +3099,44 @@ else # /var/tmp likewise # /usr/tmp likewise if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs="$TMPDIR" + ac_tmpdirs=$TMPDIR else ac_tmpdirs='/tmp /var/tmp /usr/tmp' fi for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. - (echo 1 > $ac_dir/conftest9012345) 2>/dev/null - (echo 2 > $ac_dir/conftest9012346) 2>/dev/null - val=`cat $ac_dir/conftest9012345 2>/dev/null` - if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then + ac_xdir=$ac_dir/cf$$ + (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue + ac_tf1=$ac_xdir/conftest9012345 + ac_tf2=$ac_xdir/conftest9012346 + (echo 1 >$ac_tf1) 2>/dev/null + (echo 2 >$ac_tf2) 2>/dev/null + ac_val=`cat $ac_tf1 2>/dev/null` + if test ! -f $ac_tf1 || test "$ac_val" != 1; then ac_cv_sys_long_file_names=no - rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null + rm -rf $ac_xdir 2>/dev/null break fi - rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null + rm -rf $ac_xdir 2>/dev/null done fi - -echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6 +echo "$as_me:3124: result: $ac_cv_sys_long_file_names" >&5 +echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\EOF #define HAVE_LONG_FILE_NAMES 1 EOF fi - -echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6 -echo "configure:1831: checking if filesystem supports mixed-case filenames" >&5 -if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3134: checking if filesystem supports mixed-case filenames" >&5 +echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 +if test "${cf_cv_mixedcase+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then @@ -1842,126 +3147,162 @@ else rm -f conftest CONFTEST fi - -echo "$ac_t""$cf_cv_mixedcase" 1>&6 -test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF +echo "$as_me:3150: result: $cf_cv_mixedcase" >&5 +echo "${ECHO_T}$cf_cv_mixedcase" >&6 +test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF - -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1854: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 +echo "$as_me:3156: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:3160: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3163: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1877: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:3170: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:3185: found $ac_dir/$ac_word" >&5 +break +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:3193: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3196: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:3205: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:3220: found $ac_dir/$ac_word" >&5 +break +done + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:3229: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:3232: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi # Extract the first word of "ctags", so it can be a program name with args. set dummy ctags; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1909: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3243: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_LOWER_TAGS"; then ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MAKE_LOWER_TAGS="yes" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_LOWER_TAGS="yes" +echo "$as_me:3258: found $ac_dir/$ac_word" >&5 +break +done + test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" fi fi -MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS" +MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6 + echo "$as_me:3267: result: $MAKE_LOWER_TAGS" >&5 +echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3270: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "etags", so it can be a program name with args. set dummy etags; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3277: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_UPPER_TAGS"; then ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MAKE_UPPER_TAGS="yes" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_UPPER_TAGS="yes" +echo "$as_me:3292: found $ac_dir/$ac_word" >&5 +break +done + test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" fi fi -MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS" +MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6 + echo "$as_me:3301: result: $MAKE_UPPER_TAGS" >&5 +echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3304: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else @@ -1974,138 +3315,142 @@ else MAKE_UPPER_TAGS="#" fi - if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi - for ac_prog in tdlint lint alint do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1991: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3328: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LINT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LINT"; then ac_cv_prog_LINT="$LINT" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LINT="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_LINT="$ac_prog" +echo "$as_me:3343: found $ac_dir/$ac_word" >&5 +break +done + fi fi -LINT="$ac_cv_prog_LINT" +LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$ac_t""$LINT" 1>&6 + echo "$as_me:3351: result: $LINT" >&5 +echo "${ECHO_T}$LINT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3354: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$LINT" && break + test -n "$LINT" && break done for ac_prog in man man_db do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2025: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3365: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAN"; then ac_cv_prog_MAN="$MAN" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_MAN="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAN="$ac_prog" +echo "$as_me:3380: found $ac_dir/$ac_word" >&5 +break +done + fi fi -MAN="$ac_cv_prog_MAN" +MAN=$ac_cv_prog_MAN if test -n "$MAN"; then - echo "$ac_t""$MAN" 1>&6 + echo "$as_me:3388: result: $MAN" >&5 +echo "${ECHO_T}$MAN" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:3391: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$MAN" && break + test -n "$MAN" && break done - - -if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${cf_cv_subst_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6 -echo "configure:2061: checking for loader (symbol LD)" >&5 + +echo "$as_me:3402: checking for loader (symbol LD)" >&5 +echo $ECHO_N "checking for loader (symbol LD)... $ECHO_C" >&6 test -z "$LD" && LD=ld -echo "$ac_t""$LD" 1>&6 +echo "$as_me:3405: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 cf_cv_subst_LD=$LD fi LD=${cf_cv_subst_LD} -if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${cf_cv_subst_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6 -echo "configure:2075: checking for archiver (symbol AR)" >&5 + +echo "$as_me:3417: checking for archiver (symbol AR)" >&5 +echo $ECHO_N "checking for archiver (symbol AR)... $ECHO_C" >&6 test -z "$AR" && AR=ar -echo "$ac_t""$AR" 1>&6 +echo "$as_me:3420: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 cf_cv_subst_AR=$AR fi AR=${cf_cv_subst_AR} -if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${cf_cv_subst_AR_OPTS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6 -echo "configure:2089: checking for archiver options (symbol AR_OPTS)" >&5 + +echo "$as_me:3432: checking for archiver options (symbol AR_OPTS)" >&5 +echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 test -z "$AR_OPTS" && AR_OPTS=rv -echo "$ac_t""$AR_OPTS" 1>&6 +echo "$as_me:3435: result: $AR_OPTS" >&5 +echo "${ECHO_T}$AR_OPTS" >&6 cf_cv_subst_AR_OPTS=$AR_OPTS fi AR_OPTS=${cf_cv_subst_AR_OPTS} - - -echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6 -echo "configure:2101: checking for makeflags variable" >&5 -if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:3443: checking for makeflags variable" >&5 +echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 +if test "${cf_cv_makeflags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + cf_cv_makeflags='' for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)' do cat >cf_makeflags.tmp <&6 - +fi +echo "$as_me:3476: result: $cf_cv_makeflags" >&5 +echo "${ECHO_T}$cf_cv_makeflags" >&6 -echo $ac_n "checking if you have specified an install-prefix""... $ac_c" 1>&6 -echo "configure:2137: checking if you have specified an install-prefix" >&5 +echo "$as_me:3479: checking if you have specified an install-prefix" >&5 +echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. if test "${with_install_prefix+set}" = set; then @@ -2144,21 +3488,19 @@ if test "${with_install_prefix+set}" = set; then *) DESTDIR="$withval" ;; esac -fi - -echo "$ac_t""$DESTDIR" 1>&6 - +fi; +echo "$as_me:3492: result: $DESTDIR" >&5 +echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### - ### Options to allow the user to specify the set of libraries which are used. ### Use "--without-normal --with-shared" to allow the default model to be ### shared, for example. cf_list_models="" -echo $ac_n "checking if you want to build libraries with libtool""... $ac_c" 1>&6 -echo "configure:2162: checking if you want to build libraries with libtool" >&5 +echo "$as_me:3502: checking if you want to build libraries with libtool" >&5 +echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6 # Check whether --with-libtool or --without-libtool was given. if test "${with_libtool+set}" = set; then @@ -2166,9 +3508,9 @@ if test "${with_libtool+set}" = set; then with_libtool=$withval else with_libtool=no -fi - -echo "$ac_t""$with_libtool" 1>&6 +fi; +echo "$as_me:3512: result: $with_libtool" >&5 +echo "${ECHO_T}$with_libtool" >&6 if test "$with_libtool" = "yes"; then cf_list_models="$cf_list_models libtool" test -z "$LIBTOOL" && LIBTOOL=libtool @@ -2176,9 +3518,8 @@ else LIBTOOL="" fi - -echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6 -echo "configure:2182: checking if you want to build shared libraries" >&5 +echo "$as_me:3521: checking if you want to build shared libraries" >&5 +echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. if test "${with_shared+set}" = set; then @@ -2186,13 +3527,13 @@ if test "${with_shared+set}" = set; then with_shared=$withval else with_shared=no -fi - -echo "$ac_t""$with_shared" 1>&6 +fi; +echo "$as_me:3531: result: $with_shared" >&5 +echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" -echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6 -echo "configure:2196: checking if you want to build static libraries" >&5 +echo "$as_me:3535: checking if you want to build static libraries" >&5 +echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6 # Check whether --with-normal or --without-normal was given. if test "${with_normal+set}" = set; then @@ -2200,13 +3541,13 @@ if test "${with_normal+set}" = set; then with_normal=$withval else with_normal=yes -fi - -echo "$ac_t""$with_normal" 1>&6 +fi; +echo "$as_me:3545: result: $with_normal" >&5 +echo "${ECHO_T}$with_normal" >&6 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6 -echo "configure:2210: checking if you want to build debug libraries" >&5 +echo "$as_me:3549: checking if you want to build debug libraries" >&5 +echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. if test "${with_debug+set}" = set; then @@ -2214,13 +3555,13 @@ if test "${with_debug+set}" = set; then with_debug=$withval else with_debug=yes -fi - -echo "$ac_t""$with_debug" 1>&6 +fi; +echo "$as_me:3559: result: $with_debug" >&5 +echo "${ECHO_T}$with_debug" >&6 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" -echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6 -echo "configure:2224: checking if you want to build profiling libraries" >&5 +echo "$as_me:3563: checking if you want to build profiling libraries" >&5 +echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6 # Check whether --with-profile or --without-profile was given. if test "${with_profile+set}" = set; then @@ -2228,55 +3569,51 @@ if test "${with_profile+set}" = set; then with_profile=$withval else with_profile=no -fi - -echo "$ac_t""$with_profile" 1>&6 +fi; +echo "$as_me:3573: result: $with_profile" >&5 +echo "${ECHO_T}$with_profile" >&6 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" ############################################################################### -echo $ac_n "checking for specified models""... $ac_c" 1>&6 -echo "configure:2240: checking for specified models" >&5 +echo "$as_me:3579: checking for specified models" >&5 +echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal test "$with_libtool" = "yes" && cf_list_models=libtool -echo "$ac_t""$cf_list_models" 1>&6 +echo "$as_me:3583: result: $cf_list_models" >&5 +echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo $ac_n "checking for default model""... $ac_c" 1>&6 -echo "configure:2248: checking for default model" >&5 +echo "$as_me:3588: checking for default model" >&5 +echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'` -echo "$ac_t""$DFT_LWR_MODEL" 1>&6 - +echo "$as_me:3591: result: $DFT_LWR_MODEL" >&5 +echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - TINFO_NAME=tinfo - LIB_NAME=ncurses - LIB_DIR=../lib case $cf_cv_system_name in - os2) LIB_PREFIX='' ;; + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; *) LIB_PREFIX='lib' ;; esac cf_prefix=$LIB_PREFIX - LIB_PREFIX=$cf_prefix - LIB_SUFFIX= - ############################################################################### -echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6 -echo "configure:2280: checking if you want to build a separate terminfo library" >&5 +echo "$as_me:3615: checking if you want to build a separate terminfo library" >&5 +echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 # Check whether --with-termlib or --without-termlib was given. if test "${with_termlib+set}" = set; then @@ -2284,13 +3621,13 @@ if test "${with_termlib+set}" = set; then with_termlib=$withval else with_termlib=no -fi - -echo "$ac_t""$with_termlib" 1>&6 +fi; +echo "$as_me:3625: result: $with_termlib" >&5 +echo "${ECHO_T}$with_termlib" >&6 ### Checks for special libraries, must be done up-front. -echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6 -echo "configure:2294: checking if you want to link with dbmalloc for testing" >&5 +echo "$as_me:3629: checking if you want to link with dbmalloc for testing" >&5 +echo $ECHO_N "checking if you want to link with dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then @@ -2298,61 +3635,73 @@ if test "${with_dbmalloc+set}" = set; then with_dbmalloc=$withval else with_dbmalloc=no -fi - -echo "$ac_t""$with_dbmalloc" 1>&6 +fi; +echo "$as_me:3639: result: $with_dbmalloc" >&5 +echo "${ECHO_T}$with_dbmalloc" >&6 if test "$with_dbmalloc" = yes ; then - echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6 -echo "configure:2307: checking for debug_malloc in -ldbmalloc" >&5 -ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:3643: checking for debug_malloc in -ldbmalloc" >&5 +echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 +if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 3651 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char debug_malloc(); - -int main() { -debug_malloc() -; return 0; } -EOF -if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dbmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3673: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3676: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3679: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dbmalloc_debug_malloc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dbmalloc_debug_malloc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3690: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 +if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then + cat >>confdefs.h <&6 fi fi -echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6 -echo "configure:2356: checking if you want to link with dmalloc for testing" >&5 +echo "$as_me:3703: checking if you want to link with dmalloc for testing" >&5 +echo $ECHO_N "checking if you want to link with dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then @@ -2360,62 +3709,74 @@ if test "${with_dmalloc+set}" = set; then with_dmalloc=$withval else with_dmalloc=no -fi - -echo "$ac_t""$with_dmalloc" 1>&6 +fi; +echo "$as_me:3713: result: $with_dmalloc" >&5 +echo "${ECHO_T}$with_dmalloc" >&6 if test "$with_dmalloc" = yes ; then - echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6 -echo "configure:2369: checking for dmalloc_debug in -ldmalloc" >&5 -ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:3717: checking for dmalloc_debug in -ldmalloc" >&5 +echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 +if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 3725 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dmalloc_debug(); - -int main() { -dmalloc_debug() -; return 0; } -EOF -if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3747: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3750: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3753: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dmalloc_dmalloc_debug=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dmalloc_dmalloc_debug=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3764: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 +if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then + cat >>confdefs.h <&6 fi fi SHLIB_LIST="" -echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6 -echo "configure:2419: checking if you want to link with the gpm mouse library" >&5 +echo "$as_me:3778: checking if you want to link with the gpm mouse library" >&5 +echo $ECHO_N "checking if you want to link with the gpm mouse library... $ECHO_C" >&6 # Check whether --with-gpm or --without-gpm was given. if test "${with_gpm+set}" = set; then @@ -2423,115 +3784,134 @@ if test "${with_gpm+set}" = set; then with_gpm=$withval else with_gpm=no -fi - -echo "$ac_t""$with_gpm" 1>&6 +fi; +echo "$as_me:3788: result: $with_gpm" >&5 +echo "${ECHO_T}$with_gpm" >&6 if test "$with_gpm" = yes ; then - echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:2432: checking for Gpm_Open in -lgpm" >&5 -ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:3791: checking for Gpm_Open in -lgpm" >&5 +echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 +if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 3799 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char Gpm_Open(); - -int main() { -Gpm_Open() -; return 0; } -EOF -if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + builtin and then its argument prototype would still apply. */ +char Gpm_Open (); +int +main () +{ +Gpm_Open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3818: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3821: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3824: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3827: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_Gpm_Open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_Gpm_Open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3838: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 +if test $ac_cv_lib_gpm_Gpm_Open = yes; then -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS" SHLIB_LIST="-lgpm $SHLIB_LIST" - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF - for ac_hdr in gpm.h +for ac_header in gpm.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2477: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3857 "configure" #include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:3861: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3867: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 + fi done - else - echo "$ac_t""no" 1>&6 -echo "configure: warning: Cannot link with gpm library - read the FAQ" 1>&2 + { echo "$as_me:3897: WARNING: Cannot link with gpm library - read the FAQ" >&5 +echo "$as_me: WARNING: Cannot link with gpm library - read the FAQ" >&2;} fi fi - 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 - 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 - -echo $ac_n "checking for default loader flags""... $ac_c" 1>&6 -echo "configure:2535: checking for default loader flags" >&5 +echo "$as_me:3913: checking for default loader flags" >&5 +echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; normal) LD_MODEL='' ;; @@ -2539,10 +3919,11 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$ac_t""$LD_MODEL" 1>&6 +echo "$as_me:3922: result: $LD_MODEL" >&5 +echo "${ECHO_T}$LD_MODEL" >&6 -echo $ac_n "checking if rpath option should be used""... $ac_c" 1>&6 -echo "configure:2546: checking if rpath option should be used" >&5 +echo "$as_me:3925: checking if rpath option should be used" >&5 +echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then @@ -2550,22 +3931,20 @@ if test "${enable_rpath+set}" = set; then cf_cv_ld_rpath=$enableval else cf_cv_ld_rpath=no -fi - -echo "$ac_t""$cf_cv_ld_rpath" 1>&6 +fi; +echo "$as_me:3935: result: $cf_cv_ld_rpath" >&5 +echo "${ECHO_T}$cf_cv_ld_rpath" >&6 - - - LOCAL_LDFLAGS= - LOCAL_LDFLAGS2= + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no - echo $ac_n "checking if release/abi version should be used for shared libs""... $ac_c" 1>&6 -echo "configure:2568: checking if release/abi version should be used for shared libs" >&5 - + echo "$as_me:3945: checking if release/abi version should be used for shared libs" >&5 +echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 + # Check whether --with-shlib-version or --without-shlib-version was given. if test "${with_shlib_version+set}" = set; then withval="$with_shlib_version" @@ -2578,15 +3957,17 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { echo "configure: error: option value must be one of: rel, abi, auto or no" 1>&2; exit 1; } + { { echo "$as_me:3960: error: option value must be one of: rel, abi, auto or no" >&5 +echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} + { (exit 1); exit 1; }; } ;; esac - + else cf_cv_shlib_version=auto -fi - - echo "$ac_t""$cf_cv_shlib_version" 1>&6 +fi; + echo "$as_me:3969: result: $cf_cv_shlib_version" >&5 +echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -2594,37 +3975,67 @@ fi CC_SHARED_OPTS= if test "$GCC" = yes then - echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6 -echo "configure:2599: checking which $CC option to use" >&5 + echo "$as_me:3978: checking which $CC option to use" >&5 +echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 3985 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ int x = 1 -; return 0; } -EOF -if { (eval echo configure:2612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3997: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4000: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4003: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4006: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$ac_t""$CC_SHARED_OPTS" 1>&6 + echo "$as_me:4015: result: $CC_SHARED_OPTS" >&5 +echo "${ECHO_T}$CC_SHARED_OPTS" >&6 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 @@ -2652,8 +4063,8 @@ rm -f conftest* ;; linux*|gnu*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-Wl,-rpath," @@ -2675,8 +4086,8 @@ rm -f conftest* CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS" MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' if test "$cf_cv_shlib_version" = auto; then @@ -2692,16 +4103,16 @@ rm -f conftest* # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). - MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`' + MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`' case $host_os in osf4*) - MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" - LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + LOCAL_LDFLAGS="-Wl,-rpath,`pwd`/lib" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-rpath" @@ -2711,7 +4122,7 @@ rm -f conftest* ;; sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 # tested with osr5.0.5 - if test "$ac_cv_prog_gcc" != yes; then + if test "$ac_cv_c_compiler_gnu" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@' @@ -2725,7 +4136,7 @@ rm -f conftest* ;; sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 - if test "$ac_cv_prog_gcc" != yes; then + if test "$ac_cv_c_compiler_gnu" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -assert pure-text -o $@' @@ -2733,13 +4144,13 @@ rm -f conftest* ;; solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 - if test "$ac_cv_prog_gcc" != yes; then + if test "$ac_cv_c_compiler_gnu" != 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" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_ld_rpath" = yes ; then cf_ld_rpath_opt="-R" @@ -2749,7 +4160,7 @@ rm -f conftest* ;; sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) - if test "$ac_cv_prog_gcc" != yes; then + if test "$ac_cv_c_compiler_gnu" != yes; then CC_SHARED_OPTS='-KPIC' fi MK_SHARED_LIB='$(LD) -d y -G -o $@' @@ -2768,78 +4179,84 @@ rm -f conftest* test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - echo "configure: warning: ignored --with-shlib-version" 1>&2 + { echo "$as_me:4182: WARNING: ignored --with-shlib-version" >&5 +echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac ;; esac if test -n "$cf_ld_rpath_opt" ; then - echo $ac_n "checking if we need a space after rpath option""... $ac_c" 1>&6 -echo "configure:2780: checking if we need a space after rpath option" >&5 + echo "$as_me:4190: checking if we need a space after rpath option" >&5 +echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 4195 "configure" #include "confdefs.h" -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4207: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4210: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4213: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4216: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_rpath_space=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_rpath_space=yes + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_rpath_space=yes fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$ac_t""$cf_rpath_space" 1>&6 + echo "$as_me:4226: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 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 - - - - - - - - - - if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - { echo "configure: error: Shared libraries are not supported in this version" 1>&2; exit 1; } + { { echo "$as_me:4235: error: Shared libraries are not supported in this version" >&5 +echo "$as_me: error: Shared libraries are not supported in this version" >&2;} + { (exit 1); exit 1; }; } fi done fi ############################################################################### - ### use option --disable-overwrite to leave out the link to -lcurses -echo $ac_n "checking if you wish to install ncurses overwriting curses""... $ac_c" 1>&6 -echo "configure:2830: checking if you wish to install ncurses overwriting curses" >&5 +echo "$as_me:4245: checking if you wish to install ncurses overwriting curses" >&5 +echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6 # Check whether --enable-overwrite or --disable-overwrite was given. if test "${enable_overwrite+set}" = set; then enableval="$enable_overwrite" with_overwrite=$enableval else - with_overwrite=yes -fi - -echo "$ac_t""$with_overwrite" 1>&6 + if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi +fi; +echo "$as_me:4255: result: $with_overwrite" >&5 +echo "${ECHO_T}$with_overwrite" >&6 -echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6 -echo "configure:2843: checking if external terminfo-database is used" >&5 +echo "$as_me:4258: checking if external terminfo-database is used" >&5 +echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6 # Check whether --enable-database or --disable-database was given. if test "${enable_database+set}" = set; then @@ -2847,9 +4264,9 @@ if test "${enable_database+set}" = set; then use_database=$enableval else use_database=yes -fi - -echo "$ac_t""$use_database" 1>&6 +fi; +echo "$as_me:4268: result: $use_database" >&5 +echo "${ECHO_T}$use_database" >&6 case $host_os in #(vi os2*) #(vi @@ -2860,26 +4277,30 @@ os2*) #(vi ;; esac + case $cf_cv_system_name in + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; + esac if test "$use_database" != no ; then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define USE_DATABASE 1 EOF - echo $ac_n "checking which terminfo source-file will be installed""... $ac_c" 1>&6 -echo "configure:2871: checking which terminfo source-file will be installed" >&5 - + echo "$as_me:4290: checking which terminfo source-file will be installed" >&5 +echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6 + # Check whether --enable-database or --disable-database was given. if test "${enable_database+set}" = set; then enableval="$enable_database" TERMINFO_SRC=$withval +fi; + echo "$as_me:4298: result: $TERMINFO_SRC" >&5 +echo "${ECHO_T}$TERMINFO_SRC" >&6 fi - echo "$ac_t""$TERMINFO_SRC" 1>&6 -fi - -echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6 -echo "configure:2883: checking for list of fallback descriptions" >&5 +echo "$as_me:4302: checking for list of fallback descriptions" >&5 +echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6 # Check whether --with-fallbacks or --without-fallbacks was given. if test "${with_fallbacks+set}" = set; then @@ -2887,54 +4308,54 @@ if test "${with_fallbacks+set}" = set; then with_fallback=$withval else with_fallback= -fi - -echo "$ac_t""$with_fallback" 1>&6 +fi; +echo "$as_me:4312: result: $with_fallback" >&5 +echo "${ECHO_T}$with_fallback" >&6 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` - +MAKE_TERMINFO= if test "$use_database" = no ; then - if test -z $with_fallback ; then - { echo "configure: error: You have disabled the database w/o specifying fallbacks" 1>&2; exit 1; } - fi TERMINFO="${datadir}/terminfo" + MAKE_TERMINFO="#" else -echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6 -echo "configure:2905: checking for list of terminfo directories" >&5 - +echo "$as_me:4322: checking for list of terminfo directories" >&5 +echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given. if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" - : -else - withval="${TERMINFO_DIRS-${datadir}/terminfo}" -fi -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +else + withval=${TERMINFO_DIRS-${datadir}/terminfo} +fi; +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do - + case ".$cf_src_path" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; -.a-zA-Z:\\/*) #(vi OS/2 EMX +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval cf_src_path="$cf_src_path" case ".$cf_src_path" in #(vi .NONE/*) - cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@` + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi .NONE/*) - cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@` + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { { echo "$as_me:4356: error: expected a pathname, not \"$cf_src_path\"" >&5 +echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -2943,62 +4364,63 @@ esac done IFS="$ac_save_ifs" -eval TERMINFO_DIRS="$cf_dst_path" +eval 'TERMINFO_DIRS="$cf_dst_path"' -echo "$ac_t""$TERMINFO_DIRS" 1>&6 -test -n "$TERMINFO_DIRS" && cat >> confdefs.h <&5 +echo "${ECHO_T}$TERMINFO_DIRS" >&6 +test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&6 -echo "configure:2956: checking for default terminfo directory" >&5 +echo "$as_me:4375: checking for default terminfo directory" >&5 +echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. if test "${with_default_terminfo_dir+set}" = set; then withval="$with_default_terminfo_dir" - : + else withval="${TERMINFO-${datadir}/terminfo}" -fi - +fi; case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; -.a-zA-Z:\\/*) #(vi OS/2 EMX +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { { echo "$as_me:4404: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } ;; esac eval TERMINFO="$withval" -echo "$ac_t""$TERMINFO" 1>&6 -cat >> confdefs.h <&5 +echo "${ECHO_T}$TERMINFO" >&6 +cat >>confdefs.h <&6 -echo "configure:3002: checking if big-core option selected" >&5 +echo "$as_me:4422: checking if big-core option selected" >&5 +echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 # Check whether --enable-big-core or --disable-big-core was given. if test "${enable_big_core+set}" = set; then @@ -3008,8 +4430,8 @@ else if test "$cross_compiling" = yes; then with_big_core=no else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 4434 "configure" #include "confdefs.h" #include @@ -3021,30 +4443,37 @@ int main() { s[0] = s[n-1] = 0; exit(s == 0); } -EOF -if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4448: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4451: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4453: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4456: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then with_big_core=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - with_big_core=no -fi -rm -fr conftest* + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +with_big_core=no fi - +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$with_big_core" 1>&6 -test "$with_big_core" = "yes" && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:4468: result: $with_big_core" >&5 +echo "${ECHO_T}$with_big_core" >&6 +test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_BIG_CORE 1 EOF - ### use option --enable-termcap to compile in the termcap fallback support -echo $ac_n "checking if you want termcap-fallback support""... $ac_c" 1>&6 -echo "configure:3048: checking if you want termcap-fallback support" >&5 +echo "$as_me:4475: checking if you want termcap-fallback support" >&5 +echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6 # Check whether --enable-termcap or --disable-termcap was given. if test "${enable_termcap+set}" = set; then @@ -3052,20 +4481,84 @@ if test "${enable_termcap+set}" = set; then with_termcap=$enableval else with_termcap=no -fi +fi; +echo "$as_me:4485: result: $with_termcap" >&5 +echo "${ECHO_T}$with_termcap" >&6 + +if test "$with_termcap" != "yes" ; then + if test "$use_database" = no ; then + if test -z $with_fallback ; then + { { echo "$as_me:4491: error: You have disabled the database w/o specifying fallbacks" >&5 +echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;} + { (exit 1); exit 1; }; } + fi + fi + cat >>confdefs.h <<\EOF +#define PURE_TERMINFO 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define USE_TERMCAP 1 +EOF + +echo "$as_me:4506: checking for list of termcap files" >&5 +echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6 + +# Check whether --with-termpath or --without-termpath was given. +if test "${with_termpath+set}" = set; then + withval="$with_termpath" + +else + withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} +fi; +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +cf_dst_path= +for cf_src_path in $withval +do + +case ".$cf_src_path" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval cf_src_path="$cf_src_path" + case ".$cf_src_path" in #(vi + .NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; + esac + ;; #(vi +.NONE/*) + cf_src_path=`echo $cf_src_path | sed -e s%NONE%$ac_default_prefix%` + ;; +*) + { { echo "$as_me:4540: error: expected a pathname, not \"$cf_src_path\"" >&5 +echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + + test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:" + cf_dst_path="${cf_dst_path}${cf_src_path}" +done +IFS="$ac_save_ifs" -echo "$ac_t""$with_termcap" 1>&6 +eval 'TERMPATH="$cf_dst_path"' -if test "$with_termcap" != "yes" ; then - cat >> confdefs.h <<\EOF -#define PURE_TERMINFO 1 +echo "$as_me:4553: result: $TERMPATH" >&5 +echo "${ECHO_T}$TERMPATH" >&6 +test -n "$TERMPATH" && cat >>confdefs.h <&6 -echo "configure:3069: checking if fast termcap-loader is needed" >&5 +echo "$as_me:4560: checking if fast termcap-loader is needed" >&5 +echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 # Check whether --enable-getcap or --disable-getcap was given. if test "${enable_getcap+set}" = set; then @@ -3073,16 +4566,15 @@ if test "${enable_getcap+set}" = set; then with_getcap=$enableval else with_getcap=no -fi - -echo "$ac_t""$with_getcap" 1>&6 -test "$with_getcap" = "yes" && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:4570: result: $with_getcap" >&5 +echo "${ECHO_T}$with_getcap" >&6 +test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP 1 EOF - -echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6 -echo "configure:3086: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "$as_me:4576: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. if test "${enable_getcap_cache+set}" = set; then @@ -3090,14 +4582,13 @@ if test "${enable_getcap_cache+set}" = set; then with_getcap_cache=$enableval else with_getcap_cache=no -fi - -echo "$ac_t""$with_getcap_cache" 1>&6 -test "$with_getcap_cache" = "yes" && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:4586: result: $with_getcap_cache" >&5 +echo "${ECHO_T}$with_getcap_cache" >&6 +test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP_CACHE 1 EOF - fi ### Use option --enable-symlinks to make tic use symlinks, not hard links @@ -3105,135 +4596,163 @@ fi for ac_func in \ remove \ - unlink + unlink do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3112: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4608 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ + which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +f = $ac_func; #endif -; return 0; } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4639: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4642: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4645: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4648: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4658: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done - if test "$ac_cv_prog_cc_cross" = yes ; then - for ac_func in \ + +for ac_func in \ link \ - symlink + symlink do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3171: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4681 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ + which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +f = $ac_func; #endif -; return 0; } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4712: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4715: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4718: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4721: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4731: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done else - echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6 -echo "configure:3225: checking if link/symlink functions work" >&5 -if eval "test \"`echo '$''{'cf_cv_link_funcs'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:4742: checking if link/symlink functions work" >&5 +echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6 +if test "${cf_cv_link_funcs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + cf_cv_link_funcs= for cf_func in link symlink ; do if test "$cross_compiling" = yes; then - + eval 'ac_cv_func_'$cf_func'=error' else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 4755 "configure" #include "confdefs.h" #include @@ -3260,88 +4779,96 @@ int main() #endif exit (fail); } - -EOF -if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4785: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4788: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4790: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4793: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" eval 'ac_cv_func_'$cf_func'=yes' else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + eval 'ac_cv_func_'$cf_func'=no' fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - done test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no - -fi -echo "$ac_t""$cf_cv_link_funcs" 1>&6 - test "$ac_cv_func_link" = yes && cat >> confdefs.h <<\EOF +fi +echo "$as_me:4811: result: $cf_cv_link_funcs" >&5 +echo "${ECHO_T}$cf_cv_link_funcs" >&6 + test "$ac_cv_func_link" = yes && cat >>confdefs.h <<\EOF #define HAVE_LINK 1 EOF - test "$ac_cv_func_symlink" = yes && cat >> confdefs.h <<\EOF + test "$ac_cv_func_symlink" = yes && cat >>confdefs.h <<\EOF #define HAVE_SYMLINK 1 EOF fi - with_links=no with_symlinks=no if test "$ac_cv_func_link" != yes ; then - echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6 -echo "configure:3303: checking if tic should use symbolic links" >&5 + echo "$as_me:4827: checking if tic should use symbolic links" >&5 +echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 if test "$ac_cv_func_symlink" = yes ; then with_symlinks=yes else with_symlinks=no fi - echo "$ac_t""$with_symlinks" 1>&6 + echo "$as_me:4834: result: $with_symlinks" >&5 +echo "${ECHO_T}$with_symlinks" >&6 elif test "$ac_cv_func_symlink" != yes ; then - echo $ac_n "checking if tic should use hard links""... $ac_c" 1>&6 -echo "configure:3312: checking if tic should use hard links" >&5 + echo "$as_me:4837: checking if tic should use hard links" >&5 +echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6 if test "$ac_cv_func_link" = yes ; then with_links=yes else with_links=no fi - echo "$ac_t""$with_links" 1>&6 + echo "$as_me:4844: result: $with_links" >&5 +echo "${ECHO_T}$with_links" >&6 else - echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6 -echo "configure:3321: checking if tic should use symbolic links" >&5 - + echo "$as_me:4847: checking if tic should use symbolic links" >&5 +echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 + # Check whether --enable-symlinks or --disable-symlinks was given. if test "${enable_symlinks+set}" = set; then enableval="$enable_symlinks" with_symlinks=$enableval else with_symlinks=no +fi; + echo "$as_me:4857: result: $with_symlinks" >&5 +echo "${ECHO_T}$with_symlinks" >&6 fi - echo "$ac_t""$with_symlinks" 1>&6 -fi - -test "$with_links" = yes && cat >> confdefs.h <<\EOF +test "$with_links" = yes && cat >>confdefs.h <<\EOF #define USE_LINKS 1 EOF -test "$with_symlinks" = yes && cat >> confdefs.h <<\EOF +test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF #define USE_SYMLINKS 1 EOF - ### use option --enable-broken-linker to force on use of broken-linker support -echo $ac_n "checking if you want broken-linker support code""... $ac_c" 1>&6 -echo "configure:3345: checking if you want broken-linker support code" >&5 +echo "$as_me:4870: checking if you want broken-linker support code" >&5 +echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. if test "${enable_broken_linker+set}" = set; then @@ -3349,17 +4876,62 @@ if test "${enable_broken_linker+set}" = set; then with_broken_linker=$enableval else with_broken_linker=$BROKEN_LINKER -fi +fi; +echo "$as_me:4880: result: $with_broken_linker" >&5 +echo "${ECHO_T}$with_broken_linker" >&6 + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + cat >>confdefs.h <<\EOF +#define BROKEN_LINKER 1 +EOF -echo "$ac_t""$with_broken_linker" 1>&6 -test "$with_broken_linker" = yes && cat >> confdefs.h <<\EOF + BROKEN_LINKER=1 +elif test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF + BROKEN_LINKER=1 + test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 + + ;; + esac +fi + +### use option --with-bool to override bool's type +echo "$as_me:4905: checking for type of bool" >&5 +echo $ECHO_N "checking for type of bool... $ECHO_C" >&6 + +# Check whether --with-bool or --without-bool was given. +if test "${with_bool+set}" = set; then + withval="$with_bool" + NCURSES_BOOL="$withval" +else + NCURSES_BOOL=auto +fi; +echo "$as_me:4915: result: $NCURSES_BOOL" >&5 +echo "${ECHO_T}$NCURSES_BOOL" >&6 + +### use option --with-ospeed to override ospeed's type +echo "$as_me:4919: checking for type of ospeed" >&5 +echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6 + +# Check whether --with-ospeed or --without-ospeed was given. +if test "${with_ospeed+set}" = set; then + withval="$with_ospeed" + NCURSES_OSPEED="$withval" +else + NCURSES_OSPEED=short +fi; +echo "$as_me:4929: result: $NCURSES_OSPEED" >&5 +echo "${ECHO_T}$NCURSES_OSPEED" >&6 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding -echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6 -echo "configure:3363: checking if tputs should process BSD-style prefix padding" >&5 +echo "$as_me:4933: checking if tputs should process BSD-style prefix padding" >&5 +echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6 # Check whether --enable-bsdpad or --disable-bsdpad was given. if test "${enable_bsdpad+set}" = set; then @@ -3367,17 +4939,16 @@ if test "${enable_bsdpad+set}" = set; then with_bsdpad=$enableval else with_bsdpad=no -fi - -echo "$ac_t""$with_bsdpad" 1>&6 -test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:4943: result: $with_bsdpad" >&5 +echo "${ECHO_T}$with_bsdpad" >&6 +test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF #define BSD_TPUTS 1 EOF - ### Enable compiling-in rcs id's -echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6 -echo "configure:3381: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:4950: checking if RCS identifiers should be compiled-in" >&5 +echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. if test "${with_rcs_ids+set}" = set; then @@ -3385,31 +4956,27 @@ if test "${with_rcs_ids+set}" = set; then with_rcs_ids=$withval else with_rcs_ids=no -fi - -echo "$ac_t""$with_rcs_ids" 1>&6 -test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:4960: result: $with_rcs_ids" >&5 +echo "${ECHO_T}$with_rcs_ids" >&6 +test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 EOF - ############################################################################### - - echo $ac_n "checking format of man-pages""... $ac_c" 1>&6 -echo "configure:3401: checking format of man-pages" >&5 - +echo "$as_me:4968: checking format of man-pages" >&5 +echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 # Check whether --with-manpage-format or --without-manpage-format was given. if test "${with_manpage_format+set}" = set; then withval="$with_manpage_format" - cf_manpage_form=$withval + MANPAGE_FORMAT=$withval else - cf_manpage_form=unknown -fi + MANPAGE_FORMAT=unknown +fi; - -case ".$cf_manpage_form" in +case ".$MANPAGE_FORMAT" in .gzip|.compress|.BSDI|.normal|.formatted) # (vi ;; .unknown|.) # (vi @@ -3417,8 +4984,8 @@ case ".$cf_manpage_form" in MANPATH="/usr/man:/usr/share/man" fi # look for the 'date' man-page (it's most likely to be installed!) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - cf_manpage_form=unknown + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + MANPAGE_FORMAT=unknown for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date @@ -3426,102 +4993,101 @@ case ".$cf_manpage_form" in cf_test=`echo $cf_name | sed -e 's/*//'` if test "x$cf_test" = "x$cf_name" ; then case "$cf_name" in - *.gz) cf_manpage_form=gzip;; - *.Z) cf_manpage_form=compress;; - *.0) cf_manpage_form=BSDI,formatted;; - *) cf_manpage_form=normal;; + *.gz) MANPAGE_FORMAT=gzip;; + *.Z) MANPAGE_FORMAT=compress;; + *.0) MANPAGE_FORMAT=BSDI,formatted;; + *) MANPAGE_FORMAT=normal;; esac break fi done - if test "$cf_manpage_form" != "unknown" ; then + if test "$MANPAGE_FORMAT" != "unknown" ; then break fi done IFS="$ac_save_ifs" ;; .*) # (vi - echo "configure: warning: Unexpected manpage-format" 1>&2 + { echo "$as_me:5011: WARNING: Unexpected manpage-format" >&5 +echo "$as_me: WARNING: Unexpected manpage-format" >&2;} ;; esac -echo "$ac_t""$cf_manpage_form" 1>&6 - - -echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6 -echo "configure:3453: checking for manpage renaming" >&5 +echo "$as_me:5016: result: $MANPAGE_FORMAT" >&5 +echo "${ECHO_T}$MANPAGE_FORMAT" >&6 +echo "$as_me:5019: checking for manpage renaming" >&5 +echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6 # Check whether --with-manpage-renames or --without-manpage-renames was given. if test "${with_manpage_renames+set}" = set; then withval="$with_manpage_renames" - cf_manpage_renames=$withval + MANPAGE_RENAMES=$withval else - cf_manpage_renames=yes -fi + MANPAGE_RENAMES=yes +fi; - -case ".$cf_manpage_renames" in #(vi +case ".$MANPAGE_RENAMES" in #(vi .no) #(vi ;; .|.yes) # Debian 'man' program? if test -f /etc/debian_version ; then - cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames + MANPAGE_RENAMES=`cd $srcdir && pwd`/man/man_db.renames else - cf_manpage_renames=no + MANPAGE_RENAMES=no fi ;; esac -if test "$cf_manpage_renames" != no ; then - if test ! -f $cf_manpage_renames ; then - { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; } +if test "$MANPAGE_RENAMES" != no ; then + if test -f $srcdir/man/$MANPAGE_RENAMES ; then + MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES + elif test ! -f $MANPAGE_RENAMES ; then + { { echo "$as_me:5047: error: not a filename: $MANPAGE_RENAMES" >&5 +echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} + { (exit 1); exit 1; }; } fi test ! -d man && mkdir man # Construct a sed-script to perform renaming within man-pages - if test -n "$cf_manpage_renames" ; then + if test -n "$MANPAGE_RENAMES" ; then test ! -d man && mkdir man - $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed + sh $srcdir/man/make_sed.sh $MANPAGE_RENAMES >man/edit_man.sed fi fi -echo "$ac_t""$cf_manpage_renames" 1>&6 - - -echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6 -echo "configure:3496: checking for manpage symlinks" >&5 +echo "$as_me:5061: result: $MANPAGE_RENAMES" >&5 +echo "${ECHO_T}$MANPAGE_RENAMES" >&6 +echo "$as_me:5064: checking for manpage symlinks" >&5 +echo $ECHO_N "checking for manpage symlinks... $ECHO_C" >&6 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. if test "${with_manpage_symlinks+set}" = set; then withval="$with_manpage_symlinks" - cf_manpage_symlinks=$withval + MANPAGE_SYMLINKS=$withval else - cf_manpage_symlinks=yes -fi - - -echo "$ac_t""$cf_manpage_symlinks" 1>&6 + MANPAGE_SYMLINKS=yes +fi; +echo "$as_me:5075: result: $MANPAGE_SYMLINKS" >&5 +echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 -echo $ac_n "checking for manpage tbl""... $ac_c" 1>&6 -echo "configure:3512: checking for manpage tbl" >&5 - +echo "$as_me:5078: checking for manpage tbl" >&5 +echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6 # Check whether --with-manpage-tbl or --without-manpage-tbl was given. if test "${with_manpage_tbl+set}" = set; then withval="$with_manpage_tbl" - cf_manpage_tbl=$withval + MANPAGE_TBL=$withval else - cf_manpage_tbl=no -fi - - -echo "$ac_t""$cf_manpage_tbl" 1>&6 + MANPAGE_TBL=no +fi; +echo "$as_me:5089: result: $MANPAGE_TBL" >&5 +echo "${ECHO_T}$MANPAGE_TBL" >&6 if test "$prefix" = "NONE" ; then cf_prefix="$ac_default_prefix" @@ -3529,7 +5095,7 @@ echo "$ac_t""$cf_manpage_tbl" 1>&6 cf_prefix="$prefix" fi - case "$cf_manpage_form" in # (vi + case "$MANPAGE_FORMAT" in # (vi *formatted*) # (vi cf_subdir='$mandir/cat' cf_format=yes @@ -3546,8 +5112,9 @@ cat >man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <>man/edit_man.sh <\$TMP + < \$i | sed -f edit_man.sed >\$TMP CF_EOF else cat >>man/edit_man.sh <\$TMP + < \$i >\$TMP CF_EOF fi -if test $cf_manpage_tbl = yes ; then +if test $MANPAGE_TBL = yes ; then cat >>man/edit_man.sh <\$TMP.out mv \$TMP.out \$TMP @@ -3652,7 +5226,7 @@ cat >>man/edit_man.sh <>man/edit_man.sh <&6 -echo "configure:3751: checking if you want to build with function extensions" >&5 +echo "$as_me:5320: checking if you want to build with function extensions" >&5 +echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. if test "${enable_ext_funcs+set}" = set; then @@ -3755,39 +5326,42 @@ if test "${enable_ext_funcs+set}" = set; then with_ext_funcs=$enableval else with_ext_funcs=yes -fi - -echo "$ac_t""$with_ext_funcs" 1>&6 +fi; +echo "$as_me:5330: result: $with_ext_funcs" >&5 +echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then - cat >> confdefs.h <<\EOF + NCURSES_EXT_FUNCS=1 + cat >>confdefs.h <<\EOF #define HAVE_CURSES_VERSION 1 EOF - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_HAS_KEY 1 EOF - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_RESIZETERM 1 EOF - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_USE_DEFAULT_COLORS 1 EOF - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_WRESIZE 1 EOF - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define NCURSES_EXT_FUNCS 1 EOF +else + NCURSES_EXT_FUNCS=0 fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6 -echo "configure:3791: checking for extended use of const keyword" >&5 +echo "$as_me:5363: checking for extended use of const keyword" >&5 +echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. if test "${enable_const+set}" = set; then @@ -3795,17 +5369,16 @@ if test "${enable_const+set}" = set; then with_ext_const=$enableval else with_ext_const=no -fi - -echo "$ac_t""$with_ext_const" 1>&6 +fi; +echo "$as_me:5373: result: $with_ext_const" >&5 +echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then NCURSES_CONST=const fi - -echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6 -echo "configure:3809: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "$as_me:5380: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6 # Check whether --enable-no-padding or --disable-no-padding was given. if test "${enable_no_padding+set}" = set; then @@ -3813,17 +5386,16 @@ if test "${enable_no_padding+set}" = set; then with_no_padding=$enableval else with_no_padding=$with_ext_funcs -fi - -echo "$ac_t""$with_no_padding" 1>&6 -test "$with_no_padding" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5390: result: $with_no_padding" >&5 +echo "${ECHO_T}$with_no_padding" >&6 +test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF #define NCURSES_NO_PADDING 1 EOF - ### use option --enable-sigwinch to turn on use of SIGWINCH logic -echo $ac_n "checking if you want SIGWINCH handler""... $ac_c" 1>&6 -echo "configure:3827: checking if you want SIGWINCH handler" >&5 +echo "$as_me:5397: checking if you want SIGWINCH handler" >&5 +echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6 # Check whether --enable-sigwinch or --disable-sigwinch was given. if test "${enable_sigwinch+set}" = set; then @@ -3831,17 +5403,16 @@ if test "${enable_sigwinch+set}" = set; then with_sigwinch=$enableval else with_sigwinch=$with_ext_funcs -fi - -echo "$ac_t""$with_sigwinch" 1>&6 -test "$with_sigwinch" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5407: result: $with_sigwinch" >&5 +echo "${ECHO_T}$with_sigwinch" >&6 +test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF #define USE_SIGWINCH 1 EOF - ### use option --enable-tcap-names to allow user to define new capabilities -echo $ac_n "checking if you want user-definable terminal capabilities like termcap""... $ac_c" 1>&6 -echo "configure:3845: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "$as_me:5414: checking if you want user-definable terminal capabilities like termcap" >&5 +echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6 # Check whether --enable-tcap-names or --disable-tcap-names was given. if test "${enable_tcap_names+set}" = set; then @@ -3849,18 +5420,17 @@ if test "${enable_tcap_names+set}" = set; then with_tcap_names=$enableval else with_tcap_names=$with_ext_funcs -fi - -echo "$ac_t""$with_tcap_names" 1>&6 +fi; +echo "$as_me:5424: result: $with_tcap_names" >&5 +echo "${ECHO_T}$with_tcap_names" >&6 NCURSES_XNAMES=0 test "$with_tcap_names" = yes && NCURSES_XNAMES=1 - ############################################################################### # These options are relatively safe to experiment with. -echo $ac_n "checking if you want all development code""... $ac_c" 1>&6 -echo "configure:3864: checking if you want all development code" >&5 +echo "$as_me:5432: checking if you want all development code" >&5 +echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. if test "${with_develop+set}" = set; then @@ -3868,31 +5438,13 @@ if test "${with_develop+set}" = set; then with_develop=$withval else with_develop=no -fi - -echo "$ac_t""$with_develop" 1>&6 - -### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo $ac_n "checking if you want colorfgbg code""... $ac_c" 1>&6 -echo "configure:3878: checking if you want colorfgbg code" >&5 - -# Check whether --enable-hard-tabs or --disable-hard-tabs was given. -if test "${enable_hard_tabs+set}" = set; then - enableval="$enable_hard_tabs" - with_colorfgbg=$enableval -else - with_colorfgbg=$with_develop -fi - -echo "$ac_t""$with_colorfgbg" 1>&6 -test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF -#define USE_COLORFGBG 1 -EOF - +fi; +echo "$as_me:5442: result: $with_develop" >&5 +echo "${ECHO_T}$with_develop" >&6 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo $ac_n "checking if you want hard-tabs code""... $ac_c" 1>&6 -echo "configure:3896: checking if you want hard-tabs code" >&5 +echo "$as_me:5446: checking if you want hard-tabs code" >&5 +echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. if test "${enable_hard_tabs+set}" = set; then @@ -3900,16 +5452,15 @@ if test "${enable_hard_tabs+set}" = set; then with_hardtabs=$enableval else with_hardtabs=$with_develop -fi - -echo "$ac_t""$with_hardtabs" 1>&6 -test "$with_hardtabs" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5456: result: $with_hardtabs" >&5 +echo "${ECHO_T}$with_hardtabs" >&6 +test "$with_hardtabs" = yes && cat >>confdefs.h <<\EOF #define USE_HARD_TABS 1 EOF - -echo $ac_n "checking if you want to use restrict environment when running as root""... $ac_c" 1>&6 -echo "configure:3913: checking if you want to use restrict environment when running as root" >&5 +echo "$as_me:5462: checking if you want to use restrict environment when running as root" >&5 +echo $ECHO_N "checking if you want to use restrict environment when running as root... $ECHO_C" >&6 # Check whether --enable-root-environ or --disable-root-environ was given. if test "${enable_root_environ+set}" = set; then @@ -3917,17 +5468,16 @@ if test "${enable_root_environ+set}" = set; then with_root_environ=$enableval else with_root_environ=yes -fi - -echo "$ac_t""$with_root_environ" 1>&6 -test "$with_root_environ" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5472: result: $with_root_environ" >&5 +echo "${ECHO_T}$with_root_environ" >&6 +test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF #define USE_ROOT_ENVIRON 1 EOF - ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo $ac_n "checking if you want limited support for xmc""... $ac_c" 1>&6 -echo "configure:3931: checking if you want limited support for xmc" >&5 +echo "$as_me:5479: checking if you want limited support for xmc" >&5 +echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. if test "${enable_xmc_glitch+set}" = set; then @@ -3935,20 +5485,18 @@ if test "${enable_xmc_glitch+set}" = set; then with_xmc_glitch=$enableval else with_xmc_glitch=$with_develop -fi - -echo "$ac_t""$with_xmc_glitch" 1>&6 -test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5489: result: $with_xmc_glitch" >&5 +echo "${ECHO_T}$with_xmc_glitch" >&6 +test "$with_xmc_glitch" = yes && cat >>confdefs.h <<\EOF #define USE_XMC_SUPPORT 1 EOF - ############################################################################### # These are just experimental, probably should not be in a package: - -echo $ac_n "checking if you do not want to assume colors are white-on-black""... $ac_c" 1>&6 -echo "configure:3952: checking if you do not want to assume colors are white-on-black" >&5 +echo "$as_me:5498: checking if you do not want to assume colors are white-on-black" >&5 +echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6 # Check whether --enable-assumed-color or --disable-assumed-color was given. if test "${enable_assumed_color+set}" = set; then @@ -3956,17 +5504,16 @@ if test "${enable_assumed_color+set}" = set; then with_assumed_color=$enableval else with_assumed_color=yes -fi - -echo "$ac_t""$with_assumed_color" 1>&6 -test "$with_assumed_color" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5508: result: $with_assumed_color" >&5 +echo "${ECHO_T}$with_assumed_color" >&6 +test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF #define USE_ASSUMED_COLOR 1 EOF - ### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6 -echo "configure:3970: checking if you want hashmap scrolling-optimization code" >&5 +echo "$as_me:5515: checking if you want hashmap scrolling-optimization code" >&5 +echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6 # Check whether --enable-hashmap or --disable-hashmap was given. if test "${enable_hashmap+set}" = set; then @@ -3974,16 +5521,32 @@ if test "${enable_hashmap+set}" = set; then with_hashmap=$enableval else with_hashmap=yes -fi - -echo "$ac_t""$with_hashmap" 1>&6 -test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5525: result: $with_hashmap" >&5 +echo "${ECHO_T}$with_hashmap" >&6 +test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF #define USE_HASHMAP 1 EOF +### use option --enable-colorfgbg to turn on use of $COLORFGBG environment +echo "$as_me:5532: checking if you want colorfgbg code" >&5 +echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6 + +# Check whether --enable-colorfgbg or --disable-colorfgbg was given. +if test "${enable_colorfgbg+set}" = set; then + enableval="$enable_colorfgbg" + with_colorfgbg=$enableval +else + with_colorfgbg=no +fi; +echo "$as_me:5542: result: $with_colorfgbg" >&5 +echo "${ECHO_T}$with_colorfgbg" >&6 +test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF +#define USE_COLORFGBG 1 +EOF -echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6 -echo "configure:3987: checking if you want experimental safe-sprintf code" >&5 +echo "$as_me:5548: checking if you want experimental safe-sprintf code" >&5 +echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. if test "${enable_safe_sprintf+set}" = set; then @@ -3991,19 +5554,18 @@ if test "${enable_safe_sprintf+set}" = set; then with_safe_sprintf=$enableval else with_safe_sprintf=no -fi - -echo "$ac_t""$with_safe_sprintf" 1>&6 -test "$with_safe_sprintf" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5558: result: $with_safe_sprintf" >&5 +echo "${ECHO_T}$with_safe_sprintf" >&6 +test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF #define USE_SAFE_SPRINTF 1 EOF - ### 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 -echo $ac_n "checking if you want to experiment without scrolling-hints code""... $ac_c" 1>&6 -echo "configure:4007: checking if you want to experiment without scrolling-hints code" >&5 +echo "$as_me:5567: checking if you want to experiment without scrolling-hints code" >&5 +echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. if test "${enable_scroll_hints+set}" = set; then @@ -4011,18 +5573,21 @@ if test "${enable_scroll_hints+set}" = set; then with_scroll_hints=$enableval else with_scroll_hints=yes -fi - -echo "$ac_t""$with_scroll_hints" 1>&6 -test "$with_scroll_hints" = yes && cat >> confdefs.h <<\EOF +fi; +echo "$as_me:5577: result: $with_scroll_hints" >&5 +echo "${ECHO_T}$with_scroll_hints" >&6 +test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF #define USE_SCROLL_HINTS 1 EOF fi ### use option --enable-widec to turn on use of wide-character support -echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6 -echo "configure:4026: checking if you want experimental wide-character code" >&5 +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 +echo "$as_me:5589: checking if you want experimental wide-character code" >&5 +echo $ECHO_N "checking if you want experimental wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. if test "${enable_widec+set}" = set; then @@ -4030,23 +5595,257 @@ if test "${enable_widec+set}" = set; then with_widec=$enableval else with_widec=no -fi - -echo "$ac_t""$with_widec" 1>&6 +fi; +echo "$as_me:5599: result: $with_widec" >&5 +echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define USE_WIDEC_SUPPORT 1 EOF + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + # with_overwrite=no + NCURSES_CH_T=cchar_t + echo "$as_me:5610: checking for putwc" >&5 +echo $ECHO_N "checking for putwc... $ECHO_C" >&6 +if test "${ac_cv_func_putwc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5616 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char putwc (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char putwc (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_putwc) || defined (__stub___putwc) +choke me +#else +f = putwc; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5647: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5650: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5653: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5656: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_putwc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_putwc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5666: result: $ac_cv_func_putwc" >&5 +echo "${ECHO_T}$ac_cv_func_putwc" >&6 + +if test "$ac_cv_func_putwc" != yes ; then + +echo "$as_me:5671: checking for putwc in libutf8" >&5 +echo $ECHO_N "checking for putwc in libutf8... $ECHO_C" >&6 +if test "${cf_cv_libutf8+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5680 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5693: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5696: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5699: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5702: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_libutf8=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_libutf8=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save_LIBS" + +fi +echo "$as_me:5714: result: $cf_cv_libutf8" >&5 +echo "${ECHO_T}$cf_cv_libutf8" >&6 + +if test "$cf_cv_libutf8" = yes ; then + cat >>confdefs.h <<\EOF +#define HAVE_LIBUTF8_H 1 +EOF + + LIBS="-lutf8 $LIBS" fi -############################################################################### + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + +# This is needed on Tru64 5.0 to declare mbstate_t +echo "$as_me:5731: checking if we must include wchar.h to declare mbstate_t" >&5 +echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6 +if test "${cf_cv_mbstate_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 5738 "configure" +#include "confdefs.h" + +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +mbstate_t state + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5754: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5757: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5760: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5763: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_mbstate_t=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line 5770 "configure" +#include "confdefs.h" + +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +mbstate_t value + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5787: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5790: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5793: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5796: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_mbstate_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_mbstate_t=unknown +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5808: result: $cf_cv_mbstate_t" >&5 +echo "${ECHO_T}$cf_cv_mbstate_t" >&6 + +if test "$cf_cv_mbstate_t" = yes ; then + cat >>confdefs.h <<\EOF +#define NEED_WCHAR_H 1 +EOF + +fi + +if test "$cf_cv_mbstate_t" != unknown ; then + cat >>confdefs.h <<\EOF +#define HAVE_MBSTATE_T 1 +EOF + +fi + + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi +fi +echo "$as_me:5830: checking for terminal capabilities file" >&5 +echo $ECHO_N "checking for terminal capabilities file... $ECHO_C" >&6 + +# Check whether --with-caps or --without-caps was given. +if test "${with_caps+set}" = set; then + withval="$with_caps" + TERMINFO_CAPS=Caps.$withval +else + TERMINFO_CAPS=Caps +fi; +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +echo "$as_me:5841: result: $TERMINFO_CAPS" >&5 +echo "${ECHO_T}$TERMINFO_CAPS" >&6 + +############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo $ac_n "checking if you want to display full commands during build""... $ac_c" 1>&6 -echo "configure:4050: checking if you want to display full commands during build" >&5 +echo "$as_me:5847: checking if you want to display full commands during build" >&5 +echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then @@ -4054,40 +5853,39 @@ if test "${enable_echo+set}" = set; then with_echo=$enableval else with_echo=yes -fi - +fi; if test "$with_echo" = yes; then ECHO_LINK= else ECHO_LINK='@ echo linking $@ ... ;' test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" fi -echo "$ac_t""$with_echo" 1>&6 - +echo "$as_me:5863: result: $with_echo" >&5 +echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo $ac_n "checking if you want to see compiler warnings""... $ac_c" 1>&6 -echo "configure:4071: checking if you want to see compiler warnings" >&5 +echo "$as_me:5867: checking if you want to see compiler warnings" >&5 +echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval -fi - -echo "$ac_t""$with_warnings" 1>&6 +fi; +echo "$as_me:5875: result: $with_warnings" >&5 +echo "${ECHO_T}$with_warnings" >&6 if test -n "$with_warnings"; then ADAFLAGS="$ADAFLAGS -gnatg" - + if test "$GCC" = yes then - cat > conftest.$ac_ext < conftest.$ac_ext <&6 -echo "configure:4091: checking for $CC warning options" >&5 + { echo "$as_me:5887: checking for $CC warning options..." >&5 +echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" @@ -4102,11 +5900,17 @@ echo "configure:4091: checking for $CC warning options" >&5 Wnested-externs \ Wpointer-arith \ Wshadow \ - Wstrict-prototypes $cf_warn_CONST + Wstrict-prototypes \ + Wundef $cf_warn_CONST do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo configure:4109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6 + if { (eval echo "$as_me:5907: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5910: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:5912: result: ... -$cf_opt" >&5 +echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES" fi @@ -4115,7 +5919,6 @@ echo "configure:4091: checking for $CC warning options" >&5 CFLAGS="$cf_save_CFLAGS" fi - fi if test "$GCC" = yes @@ -4136,10 +5939,10 @@ cat > conftest.i <&6 -echo "configure:4141: checking for $CC __attribute__ directives" >&5 - cat > conftest.$ac_ext <&5 +echo "$as_me: checking for $CC __attribute__ directives..." >&6;} +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6 + if { (eval echo "$as_me:5983: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5986: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:5988: result: ... $cf_attribute" >&5 +echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h # else # sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h @@ -4190,10 +5998,9 @@ fi rm -rf conftest* fi - ### use option --enable-assertions to turn on generation of assertion code -echo $ac_n "checking if you want to enable runtime assertions""... $ac_c" 1>&6 -echo "configure:4197: checking if you want to enable runtime assertions" >&5 +echo "$as_me:6002: checking if you want to enable runtime assertions" >&5 +echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. if test "${enable_assertions+set}" = set; then @@ -4201,14 +6008,14 @@ if test "${enable_assertions+set}" = set; then with_assertions=$enableval else with_assertions=no -fi - -echo "$ac_t""$with_assertions" 1>&6 +fi; +echo "$as_me:6012: result: $with_assertions" >&5 +echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then if test "$with_assertions" = no then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define NDEBUG 1 EOF @@ -4223,218 +6030,346 @@ fi # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - test "$enableval" = no && cat >> confdefs.h <<\EOF + test "$enableval" = no && cat >>confdefs.h <<\EOF #define NO_LEAKS 1 EOF -fi - -cat >> confdefs.h <<\EOF +fi; +cat >>confdefs.h <<\EOF #define HAVE_NC_ALLOC_H 1 EOF - ### use option --enable-expanded to generate certain macros as functions # Check whether --enable-expanded or --disable-expanded was given. if test "${enable_expanded+set}" = set; then enableval="$enable_expanded" - test "$enableval" = yes && cat >> confdefs.h <<\EOF + test "$enableval" = yes && cat >>confdefs.h <<\EOF #define NCURSES_EXPANDED 1 EOF -fi - +fi; ### use option --disable-macros to suppress macros in favor of functions # Check whether --enable-macros or --disable-macros was given. if test "${enable_macros+set}" = set; then enableval="$enable_macros" - test "$enableval" = no && cat >> confdefs.h <<\EOF + test "$enableval" = no && cat >>confdefs.h <<\EOF #define NCURSES_NOMACROS 1 EOF -fi - +fi; ### Checks for libraries. -echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 -echo "configure:4264: checking for gettimeofday" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:6065: checking for gettimeofday" >&5 +echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 +if test "${ac_cv_func_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6071 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gettimeofday(); below. */ + which can conflict with char gettimeofday (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday(); - -int main() { + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday) choke me #else -gettimeofday(); +f = gettimeofday; #endif -; return 0; } -EOF -if { (eval echo configure:4292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gettimeofday=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gettimeofday=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6102: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6105: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6108: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6111: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_gettimeofday=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:6121: result: $ac_cv_func_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 +if test $ac_cv_func_gettimeofday = yes; then + cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF else - echo "$ac_t""no" 1>&6 - -echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:4315: checking for gettimeofday in -lbsd" >&5 -ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:6130: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6138 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday(); - -int main() { -gettimeofday() -; return 0; } -EOF -if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6157: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6160: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6163: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6166: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6177: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF LIBS="$LIBS -lbsd" -else - echo "$ac_t""no" 1>&6 fi fi - -echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6 -echo "configure:4362: checking if -lm needed for math functions" >&5 -if eval "test \"`echo '$''{'cf_cv_need_libm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:6189: checking if -lm needed for math functions" >&5 +echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6 +if test "${cf_cv_need_libm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6196 "configure" #include "confdefs.h" #include #include - -int main() { + +int +main () +{ double x = rand(); printf("result = %g\n", sin(x)) -; return 0; } -EOF -if { (eval echo configure:4378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6211: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6214: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6217: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6220: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_need_libm=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_need_libm=yes + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_need_libm=yes fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$cf_cv_need_libm" 1>&6 +echo "$as_me:6230: result: $cf_cv_need_libm" >&5 +echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then MATH_LIB=-lm fi - - ### Checks for header files. -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4400: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:6239: checking if we must define _GNU_SOURCE" >&5 +echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 +if test "${cf_cv_gnu_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6246 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6261: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6264: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6267: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6270: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_gnu_source=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + cat >conftest.$ac_ext <<_ACEOF +#line 6279 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6294: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6297: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6300: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6303: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_gnu_source=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_gnu_source=yes +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:6318: result: $cf_cv_gnu_source" >&5 +echo "${ECHO_T}$cf_cv_gnu_source" >&6 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + +echo "$as_me:6322: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6328 "configure" #include "confdefs.h" #include #include #include #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + +_ACEOF +if { (eval echo "$as_me:6336: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:6342: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6364 "configure" #include "confdefs.h" #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -4443,16 +6378,16 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6382 "configure" #include "confdefs.h" #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -4461,265 +6396,417 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6403 "configure" #include "confdefs.h" #include -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:6429: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6432: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:6434: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6437: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:6450: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4508: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6469 "configure" #include "confdefs.h" #include #include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:4521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6484: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6487: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6490: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6493: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 + +ac_header_dirent=$ac_hdr; break fi + done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4546: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:6516: checking for opendir in -ldir" >&5 +echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 +if test "${ac_cv_lib_dir_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6524 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); - -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6543: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6546: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6549: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6552: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dir_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dir_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6563: result: $ac_cv_lib_dir_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 +if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 fi else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4587: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:6570: checking for opendir in -lx" >&5 +echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 +if test "${ac_cv_lib_x_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6578 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); - -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:4606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + builtin and then its argument prototype would still apply. */ +char opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6597: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6600: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6603: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6606: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_x_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_x_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6617: result: $ac_cv_lib_x_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 +if test $ac_cv_lib_x_opendir = yes; then + LIBS="$LIBS -lx" fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" + +echo "$as_me:6625: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 -fi + cat >conftest.$ac_ext <<_ACEOF +#line 6631 "configure" +#include "confdefs.h" +#include +#include +#include +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6647: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6650: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6653: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6656: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:6666: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF +fi -echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6 -echo "configure:4630: checking for regular-expression headers" >&5 -if eval "test \"`echo '$''{'cf_cv_regex'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:6676: checking for regular-expression headers" >&5 +echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 +if test "${cf_cv_regex+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6683 "configure" #include "confdefs.h" #include #include -int main() { +int +main () +{ regex_t *p; int x = regcomp(p, "", 0); int y = regexec(p, "", 0, 0, 0); regfree(p); - -; return 0; } -EOF -if { (eval echo configure:4649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6701: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6704: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6707: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6710: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_regex="regex.h" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext <&5 +cat conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 6718 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ char *p = compile("", "", "", 0); int x = step("", ""); - -; return 0; } -EOF -if { (eval echo configure:4668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6733: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6736: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6739: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6742: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_regex="regexp.h" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + cf_save_LIBS="$LIBS" LIBS="-lgen $LIBS" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6752 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ char *p = compile("", "", ""); int x = step("", ""); - -; return 0; } -EOF -if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6767: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6770: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6773: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6776: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_regex="regexpr.h" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$cf_save_LIBS" + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +LIBS="$cf_save_LIBS" fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$cf_cv_regex" 1>&6 +echo "$as_me:6792: result: $cf_cv_regex" >&5 +echo "${ECHO_T}$cf_cv_regex" >&6 case $cf_cv_regex in - regex.h) cat >> confdefs.h <<\EOF + regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF ;; - regexp.h) cat >> confdefs.h <<\EOF + regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF ;; - regexpr.h) cat >> confdefs.h <<\EOF + regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; esac - -for ac_hdr in \ +for ac_header in \ fcntl.h \ getopt.h \ libc.h \ @@ -4737,141 +6824,169 @@ ttyent.h \ unistd.h \ do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4743: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 6834 "configure" #include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:6838: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:6844: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 + fi done - # check for ISC (this may also define _POSIX_SOURCE) # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then - echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6 -echo "configure:4784: checking for main in -lcposix" >&5 -ac_lib_var=`echo cposix'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:6877: checking for main in -lcposix" >&5 +echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6 +if test "${ac_cv_lib_cposix_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6885 "configure" #include "confdefs.h" -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo cposix | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6900: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6903: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6906: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cposix_main=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cposix_main=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6917: result: $ac_cv_lib_cposix_main" >&5 +echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6 +if test $ac_cv_lib_cposix_main = yes; then + cat >>confdefs.h <&6 fi - echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6 -echo "configure:4827: checking for bzero in -linet" >&5 -ac_lib_var=`echo inet'_'bzero | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:6928: checking for bzero in -linet" >&5 +echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6 +if test "${ac_cv_lib_inet_bzero+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6936 "configure" #include "confdefs.h" + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bzero(); - -int main() { -bzero() -; return 0; } -EOF -if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 + builtin and then its argument prototype would still apply. */ +char bzero (); +int +main () +{ +bzero (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6955: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6958: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6961: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6964: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_bzero=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_inet_bzero=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6975: result: $ac_cv_lib_inet_bzero" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6 +if test $ac_cv_lib_inet_bzero = yes; then LIBS="$LIBS -linet" -else - echo "$ac_t""no" 1>&6 fi fi - -echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6 -echo "configure:4869: checking if sys/time.h works with sys/select.h" >&5 -if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:6982: checking if sys/time.h works with sys/select.h" >&5 +echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6 +if test "${cf_cv_sys_time_select+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 6989 "configure" #include "confdefs.h" #include @@ -4882,201 +6997,343 @@ cat > conftest.$ac_ext < #endif -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7009: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7012: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7015: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7018: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_sys_time_select=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_sys_time_select=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_sys_time_select=no fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest.$ac_ext + fi -echo "$ac_t""$cf_cv_sys_time_select" 1>&6 -test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF +echo "$as_me:7030: result: $cf_cv_sys_time_select" >&5 +echo "${ECHO_T}$cf_cv_sys_time_select" >&6 +test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF #define HAVE_SYS_TIME_SELECT 1 EOF - - ### checks for compiler characteristics ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4919: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line 7051 "configure" #include "confdefs.h" - -int main() { - -/* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; -/* SunOS 4.1.1 cc rejects this. */ -char const *const *ccp; -char **p; -/* NEC SVR4.0.2 mips cc rejects this. */ -struct point {int x, y;}; -static struct point const zero = {0,0}; -/* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in an arm - of an if-expression whose if-part is not a constant expression */ -const char *g = "string"; -ccp = &g + (g ? g-g : 0); -/* HPUX 7.0 cc rejects these. */ -++ccp; -p = (char**) ccp; -ccp = (char const *const *) p; -{ /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; -} -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; -} -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; } -{ /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; } -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; } +_ACEOF +# 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 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:7100: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7103: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7106: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7109: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:7126: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:7129: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:7134: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7140 "configure" +#include "confdefs.h" + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif -; return 0; } -EOF -if { (eval echo configure:4973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7198: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7201: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7204: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7207: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_const=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 +echo "$as_me:7217: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const + +cat >>confdefs.h <<\EOF +#define const EOF fi -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4994: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7227: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7235 "configure" #include "confdefs.h" +#ifndef __cplusplus +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif -int main() { -} $ac_kw foo() { -; return 0; } -EOF -if { (eval echo configure:5008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7244: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7247: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7250: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7253: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext done fi - -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in +echo "$as_me:7264: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline + no) +cat >>confdefs.h <<\EOF +#define inline EOF ;; - *) cat >> confdefs.h <>confdefs.h <> confdefs.h <<\EOF +test "$ac_cv_c_inline" != no && cat >>confdefs.h <<\EOF #define CC_HAS_INLINE_FUNCS 1 EOF - - -echo $ac_n "checking if unsigned literals are legal""... $ac_c" 1>&6 -echo "configure:5040: checking if unsigned literals are legal" >&5 -if eval "test \"`echo '$''{'cf_cv_unsigned_literals'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7283: checking if unsigned literals are legal" >&5 +echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6 +if test "${cf_cv_unsigned_literals+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7290 "configure" #include "confdefs.h" -int main() { +int +main () +{ long x = 1L + 1UL + 1U + 1 -; return 0; } -EOF -if { (eval echo configure:5053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7302: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7305: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7308: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7311: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_unsigned_literals=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_unsigned_literals=no -fi -rm -f conftest* - + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_unsigned_literals=no fi +rm -f conftest.$ac_objext conftest.$ac_ext -echo "$ac_t""$cf_cv_unsigned_literals" 1>&6 - +fi +echo "$as_me:7323: result: $cf_cv_unsigned_literals" >&5 +echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 -echo $ac_n "checking for type of chtype""... $ac_c" 1>&6 -echo "configure:5071: checking for type of chtype" >&5 -if eval "test \"`echo '$''{'cf_cv_typeof_chtype'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7326: checking for type of chtype" >&5 +echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 +if test "${cf_cv_typeof_chtype+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + if test "$cross_compiling" = yes; then cf_cv_typeof_chtype=long else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7336 "configure" #include "confdefs.h" #ifdef USE_WIDEC_SUPPORT @@ -5120,127 +7377,53 @@ int main() } exit(0); } - -EOF -if { (eval echo configure:5126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7383: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7386: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7388: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7391: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_typeof_chtype=`cat cf_test.out` else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_typeof_chtype=long + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_typeof_chtype=long fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - rm -f cf_test.out - -fi -echo "$ac_t""$cf_cv_typeof_chtype" 1>&6 +fi +echo "$as_me:7406: result: $cf_cv_typeof_chtype" >&5 +echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 -cat >> confdefs.h <>confdefs.h <&6 -echo "configure:5159: checking for number of bits in chtype" >&5 -if eval "test \"`echo '$''{'cf_cv_shift_limit'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - if test "$cross_compiling" = yes; then - cf_cv_shift_limit=32 -else - cat > conftest.$ac_ext < -int main() -{ - FILE *fp = fopen("cf_test.out", "w"); - if (fp != 0) { - int n; - unsigned TYPEOF_CHTYPE x = 1L; - for (n = 0; ; n++) { - unsigned long y = (x >> n); - if (y != 1 || x == 0) - break; - x <<= 1; - } - fprintf(fp, "%d", n); - fclose(fp); - } - exit(0); -} - -EOF -if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - cf_cv_shift_limit=`cat cf_test.out` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_shift_limit=32 -fi -rm -fr conftest* -fi - - rm -f cf_test.out - -fi - -echo "$ac_t""$cf_cv_shift_limit" 1>&6 - - -echo $ac_n "checking for width of character-index""... $ac_c" 1>&6 -echo "configure:5211: checking for width of character-index" >&5 -if eval "test \"`echo '$''{'cf_cv_widec_shift'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -if test ".$with_widec" = ".yes" ; then - cf_attrs_width=39 - if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null ) - then - cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width` - else - cf_cv_widec_shift=16 - fi -else - cf_cv_widec_shift=8 -fi - -fi - -echo "$ac_t""$cf_cv_widec_shift" 1>&6 - - - ### Checks for external-data - -echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6 -echo "configure:5238: checking if external errno is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7419: checking if external errno is declared" >&5 +echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 +if test "${cf_cv_dcl_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7426 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -5248,34 +7431,44 @@ else #endif #include #include -#include -int main() { +#include +int +main () +{ long x = (long) errno -; return 0; } -EOF -if { (eval echo configure:5257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval 'cf_cv_dcl_'errno'=yes' + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7444: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7447: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7450: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7453: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_dcl_errno=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval 'cf_cv_dcl_'errno'=no' + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_dcl_errno=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:7464: result: $cf_cv_dcl_errno" >&5 +echo "${ECHO_T}$cf_cv_dcl_errno" >&6 +if test "$cf_cv_dcl_errno" = no ; then -eval 'cf_result=$cf_cv_dcl_'errno -echo "$ac_t""$cf_result" 1>&6 +cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` -if test "$cf_result" = no ; then - eval 'cf_result=DECL_'errno - -cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >> confdefs.h <>confdefs.h <&6 -echo "configure:5288: checking if external errno exists" >&5 -if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7479: checking if external errno exists" >&5 +echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 +if test "${cf_cv_have_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7486 "configure" #include "confdefs.h" #undef errno extern int errno; -int main() { +int +main () +{ errno = 2 -; return 0; } -EOF -if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval 'cf_cv_have_'errno'=yes' + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7501: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7504: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7507: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7510: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_errno=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval 'cf_cv_have_'errno'=no' -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_errno=no fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:7521: result: $cf_cv_have_errno" >&5 +echo "${ECHO_T}$cf_cv_have_errno" >&6 -eval 'cf_result=$cf_cv_have_'errno -echo "$ac_t""$cf_result" 1>&6 +if test "$cf_cv_have_errno" = yes ; then -if test "$cf_result" = yes ; then - eval 'cf_result=HAVE_'errno - -cf_result=`echo "$cf_result" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - cat >> confdefs.h <>confdefs.h <&6 -echo "configure:5336: checking if data-only library module links" >&5 -if eval "test \"`echo '$''{'cf_cv_link_dataonly'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7534: checking if data-only library module links" >&5 +echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 +if test "${cf_cv_link_dataonly+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + rm -f conftest.a - cat >conftest.$ac_ext <conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; } ; then + if { (eval echo "$as_me:7545: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7548: \$? = $ac_status" >&5 + (exit $ac_status); } ; then mv conftest.o data.o && \ ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o - cat >conftest.$ac_ext <conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo "$as_me:7568: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7571: \$? = $ac_status" >&5 + (exit $ac_status); }; then mv conftest.o func.o && \ ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null fi @@ -5372,8 +7580,8 @@ EOF if test "$cross_compiling" = yes; then cf_cv_link_dataonly=unknown else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7584 "configure" #include "confdefs.h" int main() @@ -5381,32 +7589,45 @@ else extern int testfunc(); exit (!testfunc()); } - -EOF -if { (eval echo configure:5387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7595: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7598: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7600: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7603: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_link_dataonly=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_link_dataonly=no fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - LIBS="$cf_saveLIBS" - + fi -echo "$ac_t""$cf_cv_link_dataonly" 1>&6 -test "$cf_cv_link_dataonly" = no && cat >> confdefs.h <<\EOF +echo "$as_me:7618: result: $cf_cv_link_dataonly" >&5 +echo "${ECHO_T}$cf_cv_link_dataonly" >&6 + +if test "$cf_cv_link_dataonly" = no ; then + cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF - + BROKEN_LINKER=1 +fi ### Checks for library functions. + for ac_func in \ getcwd \ getegid \ @@ -5414,7 +7635,6 @@ geteuid \ getttynam \ issetugid \ memccpy \ -mkstemp \ nanosleep \ poll \ remove \ @@ -5428,78 +7648,92 @@ strdup \ strstr \ tcgetpgrp \ times \ -vfscanf \ vsnprintf \ -vsscanf \ do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5438: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7661 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ + which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +f = $ac_func; #endif -; return 0; } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7692: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7695: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7698: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7701: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:7711: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done if test "$with_getcap" = "yes" ; then - -echo $ac_n "checking for terminal-capability database functions""... $ac_c" 1>&6 -echo "configure:5493: checking for terminal-capability database functions" >&5 -if eval "test \"`echo '$''{'cf_cv_cgetent'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +echo "$as_me:7723: checking for terminal-capability database functions" >&5 +echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6 +if test "${cf_cv_cgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7730 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ char temp[128]; char *buf = temp; @@ -5507,325 +7741,720 @@ int main() { cgetent(&buf, /* int *, */ &db_array, "vt100"); cgetcap(buf, "tc", '='); cgetmatch(buf, "tc"); - -; return 0; } -EOF -if { (eval echo configure:5514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7750: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7753: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7756: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7759: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_cgetent=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_cgetent=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cgetent=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$cf_cv_cgetent" 1>&6 -test "$cf_cv_cgetent" = yes && cat >> confdefs.h <<\EOF +echo "$as_me:7771: result: $cf_cv_cgetent" >&5 +echo "${ECHO_T}$cf_cv_cgetent" >&6 +test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 EOF - fi - -echo $ac_n "checking for isascii""... $ac_c" 1>&6 -echo "configure:5537: checking for isascii" >&5 -if eval "test \"`echo '$''{'cf_cv_have_isascii'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:7779: checking for isascii" >&5 +echo $ECHO_N "checking for isascii... $ECHO_C" >&6 +if test "${cf_cv_have_isascii+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 7786 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ int x = isascii(' ') -; return 0; } -EOF -if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7798: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7801: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7804: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7807: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_have_isascii=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_have_isascii=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_isascii=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$cf_cv_have_isascii" 1>&6 -test "$cf_cv_have_isascii" = yes && cat >> confdefs.h <<\EOF +echo "$as_me:7818: result: $cf_cv_have_isascii" >&5 +echo "${ECHO_T}$cf_cv_have_isascii" >&6 +test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF - - if test "$ac_cv_func_sigaction" = yes; then -echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5571: checking whether sigaction needs _POSIX_SOURCE" >&5 -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 7828 "configure" #include "confdefs.h" #include #include -int main() { +int +main () +{ struct sigaction act -; return 0; } -EOF -if { (eval echo configure:5582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7842: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7845: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7848: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7851: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then sigact_bad=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - -cat > conftest.$ac_ext <&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 7859 "configure" #include "confdefs.h" #define _POSIX_SOURCE #include #include -int main() { +int +main () +{ struct sigaction act -; return 0; } -EOF -if { (eval echo configure:5601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7874: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7877: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7880: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7883: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then sigact_bad=yes - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define SVR4_ACTION 1 EOF else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - sigact_bad=unknown + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +sigact_bad=unknown fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest* -echo "$ac_t""$sigact_bad" 1>&6 +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:7898: result: $sigact_bad" >&5 +echo "${ECHO_T}$sigact_bad" >&6 fi - -for ac_hdr in \ +for ac_header in \ termio.h \ termios.h \ unistd.h \ do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5629: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7915 "configure" #include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:7919: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:7925: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 + fi done if test "$ISC" = yes ; then - for ac_hdr in sys/termio.h + +for ac_header in sys/termio.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5670: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7965 "configure" #include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:7969: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:7975: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "$as_ac_Header=no" fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 + fi done fi if test "$ac_cv_header_termios_h" = yes ; then - case "$CFLAGS" in + case "$CFLAGS $CPPFLAGS" in *-D_POSIX_SOURCE*) termios_bad=dunno ;; *) termios_bad=maybe ;; esac if test "$termios_bad" = maybe ; then - echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:5715: checking whether termios.h needs _POSIX_SOURCE" >&5 - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line 8015 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ struct termios foo; int x = foo.c_iflag -; return 0; } -EOF -if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8027: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8030: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8033: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8036: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then termios_bad=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext <&5 +cat conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 8044 "configure" #include "confdefs.h" #define _POSIX_SOURCE #include -int main() { +int +main () +{ struct termios foo; int x = foo.c_iflag -; return 0; } -EOF -if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8058: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8061: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8064: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8067: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then termios_bad=unknown else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - termios_bad=yes cat >> confdefs.h <<\EOF -#define SVR4_TERMIO 1 -EOF + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +termios_bad=yes cat >>confdefs.h <<\EOF +#define SVR4_TERMIO 1 +EOF + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:8082: result: $termios_bad" >&5 +echo "${ECHO_T}$termios_bad" >&6 + fi +fi + +echo "$as_me:8087: checking for tcgetattr" >&5 +echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6 +if test "${cf_cv_have_tcgetattr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 8094 "configure" +#include "confdefs.h" + +#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 + +int +main () +{ + +TTY foo; +tcgetattr(1, &foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8122: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8125: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8128: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8131: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_tcgetattr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_tcgetattr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8141: result: $cf_cv_have_tcgetattr" >&5 +echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6 +test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF +#define HAVE_TCGETATTR 1 +EOF + +echo "$as_me:8147: checking for vsscanf function or workaround" >&5 +echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6 +if test "${cf_cv_func_vsscanf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 8154 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + va_list ap; + vsscanf("from", "%d", ap) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8170: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8173: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8176: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8179: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=vsscanf +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 8187 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (vfscanf(&strbuf, "%d", ap)) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8209: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8212: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8215: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8218: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=vfscanf +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 8226 "configure" +#include "confdefs.h" + +#include +#include +int +main () +{ + + FILE strbuf; + char *str = "from"; + + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; + return (_doscan(&strbuf, "%d", ap)) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8248: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8251: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8254: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8257: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_vsscanf=_doscan +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_func_vsscanf=no fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest* - echo "$ac_t""$termios_bad" 1>&6 - fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8272: result: $cf_cv_func_vsscanf" >&5 +echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 +case $cf_cv_func_vsscanf in #(vi +vsscanf) cat >>confdefs.h <<\EOF +#define HAVE_VSSCANF 1 +EOF +;; #(vi +vfscanf) cat >>confdefs.h <<\EOF +#define HAVE_VFSCANF 1 +EOF +;; #(vi +_doscan) cat >>confdefs.h <<\EOF +#define HAVE__DOSCAN 1 +EOF +;; +esac +echo "$as_me:8290: checking for working mkstemp" >&5 +echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 +if test "${cf_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6 -echo "configure:5765: checking for tcgetattr" >&5 -if eval "test \"`echo '$''{'cf_cv_have_tcgetattr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +rm -f conftest* +if test "$cross_compiling" = yes; then + echo "$as_me:8298: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8304 "configure" #include "confdefs.h" - -#include -#ifdef HAVE_UNISTD_H -#include +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" #endif -#ifdef HAVE_TERMIOS_H -#include -#define TTY struct termios +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkstemp (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +choke me #else -#ifdef HAVE_TERMIO_H -#include -#define TTY struct termio -#endif +f = mkstemp; #endif -int main() { + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8335: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8338: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8341: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8344: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_mkstemp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8354: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 + +else + cat >conftest.$ac_ext <<_ACEOF +#line 8359 "configure" +#include "confdefs.h" + +#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); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8397: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8400: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8402: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8405: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_mkstemp=yes -TTY foo; -tcgetattr(1, &foo); -; return 0; } -EOF -if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - cf_cv_have_tcgetattr=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_have_tcgetattr=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_func_mkstemp=no + fi -rm -f conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$cf_cv_have_tcgetattr" 1>&6 -test "$cf_cv_have_tcgetattr" = yes && cat >> confdefs.h <<\EOF -#define HAVE_TCGETATTR 1 +fi +echo "$as_me:8420: result: $cf_cv_func_mkstemp" >&5 +echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 +if test "$cf_cv_func_mkstemp" = yes ; then + cat >>confdefs.h <<\EOF +#define HAVE_MKSTEMP 1 EOF +fi +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi if test "$cross_compiling" = yes ; then - echo "configure: warning: cross compiling: assume setvbuf params not reversed" 1>&2 + { echo "$as_me:8437: WARNING: cross compiling: assume setvbuf params not reversed" >&5 +echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;} else - echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:5817: checking whether setvbuf arguments are reversed" >&5 -if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:8440: checking whether setvbuf arguments are reversed" >&5 +echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6 +if test "${ac_cv_func_setvbuf_reversed+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + { { echo "$as_me:8446: error: cannot run test program while cross compiling" >&5 +echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8451 "configure" #include "confdefs.h" #include /* If setvbuf has the reversed format, exit 0. */ -main () { +int +main () +{ /* This call has the arguments reversed. A reversed system may check and see that the address of main is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ @@ -5834,43 +8463,52 @@ main () { putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ } -EOF -if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8468: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8471: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8473: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8476: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_setvbuf_reversed=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_setvbuf_reversed=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_setvbuf_reversed=no fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - rm -f core core.* *.core fi - -echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6 +echo "$as_me:8489: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6 if test $ac_cv_func_setvbuf_reversed = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\EOF #define SETVBUF_REVERSED 1 EOF fi fi -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5864: checking return type of signal handlers" >&5 -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8500: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8506 "configure" #include "confdefs.h" #include #include #ifdef signal -#undef signal +# undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); @@ -5878,80 +8516,103 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { +int +main () +{ int i; -; return 0; } -EOF -if { (eval echo configure:5886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8528: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8531: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8534: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8537: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_signal=void else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_type_signal=int + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_signal=int fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:8547: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 -echo "$ac_t""$ac_cv_type_signal" 1>&6 -cat >> confdefs.h <>confdefs.h <&6 -echo "configure:5906: checking for type sigaction_t" >&5 -if eval "test \"`echo '$''{'cf_cv_type_sigaction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8554: checking for type sigaction_t" >&5 +echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6 +if test "${cf_cv_type_sigaction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8561 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ sigaction_t x -; return 0; } -EOF -if { (eval echo configure:5920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8574: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8577: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8580: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8583: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_type_sigaction=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_type_sigaction=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_type_sigaction=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$cf_cv_type_sigaction" 1>&6 -test "$cf_cv_type_sigaction" = yes && cat >> confdefs.h <<\EOF +echo "$as_me:8594: result: $cf_cv_type_sigaction" >&5 +echo "${ECHO_T}$cf_cv_type_sigaction" >&6 +test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF - - - -echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6 -echo "configure:5941: checking declaration of size-change" >&5 -if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8600: checking declaration of size-change" >&5 +echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6 +if test "${cf_cv_sizechange+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + cf_cv_sizechange=unknown - cf_save_CFLAGS="$CFLAGS" + cf_save_CPPFLAGS="$CPPFLAGS" for cf_opts in "" "NEED_PTEM_H" do - CFLAGS="$cf_save_CFLAGS" - test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8615 "configure" #include "confdefs.h" #include #ifdef HAVE_TERMIOS_H @@ -5972,7 +8633,9 @@ do #include #endif -int main() { +int +main () +{ #ifdef TIOCGSIZE struct ttysize win; /* FIXME: what system is this? */ @@ -5987,21 +8650,32 @@ int main() { no TIOCGSIZE or TIOCGWINSZ #endif /* TIOCGWINSZ */ #endif /* TIOCGSIZE */ - -; return 0; } -EOF -if { (eval echo configure:5994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8659: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8662: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8665: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8668: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_sizechange=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_sizechange=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_sizechange=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" if test "$cf_cv_sizechange" = yes ; then echo "size-change succeeded ($cf_opts)" >&5 test -n "$cf_opts" && cf_cv_sizechange="$cf_opts" @@ -6010,16 +8684,16 @@ rm -f conftest* done fi - -echo "$ac_t""$cf_cv_sizechange" 1>&6 +echo "$as_me:8687: result: $cf_cv_sizechange" >&5 +echo "${ECHO_T}$cf_cv_sizechange" >&6 if test "$cf_cv_sizechange" != no ; then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_SIZECHANGE 1 EOF case $cf_cv_sizechange in #(vi NEED*) - cat >> confdefs.h <>confdefs.h <&6 -echo "configure:6033: checking for memmove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8704: checking for memmove" >&5 +echo $ECHO_N "checking for memmove... $ECHO_C" >&6 +if test "${ac_cv_func_memmove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8710 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char memmove(); below. */ + which can conflict with char memmove (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char memmove(); - -int main() { + builtin and then its argument prototype would still apply. */ +char memmove (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_memmove) || defined (__stub___memmove) choke me #else -memmove(); +f = memmove; #endif -; return 0; } -EOF -if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_memmove=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_memmove=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then - echo "$ac_t""yes" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8741: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8744: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8747: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8750: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memmove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_memmove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8760: result: $ac_cv_func_memmove" >&5 +echo "${ECHO_T}$ac_cv_func_memmove" >&6 +if test $ac_cv_func_memmove = yes; then : else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for bcopy""... $ac_c" 1>&6 -echo "configure:6080: checking for bcopy" >&5 -if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8766: checking for bcopy" >&5 +echo $ECHO_N "checking for bcopy... $ECHO_C" >&6 +if test "${ac_cv_func_bcopy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8772 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char bcopy(); below. */ + which can conflict with char bcopy (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bcopy(); - -int main() { + builtin and then its argument prototype would still apply. */ +char bcopy (); +char (*f) (); +int +main () +{ /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_bcopy) || defined (__stub___bcopy) choke me #else -bcopy(); +f = bcopy; #endif -; return 0; } -EOF -if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_bcopy=yes" + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8803: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8806: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8809: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8812: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_bcopy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_bcopy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8822: result: $ac_cv_func_bcopy" >&5 +echo "${ECHO_T}$ac_cv_func_bcopy" >&6 +if test $ac_cv_func_bcopy = yes; then + + echo "$as_me:8826: checking if bcopy does overlapping moves" >&5 +echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6 +if test "${cf_cv_good_bcopy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_bcopy=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6 -echo "configure:6124: checking if bcopy does overlapping moves" >&5 -if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then cf_cv_good_bcopy=unknown else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8836 "configure" #include "confdefs.h" int main() { @@ -6140,37 +8844,44 @@ int main() { bcopy(temp+5, temp+15, 10); exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); } - -EOF -if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8850: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8853: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8855: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8858: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_good_bcopy=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_good_bcopy=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_good_bcopy=no fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:8871: result: $cf_cv_good_bcopy" >&5 +echo "${ECHO_T}$cf_cv_good_bcopy" >&6 -echo "$ac_t""$cf_cv_good_bcopy" 1>&6 - else - echo "$ac_t""no" 1>&6 -cf_cv_good_bcopy=no + cf_cv_good_bcopy=no fi if test "$cf_cv_good_bcopy" = yes ; then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define USE_OK_BCOPY 1 EOF else - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define USE_MY_MEMMOVE 1 EOF @@ -6178,18 +8889,17 @@ EOF fi - -echo $ac_n "checking if poll really works""... $ac_c" 1>&6 -echo "configure:6184: checking if poll really works" >&5 -if eval "test \"`echo '$''{'cf_cv_working_poll'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8892: checking if poll really works" >&5 +echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 +if test "${cf_cv_working_poll+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 8902 "configure" #include "confdefs.h" #include @@ -6208,78 +8918,139 @@ int main() { ret = poll(&myfds, 1, 100); exit(ret != 0); } -EOF -if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8923: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8926: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8928: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8931: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_working_poll=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_working_poll=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_working_poll=no fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi - -echo "$ac_t""$cf_cv_working_poll" 1>&6 -test "$cf_cv_working_poll" = "yes" && cat >> confdefs.h <<\EOF +echo "$as_me:8943: result: $cf_cv_working_poll" >&5 +echo "${ECHO_T}$cf_cv_working_poll" >&6 +test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF - - if test -z "$cf_user_CFLAGS" ; then CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'` CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-g //' -e 's/-g$//'` fi +echo "$as_me:8954: checking for stdbool.h" >&5 +echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 8960 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:8964: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:8970: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:8989: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +if test $ac_cv_header_stdbool_h = yes; then + cf_cv_header_stdbool_h=1 +else + cf_cv_header_stdbool_h=0 +fi -echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 -echo "configure:6241: checking for builtin bool type" >&5 -if eval "test \"`echo '$''{'cf_cv_cc_bool_type'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:8997: checking for builtin bool type" >&5 +echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 +if test "${cf_cv_cc_bool_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9004 "configure" #include "confdefs.h" #include #include -int main() { +int +main () +{ bool x = false -; return 0; } -EOF -if { (eval echo configure:6257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9019: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9022: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9025: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9028: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_cc_bool_type=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_cc_bool_type=0 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cc_bool_type=0 fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest.$ac_ext + fi if test "$cf_cv_cc_bool_type" = 1 -then echo "$ac_t""yes" 1>&6 -else echo "$ac_t""no" 1>&6 +then echo "$as_me:9041: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else echo "$as_me:9043: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test -n "$CXX" ; then - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test -n "$GXX" ; then case $cf_cv_system_name in #(vi os2*) #(vi @@ -6289,51 +9060,63 @@ os2*) #(vi cf_stdcpp_libname=stdc++ ;; esac -echo $ac_n "checking for library $cf_stdcpp_libname""... $ac_c" 1>&6 -echo "configure:6294: checking for library $cf_stdcpp_libname" >&5 -if eval "test \"`echo '$''{'cf_cv_libstdcpp'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:9063: checking for library $cf_stdcpp_libname" >&5 +echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6 +if test "${cf_cv_libstdcpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + cf_save="$LIBS" LIBS="$LIBS -l$cf_stdcpp_libname" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9072 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ char buf[80]; strstreambuf foo(buf, sizeof(buf)) -; return 0; } -EOF -if { (eval echo configure:6313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9088: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9091: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9094: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9097: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_libstdcpp=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_libstdcpp=no + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_libstdcpp=no fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" fi - -echo "$ac_t""$cf_cv_libstdcpp" 1>&6 +echo "$as_me:9109: result: $cf_cv_libstdcpp" >&5 +echo "${ECHO_T}$cf_cv_libstdcpp" >&6 test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi - if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in - 1*|2.0-6*) - cf_cxx_library=yes - ;; - 2.7*) - + case $GXX_VERSION in + 1*|2.0-6*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + cf_cxx_library=unknown case $cf_cv_system_name in #(vi os2*) #(vi @@ -6343,218 +9126,460 @@ os2*) #(vi cf_gpp_libname=g++ ;; esac -if test "$ac_cv_prog_gxx" = yes; then - echo $ac_n "checking for lib$cf_gpp_libname""... $ac_c" 1>&6 -echo "configure:6349: checking for lib$cf_gpp_libname" >&5 +if test "$ac_cv_cxx_compiler_gnu" = yes; then + echo "$as_me:9130: checking for lib$cf_gpp_libname" >&5 +echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 cf_save="$LIBS" LIBS="$LIBS -l$cf_gpp_libname" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9135 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> - -int main() { + +int +main () +{ two_arg_error_handler_t foo2 = lib_error_handler -; return 0; } -EOF -if { (eval echo configure:6362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9149: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9152: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9155: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9158: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cxx_library=yes CXXLIBS="$CXXLIBS -l$cf_gpp_libname" if test "$cf_gpp_libname" = cpp ; then - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_GPP_BUILTIN_H 1 EOF else - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_GXX_BUILTIN_H 1 EOF fi else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cat > conftest.$ac_ext <&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line 9177 "configure" #include "confdefs.h" #include - -int main() { + +int +main () +{ two_arg_error_handler_t foo2 = lib_error_handler -; return 0; } -EOF -if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9191: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9194: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9197: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9200: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cxx_library=yes CXXLIBS="$CXXLIBS -l$cf_gpp_libname" - cat >> confdefs.h <<\EOF + cat >>confdefs.h <<\EOF #define HAVE_BUILTIN_H 1 EOF else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cxx_library=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cxx_library=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save" + echo "$as_me:9217: result: $cf_cxx_library" >&5 +echo "${ECHO_T}$cf_cxx_library" >&6 +fi + + ;; + *) + cf_cxx_library=no + ;; + esac + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:9232: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 9249 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:9254: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9260: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 9283 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9287: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9293: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:9330: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 9340 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:9345: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9351: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 9374 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9378: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9384: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi -rm -f conftest* - LIBS="$cf_save" - echo "$ac_t""$cf_cxx_library" 1>&6 +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext - ;; - *) - cf_cxx_library=no - ;; - esac - else - cf_cxx_library=no - fi - echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:6421: checking how to run the C++ preprocessor" >&5 -if test -z "$CXXCPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + { { echo "$as_me:9412: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - CXXCPP="${CXX-g++} -E" - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9432 "configure" #include "confdefs.h" -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:9436: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9442: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - CXXCPP=/lib/cpp + eval "$as_ac_Header=no" fi -rm -f conftest* - ac_cv_prog_CXXCPP="$CXXCPP" -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross +rm -f conftest.err conftest.$ac_ext fi +echo "$as_me:9461: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&6 +done -for ac_hdr in typeinfo -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6467: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9477 "configure" #include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" +#include +_ACEOF +if { (eval echo "$as_me:9481: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9487: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cv_header_stdbool_h=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +if test $ac_cv_header_stdbool_h = yes; then + cf_cv_header_stdbool_h=1 else - echo "$ac_t""no" 1>&6 + cf_cv_header_stdbool_h=0 fi -done - -echo $ac_n "checking for builtin bool type""... $ac_c" 1>&6 -echo "configure:6505: checking for builtin bool type" >&5 -if eval "test \"`echo '$''{'cf_cv_builtin_bool'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:9514: checking for builtin bool type" >&5 +echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 +if test "${cf_cv_builtin_bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9521 "configure" #include "confdefs.h" #include #include -int main() { +int +main () +{ bool x = false -; return 0; } -EOF -if { (eval echo configure:6521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9536: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9539: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9542: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9545: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_builtin_bool=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_builtin_bool=0 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_builtin_bool=0 fi -rm -f conftest* - +rm -f conftest.$ac_objext conftest.$ac_ext + fi if test "$cf_cv_builtin_bool" = 1 -then echo "$ac_t""yes" 1>&6 -else echo "$ac_t""no" 1>&6 +then echo "$as_me:9558: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else echo "$as_me:9560: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - -echo $ac_n "checking for size of bool""... $ac_c" 1>&6 -echo "configure:6541: checking for size of bool" >&5 -if eval "test \"`echo '$''{'cf_cv_type_of_bool'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:9564: checking for size of bool" >&5 +echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 +if test "${cf_cv_type_of_bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + rm -f cf_test.out if test "$cross_compiling" = yes; then cf_cv_type_of_bool=unknown else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9575 "configure" #include "confdefs.h" -#ifdef __cplusplus -extern "C" void exit(int); -#endif #include #include + +#if defined(__cplusplus) + #ifdef HAVE_GXX_BUILTIN_H #include #elif HAVE_GPP_BUILTIN_H @@ -6562,6 +9587,15 @@ extern "C" void exit(int); #elif HAVE_BUILTIN_H #include #endif + +#else + +#if $cf_cv_header_stdbool_h +#include +#endif + +#endif + main() { FILE *fp = fopen("cf_test.out", "w"); @@ -6577,33 +9611,48 @@ main() } exit(0); } - -EOF -if { (eval echo configure:6583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:9617: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9620: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:9622: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9625: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_type_of_bool=unknown + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_type_of_bool=unknown fi -rm -fr conftest* +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi rm -f cf_test.out -echo "$ac_t""$cf_cv_type_of_bool" 1>&6 +echo "$as_me:9643: result: $cf_cv_type_of_bool" >&5 +echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then - echo "configure: warning: Assuming unsigned for type of bool" 1>&2 - cf_cv_type_of_bool=unsigned + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + { echo "$as_me:9649: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 +echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} + cf_cv_type_of_bool=$NCURSES_BOOL fi - -echo $ac_n "checking for special defines needed for etip.h""... $ac_c" 1>&6 -echo "configure:6607: checking for special defines needed for etip.h" >&5 +echo "$as_me:9654: checking for special defines needed for etip.h" >&5 +echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" for cf_math in "" MATH_H @@ -6613,24 +9662,38 @@ do CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu" test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9666 "configure" #include "confdefs.h" #include -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - - test -n "$cf_math" && cat >> confdefs.h <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9683: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9686: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9689: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + test -n "$cf_math" && cat >>confdefs.h <> confdefs.h <>confdefs.h <&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi -rm -f conftest* +rm -f conftest.$ac_objext conftest.$ac_ext done done -echo "$ac_t""$cf_result" 1>&6 +echo "$as_me:9710: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 CXXFLAGS="$cf_save_CXXFLAGS" - -if test "$CXX" = yes ; then -echo $ac_n "checking if $CXX accepts parameter initialization""... $ac_c" 1>&6 -echo "configure:6654: checking if $CXX accepts parameter initialization" >&5 -if eval "test \"`echo '$''{'cf_cv_cpp_param_init'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$CXX"; then +echo "$as_me:9715: checking if $CXX accepts parameter initialization" >&5 +echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6 +if test "${cf_cv_cpp_param_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$cross_compiling" = yes; then cf_cv_cpp_param_init=unknown else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +#line 9731 "configure" #include "confdefs.h" -#ifdef __cplusplus -extern "C" void exit(int); -#endif class TEST { private: @@ -6686,35 +9745,242 @@ TEST::TEST(int x = 1) // some compilers do not like second initializer } void main() { } -EOF -if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:9750: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9753: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:9755: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9758: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then cf_cv_cpp_param_init=yes else - echo "configure: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cpp_param_init=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi +echo "$as_me:9776: result: $cf_cv_cpp_param_init" >&5 +echo "${ECHO_T}$cf_cv_cpp_param_init" >&6 +fi +test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF +#define CPP_HAS_PARAM_INIT 1 +EOF + +if test -n "$CXX"; then + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +for ac_header in strstream.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:9794: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9800 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:9804: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:9810: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_cpp_param_init=no + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext fi -rm -fr conftest* +echo "$as_me:9829: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking if $CXX supports vscan function... $ECHO_C" >&6 +if test "${cf_cv_cpp_vscan_func+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + for cf_vscan_func in strstream strstream_cast stdio + do + case $cf_vscan_func in #(vi + stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi + strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;; + strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;; + esac + cat >conftest.$ac_ext <<_ACEOF +#line 9853 "configure" +#include "confdefs.h" + +#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 +main () +{ +int tmp, foo = scanw("%d", &tmp) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9898: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9901: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9904: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9907: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_cpp_vscan_func=$cf_vscan_func; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_cpp_vscan_func=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + test "$cf_cv_cpp_vscan_func" != no && break + done fi +echo "$as_me:9920: result: $cf_cv_cpp_vscan_func" >&5 +echo "${ECHO_T}$cf_cv_cpp_vscan_func" >&6 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$ac_t""$cf_cv_cpp_param_init" 1>&6 fi -test "$cf_cv_cpp_param_init" = yes && cat >> confdefs.h <<\EOF -#define CPP_HAS_PARAM_INIT 1 + +case $cf_cv_cpp_vscan_func in #(vi +stdio) #(vi + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STDIO_VSCAN 1 +EOF + + ;; +strstream) + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STRSTREAM_VSCAN 1 +EOF + + ;; +strstream_cast) + cat >>confdefs.h <<\EOF +#define CPP_HAS_VSCAN_FUNC 1 +EOF + + cat >>confdefs.h <<\EOF +#define USE_STRSTREAM_VSCAN_CAST 1 EOF + ;; +esac + CXX_AR='$(AR)' + CXX_AR_OPTS='$(AR_OPTS)' case $cf_cv_system_name in #(vi - sco3.2v5*) + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi CXXLDFLAGS="-u main" ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; esac - + else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -6728,54 +9994,153 @@ else # Caveat: since the storage of the bool type is not standardized, it # may change. - echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6 -echo "configure:6733: checking for fallback type of bool" >&5 - case "$host_cpu" in #(vi - i?86) cf_cv_type_of_bool=char ;; #(vi - *) cf_cv_type_of_bool=int ;; - esac - echo "$ac_t""$cf_cv_type_of_bool" 1>&6 + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + +echo "$as_me:10002: checking for size of bool" >&5 +echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 +if test "${cf_cv_type_of_bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + rm -f cf_test.out + if test "$cross_compiling" = yes; then + cf_cv_type_of_bool=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 10013 "configure" +#include "confdefs.h" + +#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); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:10055: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10058: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:10060: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10063: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_type_of_bool=`cat cf_test.out` + if test -z "$cf_cv_type_of_bool"; then + cf_cv_type_of_bool=unknown + fi +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_type_of_bool=unknown +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +fi + rm -f cf_test.out +echo "$as_me:10081: result: $cf_cv_type_of_bool" >&5 +echo "${ECHO_T}$cf_cv_type_of_bool" >&6 +if test "$cf_cv_type_of_bool" = unknown ; then + case .$NCURSES_BOOL in #(vi + .auto|.) NCURSES_BOOL=unsigned;; + esac + { echo "$as_me:10087: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 +echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} + cf_cv_type_of_bool=$NCURSES_BOOL +fi + else + echo "$as_me:10093: checking for fallback type of bool" >&5 +echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6 + case "$host_cpu" in #(vi + i?86) cf_cv_type_of_bool=char ;; #(vi + *) cf_cv_type_of_bool=int ;; + esac + echo "$as_me:10099: result: $cf_cv_type_of_bool" >&5 +echo "${ECHO_T}$cf_cv_type_of_bool" >&6 + fi + fi +fi if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6749: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnat_exists'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:10109: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_gnat_exists+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$gnat_exists"; then ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_gnat_exists="yes" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_gnat_exists="yes" +echo "$as_me:10124: found $ac_dir/$ac_word" >&5 +break +done + test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no" fi fi -gnat_exists="$ac_cv_prog_gnat_exists" +gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$ac_t""$gnat_exists" 1>&6 + echo "$as_me:10133: result: $gnat_exists" >&5 +echo "${ECHO_T}$gnat_exists" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:10136: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else - + cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ sed -e 's/[^0-9 \.]//g' | $AWK '{print $1;}'` case $cf_cv_gnat_version in @@ -6798,32 +10163,35 @@ esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6803: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_M4_exists'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:10166: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_M4_exists+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$M4_exists"; then ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_M4_exists="yes" - break - fi - done - IFS="$ac_save_ifs" + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_M4_exists="yes" +echo "$as_me:10181: found $ac_dir/$ac_word" >&5 +break +done + test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no" fi fi -M4_exists="$ac_cv_prog_M4_exists" +M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$ac_t""$M4_exists" 1>&6 + echo "$as_me:10190: result: $M4_exists" >&5 +echo "${ECHO_T}$M4_exists" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:10193: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_M4_exists" = no; then @@ -6831,9 +10199,9 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo $ac_n "checking if GNAT works""... $ac_c" 1>&6 -echo "configure:6836: checking if GNAT works" >&5 - + echo "$as_me:10202: checking if GNAT works" >&5 +echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 + rm -f conftest* cat >>conftest.ads <&6 + echo "$as_me:10230: result: $cf_cv_prog_gnat_correct" >&5 +echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi if test "$cf_cv_prog_gnat_correct" = yes; then ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then withval="$with_ada_compiler" cf_ada_compiler=$withval else cf_ada_compiler=gnatmake -fi - +fi; cf_ada_package=terminal_interface - - - - - - - - # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" - : + else withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}" -fi - +fi; case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; -.a-zA-Z:\\/*) #(vi OS/2 EMX +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { { echo "$as_me:10273: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } ;; esac eval ADA_INCLUDE="$withval" - - - # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" - : + else withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}" -fi - +fi; case ".$withval" in #(vi -./*) #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi ;; -.a-zA-Z:\\/*) #(vi OS/2 EMX +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX ;; .\${*prefix}*) #(vi eval withval="$withval" case ".$withval" in #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; esac ;; #(vi .NONE/*) - withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@` + withval=`echo $withval | sed -e s%NONE%$ac_default_prefix%` ;; *) - { echo "configure: error: expected a pathname" 1>&2; exit 1; } + { { echo "$as_me:10307: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } ;; esac eval ADA_OBJECTS="$withval" - - fi fi @@ -6959,37 +10319,39 @@ fi ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too ### badly to consider using for development purposes, but 2.5.8 is okay. if test -n "$with_warnings"; then - if test "$GCC" = yes; then - case "`$CC --version`" in - 2.6.3) - if test "$cf_cv_type_of_bool" != "char"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - fi - ;; - 2.5*) + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - ;; - esac - fi + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac fi ### Construct the library-subsets, if any, from this set of keywords: ### none, base, ext_funcs, termlib. -echo $ac_n "checking for library subsets""... $ac_c" 1>&6 -echo "configure:6980: checking for library subsets" >&5 +echo "$as_me:10336: checking for library subsets" >&5 +echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 if test "$with_termlib" = yes ; then LIB_SUBSETS="termlib " else LIB_SUBSETS="termlib+" fi LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$ac_t""$LIB_SUBSETS" 1>&6 +echo "$as_me:10346: result: $LIB_SUBSETS" >&5 +echo "${ECHO_T}$LIB_SUBSETS" >&6 LIB_TRACING=DEBUG -case "$CFLAGS" in +ADA_TRACE=FALSE +case "$CFLAGS $CPPFLAGS" in *-DTRACE*) LIB_TRACING=all + ADA_TRACE=TRUE ;; esac @@ -7011,8 +10373,6 @@ elif test "$includedir" != "/usr/include"; then fi fi - - ACPPFLAGS="$ACPPFLAGS -I. -I../../include" if test "$srcdir" != "."; then ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include" @@ -7029,11 +10389,9 @@ elif test "$includedir" != "/usr/include"; then fi fi - - ### Build up pieces for makefile rules -echo $ac_n "checking default library suffix""... $ac_c" 1>&6 -echo "configure:7037: checking default library suffix" >&5 +echo "$as_me:10393: checking default library suffix" >&5 +echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) DFT_ARG_SUFFIX='' ;; @@ -7043,12 +10401,12 @@ echo "configure:7037: checking default library suffix" >&5 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$ac_t""$DFT_ARG_SUFFIX" 1>&6 +echo "$as_me:10404: result: $DFT_ARG_SUFFIX" >&5 +echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo $ac_n "checking default library-dependency suffix""... $ac_c" 1>&6 -echo "configure:7050: checking default library-dependency suffix" >&5 +echo "$as_me:10407: checking default library-dependency suffix" >&5 +echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 - case $DFT_LWR_MODEL in libtool) DFT_DEP_SUFFIX='.la' ;; normal) DFT_DEP_SUFFIX='.a' ;; @@ -7056,33 +10414,49 @@ echo "configure:7050: checking default library-dependency suffix" >&5 profile) DFT_DEP_SUFFIX='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) DFT_DEP_SUFFIX='.dll' ;; + darwin*) DFT_DEP_SUFFIX='.dylib' ;; hpux*) DFT_DEP_SUFFIX='.sl' ;; *) DFT_DEP_SUFFIX='.so' ;; esac esac test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$ac_t""$DFT_DEP_SUFFIX" 1>&6 +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi +echo "$as_me:10431: result: $DFT_DEP_SUFFIX" >&5 +echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo $ac_n "checking default object directory""... $ac_c" 1>&6 -echo "configure:7068: checking default object directory" >&5 +echo "$as_me:10434: checking default object directory" >&5 +echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) DFT_OBJ_SUBDIR='obj_lo' ;; normal) DFT_OBJ_SUBDIR='objects' ;; debug) DFT_OBJ_SUBDIR='obj_g' ;; profile) DFT_OBJ_SUBDIR='obj_p' ;; - shared) DFT_OBJ_SUBDIR='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + DFT_OBJ_SUBDIR='objects' ;; + *) + DFT_OBJ_SUBDIR='obj_s' ;; + esac esac -echo "$ac_t""$DFT_OBJ_SUBDIR" 1>&6 +echo "$as_me:10450: result: $DFT_OBJ_SUBDIR" >&5 +echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) -echo $ac_n "checking c++ library-dependency suffux""... $ac_c" 1>&6 -echo "configure:7081: checking c++ library-dependency suffux" >&5 +echo "$as_me:10454: checking c++ library-dependency suffix" >&5 +echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" = "yes"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else - - + case normal in libtool) CXX_LIB_SUFFIX='.la' ;; normal) CXX_LIB_SUFFIX='.a' ;; @@ -7090,28 +10464,37 @@ else profile) CXX_LIB_SUFFIX='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) CXX_LIB_SUFFIX='.dll' ;; + darwin*) CXX_LIB_SUFFIX='.dylib' ;; hpux*) CXX_LIB_SUFFIX='.sl' ;; *) CXX_LIB_SUFFIX='.so' ;; esac esac test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" fi -echo "$ac_t""$CXX_LIB_SUFFIX" 1>&6 - +echo "$as_me:10475: result: $CXX_LIB_SUFFIX" >&5 +echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 TINFO_LIST="$SHLIB_LIST" test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}" -echo $ac_n "checking where we will install curses.h""... $ac_c" 1>&6 -echo "configure:7107: checking where we will install curses.h" >&5 +echo "$as_me:10481: checking where we will install curses.h" >&5 +echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='$(prefix)/include/ncurses'${LIB_SUFFIX} -echo "$ac_t""$includedir" 1>&6 - - - +echo "$as_me:10486: result: $includedir" >&5 +echo "${ECHO_T}$includedir" >&6 +### 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)' + { echo "$as_me:10494: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 +echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} +fi +fi ### Set up low-level terminfo dependencies for makefiles. Note that we ### could override this. @@ -7129,9 +10512,8 @@ PROG_ARGS="$TEST_ARGS" ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. - -echo $ac_n "checking for src modules""... $ac_c" 1>&6 -echo "configure:7135: checking for src modules" >&5 +echo "$as_me:10515: checking for src modules" >&5 +echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS" @@ -7170,14 +10552,14 @@ do if test $cf_dir = tack ; then continue elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then - + cf_have_include=`echo "$cf_dir" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - cat >> confdefs.h <>confdefs.h <> confdefs.h <>confdefs.h <&6 -TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS" - - - -PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS" +echo "$as_me:10575: result: $cf_cv_src_modules" >&5 +echo "${ECHO_T}$cf_cv_src_modules" >&6 +TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" +PROG_ARGS="-L${LIB_DIR} $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 misc test" +SRC_SUBDIRS="$SRC_SUBDIRS test" +test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= @@ -7223,445 +10604,872 @@ if test -n "$ADA_SUBDIRS"; then do SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" done - -fi +fi DIRS_TO_MAKE="lib" for cf_item in $cf_list_models do - + case $cf_item in libtool) cf_subdir='obj_lo' ;; normal) cf_subdir='objects' ;; debug) cf_subdir='obj_g' ;; profile) cf_subdir='obj_p' ;; - shared) cf_subdir='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac esac - DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" + for cf_item2 in $DIRS_TO_MAKE + do + test $cf_item2 = $cf_subdir && break + done + test ".$cf_item2" != ".$cf_subdir" && DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir" done for cf_dir in $DIRS_TO_MAKE do test ! -d $cf_dir && mkdir $cf_dir done - +cat >>confdefs.h < confcache <<\EOF +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h misc/run_tic.sh:misc/run_tic.in $SUB_MAKEFILES Makefile" +ac_config_commands="$ac_config_commands default" +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - DEFS=-DHAVE_CONFIG_H -# Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 do - case "\$ac_option" in + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:10904: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:10923: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + esac + shift done -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +exec 5>>config.log +cat >&5 << _ACEOF -trap 'rm -fr `echo "\ - include/MKterm.h.awk \ - include/curses.h \ - include/termcap.h \ - include/unctrl.h \ - misc/run_tic.sh:misc/run_tic.in \ - $SUB_MAKEFILES \ - Makefile include/ncurses_cfg.h:include/ncurses_cfg.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@NCURSES_MAJOR@%$NCURSES_MAJOR%g -s%@NCURSES_MINOR@%$NCURSES_MINOR%g -s%@NCURSES_PATCH@%$NCURSES_PATCH%g -s%@cf_cv_rel_version@%$cf_cv_rel_version%g -s%@cf_cv_abi_version@%$cf_cv_abi_version%g -s%@cf_cv_cc_bool_type@%$cf_cv_cc_bool_type%g -s%@cf_cv_builtin_bool@%$cf_cv_builtin_bool%g -s%@cf_cv_type_of_bool@%$cf_cv_type_of_bool%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@CC@%$CC%g -s%@BUILD_CC@%$BUILD_CC%g -s%@CPP@%$CPP%g -s%@PROG_EXT@%$PROG_EXT%g -s%@LDCONFIG@%$LDCONFIG%g -s%@CXX@%$CXX%g -s%@AWK@%$AWK%g -s%@SET_MAKE@%$SET_MAKE%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@LN_S@%$LN_S%g -s%@RANLIB@%$RANLIB%g -s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g -s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g -s%@LINT@%$LINT%g -s%@MAN@%$MAN%g -s%@LINT_OPTS@%$LINT_OPTS%g -s%@LD@%$LD%g -s%@AR@%$AR%g -s%@AR_OPTS@%$AR_OPTS%g -s%@cf_cv_makeflags@%$cf_cv_makeflags%g -s%@DESTDIR@%$DESTDIR%g -s%@cf_list_models@%$cf_list_models%g -s%@LIBTOOL@%$LIBTOOL%g -s%@DFT_LWR_MODEL@%$DFT_LWR_MODEL%g -s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g -s%@TINFO_NAME@%$TINFO_NAME%g -s%@LIB_NAME@%$LIB_NAME%g -s%@LIB_PREFIX@%$LIB_PREFIX%g -s%@LIB_SUFFIX@%$LIB_SUFFIX%g -s%@CC_G_OPT@%$CC_G_OPT%g -s%@CXX_G_OPT@%$CXX_G_OPT%g -s%@LD_MODEL@%$LD_MODEL%g -s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g -s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g -s%@MK_SHARED_LIB@%$MK_SHARED_LIB%g -s%@LINK_PROGS@%$LINK_PROGS%g -s%@LINK_TESTS@%$LINK_TESTS%g -s%@EXTRA_LDFLAGS@%$EXTRA_LDFLAGS%g -s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g -s%@LOCAL_LDFLAGS2@%$LOCAL_LDFLAGS2%g -s%@INSTALL_LIB@%$INSTALL_LIB%g -s%@TERMINFO_SRC@%$TERMINFO_SRC%g -s%@FALLBACK_LIST@%$FALLBACK_LIST%g -s%@TERMINFO_DIRS@%$TERMINFO_DIRS%g -s%@TERMINFO@%$TERMINFO%g -s%@NCURSES_CONST@%$NCURSES_CONST%g -s%@NCURSES_XNAMES@%$NCURSES_XNAMES%g -s%@ECHO_LINK@%$ECHO_LINK%g -s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g -s%@MATH_LIB@%$MATH_LIB%g -s%@cf_cv_typeof_chtype@%$cf_cv_typeof_chtype%g -s%@cf_cv_1UL@%$cf_cv_1UL%g -s%@cf_cv_shift_limit@%$cf_cv_shift_limit%g -s%@cf_cv_widec_shift@%$cf_cv_widec_shift%g -s%@CXXCPP@%$CXXCPP%g -s%@CXXLDFLAGS@%$CXXLDFLAGS%g -s%@CXXLIBS@%$CXXLIBS%g -s%@gnat_exists@%$gnat_exists%g -s%@M4_exists@%$M4_exists%g -s%@cf_ada_make@%$cf_ada_make%g -s%@cf_ada_compiler@%$cf_ada_compiler%g -s%@cf_ada_package@%$cf_ada_package%g -s%@ADAFLAGS@%$ADAFLAGS%g -s%@cf_compile_generics@%$cf_compile_generics%g -s%@cf_generic_objects@%$cf_generic_objects%g -s%@ADA_INCLUDE@%$ADA_INCLUDE%g -s%@ADA_OBJECTS@%$ADA_OBJECTS%g -s%@ACPPFLAGS@%$ACPPFLAGS%g -s%@DFT_ARG_SUFFIX@%$DFT_ARG_SUFFIX%g -s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g -s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g -s%@CXX_LIB_SUFFIX@%$CXX_LIB_SUFFIX%g -s%@EXTRA_LIBS@%$EXTRA_LIBS%g -s%@TINFO_LIST@%$TINFO_LIST%g -s%@SHLIB_LIST@%$SHLIB_LIST%g -s%@TEST_DEPS@%$TEST_DEPS%g -s%@TEST_ARGS@%$TEST_ARGS%g -s%@PROG_ARGS@%$PROG_ARGS%g -s%@ADA_SUBDIRS@%$ADA_SUBDIRS%g -s%@DIRS_TO_MAKE@%$DIRS_TO_MAKE%g +This file was extended by $as_me 2.52.20011227, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` -CEOF +_ACEOF EOF -cat >> $CONFIG_STATUS <<\EOF +cat >>$CONFIG_STATUS < conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi +### 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" +target="$target" + +EOF + +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; + "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; + "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "misc/run_tic.sh" ) CONFIG_FILES="$CONFIG_FILES misc/run_tic.sh:misc/run_tic.in" ;; + "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; + *) { { echo "$as_me:11003: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t +s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t +s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t +s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t +s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t +s,@cf_cv_cc_bool_type@,$cf_cv_cc_bool_type,;t t +s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t +s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t +s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@BUILD_CC@,$BUILD_CC,;t t +s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t +s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t +s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t +s,@BUILD_LIBS@,$BUILD_LIBS,;t t +s,@CPP@,$CPP,;t t +s,@PROG_EXT@,$PROG_EXT,;t t +s,@LDCONFIG@,$LDCONFIG,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t +s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t +s,@LINT@,$LINT,;t t +s,@MAN@,$MAN,;t t +s,@LINT_OPTS@,$LINT_OPTS,;t t +s,@LD@,$LD,;t t +s,@AR@,$AR,;t t +s,@AR_OPTS@,$AR_OPTS,;t t +s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t +s,@DESTDIR@,$DESTDIR,;t t +s,@cf_list_models@,$cf_list_models,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t +s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t +s,@TINFO_NAME@,$TINFO_NAME,;t t +s,@LIB_NAME@,$LIB_NAME,;t t +s,@LIB_PREFIX@,$LIB_PREFIX,;t t +s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t +s,@CC_G_OPT@,$CC_G_OPT,;t t +s,@CXX_G_OPT@,$CXX_G_OPT,;t t +s,@LD_MODEL@,$LD_MODEL,;t t +s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t +s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t +s,@LINK_PROGS@,$LINK_PROGS,;t t +s,@LINK_TESTS@,$LINK_TESTS,;t t +s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t +s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t +s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t +s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t +s,@PATHSEP@,$PATHSEP,;t t +s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t +s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t +s,@TERMINFO@,$TERMINFO,;t t +s,@MAKE_TERMINFO@,$MAKE_TERMINFO,;t t +s,@TERMPATH@,$TERMPATH,;t t +s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t +s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t +s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t +s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t +s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@NCURSES_CONST@,$NCURSES_CONST,;t t +s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t +s,@NCURSES_CH_T@,$NCURSES_CH_T,;t t +s,@NCURSES_LIBUTF8@,$NCURSES_LIBUTF8,;t t +s,@NCURSES_MBSTATE_T@,$NCURSES_MBSTATE_T,;t t +s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t +s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t +s,@MATH_LIB@,$MATH_LIB,;t t +s,@cf_cv_typeof_chtype@,$cf_cv_typeof_chtype,;t t +s,@cf_cv_1UL@,$cf_cv_1UL,;t t +s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t +s,@CXX_AR@,$CXX_AR,;t t +s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t +s,@CXXLIBS@,$CXXLIBS,;t t +s,@gnat_exists@,$gnat_exists,;t t +s,@M4_exists@,$M4_exists,;t t +s,@cf_ada_make@,$cf_ada_make,;t t +s,@cf_ada_compiler@,$cf_ada_compiler,;t t +s,@cf_ada_package@,$cf_ada_package,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t +s,@cf_compile_generics@,$cf_compile_generics,;t t +s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t +s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_TRACE@,$ADA_TRACE,;t t +s,@ACPPFLAGS@,$ACPPFLAGS,;t t +s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t +s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t +s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t +s,@CXX_LIB_SUFFIX@,$CXX_LIB_SUFFIX,;t t +s,@EXTRA_LIBS@,$EXTRA_LIBS,;t t +s,@TINFO_LIST@,$TINFO_LIST,;t t +s,@SHLIB_LIST@,$SHLIB_LIST,;t t +s,@TEST_DEPS@,$TEST_DEPS,;t t +s,@TEST_ARGS@,$TEST_ARGS,;t t +s,@PROG_ARGS@,$PROG_ARGS,;t t +s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t +s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t +CEOF + EOF -cat >> $CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" -CONFIG_FILES=\${CONFIG_FILES-"\ - include/MKterm.h.awk \ - include/curses.h \ - include/termcap.h \ - include/unctrl.h \ - misc/run_tic.sh:misc/run_tic.in \ - $SUB_MAKEFILES \ - Makefile"} EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac + if test x"$ac_file" != x-; then + { echo "$as_me:11329: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:11347: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:11360: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_iB='\([ ]\),\1#\2define\3' +ac_iC=' ' +ac_iD='\4,;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' +ac_uD=',;t' -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in + test x"$ac_file" != x- && { echo "$as_me:11426: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:11437: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:11450: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF - # Transform confdefs.h into a list of #define's. We won't use it as a sed # script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to # be either 'cat' or 'sort'. -sort confdefs.h >conftest.vals +cat confdefs.h | uniq >conftest.vals # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail echo ' rm -f conftest.frag' >> $CONFIG_STATUS -while : +while grep . conftest.vals >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write chunks of a limited-size here document to conftest.frag. echo ' cat >> conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS @@ -7672,93 +11480,101 @@ do done rm -f conftest.vals -# Run sed to substitute the contents of conftest.frag into conftest.in at the +# Run sed to substitute the contents of conftest.frag into $tmp/in at the # marker @DEFS@. echo ' cat >> conftest.edit < conftest.out -rm -f conftest.in -mv conftest.out conftest.in +sed -f conftest.edit $tmp/in > $tmp/out +rm -f $tmp/in +mv $tmp/out $tmp/in rm -f conftest.edit conftest.frag ' >> $CONFIG_STATUS - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:11508: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -# Extra commands, if any +cat >>$CONFIG_STATUS <<\EOF +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + case $ac_dest in + default ) case $cf_cv_system_name in - os2) LIB_PREFIX='' ;; + OS/2*) LIB_PREFIX='' ;; + os2*) LIB_PREFIX='' ;; *) LIB_PREFIX='lib' ;; esac cf_prefix=$LIB_PREFIX - - for cf_dir in $SRC_SUBDIRS do if test -f $srcdir/$cf_dir/modules; then - cf_libs_to_make= + IMPORT_LIB= + SHARED_LIB= + LIBS_TO_MAKE= for cf_item in $CF_LIST_MODELS do - - + case $cf_item in libtool) cf_suffix='.la' ;; normal) cf_suffix='.a' ;; @@ -7766,6 +11582,8 @@ do profile) cf_suffix='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; hpux*) cf_suffix='.sl' ;; *) cf_suffix='.so' ;; esac @@ -7775,41 +11593,64 @@ do if test $cf_item = shared ; then if test "$cf_cv_do_symlinks" = yes ; then case "$cf_cv_shlib_version" in #(vi - rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi - abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + rel) #(vi + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(REL_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; + esac + ;; + abi) + case "$cf_cv_system_name" in #(vi + darwin*) cf_suffix='.$(ABI_VERSION)'"$cf_suffix" ;; #(vi + *) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;; + esac + ;; esac fi + # cygwin needs import library, and has unique naming convention + if test $cf_cv_shlib_version = cygdll ; then + SHARED_LIB="../lib/${cf_prefix}${cf_dir}\$(ABI_VERSION).dll" + IMPORT_LIB="../lib/${cf_prefix}${cf_dir}.dll.a" + LIBS_TO_MAKE="$LIBS_TO_MAKE \$(SHARED_LIB) \$(IMPORT_LIB)" + continue + fi fi - cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}" + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" done if test $cf_dir = ncurses ; then + cf_subsets="$LIB_SUBSETS" case "$LIB_SUBSETS" in #(vi termlib+*) #(vi ;; *) #(vi - cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g` - cf_libs_to_make="$cf_item $cf_libs_to_make" + cf_item=`echo $LIBS_TO_MAKE |sed -e s/$LIB_NAME/$TINFO_NAME/g` + LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE" ;; esac + else + cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib //'` fi - sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \ + sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \ + -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \ + -e "s%@SHARED_LIB@%$SHARED_LIB%" \ $cf_dir/Makefile >$cf_dir/Makefile.out mv $cf_dir/Makefile.out $cf_dir/Makefile $AWK -f $srcdir/mk-0th.awk \ - name=$cf_dir \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - for cf_item in $CF_LIST_MODELS + for cf_subset in $cf_subsets do - echo 'Appending rules for '$cf_item' model ('$cf_dir')' - + cf_subdirs= + for cf_item in $CF_LIST_MODELS + do + echo "Appending rules for ${cf_item} model (${cf_dir}: ${cf_subset})" + CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - case $cf_item in libtool) cf_suffix='.la' ;; normal) cf_suffix='.a' ;; @@ -7817,22 +11658,28 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ profile) cf_suffix='_p.a' ;; shared) case $cf_cv_system_name in + cygwin*) cf_suffix='.dll' ;; + darwin*) cf_suffix='.dylib' ;; hpux*) cf_suffix='.sl' ;; *) cf_suffix='.so' ;; esac esac test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}" - case $cf_item in libtool) cf_subdir='obj_lo' ;; normal) cf_subdir='objects' ;; debug) cf_subdir='obj_g' ;; profile) cf_subdir='obj_p' ;; - shared) cf_subdir='obj_s' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + cf_subdir='objects' ;; + *) + cf_subdir='obj_s' ;; + esac esac - # These dependencies really are for development, not # builds, but they are useful in porting, too. cf_depend="../include/ncurses_cfg.h" @@ -7848,8 +11695,6 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ cf_depend="$cf_depend $cf_reldir/curses.priv.h" fi - for cf_subset in $LIB_SUBSETS - do $AWK -f $srcdir/mk-1st.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -7859,6 +11704,7 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ suffix=$cf_suffix \ subset=$cf_subset \ ShlibVer=$cf_cv_shlib_version \ + ShlibVerInfix=$cf_cv_shlib_version_infix \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ @@ -7866,7 +11712,11 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ depend="$cf_depend" \ target="$target" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile - test $cf_dir = ncurses && WITH_OVERWRITE=no + for cf_subdir2 in $cf_subdirs lib + do + test $cf_subdir = $cf_subdir2 && break + done + test "${cf_subset}.${cf_subdir2}" != "${cf_subset}.${cf_subdir}" && \ $AWK -f $srcdir/mk-2nd.awk \ name=$cf_dir \ traces=$LIB_TRACING \ @@ -7876,6 +11726,7 @@ CF_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ srcdir=$srcdir \ echo=$WITH_ECHO \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile + cf_subdirs="$cf_subdirs $cf_subdir" done done fi @@ -7931,11 +11782,11 @@ done cat >> Makefile <> Makefile <>headers.sh <>$cf_dir/Makefile <>$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 + ;; + esac +done +EOF +cat >>$CONFIG_STATUS <<\EOF -exit 0 +{ (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi ${MAKE-make} preinstall diff --git a/configure.in b/configure.in index a46fbf1d..14d08e09 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -26,16 +26,16 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl Author: Thomas E. Dickey 1996,1997 +dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.220 2000/10/15 00:54:36 tom Exp $ +dnl $Id: configure.in,v 1.274 2002/09/15 00:11:28 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl -dnl See http://dickey.his.com/autoconf/ for additional information. +dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- -AC_PREREQ(2.13.20000819) -AC_REVISION($Revision: 1.220 $) +AC_PREREQ(2.13.20020210) +AC_REVISION($Revision: 1.274 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -61,19 +61,16 @@ AC_ARG_ENABLE(add-ons, dnl [glibc_add_on=yes], [glibc_add_on=]) -dnl We need to use [ and ] for other purposes for a while now. -changequote(,)dnl if test x"$glibc_add_on" = "xyes" ; then rm -f $srcdir/Banner # We are in glibc. rm -f $srcdir/Makefile cp $srcdir/Makefile.glibc $srcdir/Makefile - echo "ncurses `grep \"^[ ]*ncurses-version[ ]*=.*$\" \ + echo "ncurses `grep \"^[[ ]]*ncurses-version[[ ]]*=.*$\" \ $srcdir/Makefile | sed -e \ - 's/^[ ]*ncurses-version[ ]*=[ ]*\([^ ^ ]*\)[ ]*$/\1/'`" > $srcdir/Banner + 's/^[[ ]]*ncurses-version[[ ]]*=[[ ]]*\([[^ ^ ]]*\)[[ ]]*$/\1/'`" > $srcdir/Banner exit 0 fi -changequote([,])dnl ### Save the given $CFLAGS to allow user-override. cf_user_CFLAGS="$CFLAGS" @@ -83,16 +80,45 @@ CF_CFG_DEFAULTS ### Checks for programs. AC_PROG_CC +GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of gcc) - eval "$CC --version" + GCC_VERSION="`${CC} --version|head -1`" + AC_MSG_RESULT($GCC_VERSION) fi -if test "$host" != $build; then - AC_CHECK_PROGS(BUILD_CC, $CC gcc cc) -else - BUILD_CC="$CC" + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the target +# compiler, etc., but we need a host compiler to generate parts of the source. +BUILD_CC='$(CC)' +BUILD_CFLAGS='$(CFLAGS)' +BUILD_CPPFLAGS='$(CPPFLAGS)' +BUILD_LDFLAGS='$(LDFLAGS)' +BUILD_LIBS='$(LIBS)' +if test "$host_alias" != "$target_alias" ; then + AC_ARG_WITH(build-cc, + [ --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC)], + [BUILD_CC="$withval"], + [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)]) + AC_ARG_WITH(build-cflags, + [ --with-build-cflags=XXX if cross-compiling, the host C compiler-flags], + [BUILD_CFLAGS="$withval"]) + AC_ARG_WITH(build-cppflags, + [ --with-build-cppflags=XXX if cross-compiling, the host C preprocessor-flags], + [BUILD_CPPFLAGS="$withval"]) + AC_ARG_WITH(build-ldflags, + [ --with-build-ldflags=XXX if cross-compiling, the host linker-flags], + [BUILD_LDFLAGS="$withval"]) + AC_ARG_WITH(build-libs, + [ --with-build-libs=XXX if cross-compiling, the host libraries], + [BUILD_LIBS="$withval"]) fi AC_SUBST(BUILD_CC) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_CPPFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(BUILD_LIBS) + AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX @@ -129,17 +155,19 @@ else popdef([AC_MSG_ERROR])dnl fi -changequote(,)dnl +GXX_VERSION=none if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in - 1*|2.[0-6]*) + AC_MSG_CHECKING(version of g++) + GXX_VERSION="`${CXX-g++} --version|head -1`" + AC_MSG_RESULT($GXX_VERSION) + case $GXX_VERSION in + 1*|2.[[0-6]]*) GXX=""; CXX=""; ac_cv_prog_gxx=no cf_cxx_library=no - echo No: templates do not work + AC_MSG_WARN(templates do not work) ;; esac fi -changequote([,])dnl AC_MSG_CHECKING(if you want to build C++ binding and demo) AC_ARG_WITH(cxx-binding, @@ -200,7 +228,7 @@ dnl adjust the location into which the actual install is done, so that an dnl archive can be built without modifying the host system's configuration. AC_MSG_CHECKING(if you have specified an install-prefix) AC_ARG_WITH(install-prefix, - [ --with-install-prefix prefixes actual install-location], + [ --with-install-prefix prefixes actual install-location (\$DESTDIR)], [case "$withval" in #(vi yes|no) #(vi ;; @@ -394,12 +422,12 @@ 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], - [with_overwrite=yes]) + [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 use only built-in data], + [ --disable-database do not use terminfo, only fallbacks/termcap], [use_database=$enableval], [use_database=yes]) AC_MSG_RESULT($use_database) @@ -414,6 +442,7 @@ os2*) #(vi esac AC_SUBST(TERMINFO_SRC) +CF_PATHSEP if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) @@ -432,11 +461,10 @@ AC_MSG_RESULT($with_fallback) FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'` AC_SUBST(FALLBACK_LIST) +MAKE_TERMINFO= if test "$use_database" = no ; then - if test -z $with_fallback ; then - AC_ERROR(You have disabled the database w/o specifying fallbacks) - fi TERMINFO="${datadir}/terminfo" + MAKE_TERMINFO="#" else AC_MSG_CHECKING(for list of terminfo directories) @@ -460,6 +488,7 @@ AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO") fi AC_SUBST(TERMINFO) +AC_SUBST(MAKE_TERMINFO) ### use option --disable-big-core to make tic run on small machines ### We need 4Mb, check if we can allocate 50% more than that. @@ -492,9 +521,23 @@ AC_ARG_ENABLE(termcap, AC_MSG_RESULT($with_termcap) if test "$with_termcap" != "yes" ; then + if test "$use_database" = no ; then + if test -z $with_fallback ; then + AC_ERROR(You have disabled the database w/o specifying fallbacks) + fi + fi AC_DEFINE(PURE_TERMINFO) else +AC_DEFINE(USE_TERMCAP) +AC_MSG_CHECKING(for list of termcap files) +CF_WITH_PATHLIST(termpath, + [ --with-termpath=XXX specify list of termcap files], + TERMPATH, + /etc/termcap:/usr/share/misc/termcap) +AC_MSG_RESULT($TERMPATH) +test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH") + ### use option --enable-getcap to use a hacked getcap for reading termcaps AC_MSG_CHECKING(if fast termcap-loader is needed) AC_ARG_ENABLE(getcap, @@ -556,7 +599,39 @@ AC_ARG_ENABLE(broken_linker, [with_broken_linker=$enableval], [with_broken_linker=$BROKEN_LINKER]) AC_MSG_RESULT($with_broken_linker) -test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER) + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +elif test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 + CF_VERBOSE(cygwin linker is broken anyway) + ;; + esac +fi +AC_SUBST(BROKEN_LINKER) + +### use option --with-bool to override bool's type +AC_MSG_CHECKING(for type of bool) +AC_ARG_WITH(bool, + [ --with-bool=TYPE override fallback type of bool variable], + [NCURSES_BOOL="$withval"], + [NCURSES_BOOL=auto]) +AC_MSG_RESULT($NCURSES_BOOL) +AC_SUBST(NCURSES_BOOL) + +### use option --with-ospeed to override ospeed's type +AC_MSG_CHECKING(for type of ospeed) +AC_ARG_WITH(ospeed, + [ --with-ospeed=TYPE override type of ospeed variable], + [NCURSES_OSPEED="$withval"], + [NCURSES_OSPEED=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) @@ -590,13 +665,17 @@ AC_ARG_ENABLE(ext-funcs, [with_ext_funcs=yes]) AC_MSG_RESULT($with_ext_funcs) if test "$with_ext_funcs" = yes ; then + NCURSES_EXT_FUNCS=1 AC_DEFINE(HAVE_CURSES_VERSION) AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) +else + NCURSES_EXT_FUNCS=0 fi +AC_SUBST(NCURSES_EXT_FUNCS) ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -649,15 +728,6 @@ AC_ARG_WITH(develop, [with_develop=no]) AC_MSG_RESULT($with_develop) -### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -AC_MSG_CHECKING(if you want colorfgbg code) -AC_ARG_ENABLE(hard-tabs, - [ --enable-colorfgbg compile with \$COLORFGBG code], - [with_colorfgbg=$enableval], - [with_colorfgbg=$with_develop]) -AC_MSG_RESULT($with_colorfgbg) -test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) - ### use option --enable-hard-tabs to turn on use of hard-tabs optimize AC_MSG_CHECKING(if you want hard-tabs code) AC_ARG_ENABLE(hard-tabs, @@ -705,6 +775,15 @@ AC_ARG_ENABLE(hashmap, 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], @@ -726,6 +805,9 @@ test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS) fi ### use option --enable-widec to turn on use of wide-character support +NCURSES_CH_T=chtype +NCURSES_LIBUTF8=0 +NCURSES_MBSTATE_T=0 AC_MSG_CHECKING(if you want experimental wide-character code) AC_ARG_ENABLE(widec, [ --enable-widec compile with experimental wide-char/UTF-8 code], @@ -735,7 +817,33 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + # with_overwrite=no + NCURSES_CH_T=cchar_t + AC_CHECK_FUNC(putwc) +if test "$ac_cv_func_putwc" != yes ; then + CF_LIBUTF8 + if test "$cf_cv_libutf8" = yes ; then + NCURSES_LIBUTF8=1 + fi +fi + CF_MBSTATE_T + if test $cf_cv_mbstate_t = yes ; then + NCURSES_MBSTATE_T=1 + fi fi +AC_SUBST(NCURSES_CH_T) +AC_SUBST(NCURSES_LIBUTF8) +AC_SUBST(NCURSES_MBSTATE_T) + +AC_MSG_CHECKING(for terminal capabilities file) +AC_ARG_WITH(caps, + [ --with-caps=alt compile with experimental alternate Caps file], + [TERMINFO_CAPS=Caps.$withval], + [TERMINFO_CAPS=Caps]) +test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps +AC_MSG_RESULT($TERMINFO_CAPS) +AC_SUBST(TERMINFO_CAPS) ############################################################################### CF_HELP_MESSAGE(Testing/development Options:) @@ -814,8 +922,10 @@ CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) ### Checks for header files. +CF_GNU_SOURCE AC_STDC_HEADERS AC_HEADER_DIRENT +AC_HEADER_TIME CF_REGEX dnl These are some other potentially nonportable headers. @@ -853,7 +963,6 @@ AC_C_INLINE test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS) CF_TYPEOF_CHTYPE -CF_WIDEC_SHIFT ### Checks for external-data CF_ERRNO @@ -867,7 +976,6 @@ geteuid \ getttynam \ issetugid \ memccpy \ -mkstemp \ nanosleep \ poll \ remove \ @@ -881,9 +989,7 @@ strdup \ strstr \ tcgetpgrp \ times \ -vfscanf \ vsnprintf \ -vsscanf \ ) if test "$with_getcap" = "yes" ; then CF_CGETENT @@ -892,6 +998,16 @@ fi CF_ISASCII CF_STRUCT_SIGACTION CF_FUNC_TERMIOS +CF_FUNC_VSSCANF +CF_MKSTEMP + +# setup for prototype of fallback for vsscanf() +if test "$cf_cv_func_vsscanf" = vsscanf ; then + HAVE_VSSCANF=1 +else + HAVE_VSSCANF=0 +fi +AC_SUBST(HAVE_VSSCANF) dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS if test "$cross_compiling" = yes ; then @@ -916,32 +1032,49 @@ CF_BOOL_DECL(cf_cv_cc_bool_type) if test -n "$CXX" ; then AC_LANG_CPLUSPLUS CF_STDCPP_LIBRARY - if test "$GXX" = yes; then - case "`${CXX-g++} --version`" in - 1*|2.[0-6]*) - cf_cxx_library=yes - ;; - 2.7*) - CF_GPP_LIBRARY - ;; - *) - cf_cxx_library=no - ;; - esac - else + + case $GXX_VERSION in + 1*|2.[0-6]*) + cf_cxx_library=yes + ;; + *-2.7*|2.7*) + CF_GPP_LIBRARY + ;; + *) cf_cxx_library=no - fi + ;; + esac + AC_CHECK_HEADERS(typeinfo) + 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 - sco3.2v5*) + irix*) #(vi + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-ar -o' + fi + ;; + sco3.2v5*) #(vi CXXLDFLAGS="-u main" ;; + solaris2*) + if test "$GXX" != yes ; then + CXX_AR='$(CXX)' + CXX_AR_OPTS='-xar -o' + fi + ;; esac AC_SUBST(CXXLDFLAGS) + AC_SUBST(CXX_AR) + AC_SUBST(CXX_AR_OPTS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -955,12 +1088,20 @@ else # Caveat: since the storage of the bool type is not standardized, it # may change. - AC_MSG_CHECKING(for fallback type of bool) - case "$host_cpu" in #(vi - i?86) cf_cv_type_of_bool=char ;; #(vi - *) cf_cv_type_of_bool=int ;; - esac - AC_MSG_RESULT($cf_cv_type_of_bool) + if test "$NCURSES_BOOL" != auto ; then + cf_cv_type_of_bool=$NCURSES_AUTO + else + if test "$cf_cv_header_stdbool_h" = 1 ; then + CF_BOOL_SIZE + else + AC_MSG_CHECKING(for fallback type of bool) + case "$host_cpu" in #(vi + i?86) cf_cv_type_of_bool=char ;; #(vi + *) cf_cv_type_of_bool=int ;; + esac + AC_MSG_RESULT($cf_cv_type_of_bool) + fi + fi fi AC_SUBST(CXXLIBS) @@ -1032,18 +1173,16 @@ fi ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too ### badly to consider using for development purposes, but 2.5.8 is okay. if test -n "$with_warnings"; then - if test "$GCC" = yes; then - case "`$CC --version`" in - 2.6.3) - if test "$cf_cv_type_of_bool" != "char"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - fi - ;; - 2.5*) + case $GCC_VERSION in + 2.6.3) + if test "$cf_cv_type_of_bool" != "char"; then EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" - ;; - esac - fi + fi + ;; + 2.5*) + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion" + ;; + esac fi ### Construct the library-subsets, if any, from this set of keywords: @@ -1055,15 +1194,19 @@ else LIB_SUBSETS="termlib+" fi LIB_SUBSETS="${LIB_SUBSETS}base" +test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" AC_MSG_RESULT($LIB_SUBSETS) LIB_TRACING=DEBUG -case "$CFLAGS" in +ADA_TRACE=FALSE +case "$CFLAGS $CPPFLAGS" in *-DTRACE*) LIB_TRACING=all + ADA_TRACE=TRUE ;; esac +AC_SUBST(ADA_TRACE) ### Construct the list of include-directories to be generated CF_INCLUDE_DIRS @@ -1077,6 +1220,13 @@ AC_MSG_RESULT($DFT_ARG_SUFFIX) AC_MSG_CHECKING(default library-dependency suffix) CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl +if test $DFT_LWR_MODEL = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + DFT_DEP_SUFFIX=".dll.a" + ;; + esac +fi AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a") AC_MSG_RESULT($DFT_DEP_SUFFIX) @@ -1086,7 +1236,7 @@ AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj") AC_MSG_RESULT($DFT_OBJ_SUBDIR) # libtool thinks it can make c++ shared libraries (perhaps only g++) -AC_MSG_CHECKING(c++ library-dependency suffux) +AC_MSG_CHECKING(c++ library-dependency suffix) if test "$with_libtool" = "yes"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else @@ -1104,6 +1254,15 @@ 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) @@ -1127,13 +1286,15 @@ PROG_ARGS="$TEST_ARGS" CF_SRC_MODULES($modules_to_build) CF_DIRS_TO_MAKE +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') + ### Now that we're done running tests, add the compiler-warnings, if any CFLAGS="$CFLAGS $EXTRA_CFLAGS" ################################################################################ AC_OUTPUT( \ include/MKterm.h.awk \ - include/curses.h \ + include/curses.head:include/curses.h.in \ include/termcap.h \ include/unctrl.h \ misc/run_tic.sh:misc/run_tic.in \ @@ -1149,23 +1310,26 @@ CF_LIST_MODELS="$cf_list_models" DFT_LWR_MODEL="$DFT_LWR_MODEL" LDCONFIG="$LDCONFIG" LIB_NAME="$LIB_NAME" -LIB_SUFFIX="$LIB_SUFFIX" LIB_SUBSETS="$LIB_SUBSETS" +LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +MAKE_TERMINFO="$MAKE_TERMINFO" +NCURSES_OSPEED="$NCURSES_OSPEED" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" TINFO_NAME="$TINFO_NAME" +WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" -WITH_CURSES_H="$with_curses_h" cf_cv_abi_version="$cf_cv_abi_version" cf_cv_do_symlinks="$cf_cv_do_symlinks" cf_cv_rel_version="$cf_cv_rel_version" cf_cv_rm_so_locs="$cf_cv_rm_so_locs" +cf_cv_shlib_version="$cf_cv_shlib_version" +cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" cf_with_cxx_binding="$cf_with_cxx_binding" -cf_cv_shlib_version="$cf_cv_shlib_version" target="$target" -],sort)dnl +],cat)dnl ${MAKE-make} preinstall diff --git a/dist.mk b/dist.mk index b6a515dd..ad6743f8 100644 --- a/dist.mk +++ b/dist.mk @@ -1,4 +1,4 @@ -# $Id: dist.mk,v 1.227 2000/10/20 22:28:06 tom Exp $ +# $Id: dist.mk,v 1.327 2002/10/12 23:27:36 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -9,8 +9,8 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 -NCURSES_MINOR = 2 -NCURSES_PATCH = 20001021 +NCURSES_MINOR = 3 +NCURSES_PATCH = 20021012 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -63,17 +63,35 @@ manhtml: MANIFEST 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 @sort < 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" ;\ - man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) | \ + echo '' > doc/html/man/$$g ;\ + echo '' >> doc/html/man/$$g ;\ + man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \ sed -f subst.sed |\ sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \ - > doc/html/man/$$g ;\ + >> doc/html/man/$$g ;\ done @rm -f subst.sed @sed -e "\%./doc/html/man/%d" < MANIFEST > MANIFEST.tmp diff --git a/doc/html/Ada95.html b/doc/html/Ada95.html index 89073216..70a951db 100644 --- a/doc/html/Ada95.html +++ b/doc/html/Ada95.html @@ -1,17 +1,15 @@ - + - Ada95 Binding for ncurses

      Ada95 Binding for ncurses

      The ncurses Ada95 binding is © 1996-2000 by -Jürgen Pfeifer. +Jürgen Pfeifer.

      Permission is hereby granted to reproduce and distribute this @@ -28,7 +26,7 @@ This binding comes AS IS with no warranty, implied or expressed.

      General Remarks

    Features of Ncurses

    @@ -474,23 +317,23 @@ including (versions starting with those noted):
    cdk
    Curses Development Kit
    -http://www.vexus.ca/CDK.html +http://invisible-island.net/cdk.
    -http://dickey.his.com/cdk. +http://www.vexus.ca/CDK.html
    ded
    directory-editor
    -http://dickey.his.com/ded. +http://invisible-island.net/ded.
    dialog
    the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux.
    -http://dickey.his.com/dialog. +http://invisible-island.net/dialog.
    lynx
    the character-screen WWW browser
    http://lynx.isc.org/release. -
    Midnight Commander 4.1 +
    Midnight Commander
    file manager
    www.gnome.org/mc/. @@ -528,7 +371,7 @@ as well as some that use ncurses for the terminfo support alone:
    vile
    vi-like-emacs
    -http://dickey.his.com/vile. +http://invisible-island.net/vile.

    @@ -543,7 +386,7 @@ HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim and Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. +Jürgen Pfeifer. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -561,7 +404,7 @@ 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://dickey.his.com/ncurses. +ftp://invisible-island.net/ncurses.

    Future Plans

      diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html index 806aec57..cd2cfe0a 100644 --- a/doc/html/man/captoinfo.1m.html +++ b/doc/html/man/captoinfo.1m.html @@ -1,44 +1,83 @@ + + + +captoinfo 1m + + + +

      captoinfo 1m

      +
       
       
       

      NAME

      -       captoinfo  - convert a termcap description into a terminfo
      +       captoinfo  - convert a termcap description into a terminfo
              description
       
       
       

      SYNOPSIS

      -       captoinfo [-vn width]  [-V] [-1] [-w width] file . . .
      +       captoinfo [-vn width]  [-V] [-1] [-w width] file . . .
       
       
       

      DESCRIPTION

      -       captoinfo looks in file  for  termcap  descriptions.   For
      -       each  one  found,  an  equivalent  terminfo description is
      -       written to standard output.  Termcap tc  capabilities  are
      -       translated directly to terminfo use capabilities.
      -
      -       If no file is given, then the environment variable TERMCAP
      -       is used for the filename or entry.  If TERMCAP is  a  full
      -       pathname  to  a  file,  only  the  terminal  whose name is
      -       specified in the environment variable  TERM  is  extracted
      -       from  that  file.   If the environment variable TERMCAP is
      -       not set, then the file /usr/share/terminfo is read.
      -
      -       -v   print out tracing information on  standard  error  as
      +       captoinfo looks in file  for  termcap  descriptions.   For
      +       each  one  found,  an  equivalent  terminfo description is
      +       written to standard output.  Termcap tc  capabilities  are
      +       translated directly to terminfo use capabilities.
      +
      +       If no file is given, then the environment variable TERMCAP
      +       is used for the filename or entry.  If TERMCAP is  a  full
      +       pathname to a file, only the terminal whose name is speci-
      +       fied in the environment variable TERM  is  extracted  from
      +       that  file.   If  the  environment variable TERMCAP is not
      +       set, then the file /usr/share/terminfo is read.
      +
      +       -v   print out tracing information on  standard  error  as
                   the program runs.
       
      -       -V   print  out  the  version  of  the  program  in use on
      -            standard error and exit.
      +       -V   print  out the version of the program in use on stan-
      +            dard error and exit.
       
      -       -1   cause  the  fields  to  print  out  one  to  a  line.
      -            Otherwise,  the  fields  will be printed several to a
      -            line to a maximum width of 60 characters.
      +       -1   cause the fields to print out one to a line.   Other-
      +            wise, the fields will be printed several to a line to
      +            a maximum width of 60 characters.
       
      -       -w   change the output to width characters.
      +       -w   change the output to width characters.
       
       
       
      @@ -51,8 +90,8 @@

      TRANSLATIONS FROM NONSTANDARD CAPABILITIES

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

      NOTES

      -       This utility is actually a link to tic(1m), running in  -I
      -       mode.  You can use other tic options such as -f and  -x.
      +       This utility is actually a link to tic(1m), running in  -I
      +       mode.  You can use other tic options such as -f and  -x.
       
              The  trace  option isn't identical to SVr4's.  Under SVr4,
              instead of following the -v with  a  trace  level  n,  you
      @@ -159,7 +198,7 @@
       
       

      SEE ALSO

      -       curses(3x), infocmp(1m), terminfo(5)
      +       curses(3x), infocmp(1m), terminfo(5)
       
       
       
      diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html index fad1c207..d0e79006 100644 --- a/doc/html/man/clear.1.html +++ b/doc/html/man/clear.1.html @@ -1,28 +1,66 @@ + + + +clear 1 + + + +

      clear 1

      +
       
       
       

      NAME

      -       clear - clear the terminal screen
      +       clear - clear the terminal screen
       
       
       

      SYNOPSIS

      -       clear
      +       clear
       
       
       

      DESCRIPTION

      -       clear clears your screen if this is possible.  It looks in
      -       the environment for the terminal type and then in the ter-
      -       minfo database to figure out how to clear the screen.
      +       clear clears your screen if this is possible.  It looks in
      +       the environment for the terminal type and then in the ter-
      +       minfo database to figure out how to clear the screen.
       
       
       

      SEE ALSO

      -       tput(1), terminfo(5)
      +       tput(1), terminfo(5)
       
       
       
      diff --git a/doc/html/man/curs_add_wch.3x.html b/doc/html/man/curs_add_wch.3x.html
      new file mode 100644
      index 00000000..52af77b7
      --- /dev/null
      +++ b/doc/html/man/curs_add_wch.3x.html
      @@ -0,0 +1,172 @@
      +
      +
      +
      +
      +curs_add_wch 3x
      +
      +
      +
      +
      +

      curs_add_wch 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       add_wch,   wadd_wch,  mvadd_wch,  mvwadd_wch,  echo_wchar,
      +       wecho_wchar - add a complex character and rendition  to  a
      +       curses window, then advance the cursor
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int add_wch( const cchar_t *wch );
      +       int wadd_wch( WINDOW *win, const cchar_t *wch );
      +       int mvadd_wch( int y, int x, const cchar_t *wch );
      +       int  mvwadd_wch(  WINDOW *win, int y, int x, const cchar_t
      +       *wch );
      +       int echo_wchar( const cchar_t *wch );
      +       int wecho_wchar( WINDOW *win, const cchar_t *wch );
      +
      +
      +
      +

      DESCRIPTION

      +       The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions
      +       put the complex character wch into the given window at its
      +       current position, which is then advanced.  These functions
      +       perform  wrapping and special-character processing as fol-
      +       lows:
      +
      +       -    If wch refers to a spacing character, then any previ-
      +            ous  character  at  that  location is removed.  A new
      +            character specified by wch is placed at that location
      +            with  rendition  specified  by  wch.  The cursor then
      +            advances to the next spacing character on the screen.
      +
      +       -    If  wch refers to a non-spacing character, all previ-
      +            ous characters at that location are  preserved.   The
      +            non-spacing  characters of wch are added to the spac-
      +            ing complex character, and the rendition specified by
      +            wch is ignored.
      +
      +       -    If  the  character  part  of  wch  is a tab, newline,
      +            backspace or other control character, the  window  is
      +            updated  and  the  cursor  moves as if addch(3x) were
      +            called.
      +
      +       The echo_wchar function is functionally  equivalent  to  a
      +       call to add_wch followed by a call to refresh.  Similarly,
      +       the wecho_wchar is functionally equivalent to  a  call  to
      +       wadd_wch  followed  by  a call to wrefresh.  The knowledge
      +       that only a single character is being output is taken into
      +       consideration and, for non-control characters, a consider-
      +       able performance gain might be seen by  using  the  *echo*
      +       functions instead of their equivalents.
      +
      +
      +
      +

      RETURN VALUES

      +       All routines return the integer ERR upon failure and OK on
      +       success.
      +
      +
      +
      +
      +

      NOTES

      +       Note that add_wch, mvadd_wch, mvwadd_wch,  and  echo_wchar
      +       may be macros.
      +
      +
      +
      +

      PORTABILITY

      +       All  these functions are described in the XSI Curses stan-
      +       dard, Issue 4.  The defaults specified  for  forms-drawing
      +       characters apply in the POSIX locale.
      +
      +       XSI  documents  constants  beginning  with WACS_ which are
      +       used for line-drawing.  Those  are  not  currently  imple-
      +       mented in ncurses.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x),  curs_attr_get(3x),  curs_clear(3x), curs_out-
      +       opts(3x), curs_refresh(3x), putwc(3)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_add_wchstr.3x.html b/doc/html/man/curs_add_wchstr.3x.html new file mode 100644 index 00000000..ba756939 --- /dev/null +++ b/doc/html/man/curs_add_wchstr.3x.html @@ -0,0 +1,172 @@ + + + + +curs_add_wchstr 3x + + + + +

      curs_add_wchstr 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       add_wchstr,    add_wchnstr,   wadd_wchstr,   wadd_wchnstr,
      +       mvadd_wchstr, mvadd_wchnstr, mvwadd_wchstr, mvwadd_wchnstr
      +       - add an array of complex characters (and attributes) to a
      +       curses window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int add_wchstr(const cchar_t *wchstr);
      +       int add_wchnstr(const cchar_t *wchstr, int n);
      +       int wadd_wchstr(WINDOW * win, const cchar_t *wchstr);
      +       int wadd_wchnstr(WINDOW * win, const cchar_t *wchstr, int n);
      +       int mvadd_wchstr(int y, int x, const cchar_t *wchstr);
      +       int mvadd_wchnstr(int y, int x, const cchar_t *wchstr, int n);
      +       int mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wchstr);
      +       int mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wchstr, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       These routines copy the array of complex characters wchstr
      +       into  the  window image structure at and after the current
      +       cursor position.  The four routines with  n  as  the  last
      +       argument  copy  at  most n elements, but no more than will
      +       fit on the line.  If n=-1 then the whole array is  copied,
      +       to  the  maximum number of characters that will fit on the
      +       line.
      +
      +       The window cursor is not advanced.   These  routines  work
      +       faster than waddnstr.  On the other hand, they do not per-
      +       form checking (such as for the newline, backspace, or car-
      +       riage  return characters), they do not advance the current
      +       cursor position, they do not expand other control  charac-
      +       ters  to  ^-escapes,  and  they  truncate the string if it
      +       crosses the right margin, rather then wrapping  it  around
      +       to the new line.
      +
      +       These  routines  end  successfully  on encountering a null
      +       cchar_t, or when they have filled the current line.  If  a
      +       complex  character cannot completely fit at the end of the
      +       current line, the remaining columns are  filled  with  the
      +       background character and rendition.
      +
      +
      +
      +

      NOTES

      +       All functions except wadd_wchnstr may be macros.
      +
      +
      +
      +

      RETURN VALUES

      +       All routines return the integer ERR upon failure and OK on
      +       success.
      +
      +
      +
      +

      PORTABILITY

      +       All these entry points are described  in  the  XSI  Curses
      +       standard, Issue 4.
      +
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x), curs_addchstr(3x) curs_addwstr(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_addch.3x.html b/doc/html/man/curs_addch.3x.html index 74fdef6e..2c0f6e7b 100644 --- a/doc/html/man/curs_addch.3x.html +++ b/doc/html/man/curs_addch.3x.html @@ -1,77 +1,117 @@ + + + +curs_addch 3x + + + +

      curs_addch 3x

      +
       
       
       

      NAME

      -       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
      -       add a character (with attributes) to a curses window, then
      +       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
      +       add a character (with attributes) to a curses window, then
              advance the cursor
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int addch(chtype ch);
      -       int waddch(WINDOW *win, chtype ch);
      -       int mvaddch(int y, int x, chtype ch);
      -       int mvwaddch(WINDOW *win, int y, int x, chtype ch);
      -       int echochar(chtype ch);
      -       int wechochar(WINDOW *win, chtype ch);
      +       int addch(const chtype ch);
      +       int waddch(WINDOW *win, const chtype ch);
      +       int mvaddch(int y, int x, const chtype ch);
      +       int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
      +       int echochar(const chtype ch);
      +       int wechochar(WINDOW *win, const chtype ch);
       
       
       

      DESCRIPTION

      -       The  addch,  waddch, mvaddch and mvwaddch routines put the
      -       character ch into the given window at its  current  window
      +       The  addch,  waddch, mvaddch and mvwaddch routines put the
      +       character ch into the given window at its  current  window
              position,  which  is then advanced.  They are analogous to
      -       putchar in stdio(3).  If the advance is at the right  mar-
      +       putchar in stdio(3).  If the advance is at the right  mar-
              gin,  the  cursor  automatically wraps to the beginning of
              the next line.  At the bottom  of  the  current  scrolling
      -       region,  if  scrollok  is enabled, the scrolling region is
      +       region,  if  scrollok  is enabled, the scrolling region is
              scrolled up one line.
       
      -       If ch is a tab, newline, or backspace, the cursor is moved
      +       If ch is a tab, newline, or backspace, the cursor is moved
              appropriately within the window.  Backspace moves the cur-
              sor one character left; at the left edge of  a  window  it
      -       does  nothing.   Newline  does  a clrtoeol, then moves the
      +       does  nothing.   Newline  does  a clrtoeol, then moves the
              cursor to  the  window  left  margin  on  the  next  line,
              scrolling  the window if on the last line).  Tabs are con-
      -       sidered to be at every eighth column.
      +       sidered to be at every eighth column.   The  tab  interval
      +       may be altered by setting the TABSIZE variable.
       
      -       If ch is any control character other than tab, newline, or
      -       backspace,  it  is  drawn  in  ^X notation.  Calling winch
      +       If ch is any control character other than tab, newline, or
      +       backspace, it is drawn  in  ^X  notation.   Calling  winch
              after adding a control character does not return the char-
      -       acter  itself, but instead returns the ^-representation of
      +       acter itself, but instead returns the ^-representation  of
              the control character.
       
              Video attributes can be combined with a character argument
      -       passed to addch or related functions by logical-ORing them
      -       into the character.  (Thus,  text,  including  attributes,
      -       can  be  copied  from  one place to another using inch and
      -       addch.).  See the curs_attr(3x) page for values of  prede-
      +       passed to addch or related functions by logical-ORing them
      +       into  the  character.   (Thus, text, including attributes,
      +       can be copied from one place to  another  using  inch  and
      +       addch.).   See the curs_attr(3x) page for values of prede-
              fined video attribute constants that can be usefully OR'ed
              into characters.
       
      -       The echochar and wechochar routines are  equivalent  to  a
      -       call  to addch followed by a call to refresh, or a call to
      -       waddch followed by a call to wrefresh.  The knowledge that
      -       only  a  single character is being output is used and, for
      -       non-control characters, a  considerable  performance  gain
      -       may  be  seen  by  using  these  routines instead of their
      +       The  echochar  and  wechochar routines are equivalent to a
      +       call to addch followed by a call to refresh, or a call  to
      +       waddch followed by a call to wrefresh.  The knowledge that
      +       only a single character is being output is used  and,  for
      +       non-control  characters,  a  considerable performance gain
      +       may be seen by  using  these  routines  instead  of  their
              equivalents.
       
      -   Line Graphics
      -       The following variables may be used to  add  line  drawing
      -       characters  to  the screen with routines of the addch fam-
      -       ily.  The default character listed below is  used  if  the
      -       acsc   capability   doesn't   define  a  terminal-specific
      +   Line Graphics
      +       The  following  variables  may be used to add line drawing
      +       characters to the screen with routines of the  addch  fam-
      +       ily.   The  default  character listed below is used if the
      +       acsc  capability  doesn't   define   a   terminal-specific
              replacement for it (but see the EXTENSIONS section below).
              The names are taken from VT100 nomenclature.
       
      -       Name           Default   Description
      +       Name           Default   Description
              --------------------------------------------------
              ACS_BLOCK      #         solid square block
              ACS_BOARD      #         board of squares
      @@ -110,43 +150,41 @@
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon failure and OK on
      -       success (the SVr4 manuals specify only "an  integer  value
      -       other than ERR") upon successful completion, unless other-
      +       All routines return the integer ERR upon failure and OK on
      +       success  (the  SVr4 manuals specify only "an integer value
      +       other than ERR") upon successful completion, unless other-
              wise noted in the preceding routine descriptions.
       
       
       

      NOTES

      -       Note that addch, mvaddch, mvwaddch, and  echochar  may  be
      +       Note  that  addch,  mvaddch, mvwaddch, and echochar may be
              macros.
       
       
       

      PORTABILITY

      -       All  these functions are described in the XSI Curses stan-
      -       dard, Issue 4.  The defaults specified  for  forms-drawing
      +       All these functions are described in the XSI Curses  stan-
      +       dard,  Issue  4.  The defaults specified for forms-drawing
              characters apply in the POSIX locale.
       
      -       Some  ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
      -       ACS_PI, ACS_NEQUAL, ACS_STERLING) were not  documented  in
      -       any  publicly  released  System V.  However, many publicly
      -       available terminfos include acsc strings  in  which  their
      -       key  characters  (pryz{|}) are embedded, and a second-hand
      -       list of their character descriptions has  come  to  light.
      -       The   ACS-prefixed   names  for  them  were  invented  for
      -       ncurses(3x).
      +       Some ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL,  ACS_GEQUAL,
      +       ACS_PI,  ACS_NEQUAL,  ACS_STERLING) were not documented in
      +       any publicly released System V.   However,  many  publicly
      +       available  terminfos  include  acsc strings in which their
      +       key characters (pryz{|}) are embedded, and  a  second-hand
      +       list  of  their  character descriptions has come to light.
      +       The  ACS-prefixed  names  for  them  were   invented   for
      +       ncurses(3x).
      +
      +       The  TABSIZE  variable  is implemented in some versions of
      +       curses, but is not part of X/Open curses.
       
       
       

      SEE ALSO

      -       curses(3x), curs_attr(3x), curs_clear(3x),  curs_inch(3x),
      -       curs_outopts(3x), curs_refresh(3x), putc(3S).
      -
      -
      -
      -
      -
      +       curses(3x), curs_attr(3x), curs_clear(3x),  curs_inch(3x),
      +       curs_outopts(3x), curs_refresh(3x), putc(3S).
       
       
       
      diff --git a/doc/html/man/curs_addchstr.3x.html b/doc/html/man/curs_addchstr.3x.html
      index 43f244de..18db3f07 100644
      --- a/doc/html/man/curs_addchstr.3x.html
      +++ b/doc/html/man/curs_addchstr.3x.html
      @@ -1,42 +1,80 @@
      +
      +
       
      +
      +curs_addchstr 3x
      +
      +
      +
       
      +

      curs_addchstr 3x

      +
       
       
       

      NAME

      -       addchstr,  addchnstr,  waddchstr,  waddchnstr, mvaddchstr,
      -       mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a  string  of
      -       characters (and attributes) to a curses window
      +       addchstr,  addchnstr,  waddchstr,  waddchnstr, mvaddchstr,
      +       mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a  string  of
      +       characters (and attributes) to a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int addchstr(const chtype *chstr);
      -       int addchnstr(const chtype *chstr, int n);
      -       int waddchstr(WINDOW *win, const chtype *chstr);
      -       int waddchnstr(WINDOW *win, const chtype *chstr, int n);
      -       int mvaddchstr(int y, int x, const chtype *chstr);
      -       int mvaddchnstr(int y, int x, const chtype *chstr, int n);
      -       int mvwaddchstr(WINDOW *win, int y, int  x,  const  chtype
      -       *chstr);
      -       int  mvwaddchnstr(WINDOW  *win, int y, int x, const chtype
      -       *chstr, int n);
      +       int addchstr(const chtype *chstr);
      +       int addchnstr(const chtype *chstr, int n);
      +       int waddchstr(WINDOW *win, const chtype *chstr);
      +       int waddchnstr(WINDOW *win, const chtype *chstr, int n);
      +       int mvaddchstr(int y, int x, const chtype *chstr);
      +       int mvaddchnstr(int y, int x, const chtype *chstr, int n);
      +       int mvwaddchstr(WINDOW *win, int y, int  x,  const  chtype
      +       *chstr);
      +       int  mvwaddchnstr(WINDOW  *win, int y, int x, const chtype
      +       *chstr, int n);
       
       
       

      DESCRIPTION

      -       These routines copy chstr into the window image  structure
      +       These routines copy chstr into the window image  structure
              at  and  after the current cursor position.  The four rou-
      -       tines with n as the last argument copy at most n elements,
      -       but  no  more than will fit on the line.  If n=-1 then the
      +       tines with n as the last argument copy at most n elements,
      +       but  no  more than will fit on the line.  If n=-1 then the
              whole string is copied, to the maximum number  of  charac-
              ters that will fit on the line.
       
      -       The window cursor is not advanced, and these routines work
      -       faster than waddnstr.  On the other hand, they don't  per-
      +       The window cursor is not advanced, and these routines work
      +       faster than waddnstr.  On the other hand, they don't  per-
              form  any  kind  of  checking  (such  as  for the newline,
              backspace, or  carriage  return  characters),  they  don't
              advance  the  current  cursor  position, they don't expand
      @@ -48,15 +86,15 @@
       
       

      RETURN VALUES

      -       All routines return the integer ERR upon failure and OK on
      +       All routines return the integer ERR upon failure and OK on
              success  (the  SVr4 manuals specify only "an integer value
      -       other than ERR") upon successful completion, unless other-
      +       other than ERR") upon successful completion, unless other-
              wise noted in the preceding routine descriptions.
       
       
       

      NOTES

      -       Note that all routines except waddchnstr may be macros.
      +       Note that all routines except waddchnstr may be macros.
       
       
       
      @@ -67,7 +105,7 @@

      SEE ALSO

      -       curses(3x).
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_addstr.3x.html b/doc/html/man/curs_addstr.3x.html index e83e795f..4f4857d3 100644 --- a/doc/html/man/curs_addstr.3x.html +++ b/doc/html/man/curs_addstr.3x.html @@ -1,51 +1,90 @@ + + + +curs_addstr 3x + + + +

      curs_addstr 3x

      +
       
       
       

      NAME

      -       addstr,  addnstr,  waddstr, waddnstr, mvaddstr, mvaddnstr,
      -       mvwaddstr, mvwaddnstr - add a string of  characters  to  a
      -       curses window and advance cursor
      +       addstr,  addnstr,  waddstr, waddnstr, mvaddstr, mvaddnstr,
      +       mvwaddstr, mvwaddnstr - add a string of  characters  to  a
      +       curses window and advance cursor
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int addstr(const char *str);
      -       int addnstr(const char *str, int n);
      -       int waddstr(WINDOW *win, const char *str);
      -       int waddnstr(WINDOW *win, const char *str, int n);
      -       int mvaddstr(int y, int x, const char *str);
      -       int mvaddnstr(int y, int x, const char *str, int n);
      -       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
      -       int mvwaddnstr(WINDOW *win, int y, int x, const char *str,
      -       int n);
      +       int addstr(const char *str);
      +       int addnstr(const char *str, int n);
      +       int waddstr(WINDOW *win, const char *str);
      +       int waddnstr(WINDOW *win, const char *str, int n);
      +       int mvaddstr(int y, int x, const char *str);
      +       int mvaddnstr(int y, int x, const char *str, int n);
      +       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
      +       int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
       
       
       

      DESCRIPTION

              These  routines  write  the characters of the (null-termi-
      -       nated) character string str on the given  window.   It  is
      -       similar  to  calling waddch once for each character in the
      -       string.  The four routines with n  as  the  last  argument
      -       write  at  most n characters.  If n is -1, then the entire
      -       string will be added.
      +       nated) character string str on the given  window.   It  is
      +       similar  to  calling waddch once for each character in the
      +       string.  The four routines with n  as  the  last  argument
      +       write  at  most n characters.  If n is -1, then the entire
      +       string will be added, up to the maximum number of  charac-
      +       ters  that  will  fit  on the line, or until a terminating
      +       null is reached.
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon failure and OK on
      +       All routines return the integer ERR upon failure and OK on
              success  (the  SVr4 manuals specify only "an integer value
      -       other than ERR") upon successful completion.
      +       other than ERR") upon successful completion.
       
       
       

      NOTES

      -       Note  that  all  of  these  routines  except  waddstr  and
      -       waddnstr may be macros.
      +       Note  that  all  of  these  routines  except  waddstr  and
      +       waddnstr may be macros.
       
       
       
      @@ -58,8 +97,7 @@

      SEE ALSO

      -       curses(3x), curs_addch(3x).
      -
      +       curses(3x), curs_addch(3x).
       
       
       
      diff --git a/doc/html/man/curs_addwstr.3x.html b/doc/html/man/curs_addwstr.3x.html
      new file mode 100644
      index 00000000..d761b351
      --- /dev/null
      +++ b/doc/html/man/curs_addwstr.3x.html
      @@ -0,0 +1,118 @@
      +
      +
      +
      +
      +curs_addwstr 3x
      +
      +
      +
      +
      +

      curs_addwstr 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       addwstr,   addnwstr,   waddwstr,   waddnwstr,   mvaddwstr,
      +       mvaddnwstr, mvwaddwstr, mvwaddnwstr - add a string of wide
      +       characters to a curses window and advance cursor
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int addwstr(const wchar_t *wstr);
      +       int addnwstr(const wchar_t *wstr, int n);
      +       int waddwstr(WINDOW *win, const wchar_t *wstr);
      +       int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
      +       int mvaddwstr(int y, int x, const wchar_t *wstr);
      +       int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
      +       int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
      +       int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       These  routines  write  the characters of the (null-termi-
      +       nated) wchar_tcharacter string wstr on the  given  window.
      +       It  is  similar to constructing a cchar_t for each wchar_t
      +       in the string, then calling  wadd_wch  for  the  resulting
      +       cchar_t.
      +
      +       The mv routines perform cursor movement once, before writ-
      +       ing any characters.  Thereafter, the cursor is advanced as
      +       a side-effect of writing to the window.
      +
      +       The  four  routines  with  n as the last argument write at
      +       most n wchar_t characters.  If n is -1,  then  the  entire
      +       string  will be added, up to the maximum number of charac-
      +       ters that will fit on the line,  or  until  a  terminating
      +       null is reached.
      +
      +
      +
      +

      RETURN VALUES

      +       All routines return the integer ERR upon failure and OK on
      +       success.
      +
      +
      +
      +

      NOTES

      +       Note that all of these routines except  waddnwstr  may  be
      +       macros.
      +
      +
      +
      +

      PORTABILITY

      +       All  these  entry  points  are described in the XSI Curses
      +       standard, Issue 4.
      +
      +
      +
      +

      SEE ALSO

      +       Functions: curses(3x), curs_add_wch(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_attr.3x.html b/doc/html/man/curs_attr.3x.html index 6c2df3d1..fa0c4e11 100644 --- a/doc/html/man/curs_attr.3x.html +++ b/doc/html/man/curs_attr.3x.html @@ -1,180 +1,273 @@ + + + +curs_attr 3x + + + +

      curs_attr 3x

      +
       
       
       

      NAME

      -       attroff,  wattroff,  attron,  wattron,  attrset, wattrset,
      -       color_set,  wcolor_set,  standend,  wstandend,   standout,
      -       wstandout,   attr_get,   wattr_get,  attr_off,  wattr_off,
      -       attr_on, wattr_on,  attr_set,  wattr_set,  chgat,  wchgat,
      -       mvchgat, mvwchgat, PAIR_NUMBER - curses character and win-
      +       attroff,  wattroff,  attron,  wattron,  attrset, wattrset,
      +       color_set,  wcolor_set,  standend,  wstandend,   standout,
      +       wstandout,   attr_get,   wattr_get,  attr_off,  wattr_off,
      +       attr_on, wattr_on,  attr_set,  wattr_set,  chgat,  wchgat,
      +       mvchgat, mvwchgat, PAIR_NUMBER - curses character and win-
              dow attribute control routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       int attroff(int attrs);
      -       int wattroff(WINDOW *win, int attrs);
      -       int attron(int attrs);
      -       int wattron(WINDOW *win, int attrs);
      -       int attrset(int attrs);
      -       int wattrset(WINDOW *win, int attrs);
      -       int color_set(short color_pair_number, void* opts);
      -       int wcolor_set(WINDOW *win, short color_pair_number,
      -             void* opts);
      -       int standend(void);
      -       int wstandend(WINDOW *win);
      -       int standout(void);
      -       int wstandout(WINDOW *win);
      -       int attr_get(attr_t *attrs, short *pair, void *opts);
      -       int wattr_get(WINDOW *win, attr_t *attrs, short *pair,
      -              void *opts);
      -       int attr_off(attr_t attrs, void *opts);
      -       int wattr_off(WINDOW *win, attr_t attrs, void *opts);
      -       int attr_on(attr_t attrs, void *opts);
      -       int wattr_on(WINDOW *win, attr_t attrs, void *opts);
      -       int attr_set(attr_t attrs, short pair, void *opts);
      -       int wattr_set(WINDOW *win, attr_t attrs, short pair,  void
      -       *opts);
      -       int chgat(int n, attr_t attr, short color,
      -             const void *opts)
      -       int wchgat(WINDOW *win, int n, attr_t attr,
      -             short color, const void *opts)
      -       int mvchgat(int y, int x, int n, attr_t attr,
      -             short color, const void *opts)
      -       int mvwchgat(WINDOW *win, int y, int x, int n,
      -             attr_t attr, short color, const void *opts)
      +       #include <curses.h>
      +       int attroff(int attrs);
      +       int wattroff(WINDOW *win, int attrs);
      +       int attron(int attrs);
      +       int wattron(WINDOW *win, int attrs);
      +       int attrset(int attrs);
      +       int wattrset(WINDOW *win, int attrs);
      +       int color_set(short color_pair_number, void* opts);
      +       int wcolor_set(WINDOW *win, short color_pair_number,
      +             void* opts);
      +       int standend(void);
      +       int wstandend(WINDOW *win);
      +       int standout(void);
      +       int wstandout(WINDOW *win);
      +       int attr_get(attr_t *attrs, short *pair, void *opts);
      +       int wattr_get(WINDOW *win, attr_t *attrs, short *pair,
      +              void *opts);
      +       int attr_off(attr_t attrs, void *opts);
      +       int wattr_off(WINDOW *win, attr_t attrs, void *opts);
      +       int attr_on(attr_t attrs, void *opts);
      +       int wattr_on(WINDOW *win, attr_t attrs, void *opts);
      +       int attr_set(attr_t attrs, short pair, void *opts);
      +       int wattr_set(WINDOW *win, attr_t attrs, short pair,  void
      +       *opts);
      +       int chgat(int n, attr_t attr, short color,
      +             const void *opts)
      +       int wchgat(WINDOW *win, int n, attr_t attr,
      +             short color, const void *opts)
      +       int mvchgat(int y, int x, int n, attr_t attr,
      +             short color, const void *opts)
      +       int mvwchgat(WINDOW *win, int y, int x, int n,
      +             attr_t attr, short color, const void *opts)
       
       
       

      DESCRIPTION

              These  routines  manipulate  the current attributes of the
              named window.  The current attributes of a window apply to
      -       all  characters that are written into the window with wad-
      -       dch, waddstr and wprintw.  Attributes are  a  property  of
      +       all  characters that are written into the window with wad-
      +       dch, waddstr and wprintw.  Attributes are  a  property  of
              the  character,  and  move  with the character through any
              scrolling and insert/delete line/character operations.  To
              the  extent  possible,  they  are displayed as appropriate
              modifications to the graphic rendition of  characters  put
              on the screen.
       
      -       The  routine  attrset  sets  the current attributes of the
      -       given window to attrs.  The routine attroff turns off  the
      +       The  routine  attrset  sets  the current attributes of the
      +       given window to attrs.  The routine attroff turns off  the
              named  attributes  without turning any other attributes on
      -       or off.  The routine attron turns on the named  attributes
      -       without affecting any others.  The routine standout is the
      -       same as attron(A_STANDOUT).  The routine standend  is  the
      -       same as attrset(A_NORMAL) or attrset(0), that is, it turns
      +       or off.  The routine attron turns on the named  attributes
      +       without affecting any others.  The routine standout is the
      +       same as attron(A_STANDOUT).  The routine standend  is  the
      +       same as attrset(A_NORMAL) or attrset(0), that is, it turns
              off all attributes.
       
      -       The routine color_set sets the current color of the  given
      -       window  to the foreground/background combination described
      -       by the color_pair_number. The parameter opts  is  reserved
      +       The  attrset  and  related  routines  do  not  affect  the
      +       attributes  used when erasing portions of the window.  See
      +       curs_bkgd(3x) for functions which  modify  the  attributes
      +       used for erasing and clearing.
      +
      +       The  routine color_set sets the current color of the given
      +       window to the foreground/background combination  described
      +       by  the  color_pair_number. The parameter opts is reserved
              for future use, applications must supply a null pointer.
       
      -       The  routine  wattr_get  returns the current attribute and
      -       color pair for the given window; attr_get returns the cur-
      -       rent  attribute  and color pair for stdscr.  The remaining
      -       attr_* functions operate exactly  like  the  corresponding
      -       attr*  functions,  except that they take arguments of type
      -       attr_t rather than int.
      -
      -       The routine chgat changes the attributes of a given number
      -       of  characters  starting at the current cursor location of
      -       stdscr.  It does not update the cursor and does  not  per-
      -       form  wrapping.   A  character count of -1 or greater than
      -       the remaining window width means to change attributes  all
      -       the  way to the end of the current line.  The wchgat func-
      -       tion generalizes this to any window; the mvwchgat function
      +       The routine wattr_get returns the  current  attribute  and
      +       color pair for the given window; attr_get returns the cur-
      +       rent attribute and color pair for stdscr.   The  remaining
      +       attr_*  functions  operate  exactly like the corresponding
      +       attr* functions, except that they take arguments  of  type
      +       attr_t rather than int.
      +
      +       The routine chgat changes the attributes of a given number
      +       of characters starting at the current cursor  location  of
      +       stdscr.   It  does not update the cursor and does not per-
      +       form wrapping.  A character count of -1  or  greater  than
      +       the  remaining window width means to change attributes all
      +       the way to the end of the current line.  The wchgat  func-
      +       tion generalizes this to any window; the mvwchgat function
              does a cursor move before acting.  In these functions, the
      -       color argument is a color-pair  index  (as  in  the  first
      -       argument  of  init_pair,  see  curs_color(3x)).   The opts
      -       argument is not presently used, but is  reserved  for  the
      -       future (leave it NULL).
      -
      -   Attributes
      -       The following video attributes, defined in <curses.h>, can
      -       be passed to the routines attron, attroff, and attrset, or
      -       OR'ed with the characters passed to addch.
      -
      -        A_NORMAL        Normal display (no highlight)
      -        A_STANDOUT      Best highlighting mode of the terminal.
      -        A_UNDERLINE     Underlining
      -        A_REVERSE       Reverse video
      -        A_BLINK         Blinking
      -        A_DIM           Half bright
      -        A_BOLD          Extra bright or bold
      -        A_PROTECT       Protected mode
      -        A_INVIS         Invisible or blank mode
      -        A_ALTCHARSET    Alternate character set
      -        A_CHARTEXT      Bit-mask to extract a character
      -        COLOR_PAIR(n)   Color-pair number n
      -
      -       The following macro is the reverse of COLOR_PAIR(n):
      -
      -       PAIR_NUMBER(attrs) Returns the pair number associated
      -                          with the COLOR_PAIR(n) attribute.
      -
      -       The  return values of many of these routines are not mean-
      -       ingful (they are implemented as macro-expanded assignments
      -       and  simply  return their argument).  The SVr4 manual page
      -       claims (falsely) that these routines always return 1.
      +       color  argument  is  a  color-pair  index (as in the first
      +       argument of  init_pair,  see  curs_color(3x)).   The  opts
      +       argument  is  not  presently used, but is reserved for the
      +       future (leave it NULL).  Note that changing the attributes
      +       does  not  imply that a subsequent refresh will update the
      +       screen to match, since the character values are not  modi-
      +       fied.   Use  touchwin  to  force  the  screen to match the
      +       updated attributes.
       
      +   Attributes
      +       The following video attributes, defined in <curses.h>, can
      +       be passed to the routines attron, attroff, and attrset, or
      +       OR'ed with the characters passed to addch.
      +
      +        A_NORMAL        Normal display (no highlight)
      +        A_STANDOUT      Best highlighting mode of the terminal.
      +        A_UNDERLINE     Underlining
      +        A_REVERSE       Reverse video
      +        A_BLINK         Blinking
      +        A_DIM           Half bright
      +
      +        A_BOLD          Extra bright or bold
      +        A_PROTECT       Protected mode
      +        A_INVIS         Invisible or blank mode
      +        A_ALTCHARSET    Alternate character set
      +        A_CHARTEXT      Bit-mask to extract a character
      +        COLOR_PAIR(n)   Color-pair number n
      +
      +       The following macro is the reverse of COLOR_PAIR(n):
      +
      +       PAIR_NUMBER(attrs) Returns the pair number associated
      +                          with the COLOR_PAIR(n) attribute.
      +
      +       The return values of many of these routines are not  mean-
      +       ingful (they are implemented as macro-expanded assignments
      +       and simply return their argument).  The SVr4  manual  page
      +       claims (falsely) that these routines always return 1.
       
       
       

      NOTES

      -       Note that attroff,  wattroff,  attron,  wattron,  attrset,
      -       wattrset, standend and standout may be macros.
      +       Note  that  attroff,  wattroff,  attron, wattron, attrset,
      +       wattrset, standend and standout may be macros.
       
       
       

      PORTABILITY

      -       All  these functions are supported in the XSI Curses stan-
      -       dard, Issue 4.  The standard defined  the  dedicated  type
      -       for  highlights,  attr_t,  which  is  not  defined in SVr4
      -       curses. The functions taking attr_t arguments are not sup-
      +       All these functions are supported in the XSI Curses  stan-
      +       dard,  Issue  4.   The standard defined the dedicated type
      +       for highlights, attr_t,  which  is  not  defined  in  SVr4
      +       curses. The functions taking attr_t arguments are not sup-
              ported under SVr4.
       
      -       The  XSI  Curses  standard  states that whether the tradi-
      -       tional  functions  attron/attroff/attrset  can  manipulate
      -       attributes  other  than A_BLINK, A_BOLD, A_DIM, A_REVERSE,
      -       A_STANDOUT, or A_UNDERLINE is "unspecified".   Under  this
      -       implementation  as  well  as  SVr4 curses, these functions
      -       correctly manipulate all other  highlights  (specifically,
      -       A_ALTCHARSET, A_PROTECT, and A_INVIS).
      -
      -       XSI  Curses added the new entry points, attr_get, attr_on,
      -       attr_off,  attr_set,   wattr_on,   wattr_off,   wattr_get,
      -       wattr_set.   These  are intended to work with a new series
      -       of highlight macros prefixed with WA_.
      -
      -        WA_NORMAL       Normal display (no highlight)
      -        WA_STANDOUT     Best highlighting mode of the terminal.
      -        WA_UNDERLINE    Underlining
      -        WA_REVERSE      Reverse video
      -        WA_BLINK        Blinking
      -        WA_DIM          Half bright
      -        WA_BOLD         Extra bright or bold
      -        WA_ALTCHARSET   Alternate character set
      +       The XSI Curses standard states  that  whether  the  tradi-
      +       tional  functions  attron/attroff/attrset  can  manipulate
      +       attributes other than A_BLINK, A_BOLD,  A_DIM,  A_REVERSE,
      +       A_STANDOUT,  or  A_UNDERLINE is "unspecified".  Under this
      +       implementation as well as  SVr4  curses,  these  functions
      +       correctly  manipulate  all other highlights (specifically,
      +       A_ALTCHARSET, A_PROTECT, and A_INVIS).
      +
      +       XSI Curses added the new entry points, attr_get,  attr_on,
      +       attr_off,   attr_set,   wattr_on,   wattr_off,  wattr_get,
      +       wattr_set.  These are intended to work with a  new  series
      +       of highlight macros prefixed with WA_.
      +
      +        WA_NORMAL       Normal display (no highlight)
      +        WA_STANDOUT     Best highlighting mode of the terminal.
      +        WA_UNDERLINE    Underlining
      +        WA_REVERSE      Reverse video
      +        WA_BLINK        Blinking
      +        WA_DIM          Half bright
      +        WA_BOLD         Extra bright or bold
      +        WA_ALTCHARSET   Alternate character set
       
              The XSI curses standard specifies that each pair of corre-
      -       sponding  A_  and WA_-using functions operates on the same
      +       sponding A_ and WA_-using functions operates on  the  same
              current-highlight information.
       
              The XSI standard extended conformance level adds new high-
      -       lights A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, A_VER-
      -       TICAL (and corresponding WA_ macros for each)  which  this
      +       lights A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, A_VER-
      +       TICAL  (and  corresponding WA_ macros for each) which this
              curses does not yet support.
       
       
       

      SEE ALSO

      -       curses(3x),        curs_addch(3x),        curs_addstr(3x),
      -       curs_printw(3x)
      +       curses(3x),        curs_addch(3x),        curs_addstr(3x),
      +       curs_bkgd(3x), curs_printw(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
       
       

      diff --git a/doc/html/man/curs_beep.3x.html b/doc/html/man/curs_beep.3x.html index 516cd688..a3df0f94 100644 --- a/doc/html/man/curs_beep.3x.html +++ b/doc/html/man/curs_beep.3x.html @@ -1,27 +1,65 @@ + + + +curs_beep 3x + + + +

      curs_beep 3x

      +
       
       
       

      NAME

      -       beep, flash - curses bell and screen flash routines
      +       beep, flash - curses bell and screen flash routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int beep(void);
      -       int flash(void);
      +       int beep(void);
      +       int flash(void);
       
       
       

      DESCRIPTION

      -       The beep and flash routines are used to alert the terminal
      -       user.  The routine beep sounds an  audible  alarm  on  the
      +       The beep and flash routines are used to alert the terminal
      +       user.  The routine beep sounds an  audible  alarm  on  the
              terminal,  if  possible;  otherwise  it flashes the screen
      -       (visible bell).  The routine flash flashes the screen, and
      +       (visible bell).  The routine flash flashes the screen, and
              if  that  is  not  possible, sounds the alert.  If neither
              alert is possible, nothing happens.  Nearly all  terminals
              have  an  audible  alert (bell or beep), but only some can
      @@ -30,13 +68,13 @@
       
       

      RETURN VALUE

      -       These routines return OK if they  succeed  in  beeping  or
      -       flashing, ERR otherwise.
      +       These routines return OK if they  succeed  in  beeping  or
      +       flashing, ERR otherwise.
       
       
       

      EXTENSIONS

      -       SVr4's  beep  and flash routines always returned OK, so it
      +       SVr4's  beep  and flash routines always returned OK, so it
              was not possible to tell when the beep or flash failed.
       
       
      @@ -44,12 +82,12 @@
       

      PORTABILITY

              These functions are defined in the  XSI  Curses  standard,
              Issue  4.  Like SVr4, it specifies that they always return
      -       OK.
      +       OK.
       
       
       

      SEE ALSO

      -       curses(3x)
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/curs_bkgd.3x.html b/doc/html/man/curs_bkgd.3x.html
      index d498f465..178a8f61 100644
      --- a/doc/html/man/curs_bkgd.3x.html
      +++ b/doc/html/man/curs_bkgd.3x.html
      @@ -1,33 +1,72 @@
      +
      +
       
      +
      +curs_bkgd 3x
      +
      +
      +
       
      +

      curs_bkgd 3x

      +
       
       
       

      NAME

      -       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
      +       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
              background manipulation routines
       
       
      +
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       void bkgdset(const chtype ch);
      -       void wbkgdset(WINDOW *win, const chtype ch);
      -       int bkgd(const chtype ch);
      -       int wbkgd(WINDOW *win, const chtype ch);
      -       chtype getbkgd(WINDOW *win);
      +       void bkgdset(chtype ch);
      +       void wbkgdset(WINDOW *win, chtype ch);
      +       int bkgd(chtype ch);
      +       int wbkgd(WINDOW *win, chtype ch);
      +       chtype getbkgd(WINDOW *win);
       
       
       

      DESCRIPTION

      -       The bkgdset and wbkgdset  routines  manipulate  the  back-
      +       The bkgdset and wbkgdset  routines  manipulate  the  back-
              ground  of  the  named window.  The window background is a
      -       chtype consisting of any combination of attributes  (i.e.,
      +       chtype consisting of any combination of attributes  (i.e.,
              rendition)  and  a  character.   The attribute part of the
              background is combined (OR'ed) with all non-blank  charac-
      -       ters  that  are written into the window with waddch.  Both
      +       ters  that  are written into the window with waddch.  Both
              the character and attribute parts of  the  background  are
              combined   with  the  blank  characters.   The  background
              becomes a property of the character  and  moves  with  the
      @@ -38,7 +77,7 @@
              attribute  part  of  the  background  is  displayed as the
              graphic rendition of the character put on the screen.
       
      -       The bkgd and wbkgd functions set the  background  property
      +       The bkgd and wbkgd functions set the  background  property
              of  the  current  or  specified window and then apply this
              setting to every character position in that window:
       
      @@ -48,34 +87,33 @@
                     Wherever  the  former background character appears,
                     it is changed to the new background character.
       
      -       The getbkgd function returns the  given  window's  current
      +       The getbkgd function returns the  given  window's  current
              background character/attribute pair.
       
       
       

      RETURN VALUE

      -       The  routines  bkgd  and wbkgd return the integer OK.  The
      -       SVr4.0 manual says "or a non-negative integer  if  immedok
      +       The  routines  bkgd  and wbkgd return the integer OK.  The
      +       SVr4.0 manual says "or a non-negative integer  if  immedok
              is set", but this appears to be an error.
       
       
       

      NOTES

      -       Note that bkgdset and bkgd may be macros.
      +       Note that bkgdset and bkgd may be macros.
       
       
       

      PORTABILITY

              These  functions are described in the XSI Curses standard,
      -       Issue 4.  The draft does not include const  qualifiers  on
      -       the arguments.  The standard specifies that bkgd and wbkgd
      -       return ERR, on failure. but gives no failure conditions.
      +       Issue 4.  It specifies that bkgd and wbkgd return  ERR  on
      +       failure.  but gives no failure conditions.
       
       
       

      SEE ALSO

      -       curses(3x), curs_addch(3x), curs_outopts(3x)
      -
      +       curses(3x),   curs_addch(3x),   curs_attr(3x),   curs_out-
      +       opts(3x)
       
       
       
      diff --git a/doc/html/man/curs_bkgrnd.3x.html b/doc/html/man/curs_bkgrnd.3x.html
      new file mode 100644
      index 00000000..4a445359
      --- /dev/null
      +++ b/doc/html/man/curs_bkgrnd.3x.html
      @@ -0,0 +1,170 @@
      +
      +
      +
      +
      +curs_bkgrnd 3x
      +
      +
      +
      +
      +

      curs_bkgrnd 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       bkgrnd,  wbkgrnd,  bkgrndset, wbkgrndset, getbkgrnd, wget-
      +       bkgrnd - curses  window  complex  background  manipulation
      +       routines
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int bkgrnd( const cchar_t *wch);
      +       int wbkgrnd( WINDOW *win, const cchar_t *wch);
      +       void bkgrndset(const cchar_t *wch );
      +       void wbkgrndset(WINDOW *win, const cchar_t *wch);
      +       int getbkgrnd(cchar_t *wch);
      +       int wgetbkgrnd(WINDOW *win, cchar_t *wch);
      +
      +
      +
      +

      DESCRIPTION

      +       The bkgrndset and wbkgrndset routines manipulate the back-
      +       ground of the named window.  The window  background  is  a
      +       cchar_t consisting of any combination of attributes (i.e.,
      +       rendition) and a complex character.  The attribute part of
      +       the  background  is  combined  (OR'ed)  with all non-blank
      +       characters that are written into the window  with  waddch.
      +       Both  the  character and attribute parts of the background
      +       are combined with the blank  characters.   The  background
      +       becomes  a  property  of  the character and moves with the
      +       character  through   any   scrolling   and   insert/delete
      +       line/character operations.
      +
      +       To  the  extent  possible  on  a  particular terminal, the
      +       attribute part of  the  background  is  displayed  as  the
      +       graphic rendition of the character put on the screen.
      +
      +       The  bkgrnd and wbkgrnd functions set the background prop-
      +       erty of the current or specified  window  and  then  apply
      +       this setting to every character position in that window:
      +
      +              The  rendition  of every character on the screen is
      +              changed to the new background rendition.
      +
      +              Wherever the former background  character  appears,
      +              it is changed to the new background character.
      +
      +       The  getbkgrnd function returns the given window's current
      +       background character/attribute pair via the wch pointer.
      +
      +
      +
      +
      +

      NOTES

      +       Note that bkgrnd, bkgrndset, and getbkgrnd may be  macros.
      +
      +
      +
      +

      RETURN VALUES

      +       The  bkgrndset  and  wbkgrndset  routines  do not return a
      +       value.
      +
      +       Upon successful completion, the other functions return OK.
      +       Otherwise,  they  return  ERR.   A  null window pointer is
      +       treated as an error.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x), curs_bkgd(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_border.3x.html b/doc/html/man/curs_border.3x.html index 44f6e435..e6f9adbf 100644 --- a/doc/html/man/curs_border.3x.html +++ b/doc/html/man/curs_border.3x.html @@ -1,101 +1,138 @@ + + + +curs_border 3x + + + +

      curs_border 3x

      +
       
       
       

      NAME

      -       border,  wborder,  box, hline, whline, vline, wvline, mvh-
      -       line, mvwhline, mvvline, mvwvline - create curses borders,
      +       border,  wborder,  box, hline, whline, vline, wvline, mvh-
      +       line, mvwhline, mvvline, mvwvline - create curses borders,
              horizontal and vertical lines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       int border(chtype ls, chtype rs, chtype ts, chtype bs,
      -          chtype tl, chtype tr, chtype bl, chtype br);
      -       int wborder(WINDOW *win, chtype ls, chtype rs,
      -          chtype ts, chtype bs, chtype tl, chtype tr,
      -          chtype bl, chtype br);
      -       int box(WINDOW *win, chtype verch, chtype horch);
      -       int hline(chtype ch, int n);
      -       int whline(WINDOW *win, chtype ch, int n);
      -       int vline(chtype ch, int n);
      -       int wvline(WINDOW *win, chtype ch, int n);
      -       mvhline(int y, int x, chtype ch, int n);
      -       mvwhline(WINDOW *, int y, int x, chtype ch, int n);
      -       int mvvline(int y, int x, chtype ch, int n);
      -       int mvwvline(WINDOW *, int y, int x, chtype ch, int n);
      +       #include <curses.h>
      +       int border(chtype ls, chtype rs, chtype ts, chtype bs,
      +          chtype tl, chtype tr, chtype bl, chtype br);
      +       int wborder(WINDOW *win, chtype ls, chtype rs,
      +          chtype ts, chtype bs, chtype tl, chtype tr,
      +          chtype bl, chtype br);
      +       int box(WINDOW *win, chtype verch, chtype horch);
      +       int hline(chtype ch, int n);
      +       int whline(WINDOW *win, chtype ch, int n);
      +       int vline(chtype ch, int n);
      +       int wvline(WINDOW *win, chtype ch, int n);
      +       mvhline(int y, int x, chtype ch, int n);
      +       mvwhline(WINDOW *, int y, int x, chtype ch, int n);
      +       int mvvline(int y, int x, chtype ch, int n);
      +       int mvwvline(WINDOW *, int y, int x, chtype ch, int n);
       
       
       

      DESCRIPTION

      -       The border, wborder and box routines draw a box around the
      -       edges of a window.  The argument ls  is  a  character  and
      -       attributes  used  for  the  left  side of the border, rs -
      -       right side, ts - top side, bs -  bottom  side,  tl  -  top
      -       left-hand  corner, tr - top right-hand corner, bl - bottom
      -       left-hand corner, and br - bottom right-hand  corner.   If
      -       any of these arguments is zero, then the following default
      -       values (defined in curses.h) are used instead:  ACS_VLINE,
      -       ACS_VLINE,     ACS_HLINE,     ACS_HLINE,     ACS_ULCORNER,
      -       ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER.
      -
      -       box(win, verch, horch) is a shorthand  for  the  following
      -       call:  wborder(win,  verch,  verch, horch, horch, 0, 0, 0,
      -       0).
      -
      -       The hline and whline functions draw a horizontal (left  to
      -       right)  line using ch starting at the current cursor posi-
      +       The border, wborder and box routines draw a box around the
      +       edges of a window.  Other than the window,  each  argument
      +       is a character with attributes:
      +              ls - left side,
      +              rs - right side,
      +              ts - top side,
      +              bs - bottom side,
      +              tl - top left-hand corner,
      +              tr - top right-hand corner,
      +              bl - bottom left-hand corner, and
      +              br - bottom right-hand corner.
      +       If  any of these arguments is zero, then the corresponding
      +       default values (defined in curses.h) are used instead:
      +              ACS_VLINE,
      +              ACS_VLINE,
      +              ACS_HLINE,
      +              ACS_HLINE,
      +              ACS_ULCORNER,
      +              ACS_URCORNER,
      +              ACS_LLCORNER,
      +              ACS_LRCORNER.
      +
      +       box(win, verch, horch) is a shorthand  for  the  following
      +       call:  wborder(win,  verch,  verch, horch, horch, 0, 0, 0,
      +       0).
      +
      +       The hline and whline functions draw a horizontal (left  to
      +       right)  line using ch starting at the current cursor posi-
              tion in the window.  The current cursor  position  is  not
      -       changed.   The  line  is  at most n characters long, or as
      +       changed.   The  line  is  at most n characters long, or as
              many as fit into the window.
      -
      -       The vline and wvline functions draw  a  vertical  (top  to
      -       bottom) line using ch starting at the current cursor posi-
      +       The vline and wvline functions draw  a  vertical  (top  to
      +       bottom) line using ch starting at the current cursor posi-
              tion in the window.  The current cursor  position  is  not
      -       changed.   The  line  is  at most n characters long, or as
      +       changed.   The  line  is  at most n characters long, or as
              many as fit into the window.
       
       
       

      RETURN VALUE

      -       All routines return the integer  OK.   The  SVr4.0  manual
      -       says  "or  a  non-negative integer if immedok is set", but
      +       All routines return the integer  OK.   The  SVr4.0  manual
      +       says  "or  a  non-negative integer if immedok is set", but
              this appears to be an error.
       
       
       

      NOTES

      -       The borders generated by these functions are  inside  bor-
      +       The borders generated by these functions are  inside  bor-
              ders (this is also true of SVr4 curses, though the fact is
              not documented).
       
      -       Note that border and box may be macros.
      +       Note that border and box may be macros.
       
       
       

      PORTABILITY

              These functions are described in the XSI Curses  standard,
      -       Issue 4.  Additional functions mvhline, mvvline, mvwhline,
      -       and mvwvline are described there which this implementation
      -       does  not  yet  support.  The standard specifies that they
      -       return ERR on failure, but specifies no error  conditions.
      +       Issue  4.   The standard specifies that they return ERR on
      +       failure, but specifies no error conditions.
       
       
       

      SEE ALSO

      -       curses(3x), curs_outopts(3x).
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x), curs_outopts(3x).
       
       
       
      diff --git a/doc/html/man/curs_border_set.3x.html b/doc/html/man/curs_border_set.3x.html
      new file mode 100644
      index 00000000..b5a3ebb3
      --- /dev/null
      +++ b/doc/html/man/curs_border_set.3x.html
      @@ -0,0 +1,170 @@
      +
      +
      +
      +
      +curs_border_set 3x
      +
      +
      +
      +
      +

      curs_border_set 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       border_set,  wborder_set,  box_set, hline_set, whline_set,
      +       mvhline_set,    mvwhline_set,    vline_set,    wvline_set,
      +       mvvline_set, mvwvline_set - create curses borders or lines
      +       using complex characters and renditions
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int border_set(
      +          const cchar_t *ls, const cchar_t *rs,
      +          const cchar_t *ts, const cchar_t *bs,
      +          const cchar_t *tl, const cchar_t *tr,
      +          const cchar_t *bl, const cchar_t *br );
      +       int wborder_set(
      +          WINDOW *win,
      +          const cchar_t *ls, const cchar_t *rs,
      +          const cchar_t *ts, const cchar_t *bs,
      +          const cchar_t *tl, const cchar_t *tr,
      +          const cchar_t *bl, const cchar_t *br);
      +       int box_set(
      +          WINDOW *win,
      +          const cchar_t *verch,
      +          const cchar_t *horch);
      +       int hline_set(
      +          const cchar_t *wch, int n);
      +       int whline_set(
      +          WINDOW *win,
      +          const cchar_t *wch, int n);
      +       int mvhline_set(
      +          int y, int x,
      +          const cchar_t *wch, int n);
      +       int mvwhline_set(
      +          WINDOW *win,
      +          int y, int x,
      +          const cchar_t *wch, int n);
      +       int vline_set(
      +          const cchar_t *wch, int n);
      +       int wvline_set(
      +          WINDOW *win,
      +          const cchar_t *wch, int n);
      +       int mvvline_set(
      +          int y, int x,
      +          const cchar_t *wch, int n);
      +       int mvwvline_set(
      +          WINDOW *win,
      +          int y, int x,
      +          const cchar_t *wch, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       The border_set and wborder_set  functions  draw  a  border
      +       around  the  edges  of  the  current  or specified window.
      +       These functions do not change the cursor position, and  do
      +       not wrap.
      +       Other  than the window, each argument is a complex charac-
      +       ter with attributes:
      +              ls - left side,
      +              rs - right side,
      +              ts - top side,
      +              bs - bottom side,
      +              tl - top left-hand corner,
      +              tr - top right-hand corner,
      +              bl - bottom left-hand corner, and
      +              br - bottom right-hand corner.
      +
      +       If any of these arguments is zero, then the  corresponding
      +       default values (defined in curses.h) are used instead:
      +              WACS_VLINE,
      +              WACS_VLINE,
      +              WACS_HLINE,
      +              WACS_HLINE,
      +              WACS_ULCORNER,
      +              WACS_URCORNER,
      +              WACS_LLCORNER, and
      +              WACS_LRCORNER.
      +
      +       box_set(win, verch, horch); is a shorthand for the follow-
      +       ing call:
      +
      +       wborder_set(win, verch, verch,
      +           horch, horch, NULL, NULL, NULL, NULL);
      +
      +       The *line_set functions use wch to draw a line starting at
      +       the current cursor position in the window.  The line is at
      +       most n characters long or as many as fit into the  window.
      +       The current cursor position is not changed.
      +
      +       The  hline_set,  mvhline_set, mvwhline_set, and whline_set
      +       functions draw a line proceeding toward the last column of
      +       the same line.
      +
      +       The  vline_set,  mvvline_set, mvwvline_set, and wvline_set
      +       functions draw a line proceeding toward the last  line  of
      +       the window.
      +
      +
      +
      +

      NOTES

      +       Note that border_set, hline_set, mvhline_set, mvvline_set,
      +       mvwhline_set, mvwvline_set, and vline_set may be macros.
      +
      +
      +
      +

      RETURN VALUES

      +       Upon successful completion,  these  functions  return  OK.
      +       Otherwise, they return ERR.
      +
      +
      +
      +

      SEE ALSO

      +       ncurses(3x), curs_border(3x), curs_outopts(3x)
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_clear.3x.html b/doc/html/man/curs_clear.3x.html index 1a874f2e..bb5ff226 100644 --- a/doc/html/man/curs_clear.3x.html +++ b/doc/html/man/curs_clear.3x.html @@ -1,79 +1,117 @@ + + + +curs_clear 3x + + + +

      curs_clear 3x

      +
       
       
       

      NAME

      -       erase,  werase,  clear,  wclear, clrtobot, wclrtobot, clr-
      -       toeol, wclrtoeol - clear all or part of a curses window
      +       erase,  werase,  clear,  wclear, clrtobot, wclrtobot, clr-
      +       toeol, wclrtoeol - clear all or part of a curses window
       
       
       

      SYNOPSIS

      -       # include <curses.h>
      +       # include <curses.h>
       
      -       int erase(void);
      -       int werase(WINDOW *win);
      -       int clear(void);
      -       int wclear(WINDOW *win);
      -       int clrtobot(void);
      -       int wclrtobot(WINDOW *win);
      -       int clrtoeol(void);
      -       int wclrtoeol(WINDOW *win);
      +       int erase(void);
      +       int werase(WINDOW *win);
      +       int clear(void);
      +       int wclear(WINDOW *win);
      +       int clrtobot(void);
      +       int wclrtobot(WINDOW *win);
      +       int clrtoeol(void);
      +       int wclrtoeol(WINDOW *win);
       
       
       

      DESCRIPTION

      -       The erase and werase routines copy blanks to  every  posi-
      +       The erase and werase routines copy blanks to  every  posi-
              tion in the window, clearing the screen.
       
      -       The  clear  and wclear routines are like erase and werase,
      -       but they also call clearok, so that the screen is  cleared
      -       completely  on  the  next call to wrefresh for that window
      +       The  clear  and wclear routines are like erase and werase,
      +       but they also call clearok, so that the screen is  cleared
      +       completely  on  the  next call to wrefresh for that window
              and repainted from scratch.
       
      -       The clrtobot and wclrtobot routines erase from the  cursor
      +       The clrtobot and wclrtobot routines erase from the  cursor
              to the end of screen.  That is, they erase all lines below
              the cursor in the window.  Also, the current line  to  the
              right of the cursor, inclusive, is erased.
       
      -       The clrtoeol and wclrtoeol routines erase the current line
      +       The clrtoeol and wclrtoeol routines erase the current line
              to the right of the cursor, inclusive, to the end  of  the
              current line.
       
              Blanks created by erasure have the current background ren-
      -       dition (as set by wbkgdset) merged into them.
      +       dition (as set by wbkgdset) merged into them.
       
       
       

      RETURN VALUE

      -       All routines return the integer  OK.   The  SVr4.0  manual
      -       says  "or  a  non-negative integer if immedok is set", but
      +       All routines return the integer  OK.   The  SVr4.0  manual
      +       says  "or  a  non-negative integer if immedok is set", but
              this appears to be an error.
       
       
       

      NOTES

      -       Note that erase, werase, clear, wclear, clrtobot, and clr-
      -       toeol may be macros.
      +       Note that erase, werase, clear, wclear, clrtobot, and clr-
      +       toeol may be macros.
       
       
       

      PORTABILITY

              These  functions are described in the XSI Curses standard,
      -       Issue 4.  The standard specifies that they return  ERR  on
      +       Issue 4.  The standard specifies that they return  ERR  on
              failure, but specifies no error conditions.
       
              Some  historic  curses  implementations had, as an undocu-
              mented feature,  the  ability  to  do  the  equivalent  of
      -       clearok(...,    1)    by    saying   touchwin(stdscr)   or
      -       clear(stdscr).  This will not work under ncurses.
      +       clearok(...,    1)    by    saying   touchwin(stdscr)   or
      +       clear(stdscr).  This will not work under ncurses.
       
       
       

      SEE ALSO

      -       curses(3x), curs_outopts(3x), curs_refresh(3x)
      +       curses(3x), curs_outopts(3x), curs_refresh(3x)
       
       
       
      diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html
      index b24a83c0..2165cebf 100644
      --- a/doc/html/man/curs_color.3x.html
      +++ b/doc/html/man/curs_color.3x.html
      @@ -1,160 +1,198 @@
      +
      +
       
      +
      +curs_color 3x
      +
      +
      +
       
      +

      curs_color 3x

      +
       
       
       

      NAME

      -       start_color,     init_pair,     init_color,    has_colors,
      -       can_change_color, color_content, pair_content,  COLOR_PAIR
      -       - curses color manipulation routines
      +       start_color,     init_pair,     init_color,    has_colors,
      +       can_change_color, color_content, pair_content,  COLOR_PAIR
      +       - curses color manipulation routines
       
       
       

      SYNOPSIS

      -       # include <curses.h>
      -       int start_color(void);
      -       int init_pair(short pair, short f, short b);
      -       int init_color(short color, short r, short g, short b);
      -       bool has_colors(void);
      -       bool can_change_color(void);
      -       int  color_content(short  color, short *r, short *g, short
      -       *b);
      -       int pair_content(short pair, short *f, short *b);
      +       # include <curses.h>
      +       int start_color(void);
      +       int init_pair(short pair, short f, short b);
      +       int init_color(short color, short r, short g, short b);
      +       bool has_colors(void);
      +       bool can_change_color(void);
      +       int  color_content(short  color, short *r, short *g, short
      +       *b);
      +       int pair_content(short pair, short *f, short *b);
       
       
       

      DESCRIPTION

      -   Overview
      -       curses support color attributes  on  terminals  with  that
      -       capability.   To  use  these  routines start_color must be
      -       called, usually right after initscr.   Colors  are  always
      +   Overview
      +       curses support color attributes  on  terminals  with  that
      +       capability.   To  use  these  routines start_color must be
      +       called, usually right after initscr.   Colors  are  always
              used  in pairs (referred to as color-pairs).  A color-pair
              consists of a foreground  color  (for  characters)  and  a
              background color (for the blank field on which the charac-
              ters are displayed).  A programmer  initializes  a  color-
      -       pair  with  the routine init_pair.  After it has been ini-
      -       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
      +       pair  with  the routine init_pair.  After it has been ini-
      +       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
              can be used as a new video attribute.
       
              If  a  terminal  is capable of redefining colors, the pro-
      -       grammer can use the routine init_color to change the defi-
      -       nition   of   a   color.    The  routines  has_colors  and
      -       can_change_color  return  TRUE  or  FALSE,  depending   on
      +       grammer can use the routine init_color to change the defi-
      +       nition   of   a   color.    The  routines  has_colors  and
      +       can_change_color  return  TRUE  or  FALSE,  depending   on
              whether  the  terminal  has color capabilities and whether
              the  programmer  can  change  the  colors.   The   routine
      -       color_content  allows  a programmer to extract the amounts
      +       color_content  allows  a programmer to extract the amounts
              of red, green,  and  blue  components  in  an  initialized
      -       color.   The  routine  pair_content allows a programmer to
      +       color.   The  routine  pair_content allows a programmer to
              find out how a given color-pair is currently defined.
       
      -   Routine Descriptions
      -       The start_color routine requires no arguments.  It must be
      +   Routine Descriptions
      +       The start_color routine requires no arguments.  It must be
              called  if  the programmer wants to use colors, and before
              any other color manipulation routine  is  called.   It  is
      -       good  practice  to  call this routine right after initscr.
      -       start_color initializes eight basic  colors  (black,  red,
      +       good  practice  to  call this routine right after initscr.
      +       start_color initializes eight basic  colors  (black,  red,
              green,  yellow,  blue,  magenta, cyan, and white), and two
      -       global variables,  COLORS  and  COLOR_PAIRS  (respectively
      +       global variables,  COLORS  and  COLOR_PAIRS  (respectively
              defining  the maximum number of colors and color-pairs the
              terminal can support).  It also restores the colors on the
              terminal to the values they had when the terminal was just
              turned on.
       
      -       The init_pair routine changes the definition of  a  color-
      +       The init_pair routine changes the definition of  a  color-
              pair.   It takes three arguments: the number of the color-
              pair to be changed, the foreground color number,  and  the
              background color number.  For portable applications:
       
      -       -    The value of the first argument must be between 1 and
      -            COLOR_PAIRS-1.
      +       -    The value of the first argument must be between 1 and
      +            COLOR_PAIRS-1.
       
              -    The value of the second and third arguments  must  be
      -            between  0  and  COLORS (the 0 color pair is wired to
      +            between  0  and  COLORS (the 0 color pair is wired to
                   white on black and cannot be changed).
       
              If the color-pair was previously initialized,  the  screen
      -       is  refreshed  and  all  occurrences of that color-pair is
      +       is  refreshed  and  all occurrences of that color-pair are
              changed to the new definition.
       
              As an extension, ncurses allows you to set  color  pair  0
      -       via  the  assume_default_colors routine, or to specify the
      -       use of default colors  (color  number  -1)  if  you  first
      -       invoke the use_default_colors routine.
      +       via  the  assume_default_colors routine, or to specify the
      +       use of default colors  (color  number  -1)  if  you  first
      +       invoke the use_default_colors routine.
       
      -       The  init_color routine changes the definition of a color.
      +       The  init_color routine changes the definition of a color.
              It takes four arguments: the number of  the  color  to  be
              changed  followed  by three RGB values (for the amounts of
              red, green, and blue components).  The value of the  first
      -       argument  must  be between 0 and COLORS.  (See the section
      -       Colors for the default color index.)   Each  of  the  last
      +       argument  must  be between 0 and COLORS.  (See the section
      +       Colors for the default color index.)   Each  of  the  last
              three  arguments must be a value between 0 and 1000.  When
      -       init_color is used, all occurrences of that color  on  the
      +       init_color is used, all occurrences of that color  on  the
              screen immediately change to the new definition.
       
      -       The  has_colors routine requires no arguments.  It returns
      -       TRUE if the terminal can manipulate colors; otherwise,  it
      -       returns FALSE.  This routine facilitates writing terminal-
      +       The  has_colors routine requires no arguments.  It returns
      +       TRUE if the terminal can manipulate colors; otherwise,  it
      +       returns FALSE.  This routine facilitates writing terminal-
              independent programs.  For example, a programmer  can  use
              it  to  decide  whether  to  use color or some other video
              attribute.
       
      -       The can_change_color routine requires  no  arguments.   It
      -       returns  TRUE  if  the  terminal  supports  colors and can
      -       change their definitions; other, it returns  FALSE.   This
      +       The can_change_color routine requires  no  arguments.   It
      +       returns  TRUE  if  the  terminal  supports  colors and can
      +       change their definitions; other, it returns  FALSE.   This
              routine facilitates writing terminal-independent programs.
       
      -       The color_content routine gives programmers a way to  find
      +       The color_content routine gives programmers a way to  find
              the intensity of the red, green, and blue (RGB) components
              in a color.  It requires four arguments: the color number,
      -       and  three addresses of shorts for storing the information
      +       and  three addresses of shorts for storing the information
              about the amounts of red, green, and  blue  components  in
              the  given color.  The value of the first argument must be
      -       between 0 and COLORS.  The values that are stored  at  the
      +       between 0 and COLORS.  The values that are stored  at  the
              addresses  pointed  to  by  the  last  three arguments are
              between 0 (no component) and 1000 (maximum amount of  com-
              ponent).
       
      -       The  pair_content  routine  allows programmers to find out
      +       The  pair_content  routine  allows programmers to find out
              what colors a given color-pair consists of.   It  requires
              three  arguments: the color-pair number, and two addresses
      -       of shorts for storing the foreground  and  the  background
      +       of shorts for storing the foreground  and  the  background
              color  numbers.   The  value of the first argument must be
      -       between 1 and COLOR_PAIRS-1.  The values that  are  stored
      +       between 1 and COLOR_PAIRS-1.  The values that  are  stored
              at  the addresses pointed to by the second and third argu-
      -       ments are between 0 and COLORS.
      +       ments are between 0 and COLORS.
       
      -   Colors
      -       In <curses.h> the following macros are defined.  These are
      -       the  default colors.  curses also assumes that COLOR_BLACK
      +   Colors
      +       In <curses.h> the following macros are defined.  These are
      +       the  default colors.  curses also assumes that COLOR_BLACK
              is the default background color for all terminals.
       
      -             COLOR_BLACK
      -             COLOR_RED
      -             COLOR_GREEN
      -             COLOR_YELLOW
      -             COLOR_BLUE
      -             COLOR_MAGENTA
      -             COLOR_CYAN
      -             COLOR_WHITE
      +             COLOR_BLACK
      +             COLOR_RED
      +             COLOR_GREEN
      +             COLOR_YELLOW
      +             COLOR_BLUE
      +             COLOR_MAGENTA
      +             COLOR_CYAN
      +             COLOR_WHITE
       
       
       

      RETURN VALUE

      -       The routines can_change_color()  and  has_colors()  return
      -       TRUE or FALSE.
      +       The routines can_change_color()  and  has_colors()  return
      +       TRUE or FALSE.
       
      -       All other routines return the integer ERR upon failure and
      -       an OK (SVr4 specifies only "an integer  value  other  than
      -       ERR") upon successful completion.
      +       All other routines return the integer ERR upon failure and
      +       an OK (SVr4 specifies only "an integer  value  other  than
      +       ERR") upon successful completion.
       
       
       

      NOTES

      -       In  the  ncurses implementation, there is a separate color
      +       In  the  ncurses implementation, there is a separate color
              activation flag, color palette,  color  pairs  table,  and
              associated  COLORS and COLOR_PAIRS counts for each screen;
      -       the start_color function only affects the current  screen.
      +       the start_color function only affects the current  screen.
              The SVr4/XSI interface is not really designed with this in
              mind, and historical  implementations  may  use  a  single
              shared color palette.
      @@ -163,13 +201,13 @@
              pair affects only character cells that a  character  write
              operation  explicitly  touches.   To change the background
              color used when parts of a window are blanked  by  erasing
      -       or scrolling operations, see curs_bkgd(3x).
      +       or scrolling operations, see curs_bkgd(3x).
       
              Several  caveats  apply  on 386 and 486 machines with VGA-
              compatible graphics:
       
              -    COLOR_YELLOW is actually brown.  To get  yellow,  use
      -            COLOR_YELLOW combined with the A_BOLD attribute.
      +            COLOR_YELLOW combined with the A_BOLD attribute.
       
              -    The  A_BLINK  attribute  should  in  theory cause the
                   background to go bright.  This often fails  to  work,
      @@ -184,23 +222,23 @@
       

      PORTABILITY

              This implementation satisfies XSI Curses's  minimum  maxi-
      -       mums for COLORS and COLOR_PAIRS.
      +       mums for COLORS and COLOR_PAIRS.
       
      -       The  init_pair  routine  accepts  negative values of fore-
      +       The  init_pair  routine  accepts  negative values of fore-
              ground   and   background    color    to    support    the
      -       use_default_colors extension, but only if that routine has
      +       use_default_colors extension, but only if that routine has
              been first invoked.
       
      -       The assumption that COLOR_BLACK is the default  background
      +       The assumption that COLOR_BLACK is the default  background
              color   for  all  terminals  can  be  modified  using  the
      -       assume_default_colors extension,
      +       assume_default_colors extension,
      +
       
       
       

      SEE ALSO

      -       curses(3x), curs_initscr(3x), curs_attr(3x),  default_col-
      -       ors(3x)
      -
      +       curses(3x), curs_initscr(3x), curs_attr(3x),  default_col-
      +       ors(3x)
       
       
       
      diff --git a/doc/html/man/curs_delch.3x.html b/doc/html/man/curs_delch.3x.html
      index 8d376480..10840ed9 100644
      --- a/doc/html/man/curs_delch.3x.html
      +++ b/doc/html/man/curs_delch.3x.html
      @@ -1,22 +1,60 @@
      +
      +
       
      +
      +curs_delch 3x
      +
      +
      +
       
      +

      curs_delch 3x

      +
       
       
       

      NAME

      -       delch,  wdelch, mvdelch, mvwdelch - delete character under
      -       the cursor in a curses window
      +       delch,  wdelch, mvdelch, mvwdelch - delete character under
      +       the cursor in a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int delch(void);
      -       int wdelch(WINDOW *win);
      -       int mvdelch(int y, int x);
      -       int mvwdelch(WINDOW *win, int y, int x);
      +       int delch(void);
      +       int wdelch(WINDOW *win);
      +       int mvdelch(int y, int x);
      +       int mvwdelch(WINDOW *win, int y, int x);
       
       
       
      @@ -25,33 +63,33 @@ characters to the right of the cursor on the same line are moved to the left one position and the last character on the line is filled with a blank. The cursor position does - not change (after moving to y, x, if specified). (This + not change (after moving to y, x, if specified). (This does not imply use of the hardware delete character fea- ture.)

      RETURN VALUE

      -       All routines return the integer ERR upon failure and an OK
      -       (SVr4  specifies  only  "an integer value other than ERR")
      +       All routines return the integer ERR upon failure and an OK
      +       (SVr4  specifies  only  "an integer value other than ERR")
              upon successful completion.
       
       
       

      NOTES

      -       Note that delch, mvdelch, and mvwdelch may be macros.
      +       Note that delch, mvdelch, and mvwdelch may be macros.
       
       
       

      PORTABILITY

              These functions are described in the XSI Curses  standard,
      -       Issue  4.   The standard specifies that they return ERR on
      +       Issue  4.   The standard specifies that they return ERR on
              failure, but specifies no error conditions.
       
       
       

      SEE ALSO

      -       curses(3x)
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/curs_deleteln.3x.html b/doc/html/man/curs_deleteln.3x.html
      index 62cb0a49..2c3fc1ce 100644
      --- a/doc/html/man/curs_deleteln.3x.html
      +++ b/doc/html/man/curs_deleteln.3x.html
      @@ -1,71 +1,109 @@
      +
      +
       
      +
      +curs_deleteln 3x
      +
      +
      +
       
      +

      curs_deleteln 3x

      +
       
       
       

      NAME

      -       deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
      -       sertln - delete and insert lines in a curses window
      +       deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
      +       sertln - delete and insert lines in a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int deleteln(void);
      -       int wdeleteln(WINDOW *win);
      -       int insdelln(int n);
      -       int winsdelln(WINDOW *win, int n);
      -       int insertln(void);
      -       int winsertln(WINDOW *win);
      +       int deleteln(void);
      +       int wdeleteln(WINDOW *win);
      +       int insdelln(int n);
      +       int winsdelln(WINDOW *win, int n);
      +       int insertln(void);
      +       int winsertln(WINDOW *win);
       
       
       

      DESCRIPTION

      -       The deleteln and wdeleteln routines delete the line  under
      +       The deleteln and wdeleteln routines delete the line  under
              the cursor in the window; all lines below the current line
              are moved up one line.  The bottom line of the  window  is
              cleared.  The cursor position does not change.
       
      -       The  insdelln  and  winsdelln  routines,  for  positive n,
      -       insert n lines into the specified window above the current
      -       line.   The  n  bottom  lines  are  lost.  For negative n,
      -       delete n lines (starting with the one under  the  cursor),
      -       and  move  the remaining lines up.  The bottom n lines are
      +       The  insdelln  and  winsdelln  routines,  for  positive n,
      +       insert n lines into the specified window above the current
      +       line.   The  n  bottom  lines  are  lost.  For negative n,
      +       delete n lines (starting with the one under  the  cursor),
      +       and  move  the remaining lines up.  The bottom n lines are
              cleared.  The current cursor position remains the same.
       
      -       The insertln and insertln routines, insert  a  blank  line
      +       The insertln and winsertln routines, insert a  blank  line
              above the current line and the bottom line is lost.
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon failure and an OK
      -       (SVr4 specifies only "an integer value  other  than  ERR")
      +       All routines return the integer ERR upon failure and an OK
      +       (SVr4 specifies only "an integer value  other  than  ERR")
              upon successful completion.
       
       
       

      PORTABILITY

              These  functions are described in the XSI Curses standard,
      -       Issue 4.  The standard specifies that they return  ERR  on
      +       Issue 4.  The standard specifies that they return  ERR  on
              failure, but specifies no error conditions.
       
       
       

      NOTES

      -       Note that all but winsdelln may be macros.
      +       Note that all but winsdelln may be macros.
       
              These  routines  do  not require a hardware line delete or
              insert feature in the terminal.  In fact, they  won't  use
      -       hardware  line  delete/insert  unless idlok(..., TRUE) has
      +       hardware  line  delete/insert  unless idlok(..., TRUE) has
              been set on the current window.
       
       
       

      SEE ALSO

      -       curses(3x)
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/curs_extend.3x.html b/doc/html/man/curs_extend.3x.html
      index a91102ed..188389fe 100644
      --- a/doc/html/man/curs_extend.3x.html
      +++ b/doc/html/man/curs_extend.3x.html
      @@ -1,20 +1,60 @@
      +
      +
       
      +
      +curs_extend 3x
      +
      +
      +
       
      +

      curs_extend 3x

      +
       
       
       

      NAME

      -       curs_extend:  curses_version, use_extended_names - miscel-
      -       laneous curses extensions
      +       curses_version,  use_extended_names - miscellaneous curses
      +       extensions
      +
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       const char * curses_version(void);
      -       int use_extended_names(bool enable);
      +       const char * curses_version(void);
      +       int use_extended_names(bool enable);
       
       
       
      @@ -22,15 +62,15 @@ These functions are extensions to the curses library which do not fit easily into other categories. - Use curses_version() to get the version number, including - patch level of the library, e.g., 5.0.19991023 + Use curses_version() to get the version number, including + patch level of the library, e.g., 5.0.19991023 - The use_extended_names() function controls whether the + The use_extended_names() function controls whether the calling application is able to use user-defined or non- standard names which may be compiled into the terminfo description, i.e., via the terminfo or termcap interfaces. Normally these names are available for use, since the - essential descision is made by using the -x option of tic + essential descision is made by using the -x option of tic to compile extended terminal definitions. However you can disable this feature to ensure compatiblity with other implementations of curses @@ -46,9 +86,9 @@

      SEE ALSO

      -       curs_getch(3x),       curs_mouse(3x),      curs_print(3x),
      -       default_colors(3x),     define_key(3x),      keybound(3x),
      -       keyok(3x), resizeterm(3x), wresize(3x).
      +       curs_getch(3x),       curs_mouse(3x),      curs_print(3x),
      +       default_colors(3x),     define_key(3x),      keybound(3x),
      +       keyok(3x), resizeterm(3x), wresize(3x).
       
       
       
      @@ -67,7 +107,6 @@ -

      diff --git a/doc/html/man/curs_get_wch.3x.html b/doc/html/man/curs_get_wch.3x.html new file mode 100644 index 00000000..ddd3f4b1 --- /dev/null +++ b/doc/html/man/curs_get_wch.3x.html @@ -0,0 +1,170 @@ + + + + +curs_get_wch 3x + + + + +

      curs_get_wch 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       get_wch,  wget_wch, mvget_wch, mvwget_wch, unget_wch - get
      +       (or push back) a wide character from curses terminal  key-
      +       board
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int get_wch(win_t *wch);
      +       int wget_wch(WINDOW *win, win_t *wch);
      +       int mvget_wch(int y, int x, win_t *wch);
      +       int mvwget_wch(WINDOW *win, int y, int x, win_t *wch);
      +       int unget_wch(const wchar_t wch);
      +
      +
      +
      +

      DESCRIPTION

      +       The get_wch, wget_wch, mvget_wch, and mvwget_wch functions
      +       read a character from the  terminal  associated  with  the
      +       current  or  specified  window.   In  no-delay mode, if no
      +       input is waiting, the value ERR  is  returned.   In  delay
      +       mode,  the  program  waits  until  the  system passes text
      +       through to the  program.   Depending  on  the  setting  of
      +       cbreak,  this  is  after  one  character (cbreak mode), or
      +       after the first newline (nocbreak  mode).   In  half-delay
      +       mode,  the  program waits until the user types a character
      +       or the specified timeout interval has elapsed.
      +
      +       Unless noecho has been set, these routines echo the  char-
      +       acter into the designated window.
      +
      +       If  the window is not a pad and has been moved or modified
      +       since the last call to wrefresh, wrefresh will  be  called
      +       before another character is read.
      +
      +       If  keypad  is  enabled,  these  functions  respond to the
      +       pressing of a function key by setting the  object  pointed
      +       to  by  wch  to  the  corresponding  KEY_ value defined in
      +       <curses.h> and returning  KEY_CODE_YES.   If  a  character
      +       (such as escape) that could be the beginning of a function
      +       key is received, curses sets a timer.  If the remainder of
      +       the  sequence  does  arrive  within  the  designated time,
      +       curses passes through  the  character;  otherwise,  curses
      +       returns  the  function  key  value.  For this reason, many
      +       terminals experience a  delay  between  the  time  a  user
      +       presses the escape key and the time the escape is returned
      +       to the program.
      +
      +       The unget_wch function pushes the wide character wch  back
      +       onto the head of the input queue, so the wide character is
      +       returned by the next call to get_wch.  The pushback of one
      +       character  is  guaranteed.  If the program calls unget_wch
      +       too many times without an intervening call to get_wch, the
      +       operation may fail.
      +
      +
      +
      +
      +

      NOTES

      +       The  header  file  <curses.h>  automatically  includes the
      +       header file <stdio.h>.
      +
      +       Applications should not define the escape key by itself as
      +       a single-character function.
      +
      +       When  using  get_wch,  wget_wch, mvget_wch, or mvwget_wch,
      +       applications should not use nocbreak mode and echo mode at
      +       the  same  time.  Depending on the state of the tty driver
      +       when each character is  typed,  the  program  may  produce
      +       undesirable results.
      +
      +       All functions except wget_wch and unget_wch may be macros.
      +
      +
      +
      +

      RETURN VALUES

      +       When get_wch, wget_wch, mvget_wch,  and  mvwget_wch  func-
      +       tions  successfully report the pressing of a function key,
      +       they return KEY_CODE_YES.  When they successfully report a
      +       wide  character,  they  return OK.  Otherwise, they return
      +       ERR.
      +
      +       Upon successful completion, unget_wch returns OK.   Other-
      +       wise, the function returns ERR.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x),        curs_getch(3x),       curs_ins_wch(3x),
      +       curs_inopts(3x), curs_move(3x), curs_refresh(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_get_wstr.3x.html b/doc/html/man/curs_get_wstr.3x.html new file mode 100644 index 00000000..b3b066d5 --- /dev/null +++ b/doc/html/man/curs_get_wstr.3x.html @@ -0,0 +1,172 @@ + + + + +curs_get_wstr 3x + + + + +

      curs_get_wstr 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       get_wstr,  getn_wstr,  wget_wstr,  wgetn_wstr, mvget_wstr,
      +       mvgetn_wstr, mvwget_wstr, mvwgetn_wstr - get an  array  of
      +       wide characters from a curses terminal keyboard
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int get_wstr(wint_t *wstr);
      +       int getn_wstr(wint_t *wstr, int n);
      +       int wget_wstr(WINDOW *win, wint_t *wstr);
      +       int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
      +       int mvget_wstr(int y, int x, wint_t *wstr);
      +       int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
      +       int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr);
      +       int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       The  effect  of get_wstr is as though a series of calls to
      +       get_wch were made, until a newline, other end-of-line,  or
      +       end-of-file condition is processed.  An end-of-file condi-
      +       tion is represented by WEOF, as defined in <wchar.h>.  The
      +       newline  and end-of-line conditions are represented by the
      +       \n wchar_t value.  In all instances, the end of the string
      +       is  terminated  by  a  null  wchar_t.   The routine places
      +       resulting values in the area pointed to by wstr.
      +
      +       The user's erase and kill characters are interpreted.   If
      +       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
      +       KEY_BACKSPACE are both considered equivalent to the user's
      +       kill character.
      +
      +       Characters  input are echoed only if echo is currently on.
      +       In that case, backspace is echoed as deletion of the  pre-
      +       vious character (typically a left motion).
      +
      +       The  effect of wget_wstr is as though a series of calls to
      +       wget_wch were made.
      +
      +       The effect of mvget_wstr is as though a call to  move  and
      +       then a series of calls to get_wch were made.
      +
      +       The effect of mvwget_wstr is as though a call to wmove and
      +       then a series of calls to wget_wch were made.
      +
      +       The getn_wstr, mvgetn_wstr, mvwgetn_wstr,  and  wgetn_wstr
      +       functions  are  identical  to  the  get_wstr,  mvget_wstr,
      +       mvwget_wstr, and wget_wstr functions, respectively, except
      +       that  the *n_* versions read at most n characters, letting
      +       the application prevent overflow of the input buffer.
      +
      +
      +
      +

      NOTES

      +       Using get_wstr, mvget_wstr, mvwget_wstr, or  wget_wstr  to
      +       read  a  line  that overflows the array pointed to by wstr
      +       causes  undefined  results.    The   use   of   getn_wstr,
      +       mvgetn_wstr, mvwgetn_wstr, or wgetn_wstr, respectively, is
      +       recommended.
      +
      +       These functions cannot return KEY_ values because there is
      +       no  way  to  distinguish a KEY_ value from a valid wchar_t
      +       value.
      +
      +       All of these routines except wgetn_wstr may be macros.
      +
      +
      +
      +

      RETURN VALUES

      +       All of these functions return OK upon  successful  comple-
      +       tion.  Otherwise, they return ERR.
      +
      +
      +
      +

      PORTABILITY

      +       These  functions are described in The Single Unix Specifi-
      +       cation, Version 2.  No error conditions are defined.  This
      +       implementation  returns ERR if the window pointer is null,
      +       or if the lower-level wget_wch call returns  an  ERR.   In
      +       the  latter  case,  an  ERR  return  without other data is
      +       treated as an  end-of-file  condition,  and  the  returned
      +       array contains a WEOF followed by a null wchar_t.
      +
      +
      +
      +

      SEE ALSO

      +       Functions:  curses(3x), curs_get_wch(3x), curs_getstr(3x).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_getcchar.3x.html b/doc/html/man/curs_getcchar.3x.html new file mode 100644 index 00000000..0ae39ca0 --- /dev/null +++ b/doc/html/man/curs_getcchar.3x.html @@ -0,0 +1,170 @@ + + + + +curs_getcchar 3x + + + + +

      curs_getcchar 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       getcchar,  setcchar - Get a wide character string and ren-
      +       dition from a cchar_t or set a cchar_t from a wide-charac-
      +       ter string
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int getcchar(
      +               const cchar_t *wcval,
      +               wchar_t *wch,
      +               attr_t *attrs,
      +               short *color_pair,
      +               void *opts );
      +
      +       int setcchar(
      +               cchar_t *wcval,
      +               const wchar_t *wch,
      +               const attr_t attrs,
      +               short color_pair,
      +               void *opts );
      +
      +
      +
      +

      DESCRIPTION

      +       The  getcchar  function  gets  a wide-character string and
      +       rendition from a cchar_t argument.  When wch is not a null
      +       pointer, the getcchar function does the following:
      +
      +       -    Extracts information from a cchar_t value wcval
      +
      +       -    Stores  the  character  attributes  in  the  location
      +            pointed to by attrs
      +
      +       -    Stores the color-pair in the location pointed  to  by
      +            color_pair
      +
      +       -    Stores  the  wide-character string, characters refer-
      +            enced by wcval, into the array pointed to by wch.
      +
      +       When wch is a null pointer, the getcchar function does the
      +       following:
      +
      +       -    Obtains  the  number of wide characters pointed to by
      +            wcval
      +
      +       -    Does not change  the  data  referenced  by  attrs  or
      +            color_pair
      +
      +       The  setcchar function initializes the location pointed to
      +       by wcval by using:
      +
      +       -    The character attributes in attrs
      +
      +       -    The color pair in color_pair
      +
      +       -    The wide-character string pointed  to  by  wch.   The
      +            string  must be L'\0' terminated, contain at most one
      +            character with strictly positive width, which must be
      +            the  first,  and  contain  no  characters of negative
      +            width.
      +
      +
      +
      +

      NOTES

      +       The opts argument is reserved for future use.   Currently,
      +       an application must provide a null pointer as opts.
      +
      +       The  wcval  argument may be a value generated by a call to
      +       setcchar or by a function that has a cchar_t output  argu-
      +       ment.   If  wcval  is  constructed by any other means, the
      +       effect is unspecified.
      +
      +
      +
      +

      RETURN VALUES

      +       When wch is a null pointer, getcchar returns the number of
      +       wide  characters  referenced  by wcval, including the null
      +       terminator.
      +
      +       When wch is not a null pointer, getcchar returns  OK  upon
      +       successful completion, and ERR otherwise.
      +
      +       Upon  successful  completion, setcchar returns OK.  Other-
      +       wise, it returns ERR.
      +
      +
      +
      +

      SEE ALSO

      +       Functions:  curses(3x),  wcwidth(3x),   curs_attr_get(3x),
      +       can_change_color(3x).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_getch.3x.html b/doc/html/man/curs_getch.3x.html index 833b88e6..76b20e49 100644 --- a/doc/html/man/curs_getch.3x.html +++ b/doc/html/man/curs_getch.3x.html @@ -1,62 +1,101 @@ + + + +curs_getch 3x + + + +

      curs_getch 3x

      +
       
       
       

      NAME

      -       getch,  wgetch,  mvgetch, mvwgetch, ungetch, has_key - get
      -       (or push back) characters from curses terminal keyboard
      +       getch,  wgetch,  mvgetch, mvwgetch, ungetch, has_key - get
      +       (or push back) characters from curses terminal keyboard
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int getch(void);
      -       int wgetch(WINDOW *win);
      -       int mvgetch(int y, int x);
      -       int mvwgetch(WINDOW *win, int y, int x);
      -       int ungetch(int ch);
      -       int has_key(int ch);
      +       int getch(void);
      +       int wgetch(WINDOW *win);
      +       int mvgetch(int y, int x);
      +       int mvwgetch(WINDOW *win, int y, int x);
      +       int ungetch(int ch);
      +       int has_key(int ch);
       
       
       

      DESCRIPTION

      -       The getch, wgetch, mvgetch and mvwgetch, routines  read  a
      +       The getch, wgetch, mvgetch and mvwgetch, routines  read  a
              character  from the window.  In no-delay mode, if no input
      -       is waiting, the value ERR is returned.  In delay mode, the
      +       is waiting, the value ERR is returned.  In delay mode, the
              program  waits until the system passes text through to the
      -       program.  Depending on the  setting  of  cbreak,  this  is
      +       program.  Depending on the  setting  of  cbreak,  this  is
              after one character (cbreak mode), or after the first new-
              line (nocbreak mode).  In  half-delay  mode,  the  program
              waits  until a character is typed or the specified timeout
              has been reached.
       
      -       Unless noecho has been set, then the character  will  also
      +       Unless noecho has been set, then the character  will  also
              be echoed into the designated window according to the fol-
              lowing rules: If the character is the current erase  char-
              acter,  left  arrow, or backspace, the cursor is moved one
              space to the left and that screen position is erased as if
      -       delch  had  been  called.   If  the character value is any
      -       other KEY_ define, the user is alerted with a  beep  call.
      +       delch  had  been  called.   If  the character value is any
      +       other KEY_ define, the user is alerted with a  beep  call.
              Otherwise the character is simply output to the screen.
       
              If the window is not a pad, and it has been moved or modi-
      -       fied since the last call to  wrefresh,  wrefresh  will  be
      +       fied since the last call to  wrefresh,  wrefresh  will  be
              called before another character is read.
       
      -       If  keypad  is  TRUE,  and  a function key is pressed, the
      +       If  keypad  is  TRUE,  and  a function key is pressed, the
              token for that function key is returned instead of the raw
              characters.    Possible   function  keys  are  defined  in
      -       <curses.h> as macros with  values  outside  the  range  of
      -       8-bit  characters  whose  names  begin  with KEY_. Thus, a
      +       <curses.h> as macros with  values  outside  the  range  of
      +       8-bit  characters  whose  names  begin  with KEY_. Thus, a
              variable intended to hold the return value of  a  function
              key must be of short size or larger.
       
              When a character that could be the beginning of a function
              key is received (which,  on  modern  terminals,  means  an
      -       escape  character), curses sets a timer.  If the remainder
      +       escape  character), curses sets a timer.  If the remainder
              of the sequence does not come  in  within  the  designated
              time,  the  character  is  passed  through; otherwise, the
              function key value is returned.   For  this  reason,  many
      @@ -64,18 +103,18 @@
              presses the escape key and the escape is returned  to  the
              program.
       
      -       The ungetch routine places ch back onto the input queue to
      -       be returned by the next call to wgetch.  Note  that  there
      -       is, in effect, just one input queue for all windows.
      +       The ungetch routine places ch back onto the input queue to
      +       be returned by the next call to wgetch.  There is just one
      +       input queue for all windows.
       
       
      -   Function Keys
      -       The  following function keys, defined in <curses.h>, might
      -       be returned by getch if keypad  has  been  enabled.   Note
      +   Function Keys
      +       The  following function keys, defined in <curses.h>, might
      +       be returned by getch if keypad  has  been  enabled.   Note
              that  not  all  of  these are necessarily supported on any
              particular terminal.
       
      -           Name            Key name
      +           Name            Key name
       
                  KEY_BREAK       Break key
                  KEY_DOWN        The four arrow keys ...
      @@ -86,7 +125,7 @@
                  KEY_BACKSPACE   Backspace
                  KEY_F0          Function keys; space for 64  keys
                                  is reserved.
      -           KEY_F(n)        For 0 <= n <= 63
      +           KEY_F(n)        For 0 <= n <= 63
                  KEY_DL          Delete line
                  KEY_IL          Insert line
                  KEY_DC          Delete character
      @@ -176,22 +215,22 @@
              Keypad is arranged like this:
       
                                +-----+------+-------+
      -                         | A1  |  up  |  A3   |
      +                         | A1  |  up  |  A3   |
                                +-----+------+-------+
      -                         |left |  B2  | right |
      +                         |left |  B2  | right |
                                +-----+------+-------+
      -                         | C1  | down |  C3   |
      +                         | C1  | down |  C3   |
                                +-----+------+-------+
      -       The has_key routine takes a key value from the above list,
      -       and returns TRUE or FALSE according as the current  termi-
      -       nal type recognizes a key with that value.
      +       The has_key routine takes a key value from the above list,
      +       and returns TRUE or FALSE according to whether the current
      +       terminal type recognizes a key with that value.
       
       
       
       

      RETURN VALUE

      -       All  routines  return  the integer ERR upon failure and an
      -       integer value other than ERR (OK in the case of ungetch())
      +       All  routines  return  the integer ERR upon failure and an
      +       integer value other than ERR (OK in the case of ungetch())
              upon successful completion.
       
       
      @@ -202,70 +241,70 @@
              up to one second while the keypad code looks for a follow-
              ing function-key sequence.
       
      -       When using getch, wgetch, mvgetch, or  mvwgetch,  nocbreak
      -       mode (nocbreak) and echo mode (echo) should not be used at
      -       the same time.  Depending on the state of the  tty  driver
      -       when  each  character  is  typed,  the program may produce
      +       Note that some keys may be the same as commonly used  con-
      +       trol keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE
      +       versus control/H.  Some curses implementations may  differ
      +       according  to  whether  they treat these control keys spe-
      +       cially (and ignore the terminfo), or use the terminfo def-
      +       initions.   Ncurses  uses  the terminfo definition.  If it
      +       says that  KEY_ENTER  is  control/M,  getch,  will  return
      +       KEY_ENTER when you press control/M.
      +
      +       When  using  getch, wgetch, mvgetch, or mvwgetch, nocbreak
      +       mode (nocbreak) and echo mode (echo) should not be used at
      +       the  same  time.  Depending on the state of the tty driver
      +       when each character is  typed,  the  program  may  produce
              undesirable results.
       
      -       Note that getch, mvgetch, and mvwgetch may be macros.
      +       Note that getch, mvgetch, and mvwgetch may be macros.
       
              Historically, the set of keypad macros was largely defined
      -       by  the  extremely  function-key-rich keyboard of the AT&T
      -       7300, aka 3B1, aka Safari 4.   Modern  personal  computers
      -       usually  have  only a small subset of these.  IBM PC-style
      -       consoles  typically  support  little  more  than   KEY_UP,
      -       KEY_DOWN,    KEY_LEFT,   KEY_RIGHT,   KEY_HOME,   KEY_END,
      -       KEY_NPAGE, KEY_PPAGE, and function keys 1 through 12.  The
      -       Ins key is usually mapped to KEY_IC.
      +       by the extremely function-key-rich keyboard  of  the  AT&T
      +       7300,  aka  3B1,  aka Safari 4.  Modern personal computers
      +       usually have only a small subset of these.   IBM  PC-style
      +       consoles   typically  support  little  more  than  KEY_UP,
      +       KEY_DOWN,   KEY_LEFT,   KEY_RIGHT,   KEY_HOME,    KEY_END,
      +       KEY_NPAGE, KEY_PPAGE, and function keys 1 through 12.  The
      +       Ins key is usually mapped to KEY_IC.
       
       
       

      PORTABILITY

      -       The  *get* functions are described in the XSI Curses stan-
      -       dard, Issue 4.  They  read  single-byte  characters  only.
      -       The  standard  specifies  that they return ERR on failure,
      +       The *get* functions are described in the XSI Curses  stan-
      +       dard,  Issue  4.   They  read single-byte characters only.
      +       The standard specifies that they return  ERR  on  failure,
              but specifies no error conditions.
       
      -       The echo behavior of these functions on input of  KEY_  or
      -       backspace  characters  was not specified in the SVr4 docu-
      -       mentation.  This  description  is  adopted  from  the  XSI
      +       The  echo  behavior of these functions on input of KEY_ or
      +       backspace characters was not specified in the  SVr4  docu-
      +       mentation.   This  description  is  adopted  from  the XSI
              Curses standard.
       
      -       The  behavior of getch and friends in the presence of han-
      -       dled signals is unspecified in the  SVr4  and  XSI  Curses
      -       documentation.   Under  historical curses implementations,
      -       it varied depending  on  whether  the  operating  system's
      -       implementation  of  handled  signal  receipt  interrupts a
      -       read(2) call in progress or not, and also (in some  imple-
      -       mentations)  depending on whether an input timeout or non-
      +       The behavior of getch and friends in the presence of  han-
      +       dled  signals  is  unspecified  in the SVr4 and XSI Curses
      +       documentation.  Under historical  curses  implementations,
      +       it  varied  depending  on  whether  the operating system's
      +       implementation of  handled  signal  receipt  interrupts  a
      +       read(2)  call in progress or not, and also (in some imple-
      +       mentations) depending on whether an input timeout or  non-
              blocking mode hsd been set.
       
              Programmers concerned about portability should be prepared
      -       for  either  of  two  cases:  (a)  signal receipt does not
      -       interrupt getch; (b) signal receipt interrupts  getch  and
      -       causes  it  to  return ERR with errno set to EINTR.  Under
      -       the ncurses implementation, handled signals  never  inter-
      -       rupt getch.
      +       for either of two  cases:  (a)  signal  receipt  does  not
      +       interrupt  getch;  (b) signal receipt interrupts getch and
      +       causes it to return ERR with errno set  to  EINTR.   Under
      +       the  ncurses  implementation, handled signals never inter-
      +       rupt getch.
       
      -       The  has_key  function is unique to ncurses.  We recommend
      -       that  any  code  using  it  be  conditionalized   on   the
      -       NCURSES_VERSION feature macro.
      +       The has_key function is unique to ncurses.   We  recommend
      +       that   any   code  using  it  be  conditionalized  on  the
      +       NCURSES_VERSION feature macro.
       
       
       

      SEE ALSO

      -       curses(3x),        curs_inopts(3x),        curs_mouse(3x),
      -       curs_move(3x), curs_refresh(3x).  resizeterm(3x).
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x),        curs_inopts(3x),        curs_mouse(3x),
      +       curs_move(3x), curs_refresh(3x).  resizeterm(3x).
       
       
       
      diff --git a/doc/html/man/curs_getstr.3x.html b/doc/html/man/curs_getstr.3x.html
      index 19c8ce16..029ce0c3 100644
      --- a/doc/html/man/curs_getstr.3x.html
      +++ b/doc/html/man/curs_getstr.3x.html
      @@ -1,92 +1,130 @@
      +
      +
       
      +
      +curs_getstr 3x
      +
      +
      +
       
      +

      curs_getstr 3x

      +
       
       
       

      NAME

      -       getstr,  getnstr,  wgetstr, wgetnstr, mvgetstr, mvgetnstr,
      -       mvwgetstr, mvwgetnstr  -  accept  character  strings  from
      -       curses terminal keyboard
      +       getstr,  getnstr,  wgetstr, wgetnstr, mvgetstr, mvgetnstr,
      +       mvwgetstr, mvwgetnstr  -  accept  character  strings  from
      +       curses terminal keyboard
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int getstr(char *str);
      -       int getnstr(char *str, int n);
      -       int wgetstr(WINDOW *win, char *str);
      -       int wgetnstr(WINDOW *win, char *str, int n);
      -       int mvgetstr(int y, int x, char *str);
      -       int mvwgetstr(WINDOW *win, int y, int x, char *str);
      -       int mvgetnstr(int y, int x, char *str, int n);
      -       int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
      +       int getstr(char *str);
      +       int getnstr(char *str, int n);
      +       int wgetstr(WINDOW *win, char *str);
      +       int wgetnstr(WINDOW *win, char *str, int n);
      +       int mvgetstr(int y, int x, char *str);
      +       int mvwgetstr(WINDOW *win, int y, int x, char *str);
      +       int mvgetnstr(int y, int x, char *str, int n);
      +       int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
       
       
       

      DESCRIPTION

      -       The  function getstr is equivalent to a series of calls to
      -       getch, until a newline or carriage return is received (the
      +       The  function getstr is equivalent to a series of calls to
      +       getch, until a newline or carriage return is received (the
              terminating  character  is  not  included  in the returned
              string).  The  resulting  value  is  placed  in  the  area
      -       pointed to by the character pointer str.
      +       pointed to by the character pointer str.
       
      -       wgetnstr  reads  at  most  n characters, thus preventing a
      +       wgetnstr  reads  at  most  n characters, thus preventing a
              possible overflow of the input  buffer.   Any  attempt  to
              enter  more characters (other than the terminating newline
              or carriage return) causes a  beep.   Function  keys  also
      -       cause  a beep and are ignored.  The getnstr function reads
      -       from the stdscr default window.
      +       cause  a beep and are ignored.  The getnstr function reads
      +       from the stdscr default window.
       
              The user's erase and kill characters are interpreted.   If
      -       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
      -       KEY_BACKSPACE are both considered equivalent to the user's
      +       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
      +       KEY_BACKSPACE are both considered equivalent to the user's
              kill character.
       
      -       Characters  input are echoed only if echo is currently on.
      +       Characters  input are echoed only if echo is currently on.
              In that case, backspace is echoed as deletion of the  pre-
              vious character (typically a left motion).
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon failure and an OK
      -       (SVr4 specifies only "an integer value  other  than  ERR")
      +       All routines return the integer ERR upon failure and an OK
      +       (SVr4 specifies only "an integer value  other  than  ERR")
              upon successful completion.
       
       
       

      NOTES

      -       Note that getstr, mvgetstr, and mvwgetstr may be macros.
      +       Note that getstr, mvgetstr, and mvwgetstr may be macros.
       
       
       

      PORTABILITY

              These  functions are described in the XSI Curses standard,
              Issue 4.  They  read  single-byte  characters  only.   The
      -       standard  specifies  that  they return ERR on failure, but
      -       the  single  error  condition  EOVERFLOW  associated  with
      -       extended-level  conformance  is  not yet returned (the XSI
      -       curses support for multi-byte characters is not  yet  pre-
      -       sent).
      -
      +       standard  does  not  define  any  error  conditions.  This
      +       implementation returns ERR if the window pointer is  null,
      +       or if the lower-level wgetch call returns an ERR.
              SVr3  and early SVr4 curses implementations did not reject
              function keys; the SVr4.0 documentation claimed that "spe-
              cial  keys"  (such  as  function keys, "home" key, "clear"
      -       key, etc.) are interpreted" without  giving  details.   It
      +       key, etc.) are interpreted" without  giving  details.   It
              lied.   In  fact,  the  `character'  value appended to the
              string by those implementations was  predictable  but  not
              useful  (being,  in  fact, the low-order eight bits of the
              key's KEY_ value).
       
      -       The functions getnstr, mvgetnstr, and mvwgetnstr were pre-
      +       The functions getnstr, mvgetnstr, and mvwgetnstr were pre-
              sent but not documented in SVr4.
       
       
       

      SEE ALSO

      -       curses(3x), curs_getch(3x).
      +       curses(3x), curs_getch(3x).
      +
      +
      +
       
       
       
      diff --git a/doc/html/man/curs_getyx.3x.html b/doc/html/man/curs_getyx.3x.html
      index 562d7106..d6db1a8b 100644
      --- a/doc/html/man/curs_getyx.3x.html
      +++ b/doc/html/man/curs_getyx.3x.html
      @@ -1,65 +1,103 @@
      +
      +
       
      +
      +curs_getyx 3x
      +
      +
      +
       
      +

      curs_getyx 3x

      +
       
       
       

      NAME

      -       getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
      +       getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
              and window coordinates
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       void getyx(WINDOW *win, int y, int x);
      -       void getparyx(WINDOW *win, int y, int x);
      -       void getbegyx(WINDOW *win, int y, int x);
      -       void getmaxyx(WINDOW *win, int y, int x);
      +       void getyx(WINDOW *win, int y, int x);
      +       void getparyx(WINDOW *win, int y, int x);
      +       void getbegyx(WINDOW *win, int y, int x);
      +       void getmaxyx(WINDOW *win, int y, int x);
       
       
       

      DESCRIPTION

      -       The getyx macro places the current cursor position of  the
      -       given window in the two integer variables y and x.
      +       The getyx macro places the current cursor position of  the
      +       given window in the two integer variables y and x.
       
      -       If  win  is  a  subwindow,  the  getparyx macro places the
      +       If  win  is  a  subwindow,  the  getparyx macro places the
              beginning coordinates of the  subwindow  relative  to  the
      -       parent  window into two integer variables y and x.  Other-
      -       wise, -1 is placed into y and x.
      +       parent  window into two integer variables y and x.  Other-
      +       wise, -1 is placed into y and x.
       
      -       Like getyx, the getbegyx and  getmaxyx  macros  store  the
      +       Like getyx, the getbegyx and  getmaxyx  macros  store  the
              current  beginning  coordinates  and size of the specified
              window.
       
       
       

      RETURN VALUE

      -       The return values of these  macros  are  undefined  (i.e.,
      +       The return values of these  macros  are  undefined  (i.e.,
              they  should not be used as the right-hand side of assign-
              ment statements).
       
       
       

      NOTES

      -       All of these interfaces are macros and  that  "&"  is  not
      -       necessary before the variables y and x.
      +       All of these interfaces are macros.  A "&" is  not  neces-
      +       sary before the variables y and x.
       
       
       

      PORTABILITY

      -       These  functions are described in the XSI Curses standard,
      -       Issue 4.
      +       The  getyx,  getparyx, getbegyx and getmaxyx functions are
      +       described in the XSI Curses standard, Issue 4.
      +
      +       This  implementation  also  provides   getbegx,   getbegy,
      +       getcurx,  getcury,  getmaxx,  getmaxy, getparx and getpary
      +       for compatibility with older versions of curses.
       
       
       

      SEE ALSO

      -       curses(3x)
      -
      -
      -
      -
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/curs_in_wch.3x.html b/doc/html/man/curs_in_wch.3x.html
      new file mode 100644
      index 00000000..5aa287e5
      --- /dev/null
      +++ b/doc/html/man/curs_in_wch.3x.html
      @@ -0,0 +1,118 @@
      +
      +
      +
      +
      +curs_in_wch 3x
      +
      +
      +
      +
      +

      curs_in_wch 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       in_wch,  mvin_wch,  mvwin_wch, win_wch - extract a complex
      +       character and rendition from a window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int in_wch(cchar_t *wcval);
      +       int mvin_wch(int y, int x, cchar_t *wcval);
      +       int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
      +       int win_wch(WINDOW *win, cchar_t *wcval);
      +
      +
      +
      +

      DESCRIPTION

      +       These functions extract the complex character  and  rendi-
      +       tion  from  the  current position in the named window into
      +       the cchar_t object referenced by wcval.
      +
      +
      +
      +

      RETURN VALUE

      +       No errors are defined in the XSI  Curses  standard.   This
      +       implementation  checks  for  null pointers, returns ERR in
      +       that case.  Also, the mv routines check for  error  moving
      +       the  cursor,  returning  ERR in that case.  Otherwise they
      +       return OK
      +
      +
      +
      +

      NOTES

      +       Note that all of these routines may be macros.
      +
      +
      +
      +

      PORTABILITY

      +       These functions are described in the XSI Curses  standard,
      +       Issue 4.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x), curs_inch(3x).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_in_wchstr.3x.html b/doc/html/man/curs_in_wchstr.3x.html new file mode 100644 index 00000000..0277eb47 --- /dev/null +++ b/doc/html/man/curs_in_wchstr.3x.html @@ -0,0 +1,118 @@ + + + + +curs_in_wchstr 3x + + + + +

      curs_in_wchstr 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       in_wchstr,  in_wchnstr, win_wchstr, win_wchnstr, mvin_wch-
      +       str, mvin_wchnstr, mvwin_wchstr, mvwin_wchnstr  -  get  an
      +       array  of  complex characters and renditions from a curses
      +       window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int in_wchstr(cchar_t *wchstr);
      +       int in_wchnstr(cchar_t *wchstr, int n);
      +       int win_wchstr(WINDOW *win, cchar_t *wchstr);
      +       int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n);
      +       int mvin_wchstr(int y, int x, cchar_t *wchstr);
      +       int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n);
      +       int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr);
      +       int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       These functions return an array of complex  characters  in
      +       wchstr,  starting  at  the  current cursor position in the
      +       named window.  Attributes (rendition) are stored with  the
      +       characters.
      +
      +       The  in_wchnstr, mvin_wchnstr, mvwin_wchnstr and win_wchn-
      +       str fill the array with at most n cchar_t elements.
      +
      +
      +
      +

      NOTES

      +       Note that all routines except win_wchnstr may be macros.
      +
      +       Reading a line that overflows the array pointed to by wch-
      +       str  with in_wchstr, mvin_wchstr, mvwin_wchstr or win_wch-
      +       str  causes  undefined  results.  Therefore,  the  use  of
      +       in_wchnstr, mvin_wchnstr, mvwin_wchnstr, or win_wchnstr is
      +       recommended.
      +
      +
      +
      +

      RETURN VALUES

      +       Upon successful completion,  these  functions  return  OK.
      +       Otherwise, they return ERR.
      +
      +
      +
      +

      PORTABILITY

      +       The  XSI  Curses defines no error conditions.  This imple-
      +       mentation checks for null pointers, returning ERR in  that
      +       case.
      +
      +
      +
      +

      SEE ALSO

      +       Functions:   curses(3x),  curs_in_wch(3x)  curs_instr(3x),
      +       curs_inwstr(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_inch.3x.html b/doc/html/man/curs_inch.3x.html index 2c4b22a5..b3f1485d 100644 --- a/doc/html/man/curs_inch.3x.html +++ b/doc/html/man/curs_inch.3x.html @@ -1,41 +1,80 @@ + + + +curs_inch 3x + + + +

      curs_inch 3x

      +
       
       
       

      NAME

      -       inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
      -       attributes from a curses window
      +       inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
      +       attributes from a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       chtype inch(void);
      -       chtype winch(WINDOW *win);
      -       chtype mvinch(int y, int x);
      -       chtype mvwinch(WINDOW *win, int y, int x);
      +       chtype inch(void);
      +       chtype winch(WINDOW *win);
      +       chtype mvinch(int y, int x);
      +       chtype mvwinch(WINDOW *win, int y, int x);
       
       
       

      DESCRIPTION

      -       These routines return the character, of  type  chtype,  at
      +       These routines return the character, of  type  chtype,  at
              the   current  position  in  the  named  window.   If  any
              attributes are set for that  position,  their  values  are
              OR'ed  into  the  value  returned.   Constants  defined in
      -       <curses.h> can be used with the & (logical  AND)  operator
      +       <curses.h> can be used with the & (logical  AND)  operator
              to extract the character or attributes alone.
       
       
      -   Attributes
      +   Attributes
              The  following  bit-masks  may  be  AND-ed with characters
      -       returned by winch.
      +       returned by winch.
       
      -       A_CHARTEXT     Bit-mask to extract character
      -       A_ATTRIBUTES   Bit-mask to extract attributes
      -       A_COLOR        Bit-mask to extract color-pair field information
      +       A_CHARTEXT     Bit-mask to extract character
      +       A_ATTRIBUTES   Bit-mask to extract attributes
      +       A_COLOR        Bit-mask to extract color-pair field information
       
       
       
      @@ -51,7 +90,7 @@

      SEE ALSO

      -       curses(3x).
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_inchstr.3x.html b/doc/html/man/curs_inchstr.3x.html
      index 5688c02a..cdf33a2a 100644
      --- a/doc/html/man/curs_inchstr.3x.html
      +++ b/doc/html/man/curs_inchstr.3x.html
      @@ -1,54 +1,92 @@
      +
      +
       
      +
      +curs_inchstr 3x
      +
      +
      +
       
      +

      curs_inchstr 3x

      +
       
       
       

      NAME

      -       inchstr,   inchnstr,   winchstr,   winchnstr,   mvinchstr,
      -       mvinchnstr, mvwinchstr, mvwinchnstr  -  get  a  string  of
      -       characters (and attributes) from a curses window
      +       inchstr,   inchnstr,   winchstr,   winchnstr,   mvinchstr,
      +       mvinchnstr, mvwinchstr, mvwinchnstr  -  get  a  string  of
      +       characters (and attributes) from a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int inchstr(chtype *chstr);
      -       int inchnstr(chtype *chstr, int n);
      -       int winchstr(WINDOW *win, chtype *chstr);
      -       int winchnstr(WINDOW *win, chtype *chstr, int n);
      -       int mvinchstr(int y, int x, chtype *chstr);
      -       int mvinchnstr(int y, int x, chtype *chstr, int n);
      -       int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
      -       int  mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr,
      -       int n);
      +       int inchstr(chtype *chstr);
      +       int inchnstr(chtype *chstr, int n);
      +       int winchstr(WINDOW *win, chtype *chstr);
      +       int winchnstr(WINDOW *win, chtype *chstr, int n);
      +       int mvinchstr(int y, int x, chtype *chstr);
      +       int mvinchnstr(int y, int x, chtype *chstr, int n);
      +       int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
      +       int  mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr,
      +       int n);
       
       
       

      DESCRIPTION

      -       These routines return a NULL-terminated  array  of  chtype
      +       These routines return a NULL-terminated  array  of  chtype
              quantities, starting at the current cursor position in the
              named window and ending at the right margin of the window.
      -       The  four  functions with n as the last argument, return a
      -       leading substring at most n characters long (exclusive  of
      -       the  trailing (chtype)0).  Constants defined in <curses.h>
      -       can be used with the & (logical AND) operator  to  extract
      +       The  four  functions with n as the last argument, return a
      +       leading substring at most n characters long (exclusive  of
      +       the  trailing (chtype)0).  Constants defined in <curses.h>
      +       can be used with the & (logical AND) operator  to  extract
              the  character or the attribute alone from any position in
      -       the chstr [see curs_inch(3x)].
      +       the chstr [see curs_inch(3x)].
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon  failure  and  an
      -       integer  value  other  than ERR upon successful completion
      +       All routines return the integer ERR upon  failure  and  an
      +       integer  value  other  than ERR upon successful completion
              (the number of  characters  retrieved,  exclusive  of  the
              trailing 0).
       
       
       

      NOTES

      -       Note  that  all  routines  except winchnstr may be macros.
      +       Note  that  all  routines  except winchnstr may be macros.
              SVr4 does not document whether the result string is 0-ter-
              minated; it does not document whether a length limit argu-
              ment includes any trailing 0; and it does not document the
      @@ -60,12 +98,12 @@
              These  functions are described in the XSI Curses standard,
              Issue 4.  It is no more specific than the SVr4  documenta-
              tion on the trailing 0.  It does specify that the success-
      -       ful return of the functions is OK.
      +       ful return of the functions is OK.
       
       
       

      SEE ALSO

      -       curses(3x), curs_inch(3x).
      +       curses(3x), curs_inch(3x).
       
       
       
      diff --git a/doc/html/man/curs_initscr.3x.html b/doc/html/man/curs_initscr.3x.html
      index 81be73b9..74f72009 100644
      --- a/doc/html/man/curs_initscr.3x.html
      +++ b/doc/html/man/curs_initscr.3x.html
      @@ -1,113 +1,151 @@
      +
      +
       
      +
      +curs_initscr 3x
      +
      +
      +
       
      +

      curs_initscr 3x

      +
       
       
       

      NAME

      -       initscr,  newterm, endwin, isendwin, set_term, delscreen -
      -       curses screen initialization and manipulation routines
      +       initscr,  newterm, endwin, isendwin, set_term, delscreen -
      +       curses screen initialization and manipulation routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       WINDOW *initscr(void);
      -       int endwin(void);
      -       bool isendwin(void);
      -       SCREEN  *newterm(const  char  *type,  FILE  *outfd,   FILE
      -       *infd);
      -       SCREEN *set_term(SCREEN *new);
      -       void delscreen(SCREEN* sp);
      +       WINDOW *initscr(void);
      +       int endwin(void);
      +       bool isendwin(void);
      +       SCREEN *newterm(char *type, FILE *outfd, FILE *infd);
      +       SCREEN *set_term(SCREEN *new);
      +       void delscreen(SCREEN* sp);
       
       
       

      DESCRIPTION

      -       initscr  is normally the first curses routine to call when
      -       initializing a program.  A few special routines  sometimes
      -       need  to  be called before it; these are slk_init, filter,
      -       ripoffline, use_env.  For multiple-terminal  applications,
      -       newterm may be called before initscr.
      +       initscr is normally the first curses routine to call  when
      +       initializing  a program.  A few special routines sometimes
      +       need to be called before it; these are  slk_init,  filter,
      +       ripoffline,  use_env.  For multiple-terminal applications,
      +       newterm may be called before initscr.
       
              The initscr code determines the terminal type and initial-
      -       izes all curses data structures.  initscr also causes  the
      -       first  call  to  refresh  to  clear the screen.  If errors
      -       occur, initscr writes  an  appropriate  error  message  to
      +       izes  all curses data structures.  initscr also causes the
      +       first call to refresh to  clear  the  screen.   If  errors
      +       occur,  initscr  writes  an  appropriate  error message to
              standard error and exits; otherwise, a pointer is returned
      -       to stdscr.
      +       to stdscr.
       
      -       A program that outputs to more than  one  terminal  should
      -       use  the  newterm  routine  for  each  terminal instead of
      -       initscr.  A program that needs to inspect capabilities, so
      +       A  program  that  outputs to more than one terminal should
      +       use the newterm  routine  for  each  terminal  instead  of
      +       initscr.  A program that needs to inspect capabilities, so
              it can continue to run in a line-oriented mode if the ter-
              minal cannot support a screen-oriented program, would also
      -       use  newterm.   The  routine newterm should be called once
      -       for each terminal.  It returns a variable of type SCREEN *
      -       which  should  be  saved  as a reference to that terminal.
      -       The arguments are the type of the terminal to be  used  in
      -       place of $TERM, a file pointer for output to the terminal,
      -       and another file pointer for input from the  terminal  (if
      -       type  is NULL, $TERM will be used).  The program must also
      -       call endwin for each terminal being  used  before  exiting
      -       from  curses.  If newterm is called more than once for the
      -       same terminal, the first terminal referred to must be  the
      -       last one for which endwin is called.
      -
      -       A  program  should  always  call  endwin before exiting or
      -       escaping  from  curses  mode  temporarily.   This  routine
      -       restores  tty  modes,  moves the cursor to the lower left-
      +       use newterm.  The routine newterm should  be  called  once
      +       for each terminal.  It returns a variable of type SCREEN *
      +       which should be saved as a  reference  to  that  terminal.
      +       The  arguments  are the type of the terminal to be used in
      +       place of $TERM, a file pointer for output to the terminal,
      +       and  another  file pointer for input from the terminal (if
      +       type is NULL, $TERM will be used).  The program must  also
      +       call  endwin  for  each terminal being used before exiting
      +       from curses.  If newterm is called more than once for  the
      +       same  terminal, the first terminal referred to must be the
      +       last one for which endwin is called.
      +
      +       A program should always  call  endwin  before  exiting  or
      +       escaping  from  curses  mode  temporarily.   This  routine
      +       restores tty modes, moves the cursor to  the  lower  left-
              hand corner of the screen and resets the terminal into the
      -       proper non-visual mode.  Calling refresh or doupdate after
      -       a temporary escape causes the  program  to  resume  visual
      +       proper non-visual mode.  Calling refresh or doupdate after
      +       a  temporary  escape  causes  the program to resume visual
              mode.
       
      -       The  isendwin  routine  returns  TRUE  if  endwin has been
      -       called without any subsequent calls to wrefresh, and FALSE
      +       The isendwin routine  returns  TRUE  if  endwin  has  been
      +       called without any subsequent calls to wrefresh, and FALSE
              otherwise.
       
      -       The  set_term  routine is used to switch between different
      -       terminals.  The screen reference new becomes the new  cur-
      -       rent  terminal.   The previous terminal is returned by the
      -       routine.  This  is  the  only  routine  which  manipulates
      -       SCREEN  pointers;  all other routines affect only the cur-
      +       The set_term routine is used to switch  between  different
      +       terminals.   The screen reference new becomes the new cur-
      +       rent terminal.  The previous terminal is returned  by  the
      +       routine.   This  is  the  only  routine  which manipulates
      +       SCREEN pointers; all other routines affect only  the  cur-
              rent terminal.
       
      -       The delscreen routine frees storage  associated  with  the
      -       SCREEN  data  structure.   The  endwin routine does not do
      -       this, so delscreen should be called after endwin if a par-
      -       ticular SCREEN is no longer needed.
      +       The  delscreen  routine  frees storage associated with the
      +       SCREEN data structure.  The endwin  routine  does  not  do
      +       this, so delscreen should be called after endwin if a par-
      +       ticular SCREEN is no longer needed.
       
       
       

      RETURN VALUE

      -       endwin  returns  the  integer ERR upon failure and OK upon
      +       endwin returns the integer ERR upon failure  and  OK  upon
              successful completion.
       
      -       Routines that return pointers always return NULL on error.
      +       Routines that return pointers always return NULL on error.
       
       
       

      NOTES

      -       Note that initscr and newterm may be macros.
      +       Note that initscr and newterm may be macros.
       
       
       

      PORTABILITY

      -       These  functions are described in the XSI Curses standard,
      +       These functions are described in the XSI Curses  standard,
              Issue 4.  It specifies that portable applications must not
      -       call initscr more than once.
      +       call initscr more than once.
       
              Old versions of curses, e.g., BSD 4.4, may have returned a
      -       null pointer from  initscr  when  an  error  is  detected,
      -       rather  than  exiting.   It is safe but redundant to check
      -       the return value of initscr in XSI Curses.
      +       null  pointer  from  initscr  when  an  error is detected,
      +       rather than exiting.  It is safe but  redundant  to  check
      +       the return value of initscr in XSI Curses.
       
       
       

      SEE ALSO

      -       curses(3x),       curs_kernel(3x),       curs_refresh(3x),
      -       curs_slk(3x), curs_util(3x)
      +       curses(3x),       curs_kernel(3x),       curs_refresh(3x),
      +       curs_slk(3x), curs_util(3x)
      +
       
       
       
      diff --git a/doc/html/man/curs_inopts.3x.html b/doc/html/man/curs_inopts.3x.html
      index 13ec59ce..9e8ce06e 100644
      --- a/doc/html/man/curs_inopts.3x.html
      +++ b/doc/html/man/curs_inopts.3x.html
      @@ -1,166 +1,204 @@
      +
      +
       
      +
      +curs_inopts 3x
      +
      +
      +
       
      +

      curs_inopts 3x

      +
       
       
       

      NAME

      -       cbreak, nocbreak, echo, noecho, halfdelay, intrflush, key-
      -       pad, meta,  nodelay,  notimeout,  raw,  noraw,  noqiflush,
      -       qiflush,  timeout,  wtimeout,  typeahead  -  curses  input
      +       cbreak, nocbreak, echo, noecho, halfdelay, intrflush, key-
      +       pad, meta,  nodelay,  notimeout,  raw,  noraw,  noqiflush,
      +       qiflush,  timeout,  wtimeout,  typeahead  -  curses  input
              options
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -
      -       int cbreak(void);
      -       int nocbreak(void);
      -       int echo(void);
      -       int noecho(void);
      -       int halfdelay(int tenths);
      -       int intrflush(WINDOW *win, bool bf);
      -       int keypad(WINDOW *win, bool bf);
      -       int meta(WINDOW *win, bool bf);
      -       int nodelay(WINDOW *win, bool bf);
      -       int raw(void);
      -       int noraw(void);
      -       void noqiflush(void);
      -       void qiflush(void);
      -       int notimeout(WINDOW *win, bool bf);
      -       void timeout(int delay);
      -       void wtimeout(WINDOW *win, int delay);
      -       int typeahead(int fd);
      +       #include <curses.h>
      +
      +       int cbreak(void);
      +       int nocbreak(void);
      +       int echo(void);
      +       int noecho(void);
      +       int halfdelay(int tenths);
      +       int intrflush(WINDOW *win, bool bf);
      +       int keypad(WINDOW *win, bool bf);
      +       int meta(WINDOW *win, bool bf);
      +       int nodelay(WINDOW *win, bool bf);
      +       int raw(void);
      +       int noraw(void);
      +       void noqiflush(void);
      +       void qiflush(void);
      +       int notimeout(WINDOW *win, bool bf);
      +       void timeout(int delay);
      +       void wtimeout(WINDOW *win, int delay);
      +       int typeahead(int fd);
       
       
       

      DESCRIPTION

              Normally, the tty driver buffers typed characters until  a
      -       newline  or  carriage return is typed.  The cbreak routine
      +       newline  or  carriage return is typed.  The cbreak routine
              disables line buffering and erase/kill  character-process-
              ing  (interrupt  and  flow  control  characters  are unaf-
              fected), making characters typed by the  user  immediately
      -       available  to  the  program.  The nocbreak routine returns
      +       available  to  the  program.  The nocbreak routine returns
              the terminal to normal (cooked) mode.
       
      -       Initially the terminal may or may not be in  cbreak  mode,
      +       Initially the terminal may or may not be in  cbreak  mode,
              as the mode is inherited; therefore, a program should call
      -       cbreak or nocbreak explicitly.  Most interactive  programs
      -       using  curses set the cbreak mode.  Note that cbreak over-
      -       rides raw.  [See curs_getch(3x) for a  discussion  of  how
      -       these routines interact with echo and noecho.]
      +       cbreak or nocbreak explicitly.  Most interactive  programs
      +       using  curses set the cbreak mode.  Note that cbreak over-
      +       rides raw.  [See curs_getch(3x) for a  discussion  of  how
      +       these routines interact with echo and noecho.]
       
      -       The  echo  and  noecho routines control whether characters
      -       typed by the user are echoed by getch as they  are  typed.
      +       The  echo  and  noecho routines control whether characters
      +       typed by the user are echoed by getch as they  are  typed.
              Echoing  by  the  tty  driver is always disabled, but ini-
      -       tially getch is in echo  mode,  so  characters  typed  are
      +       tially getch is in echo  mode,  so  characters  typed  are
              echoed.  Authors of most interactive programs prefer to do
              their own echoing in a controlled area of the  screen,  or
              not  to  echo  at  all, so they disable echoing by calling
      -       noecho.  [See curs_getch(3x) for a discussion of how these
      -       routines interact with cbreak and nocbreak.]
      +       noecho.  [See curs_getch(3x) for a discussion of how these
      +       routines interact with cbreak and nocbreak.]
       
      -       The  halfdelay  routine is used for half-delay mode, which
      -       is similar to cbreak mode in that characters typed by  the
      +       The  halfdelay  routine is used for half-delay mode, which
      +       is similar to cbreak mode in that characters typed by  the
              user  are  immediately available to the program.  However,
      -       after blocking  for  tenths  tenths  of  seconds,  ERR  is
      -       returned  if  nothing has been typed.  The value of tenths
      -       must be a number between 1 and 255.  Use nocbreak to leave
      +       after blocking  for  tenths  tenths  of  seconds,  ERR  is
      +       returned  if  nothing has been typed.  The value of tenths
      +       must be a number between 1 and 255.  Use nocbreak to leave
              half-delay mode.
       
      -       If  the intrflush option is enabled, (bf is TRUE), when an
      +       If  the intrflush option is enabled, (bf is TRUE), when an
              interrupt key  is  pressed  on  the  keyboard  (interrupt,
              break,  quit)  all  output in the tty driver queue will be
              flushed, giving the  effect  of  faster  response  to  the
      -       interrupt,  but  causing  curses to have the wrong idea of
      -       what is on the  screen.   Disabling  (bf  is  FALSE),  the
      +       interrupt,  but  causing  curses to have the wrong idea of
      +       what is on the  screen.   Disabling  (bf  is  FALSE),  the
              option  prevents the flush.  The default for the option is
              inherited from the tty driver settings.  The window  argu-
              ment is ignored.
       
      -       The  keypad option enables the keypad of the user's termi-
      -       nal.  If enabled (bf is TRUE), the user can press a  func-
      -       tion  key (such as an arrow key) and wgetch returns a sin-
      -       gle value representing the function key, as  in  KEY_LEFT.
      -       If  disabled (bf is FALSE), curses does not treat function
      +       The  keypad option enables the keypad of the user's termi-
      +       nal.  If enabled (bf is TRUE), the user can press a  func-
      +       tion  key (such as an arrow key) and wgetch returns a sin-
      +       gle value representing the function key, as  in  KEY_LEFT.
      +       If  disabled (bf is FALSE), curses does not treat function
              keys specially and the program has to interpret the escape
              sequences  itself.   If  the keypad in the terminal can be
              turned on  (made  to  transmit)  and  off  (made  to  work
              locally),  turning on this option causes the terminal key-
      -       pad to be turned on when wgetch is  called.   The  default
      +       pad to be turned on when wgetch is  called.   The  default
              value for keypad is false.
       
              Initially, whether the terminal returns 7 or 8 significant
              bits on input depends on  the  control  mode  of  the  tty
      -       driver  [see  termio(7)].  To force 8 bits to be returned,
      -       invoke meta(win, TRUE); this is equivalent,  under  POSIX,
      +       driver  [see  termio(7)].  To force 8 bits to be returned,
      +       invoke meta(win, TRUE); this is equivalent,  under  POSIX,
              to  setting the CS8 flag on the terminal.  To force 7 bits
      -       to be returned, invoke meta(win, FALSE); this  is  equiva-
      -       lent,  under  POSIX, to setting the CS8 flag on the termi-
      -       nal.  The window argument, win, is always ignored.  If the
      -       terminfo capabilities smm (meta_on) and rmm (meta_off) are
      -       defined for the terminal, smm is sent to the terminal when
      -       meta(win,  TRUE)  is called and rmm is sent when meta(win,
      -       FALSE) is called.
      -
      -       The nodelay option causes getch to be a non-blocking call.
      -       If  no input is ready, getch returns ERR.  If disabled (bf
      -       is FALSE), getch waits until a key is pressed.
      -
      -       While interpreting an input escape sequence, wgetch sets a
      -       timer  while  waiting  for the next character.  If notime-
      -       out(win, TRUE) is called,  then  wgetch  does  not  set  a
      +       to be returned, invoke meta(win, FALSE); this  is  equiva-
      +       lent,  under  POSIX, to setting the CS7 flag on the termi-
      +       nal.  The window argument, win, is always ignored.  If the
      +       terminfo capabilities smm (meta_on) and rmm (meta_off) are
      +       defined for the terminal, smm is sent to the terminal when
      +       meta(win,  TRUE)  is called and rmm is sent when meta(win,
      +       FALSE) is called.
      +
      +       The nodelay option causes getch to be a non-blocking call.
      +       If  no input is ready, getch returns ERR.  If disabled (bf
      +       is FALSE), getch waits until a key is pressed.
      +
      +       While interpreting an input escape sequence, wgetch sets a
      +       timer  while  waiting  for the next character.  If notime-
      +       out(win, TRUE) is called,  then  wgetch  does  not  set  a
              timer.   The  purpose  of  the timeout is to differentiate
              between sequences received from a function key  and  those
              typed by a user.
       
      -       The  raw and noraw routines place the terminal into or out
      -       of raw mode.  Raw mode is similar to cbreak mode, in  that
      +       The  raw and noraw routines place the terminal into or out
      +       of raw mode.  Raw mode is similar to cbreak mode, in  that
              characters  typed  are  immediately  passed through to the
              user program.  The differences are that in raw  mode,  the
              interrupt,  quit, suspend, and flow control characters are
              all passed through uninterpreted, instead of generating  a
              signal.   The  behavior  of the BREAK key depends on other
      -       bits in the tty driver that are not set by curses.
      +       bits in the tty driver that are not set by curses.
       
      -       When the noqiflush routine is used, normal flush of  input
      -       and  output queues associated with the INTR, QUIT and SUSP
      -       characters will not be done [see termio(7)].  When qiflush
      +       When the noqiflush routine is used, normal flush of  input
      +       and  output queues associated with the INTR, QUIT and SUSP
      +       characters will not be done [see termio(7)].  When qiflush
              is  called,  the queues will be flushed when these control
      -       characters are read.  You may want to call noqiflush()  in
      +       characters are read.  You may want to call noqiflush()  in
              a  signal handler if you want output to continue as though
              the interrupt had not occurred, after the handler exits.
       
      -       The timeout and wtimeout routines  set  blocking  or  non-
      -       blocking  read  for a given window.  If delay is negative,
      -       blocking  read  is  used  (i.e.,  waits  indefinitely  for
      -       input).   If delay is zero, then non-blocking read is used
      -       (i.e., read returns ERR if no input is waiting).  If delay
      -       is  positive, then read blocks for delay milliseconds, and
      -       returns ERR if there is still no input.  Hence, these rou-
      -       tines  provide the same functionality as nodelay, plus the
      +       The timeout and wtimeout routines  set  blocking  or  non-
      +       blocking  read  for a given window.  If delay is negative,
      +       blocking  read  is  used  (i.e.,  waits  indefinitely  for
      +       input).   If delay is zero, then non-blocking read is used
      +       (i.e., read returns ERR if no input is waiting).  If delay
      +       is  positive, then read blocks for delay milliseconds, and
      +       returns ERR if there is still no input.  Hence, these rou-
      +       tines  provide the same functionality as nodelay, plus the
              additional capability of being  able  to  block  for  only
      -       delay milliseconds (where delay is positive).
      +       delay milliseconds (where delay is positive).
       
      -       The  curses library does ``line-breakout optimization'' by
      +       The  curses library does ``line-breakout optimization'' by
              looking for  typeahead  periodically  while  updating  the
              screen.   If  input is found, and it is coming from a tty,
      -       the current update is postponed until refresh or  doupdate
      +       the current update is postponed until refresh or  doupdate
              is  called again.  This allows faster response to commands
              typed in advance.  Normally, the input FILE pointer passed
      -       to  newterm,  or  stdin in the case that initscr was used,
      -       will be used to do this typeahead checking.  The typeahead
      -       routine  specifies  that  the  file descriptor fd is to be
      -       used to check for typeahead instead.  If fd is -1, then no
      +       to  newterm,  or  stdin in the case that initscr was used,
      +       will be used to do this typeahead checking.  The typeahead
      +       routine  specifies  that  the  file descriptor fd is to be
      +       used to check for typeahead instead.  If fd is -1, then no
              typeahead checking is done.
       
       
       

      RETURN VALUE

      -       All  routines that return an integer return ERR upon fail-
      +       All  routines that return an integer return ERR upon fail-
              ure and OK (SVr4 specifies only "an  integer  value  other
      -       than  ERR")  upon  successful completion, unless otherwise
      +       than  ERR")  upon  successful completion, unless otherwise
              noted in the preceding routine descriptions.
       
       
      @@ -173,7 +211,7 @@
              torical practice of the AT&T  curses  implementations,  in
              that  the  echo bit is cleared when curses initializes the
              terminal state.  BSD curses differed from  this  slightly;
      -       it left the echo bit on at initialization, but the BSD raw
      +       it left the echo bit on at initialization, but the BSD raw
              call turned it off as a side-effect.  For  best  portabil-
              ity,  set echo or noecho explicitly just after initializa-
              tion, even if your program remains in cooked mode.
      @@ -181,11 +219,11 @@
       
       

      NOTES

      -       Note that echo, noecho, halfdelay, intrflush, meta,  node-
      -       lay,  notimeout, noqiflush, qiflush, timeout, and wtimeout
      +       Note that echo, noecho, halfdelay, intrflush, meta,  node-
      +       lay,  notimeout, noqiflush, qiflush, timeout, and wtimeout
              may be macros.
       
      -       The noraw and nocbreak calls follow historical practice in
      +       The noraw and nocbreak calls follow historical practice in
              that  they  attempt  to  restore to normal (`cooked') mode
              from raw and cbreak modes respectively.  Mixing  raw/noraw
              and  cbreak/nocbreak  calls  leads  to  tty driver control
      @@ -195,7 +233,7 @@
       
       

      SEE ALSO

      -       curses(3x), curs_getch(3x), curs_initscr(3x), termio(7)
      +       curses(3x), curs_getch(3x), curs_initscr(3x), termio(7)
       
       
       
      diff --git a/doc/html/man/curs_ins_wch.3x.html b/doc/html/man/curs_ins_wch.3x.html
      new file mode 100644
      index 00000000..aa07ca32
      --- /dev/null
      +++ b/doc/html/man/curs_ins_wch.3x.html
      @@ -0,0 +1,116 @@
      +
      +
      +
      +
      +curs_ins_wch 3x
      +
      +
      +
      +
      +

      curs_ins_wch 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       ins_wch,  mvins_wch,  mvwins_wch, wins_wch - insert a com-
      +       plex character and rendition into a window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int ins_wch(const cchar_t *wch);
      +       int wins_wch(WINDOW *win, const cchar_t *wch);
      +       int mvins_wch(int y, int x, const cchar_t *wch);
      +       int mvwins_wch(WINDOW *win, int y, int  x,  const  cchar_t
      +       *wch);
      +
      +
      +
      +

      DESCRIPTION

      +       These routines, insert the complex character wch with ren-
      +       dition before the character under the cursor.  All charac-
      +       ters to the right of the cursor are moved one space to the
      +       right, with the possibility of the rightmost character  on
      +       the  line  being  lost.   The insertion operation does not
      +       change the cursor position.
      +
      +
      +
      +

      RETURN VALUE

      +       If successful, these functions return OK.   If  not,  they
      +       return ERR.
      +
      +
      +
      +

      ERRORS

      +       No errors are defined.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x), curs_insch(3x).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_ins_wstr.3x.html b/doc/html/man/curs_ins_wstr.3x.html new file mode 100644 index 00000000..43e874b3 --- /dev/null +++ b/doc/html/man/curs_ins_wstr.3x.html @@ -0,0 +1,170 @@ + + + + +curs_ins_wstr 3x + + + + +

      curs_ins_wstr 3x

      +
      +
      +
      +
      +
      +

      NAME

      +       ins_wstr,  ins_nwstr,  wins_wstr,  wins_nwstr, mvins_wstr,
      +       mvins_nwstr, mvwins_wstr, mvwins_nwstr -  insert  a  wide-
      +       character string into a curses window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int ins_wstr(const wchar_t *wstr);
      +       int ins_nwstr(const wchar_t *wstr, int n);
      +       int wins_wstr(WINDOW *win, const wchar_t *wstr);
      +       int wins_nwstr(WINDOW *win, const wchar_t *wstr, int n);
      +       int mvins_wstr(int y, int x, const wchar_t *wstr);
      +       int mvins_nwstr(int y, int x, const wchar_t *wstr, int n);
      +       int mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr);
      +       int mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       These  routines insert a wchar_t character string (as many
      +       characters as will fit on the line) before  the  character
      +       under the cursor.  All characters to the right of the cur-
      +       sor are shifted right, with the possibility of the  right-
      +       most  characters  on  the line being lost.  No wrapping is
      +       performed.  The cursor position  does  not  change  (after
      +       moving  to  y, x, if specified).  The four routines with n
      +       as the last argument insert a leading substring of at most
      +       n  wchar_t  characters.   If  n is less than 1, the entire
      +       string is inserted.
      +
      +       If a character in wstr is a tab, newline, carriage  return
      +       or backspace, the cursor is moved appropriately within the
      +       window.  A newline also does  a  clrtoeol  before  moving.
      +       Tabs  are  considered  to be at every eighth column.  If a
      +       character in wstr is  another  control  character,  it  is
      +       drawn  in the ^X notation.  Calling win_wch after adding a
      +       control character (and moving to it,  if  necessary)  does
      +       not  return  the  control character, but instead returns a
      +       character in the ^-representation of the  control  charac-
      +       ter.
      +
      +
      +
      +

      NOTES

      +       Note that all but wins_nwstr may be macros.
      +
      +       If the first character in the string is a nonspacing char-
      +       acter, these functions will fail.   XSI  does  not  define
      +       what  will happen if a nonspacing character follows a con-
      +       trol character.
      +
      +
      +
      +

      RETURN VALUES

      +       Upon successful completion,  these  functions  return  OK.
      +       Otherwise, they return ERR.
      +
      +
      +
      +

      SEE ALSO

      +       curses(3x),        curs_insstr(3x),       curs_in_wch(3x),
      +       curs_ins_wch(3x).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_insch.3x.html b/doc/html/man/curs_insch.3x.html index 5a1610b5..4ad06bdf 100644 --- a/doc/html/man/curs_insch.3x.html +++ b/doc/html/man/curs_insch.3x.html @@ -1,27 +1,65 @@ + + + +curs_insch 3x + + + +

      curs_insch 3x

      +
       
       
       

      NAME

      -       insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
      -       before cursor in a curses window
      +       insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
      +       before cursor in a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int insch(chtype ch);
      -       int winsch(WINDOW *win, chtype ch);
      -       int mvinsch(int y, int x, chtype ch);
      -       int mvwinsch(WINDOW *win, int y, int x, chtype ch);
      +       int insch(chtype ch);
      +       int winsch(WINDOW *win, chtype ch);
      +       int mvinsch(int y, int x, chtype ch);
      +       int mvwinsch(WINDOW *win, int y, int x, chtype ch);
       
       
       

      DESCRIPTION

      -       These routines, insert the character ch before the charac-
      +       These routines, insert the character ch before the charac-
              ter  under the cursor.  All characters to the right of the
              cursor are moved one space to the right, with  the  possi-
              bility  of the rightmost character on the line being lost.
      @@ -31,9 +69,9 @@
       
       

      RETURN VALUE

      -       All  routines that return an integer return ERR upon fail-
      +       All  routines that return an integer return ERR upon fail-
              ure and OK (SVr4 specifies only "an  integer  value  other
      -       than  ERR")  upon  successful completion, unless otherwise
      +       than  ERR")  upon  successful completion, unless otherwise
              noted in the preceding routine descriptions.
       
       
      @@ -42,7 +80,7 @@
              These routines do not necessarily imply use of a  hardware
              insert character feature.
       
      -       Note that insch, mvinsch, and mvwinsch may be macros.
      +       Note that insch, mvinsch, and mvwinsch may be macros.
       
       
       
      @@ -53,7 +91,7 @@

      SEE ALSO

      -       curses(3x).
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_insstr.3x.html b/doc/html/man/curs_insstr.3x.html
      index 2349cbc2..0e95f565 100644
      --- a/doc/html/man/curs_insstr.3x.html
      +++ b/doc/html/man/curs_insstr.3x.html
      @@ -1,27 +1,65 @@
      +
      +
       
      +
      +curs_insstr 3x
      +
      +
      +
       
      +

      curs_insstr 3x

      +
       
       
       

      NAME

      -       insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
      -       mvwinsstr, mvwinsnstr - insert string before cursor  in  a
      -       curses window
      +       insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
      +       mvwinsstr, mvwinsnstr - insert string before cursor  in  a
      +       curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       int insstr(const char *str);
      -       int insnstr(const char *str, int n);
      -       int winsstr(WINDOW *win, const char *str);
      -       int winsnstr(WINDOW *win, const char *str, int n);
      -       int mvinsstr(int y, int x, const char *str);
      -       int mvinsnstr(int y, int x, const char *str, int n);
      -       int mvwinsstr(WINDOW *win, int y, int x, const char *str);
      -       int mvwinsnstr(WINDOW *win, int y, int x, const char *str,
      -       int n);
      +       #include <curses.h>
      +       int insstr(const char *str);
      +       int insnstr(const char *str, int n);
      +       int winsstr(WINDOW *win, const char *str);
      +       int winsnstr(WINDOW *win, const char *str, int n);
      +       int mvinsstr(int y, int x, const char *str);
      +       int mvinsnstr(int y, int x, const char *str, int n);
      +       int mvwinsstr(WINDOW *win, int y, int x, const char *str);
      +       int mvwinsnstr(WINDOW *win, int y, int x, const char *str,
      +       int n);
       
       
       
      @@ -31,17 +69,17 @@ the cursor. All characters to the right of the cursor are shifted right, with the possibility of the rightmost char- acters on the line being lost. The cursor position does - not change (after moving to y, x, if specified). The four - routines with n as the last argument insert a leading sub- - string of at most n characters. If n<=0, then the entire + not change (after moving to y, x, if specified). The four + routines with n as the last argument insert a leading sub- + string of at most n characters. If n<=0, then the entire string is inserted. - If a character in str is a tab, newline, carriage return + If a character in str is a tab, newline, carriage return or backspace, the cursor is moved appropriately within the - window. A newline also does a clrtoeol before moving. + window. A newline also does a clrtoeol before moving. Tabs are considered to be at every eighth column. If a - character in str is another control character, it is drawn - in the ^X notation. Calling winch after adding a control + character in str is another control character, it is drawn + in the ^X notation. Calling winch after adding a control character (and moving to it, if necessary) does not return the control character, but instead returns a character in the ^-representation of the control character. @@ -49,30 +87,30 @@

      RETURN VALUE

      -       All  routines that return an integer return ERR upon fail-
      +       All  routines that return an integer return ERR upon fail-
              ure and OK (SVr4 specifies only "an  integer  value  other
      -       than  ERR")  upon  successful completion, unless otherwise
      +       than  ERR")  upon  successful completion, unless otherwise
              noted in the preceding routine descriptions.
       
       
       

      NOTES

      -       Note that all but winsnstr may be macros.
      +       Note that all but winsnstr may be macros.
       
       
       

      PORTABILITY

              These functions are described in the XSI Curses  standard,
              Issue  4,  which  adds  const qualifiers to the arguments.
      -       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
      +       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
              associated  with  extended-level  conformance  are not yet
              detected (this implementation does not  yet  support  XPG4
      -       multi-byte characters).
      +       multibyte characters).
       
       
       

      SEE ALSO

      -       curses(3x), curs_clear(3x), curs_inch(3x).
      +       curses(3x), curs_clear(3x), curs_inch(3x).
       
       
       
      diff --git a/doc/html/man/curs_instr.3x.html b/doc/html/man/curs_instr.3x.html
      index 30746395..3bd43e81 100644
      --- a/doc/html/man/curs_instr.3x.html
      +++ b/doc/html/man/curs_instr.3x.html
      @@ -1,67 +1,105 @@
      +
      +
       
      +
      +curs_instr 3x
      +
      +
      +
       
      +

      curs_instr 3x

      +
       
       
       

      NAME

      -       instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
      -       str, mvwinnstr - get a string of characters from a  curses
      +       instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
      +       str, mvwinnstr - get a string of characters from a  curses
              window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int instr(char *str);
      -       int innstr(char *str, int n);
      -       int winstr(WINDOW *win, char *str);
      -       int winnstr(WINDOW *win, char *str, int n);
      -       int mvinstr(int y, int x, char *str);
      -       int mvinnstr(int y, int x, char *str, int n);
      -       int mvwinstr(WINDOW *win, int y, int x, char *str);
      -       int  mvwinnstr(WINDOW  *win,  int y, int x, char *str, int
      -       n);
      +       int instr(char *str);
      +       int innstr(char *str, int n);
      +       int winstr(WINDOW *win, char *str);
      +       int winnstr(WINDOW *win, char *str, int n);
      +       int mvinstr(int y, int x, char *str);
      +       int mvinnstr(int y, int x, char *str, int n);
      +       int mvwinstr(WINDOW *win, int y, int x, char *str);
      +       int  mvwinnstr(WINDOW  *win,  int y, int x, char *str, int
      +       n);
       
       
       

      DESCRIPTION

      -       These routines return  a  string  of  characters  in  str,
      +       These routines return  a  string  of  characters  in  str,
              extracted  starting  at the current cursor position in the
              named window.  Attributes are stripped  from  the  charac-
      -       ters.   The  four  functions  with  n as the last argument
      -       return a leading  substring  at  most  n  characters  long
      +       ters.   The  four  functions  with  n as the last argument
      +       return a leading  substring  at  most  n  characters  long
              (exclusive of the trailing NUL).
       
       
       

      RETURN VALUE

      -       All  of the functions return ERR upon failure, or the num-
      +       All  of the functions return ERR upon failure, or the num-
              ber of characters actually read into the string.
       
       
       

      NOTES

      -       Note that all routines except winnstr may be macros.
      +       Note that all routines except winnstr may be macros.
       
       
       

      PORTABILITY

      -       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
      +       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
              associated  with  extended-level  conformance  are not yet
              detected (this implementation does not  yet  support  XPG4
      -       multi-byte  characters).  SVr4 does not document whether a
      +       multibyte  characters).   SVr4 does not document whether a
              length limit includes or excludes the trailing NUL.
       
              The ncurses library extends the XSI description by  allow-
      -       ing  a  negative value for n.  In this case, the functions
      +       ing  a  negative value for n.  In this case, the functions
              return the string ending at the right margin.
       
       
       

      SEE ALSO

      -       curses(3x).
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_inwstr.3x.html b/doc/html/man/curs_inwstr.3x.html
      new file mode 100644
      index 00000000..297e06ba
      --- /dev/null
      +++ b/doc/html/man/curs_inwstr.3x.html
      @@ -0,0 +1,116 @@
      +
      +
      +
      +
      +curs_inwstr 3
      +
      +
      +
      +
      +

      curs_inwstr 3

      +
      +
      +
      +
      +
      +

      NAME

      +       inwstr,  innwstr,  winwstr, winnwstr, mvinwstr, mvinnwstr,
      +       mvwinwstr, mvwinnwstr - get a string of wchar_t characters
      +       from a curses window
      +
      +
      +
      +

      SYNOPSIS

      +       #include <curses.h>
      +
      +       int inwstr(wchar_t *str);
      +       int innwstr(wchar_t *str, int n);
      +       int winwstr(WINDOW *win, wchar_t *str);
      +       int winnwstr(WINDOW *win, wchar_t *str, int n);
      +       int mvinwstr(int y, int x, wchar_t *str);
      +       int mvinnwstr(int y, int x, wchar_t *str, int n);
      +       int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str);
      +       int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n);
      +
      +
      +
      +

      DESCRIPTION

      +       These  routines  return  a string of wchar_t characters in
      +       wstr, extracted starting at the current cursor position in
      +       the  named window.  Attributes are stripped from the char-
      +       acters.  The four functions with n as  the  last  argument
      +       return a leading substring at most n bytes long (exclusive
      +       of the trailing NUL).  Transfer stops at the  end  of  the
      +       current  line,  or  when  n  bytes have been stored at the
      +       location referenced by wstr.
      +
      +       If the size n is not large  enough  to  store  a  complete
      +       character, an error is generated.
      +
      +
      +
      +

      NOTES

      +       Note that all routines except winnwstr may be macros.
      +
      +
      +
      +

      RETURN VALUES

      +       All routines return ERR upon failure. Upon successful com-
      +       pletion, the *inwstr routines return OK, and the  *innwstr
      +       routines  return  the  number  of characters read into the
      +       string.
      +
      +
      +
      +

      SEE ALSO

      +       Functions: curses(3x), curs_instr(3x), curs_in_wchstr(3x)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +Man(1) output converted with +man2html +
      + + diff --git a/doc/html/man/curs_kernel.3x.html b/doc/html/man/curs_kernel.3x.html index 094f396e..beaea46f 100644 --- a/doc/html/man/curs_kernel.3x.html +++ b/doc/html/man/curs_kernel.3x.html @@ -1,139 +1,177 @@ + + + +curs_kernel 3x + + + +

      curs_kernel 3x

      +
       
       
       

      NAME

      -       def_prog_mode,       def_shell_mode,      reset_prog_mode,
      -       reset_shell_mode, resetty, savetty, getsyx, setsyx, ripof-
      -       fline, curs_set, napms - low-level curses routines
      +       def_prog_mode,       def_shell_mode,      reset_prog_mode,
      +       reset_shell_mode, resetty, savetty, getsyx, setsyx, ripof-
      +       fline, curs_set, napms - low-level curses routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int def_prog_mode(void);
      -       int def_shell_mode(void);
      -       int reset_prog_mode(void);
      -       int reset_shell_mode(void);
      -       int resetty(void);
      -       int savetty(void);
      -       void getsyx(int y, int x);
      -       void setsyx(int y, int x);
      -       int ripoffline(int line, int (*init)(WINDOW *, int));
      -       int curs_set(int visibility);
      -       int napms(int ms);
      +       int def_prog_mode(void);
      +       int def_shell_mode(void);
      +       int reset_prog_mode(void);
      +       int reset_shell_mode(void);
      +       int resetty(void);
      +       int savetty(void);
      +       void getsyx(int y, int x);
      +       void setsyx(int y, int x);
      +       int ripoffline(int line, int (*init)(WINDOW *, int));
      +       int curs_set(int visibility);
      +       int napms(int ms);
       
       
       

      DESCRIPTION

              The  following  routines  give low-level access to various
      -       curses capabilities.  Theses routines typically  are  used
      +       curses capabilities.  Theses routines typically  are  used
              inside library routines.
       
      -       The  def_prog_mode  and  def_shell_mode  routines save the
      -       current terminal modes as the  "program"  (in  curses)  or
      -       "shell"   (not   in   curses)   state   for   use  by  the
      -       reset_prog_mode and reset_shell_mode  routines.   This  is
      -       done  automatically  by  initscr.   There is one such save
      -       area for each screen context allocated by newterm().
      -
      -       The reset_prog_mode and reset_shell_mode routines  restore
      -       the  terminal  to "program" (in curses) or "shell" (out of
      -       curses) state.  These are  done  automatically  by  endwin
      -       and,  after  an  endwin, by doupdate, so they normally are
      +       The  def_prog_mode  and  def_shell_mode  routines save the
      +       current terminal modes as the  "program"  (in  curses)  or
      +       "shell"   (not   in   curses)   state   for   use  by  the
      +       reset_prog_mode and reset_shell_mode  routines.   This  is
      +       done  automatically  by  initscr.   There is one such save
      +       area for each screen context allocated by newterm().
      +
      +       The reset_prog_mode and reset_shell_mode routines  restore
      +       the  terminal  to "program" (in curses) or "shell" (out of
      +       curses) state.  These are  done  automatically  by  endwin
      +       and,  after  an  endwin, by doupdate, so they normally are
              not called.
       
      -       The resetty and savetty  routines  save  and  restore  the
      -       state  of  the  terminal modes.  savetty saves the current
      -       state in a buffer and resetty restores the state  to  what
      -       it was at the last call to savetty.
      -
      -       The  getsyx routine returns the current coordinates of the
      -       virtual screen cursor in y and x.  If leaveok is currently
      -       TRUE,  then -1,-1 is returned.  If lines have been removed
      -       from the top of the screen,  using  ripoffline,  y  and  x
      -       include  these  lines;  therefore,  y and x should be used
      -       only as arguments for setsyx.
      -
      -       The setsyx routine sets the virtual screen cursor to y, x.
      -       If y and x are both -1, then leaveok is set.  The two rou-
      -       tines getsyx and setsyx are  designed  to  be  used  by  a
      -       library routine, which manipulates curses windows but does
      +       The resetty and savetty  routines  save  and  restore  the
      +       state  of  the  terminal modes.  savetty saves the current
      +       state in a buffer and resetty restores the state  to  what
      +       it was at the last call to savetty.
      +
      +       The  getsyx routine returns the current coordinates of the
      +       virtual screen cursor in y and x.  If leaveok is currently
      +       TRUE,  then -1,-1 is returned.  If lines have been removed
      +       from the top of the screen,  using  ripoffline,  y  and  x
      +       include  these  lines;  therefore,  y and x should be used
      +       only as arguments for setsyx.
      +
      +       The setsyx routine sets the virtual screen cursor to y, x.
      +       If y and x are both -1, then leaveok is set.  The two rou-
      +       tines getsyx and setsyx are  designed  to  be  used  by  a
      +       library routine, which manipulates curses windows but does
              not want to change the current position of  the  program's
      -       cursor.   The  library  routine  would  call getsyx at the
      +       cursor.   The  library  routine  would  call getsyx at the
              beginning, do its manipulation of its own  windows,  do  a
      -       wnoutrefresh  on  its  windows, call setsyx, and then call
      -       doupdate.
      -
      -       The ripoffline routine provides access to the same  facil-
      -       ity  that  slk_init  [see curs_slk(3x)] uses to reduce the
      -       size of the screen.   ripoffline  must  be  called  before
      -       initscr or newterm is called.  If line is positive, a line
      -       is removed from the top of stdscr; if line is negative,  a
      +       wnoutrefresh  on  its  windows, call setsyx, and then call
      +       doupdate.
      +
      +       The ripoffline routine provides access to the same  facil-
      +       ity  that  slk_init  [see curs_slk(3x)] uses to reduce the
      +       size of the screen.   ripoffline  must  be  called  before
      +       initscr or newterm is called.  If line is positive, a line
      +       is removed from the top of stdscr; if line is negative,  a
              line is removed from the bottom.  When this is done inside
      -       initscr, the routine init (supplied by the user) is called
      +       initscr, the routine init (supplied by the user) is called
              with  two arguments: a window pointer to the one-line win-
              dow that has been allocated and an integer with the number
              of columns in the window.  Inside this initialization rou-
      -       tine, the integer variables LINES  and  COLS  (defined  in
      -       <curses.h>) are not guaranteed to be accurate and wrefresh
      -       or doupdate must not be called.  It is allowable  to  call
      -       wnoutrefresh during the initialization routine.
      +       tine, the integer variables LINES  and  COLS  (defined  in
      +       <curses.h>) are not guaranteed to be accurate and wrefresh
      +       or doupdate must not be called.  It is allowable  to  call
      +       wnoutrefresh during the initialization routine.
       
      -       ripoffline  can  be called up to five times before calling
      -       initscr or newterm.
      +       ripoffline  can  be called up to five times before calling
      +       initscr or newterm.
       
      -       The curs_set routine sets  the  cursor  state  is  set  to
      -       invisible, normal, or very visible for visibility equal to
      -       0, 1, or 2 respectively.  If  the  terminal  supports  the
      -       visibility   requested,   the  previous  cursor  state  is
      -       returned; otherwise, ERR is returned.
      +       The curs_set routine sets  the  cursor  state  is  set  to
      +       invisible, normal, or very visible for visibility equal to
      +       0, 1, or 2 respectively.  If  the  terminal  supports  the
      +       visibility   requested,   the  previous  cursor  state  is
      +       returned; otherwise, ERR is returned.
       
      -       The napms routine is used to sleep for ms milliseconds.
      +       The napms routine is used to sleep for ms milliseconds.
       
       
       

      RETURN VALUE

      -       Except for curs_set,  these  routines  always  return  OK.
      -       curs_set  returns the previous cursor state, or ERR if the
      -       requested visibility is not supported.
      +       Except for curs_set,  these  routines  always  return  OK.
      +       curs_set  returns the previous cursor state, or ERR if the
      +       requested visibility is not supported.
       
       
       

      NOTES

      -       Note that getsyx is a macro, so & is not necessary  before
      -       the variables y and x.
      +       Note that getsyx is a macro, so & is not necessary  before
      +       the variables y and x.
       
              Older  SVr4  man  pages  warn  that  the  return  value of
      -       curs_set "is currently  incorrect".   This  implementation
      +       curs_set "is currently  incorrect".   This  implementation
              gets  it  right, but it may be unwise to count on the cor-
              rectness of the return value anywhere else.
       
      -       Both ncurses and SVr4 will  call  curs_set  in  endwin  if
      -       curs_set  has  been  called  to make the cursor other than
      -       normal, i.e., either visible or very visible.  There is no
      -       way  for  ncurses to determine the initial cursor state to
      -       restore that.
      +       Both ncurses and SVr4 will  call  curs_set  in  endwin  if
      +       curs_set  has  been  called  to make the cursor other than
      +       normal, i.e., either invisible or very visible.  There  is
      +       no  way  for ncurses to determine the initial cursor state
      +       to restore that.
       
       
       

      PORTABILITY

      -       The functions setsyx and getsyx are not described  in  the
      +       The functions setsyx and getsyx are not described  in  the
              XSI  Curses standard, Issue 4.  All other functions are as
              described in XSI Curses.
       
      -       The SVr4 documentation describes setsyx and getsyx as hav-
      +       The SVr4 documentation describes setsyx and getsyx as hav-
              ing  return  type  int.  This  is  misleading, as they are
              macros with no documented semantics for the return  value.
       
       
       

      SEE ALSO

      -       curses(3x),       curs_initscr(3x),      curs_outopts(3x),
      -       curs_refresh(3x), curs_scr_dump(3x), curs_slk(3x)
      +       curses(3x),       curs_initscr(3x),      curs_outopts(3x),
      +       curs_refresh(3x), curs_scr_dump(3x), curs_slk(3x)
       
       
       
      diff --git a/doc/html/man/curs_mouse.3x.html b/doc/html/man/curs_mouse.3x.html
      index 6e1ca87a..9a09a3f4 100644
      --- a/doc/html/man/curs_mouse.3x.html
      +++ b/doc/html/man/curs_mouse.3x.html
      @@ -1,45 +1,84 @@
      +
      +
       
      +
      +curs_mouse 3x
      +
      +
      +
       
      +

      curs_mouse 3x

      +
       
       
       

      NAME

      -       getmouse,  ungetmouse,  mousemask,  wenclose, mouse_trafo,
      -       wmouse_trafo,  mouseinterval  -  mouse  interface  through
      +       getmouse,  ungetmouse,  mousemask,  wenclose, mouse_trafo,
      +       wmouse_trafo,  mouseinterval  -  mouse  interface  through
              curses
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -
      -       typedef unsigned long mmask_t;
      -
      -       typedef struct
      -       {
      -           short id;         /* ID to distinguish multiple devices */
      -           int x, y, z;      /* event coordinates */
      -           mmask_t bstate;   /* button state bits */
      -       }
      -       MEVENT;
      -       int getmouse(MEVENT *event);
      -       int ungetmouse(MEVENT *event);
      -       mmask_t mousemask(mmask_t newmask, mmask_t *oldmask);
      -       bool wenclose(WINDOW *win, int y, int x);
      -       bool mouse_trafo(int* pY, int* pX, bool to_screen);
      -       bool wmouse_trafo(const WINDOW* win, int* pY, int* pX,
      -            bool to_screen);
      -       int mouseinterval(int erval);
      +       #include <curses.h>
      +
      +       typedef unsigned long mmask_t;
      +
      +       typedef struct
      +       {
      +           short id;         /* ID to distinguish multiple devices */
      +           int x, y, z;      /* event coordinates */
      +           mmask_t bstate;   /* button state bits */
      +       }
      +       MEVENT;
      +       int getmouse(MEVENT *event);
      +       int ungetmouse(MEVENT *event);
      +       mmask_t mousemask(mmask_t newmask, mmask_t *oldmask);
      +       bool wenclose(const WINDOW *win, int y, int x);
      +       bool mouse_trafo(int* pY, int* pX, bool to_screen);
      +       bool wmouse_trafo(const WINDOW* win, int* pY, int* pX,
      +            bool to_screen);
      +       int mouseinterval(int erval);
       
       
       

      DESCRIPTION

              These  functions provide an interface to mouse events from
      -       ncurses(3x).  Mouse events are  represented  by  KEY_MOUSE
      -       pseudo-key values in the wgetch input stream.
      +       ncurses(3x).  Mouse events are  represented  by  KEY_MOUSE
      +       pseudo-key values in the wgetch input stream.
       
      -       To  make mouse events visible, use the mousemask function.
      +       To  make mouse events visible, use the mousemask function.
              This will  set  the  mouse  events  to  be  reported.   By
              default,  no mouse events are reported.  The function will
              return a mask to indicate which  of  the  specified  mouse
      @@ -54,7 +93,7 @@
       
              Here are the mouse event type masks:
       
      -       Name                     Description
      +       Name                     Description
              ---------------------------------------------------------------------
              BUTTON1_PRESSED          mouse button 1 down
              BUTTON1_RELEASED         mouse button 1 up
      @@ -84,95 +123,96 @@
              REPORT_MOUSE_POSITION    report mouse movement
       
              Once a class of mouse events have been made visible  in  a
      -       window,  calling  the  wgetch  function on that window may
      -       return KEY_MOUSE as an indicator that a  mouse  event  has
      +       window,  calling  the  wgetch  function on that window may
      +       return KEY_MOUSE as an indicator that a  mouse  event  has
              been queued.  To read the event data and pop the event off
      -       the queue, call getmouse.  This function will return OK if
      -       a mouse event is actually visible in the given window, ERR
      -       otherwise.  When getmouse returns OK, the  data  deposited
      +       the queue, call getmouse.  This function will return OK if
      +       a mouse event is actually visible in the given window, ERR
      +       otherwise.  When getmouse returns OK, the  data  deposited
              as  y  and  x  in  the event structure coordinates will be
              screen-relative character-cell coordinates.  The  returned
              state  mask  will have exactly one bit set to indicate the
              event type.
       
      -       The ungetmouse function behaves  analogously  to  ungetch.
      -       It  pushes  a  KEY_MOUSE  event  onto the input queue, and
      +       The ungetmouse function behaves  analogously  to  ungetch.
      +       It  pushes  a  KEY_MOUSE  event  onto the input queue, and
              associates with  that  event  the  given  state  data  and
              screen-relative character-cell coordinates.
       
      -       The  wenclose  function  tests  whether  a  given  pair of
      +       The  wenclose  function  tests  whether  a  given  pair of
              screen-relative character-cell coordinates is enclosed  by
              a  given  window, returning TRUE if it is and FALSE other-
              wise.  It is useful for determining  what  subset  of  the
              screen windows enclose the location of a mouse event.
       
      -       The wmouse_trafo function transforms a given pair of coor-
      +       The wmouse_trafo function transforms a given pair of coor-
              dinates from stdscr-relative coordinates  to  screen-rela-
              tive  coordinates  or  vice  versa.  Please remember, that
              stdscr-relative coordinates are not  always  identical  to
              screen-relative   coordinates  due  to  the  mechanism  to
              reserve lines on top or bottom of  the  screen  for  other
      -       purposes  (ripoff() call, see also slk_...  functions). If
      -       the parameter to_screen is TRUE, the pointers pY, pX  must
      +       purposes (ripoff() call, see also slk_...  functions).  If
      +       the parameter to_screen is TRUE, the pointers pY, pX  must
              reference  the coordinates of a location inside the window
      -       win. They are converted to screen-relative coordinates and
      -       returned  through the pointers. If the conversion was suc-
      -       cessful, the function returns TRUE. If one of the  parame-
      -       ters  was  NULL  or the location is not inside the window,
      -       FALSE is returned. If to_screen is FALSE, the pointers pY,
      -       pX  must  reference  screen-relative coordinates. They are
      -       converted to stdscr-relative coordinates if the window win
      -       encloses  this  point.  In  this case the function returns
      -       TRUE. If one of the parameters is NULL or the point is not
      -       inside  the window, FALSE is returned. Please notice, that
      -       the referenced coordinates are only replaced by  the  con-
      -       verted coordinates if the transformation was successful.
      -
      -       The mouseinterval function sets the maximum time (in thou-
      -       sands of a second)  that  can  elapse  between  press  and
      -       release  events  in  order  for them to be recognized as a
      -       click.  This function returns the previous interval value.
      -       The default is one fifth of a second.
      +       win.  They are converted  to  screen-relative  coordinates
      +       and  returned through the pointers.  If the conversion was
      +       successful, the function returns  TRUE.   If  one  of  the
      +       parameters was NULL or the location is not inside the win-
      +       dow, FALSE is returned.  If to_screen is FALSE, the point-
      +       ers  pY,  pX  must  reference screen-relative coordinates.
      +       They are converted to stdscr-relative coordinates  if  the
      +       window win encloses this point.  In this case the function
      +       returns TRUE.  If one of the parameters  is  NULL  or  the
      +       point is not inside the window, FALSE is returned.  Please
      +       notice, that the referenced coordinates are only  replaced
      +       by  the  converted  coordinates  if the transformation was
      +       successful.
      +
      +       The mouseinterval function sets the maximum time (in thou-
      +       sands  of  a  second)  that  can  elapse between press and
      +       release events for them to be recognized as a click.   Use
      +       mouseinterval(-1) to disable click resolution.  This func-
      +       tion returns the previous interval value.  The default  is
      +       one sixth of a second.
       
              Note  that  mouse  events will be ignored when input is in
              cooked mode, and will cause an error beep when cooked mode
      -       is  being simulated in a window by a function such as get-
      -       str that expects a linefeed for input-loop termination.
      +       is  being simulated in a window by a function such as get-
      +       str that expects a linefeed for input-loop termination.
       
       
       
       

      RETURN VALUE

      -       getmouse, ungetmouse and mouseinterval return the  integer
      -       ERR  upon failure or OK upon successful completion. mouse-
      -       mask returns the mask of reportable events.  wenclose  and
      -       wmouse_trafo are boolean functions returning TRUE or FALSE
      +       getmouse, ungetmouse and mouseinterval return the  integer
      +       ERR upon failure or OK upon successful completion.  mouse-
      +       mask returns the mask of reportable events.  wenclose  and
      +       wmouse_trafo are boolean functions returning TRUE or FALSE
              depending on their test result.
       
       
       

      PORTABILITY

      -       These calls were designed for  ncurses(3x),  and  are  not
      +       These calls were designed for  ncurses(3x),  and  are  not
              found in SVr4 curses, 4.4BSD curses, or any other previous
              version of curses.
       
      -       The feature macro NCURSES_MOUSE_VERSION is provided so the
      +       The feature macro NCURSES_MOUSE_VERSION is provided so the
              preprocessor  can  be  used to test whether these features
              are present  (its  value  is  1).   If  the  interface  is
      -       changed, the value of NCURSES_MOUSE_VERSION will be incre-
      +       changed, the value of NCURSES_MOUSE_VERSION will be incre-
              mented.
       
      -       The order of the MEVENT structure members is  not  guaran-
      +       The order of the MEVENT structure members is  not  guaran-
              teed.   Additional fields may be added to the structure in
              the future.
       
      -       Under  ncurses(3x),  these  calls  are  implemented  using
      +       Under  ncurses(3x),  these  calls  are  implemented  using
              either  xterm's  built-in mouse-tracking API or Alessandro
              Rubini's gpm server.  If you  are  using  something  other
              than  xterm  and  there  is  no gpm daemon running on your
      -       machine, mouse events will not be visible  to  ncurses(3x)
      -       (and the wmousemask function will always return 0).
      -
      +       machine, mouse events will not be visible  to  ncurses(3x)
      +       (and the wmousemask function will always return 0).
              The z member in the event structure is not presently used.
              It is intended for use with touch screens  (which  may  be
              pressure-sensitive)   or   with   3D-mice/trackballs/power
      @@ -182,28 +222,27 @@
       

      BUGS

              Mouse events under xterm will not in fact be ignored  dur-
      -       ing  cooked mode, if they have been enabled by wmousemask.
      +       ing  cooked mode, if they have been enabled by wmousemask.
              Instead, the xterm mouse report sequence  will  appear  in
              the string read.
       
              Mouse events under xterm will not be detected correctly in
              a window with its keypad bit off, since  they  are  inter-
              preted  as  a  variety  of  function  key.   Your terminfo
      -       description must have kmous set to "\E[M"  (the  beginning
      +       description must have kmous set to "\E[M"  (the  beginning
              of the response from xterm for mouse clicks).
       
              Because  there  are  no  standard  terminal responses that
              would serve to identify terminals which support the  xterm
      -       mouse  protocol,  ncurses  assumes  that  if your $DISPLAY
      -       environment variable is set, and kmous is defined  in  the
      -       terminal  description,  then  the  terminal may send mouse
      +       mouse  protocol,  ncurses assumes that if your $TERM envi-
      +       ronment variable contains "xterm", or kmous is defined  in
      +       the terminal description, then the terminal may send mouse
              events.
       
       
       

      SEE ALSO

      -       curses(3x).
      -
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_move.3x.html b/doc/html/man/curs_move.3x.html
      index 7a73e487..890b78a9 100644
      --- a/doc/html/man/curs_move.3x.html
      +++ b/doc/html/man/curs_move.3x.html
      @@ -1,40 +1,78 @@
      +
      +
       
      +
      +curs_move 3x
      +
      +
      +
       
      +

      curs_move 3x

      +
       
       
       

      NAME

      -       move, wmove - move curses window cursor
      +       move, wmove - move curses window cursor
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int move(int y, int x);
      -       int wmove(WINDOW *win, int y, int x);
      +       int move(int y, int x);
      +       int wmove(WINDOW *win, int y, int x);
       
       
       

      DESCRIPTION

              These  routines move the cursor associated with the window
      -       to line y and column x.  This routine does  not  move  the
      -       physical  cursor  of the terminal until refresh is called.
      +       to line y and column x.  This routine does  not  move  the
      +       physical  cursor  of the terminal until refresh is called.
              The position specified is relative to the upper  left-hand
              corner of the window, which is (0,0).
       
       
       

      RETURN VALUE

      -       These routines return ERR upon failure and OK (SVr4 speci-
      -       fies only "an integer value other than ERR") upon success-
      +       These routines return ERR upon failure and OK (SVr4 speci-
      +       fies only "an integer value other than ERR") upon success-
              ful completion.
       
       
       

      NOTES

      -       Note that move may be a macro.
      +       Note that move may be a macro.
       
       
       
      @@ -43,13 +81,13 @@ Issue 4. The standard specifies that if (y,x) is within a multi-column character, the cursor is moved to the first column of that character; however, this implementation - does not yet support the extended-level XSI multi-byte + does not yet support the extended-level XSI multibyte characters.

      SEE ALSO

      -       curses(3x), curs_refresh(3x)
      +       curses(3x), curs_refresh(3x)
       
       
       
      diff --git a/doc/html/man/curs_outopts.3x.html b/doc/html/man/curs_outopts.3x.html
      index a7a0a456..9d2d1735 100644
      --- a/doc/html/man/curs_outopts.3x.html
      +++ b/doc/html/man/curs_outopts.3x.html
      @@ -1,168 +1,206 @@
      +
      +
       
      +
      +curs_outopts 3x
      +
      +
      +
       
      +

      curs_outopts 3x

      +
       
       
       

      NAME

      -       clearok,   idlok,   idcok   immedok,  leaveok,  setscrreg,
      -       wsetscrreg, scrollok, nl, nonl - curses output options
      +       clearok,   idlok,   idcok,  immedok,  leaveok,  setscrreg,
      +       wsetscrreg, scrollok, nl, nonl - curses output options
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int clearok(WINDOW *win, bool bf);
      -       int idlok(WINDOW *win, bool bf);
      -       void idcok(WINDOW *win, bool bf);
      -       void immedok(WINDOW *win, bool bf);
      -       int leaveok(WINDOW *win, bool bf);
      -       int setscrreg(int top, int bot);
      -       int wsetscrreg(WINDOW *win, int top, int bot);
      -       int scrollok(WINDOW *win, bool bf);
      -       int nl(void);
      -       int nonl(void);
      +       int clearok(WINDOW *win, bool bf);
      +       int idlok(WINDOW *win, bool bf);
      +       void idcok(WINDOW *win, bool bf);
      +       void immedok(WINDOW *win, bool bf);
      +       int leaveok(WINDOW *win, bool bf);
      +       int setscrreg(int top, int bot);
      +       int wsetscrreg(WINDOW *win, int top, int bot);
      +       int scrollok(WINDOW *win, bool bf);
      +       int nl(void);
      +       int nonl(void);
       
       
       

      DESCRIPTION

              These routines set options that change the style of output
      -       within  curses.   All  options are initially FALSE, unless
      +       within  curses.   All  options are initially FALSE, unless
              otherwise stated.  It  is  not  necessary  to  turn  these
      -       options off before calling endwin.
      +       options off before calling endwin.
       
      -       If  clearok is called with TRUE as argument, the next call
      -       to wrefresh with this window will clear  the  screen  com-
      +       If  clearok is called with TRUE as argument, the next call
      +       to wrefresh with this window will clear  the  screen  com-
              pletely  and  redraw the entire screen from scratch.  This
              is useful when the contents of the screen  are  uncertain,
              or  in  some  cases for a more pleasing visual effect.  If
      -       the win argument to clearok is the global variable curscr,
      -       the  next  call  to  wrefresh  with  any window causes the
      +       the win argument to clearok is the global variable curscr,
      +       the  next  call  to  wrefresh  with  any window causes the
              screen to be cleared and repainted from scratch.
       
      -       If idlok is called with TRUE as  second  argument,  curses
      +       If idlok is called with TRUE as  second  argument,  curses
              considers using the hardware insert/delete line feature of
      -       terminals so equipped.  Calling idlok with FALSE as second
      +       terminals so equipped.  Calling idlok with FALSE as second
              argument  disables  use  of  line  insertion and deletion.
              This option should be  enabled  only  if  the  application
              needs  insert/delete  line, for example, for a screen edi-
              tor.  It is disabled by default because insert/delete line
              tends  to  be  visually annoying when used in applications
              where it isn't really needed.  If insert/delete line  can-
      -       not  be  used,  curses redraws the changed portions of all
      +       not  be  used,  curses redraws the changed portions of all
              lines.
       
      -       If idcok is called with FALSE as second  argument,  curses
      +       If idcok is called with FALSE as second  argument,  curses
              no longer considers using the hardware insert/delete char-
              acter feature of terminals so equipped.  Use of  character
      -       insert/delete  is  enabled by default.  Calling idcok with
      -       TRUE as second argument re-enables use of character inser-
      +       insert/delete  is  enabled by default.  Calling idcok with
      +       TRUE as second argument re-enables use of character inser-
              tion and deletion.
       
      -       If  immedok is called with TRUE as argument, any change in
      -       the window image, such  as  the  ones  caused  by  waddch,
      -       wclrtobot, wscrl, etc., automatically cause a call to wre-
      -       fresh.  However, it may degrade performance  considerably,
      -       due  to  repeated  calls  to  wrefresh.  It is disabled by
      +       If  immedok is called with TRUE as argument, any change in
      +       the window image, such  as  the  ones  caused  by  waddch,
      +       wclrtobot, wscrl, etc., automatically cause a call to wre-
      +       fresh.  However, it may degrade performance  considerably,
      +       due  to  repeated  calls  to  wrefresh.  It is disabled by
              default.
       
              Normally, the hardware cursor is left at the  location  of
      -       the  window  cursor  being  refreshed.  The leaveok option
      +       the  window  cursor  being  refreshed.  The leaveok option
              allows the cursor to be left wherever the  update  happens
              to leave it.  It is useful for applications where the cur-
              sor is not used, since it  reduces  the  need  for  cursor
      -       motions.   If  possible, the cursor is made invisible when
      -       this option is enabled.
      +       motions.
       
      -       The setscrreg and wsetscrreg routines allow  the  applica-
      -       tion  programmer  to  set a software scrolling region in a
      -       window.  top and bot are the line numbers of the  top  and
      +       The  setscrreg  and wsetscrreg routines allow the applica-
      +       tion programmer to set a software scrolling  region  in  a
      +       window.   top  and bot are the line numbers of the top and
              bottom margin of the scrolling region.  (Line 0 is the top
      -       line of the window.)  If  this  option  and  scrollok  are
      -       enabled,  an  attempt  to  move off the bottom margin line
      -       causes all lines in the scrolling  region  to  scroll  one
      +       line  of  the  window.)   If  this option and scrollok are
      +       enabled, an attempt to move off  the  bottom  margin  line
      +       causes  all  lines  in  the scrolling region to scroll one
              line in the direction of the first line.  Only the text of
              the window is scrolled.  (Note that this has nothing to do
      -       with  the use of a physical scrolling region capability in
      -       the terminal, like that in the VT100.  If idlok is enabled
      -       and   the  terminal  has  either  a  scrolling  region  or
      -       insert/delete line capability, they will probably be  used
      +       with the use of a physical scrolling region capability  in
      +       the terminal, like that in the VT100.  If idlok is enabled
      +       and  the  terminal  has  either  a  scrolling  region   or
      +       insert/delete  line capability, they will probably be used
              by the output routines.)
       
      -       The  scrollok option controls what happens when the cursor
      -       of a window is  moved  off  the  edge  of  the  window  or
      -       scrolling  region,  either as a result of a newline action
      -       on the bottom line, or typing the last  character  of  the
      -       last line.  If disabled, (bf is FALSE), the cursor is left
      -       on the bottom line.  If enabled, (bf is TRUE), the  window
      -       is  scrolled  up  one  line (Note that in order to get the
      -       physical scrolling effect on the terminal, it is also nec-
      -       essary to call idlok).
      -
      -       The  nl  and  nonl routines control whether the underlying
      -       display device translates the return key into  newline  on
      -       input,  and  whether it translates newline into return and
      -       line-feed on output (in either case, the call  addch('\n')
      +       The scrollok option controls what happens when the  cursor
      +       of  a  window  is  moved  off  the  edge  of the window or
      +       scrolling region, either as a result of a  newline  action
      +       on  the  bottom  line, or typing the last character of the
      +       last line.  If disabled, (bf is FALSE), the cursor is left
      +       on  the bottom line.  If enabled, (bf is TRUE), the window
      +       is scrolled up one line (Note that  to  get  the  physical
      +       scrolling  effect on the terminal, it is also necessary to
      +       call idlok).
      +
      +       The nl and nonl routines control  whether  the  underlying
      +       display  device  translates the return key into newline on
      +       input, and whether it translates newline into  return  and
      +       line-feed  on output (in either case, the call addch('\n')
              does the equivalent of return and line feed on the virtual
      -       screen).  Initially, these translations do occur.  If  you
      -       disable  them using nonl, curses will be able to make bet-
      -       ter use of the line-feed capability, resulting  in  faster
      -       cursor  motion.   Also, curses will then be able to detect
      +       screen).   Initially, these translations do occur.  If you
      +       disable them using nonl, curses will be able to make  bet-
      +       ter  use  of the line-feed capability, resulting in faster
      +       cursor motion.  Also, curses will then be able  to  detect
              the return key.
       
       
       

      RETURN VALUE

      -       The functions setscrreg and wsetscrreg return OK upon suc-
      -       cess  and ERR upon failure. All other routines that return
      -       an integer always return OK.
      +       The functions setscrreg and wsetscrreg return OK upon suc-
      +       cess and ERR upon failure.  All other routines that return
      +       an integer always return OK.
      +
       
       
       

      PORTABILITY

      -       These functions are described in the XSI Curses  standard,
      +       These  functions are described in the XSI Curses standard,
              Issue 4.
       
      -       The  XSI  Curses  standard is ambiguous on the question of
      -       whether raw() should disable the  CRLF  translations  con-
      -       trolled by nl() and nonl().  BSD curses did turn off these
      -       translations; AT&T curses (at least as late as  SVr1)  did
      -       not.   We choose to do so, on the theory that a programmer
      -       requesting raw input wants a clean (ideally  8-bit  clean)
      +       The XSI Curses standard is ambiguous on  the  question  of
      +       whether  raw()  should  disable the CRLF translations con-
      +       trolled by nl() and nonl().  BSD curses did turn off these
      +       translations;  AT&T  curses (at least as late as SVr1) did
      +       not.  We choose to do so, on the theory that a  programmer
      +       requesting  raw  input wants a clean (ideally 8-bit clean)
              connection that the operating system does not mess with.
       
      -       Some  historic  curses  implementations had, as an undocu-
      -       mented feature,  the  ability  to  do  the  equivalent  of
      -       clearok(...,  1)  by saying touchwin(stdscr) or clear(std-
      -       scr).  This will not work under ncurses.
      +       Some historic curses implementations had,  as  an  undocu-
      +       mented  feature,  the  ability  to  do  the  equivalent of
      +       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
      +       scr).  This will not work under ncurses.
       
      -       Earlier System V  curses  implementations  specified  that
      -       with  scrollok enabled, any window modification triggering
      -       a scroll also forced a physical refresh.  XSI Curses  does
      -       not  require this, and ncurses avoids doing it in order to
      -       perform better vertical-motion  optimization  at  wrefresh
      -       time.
      +       Earlier  System  V  curses  implementations specified that
      +       with scrollok enabled, any window modification  triggering
      +       a  scroll also forced a physical refresh.  XSI Curses does
      +       not require this, and ncurses avoids doing it  to  perform
      +       better vertical-motion optimization at wrefresh time.
       
              The  XSI  Curses standard does not mention that the cursor
      -       should be made invisible  as  a  side-effect  of  leaveok.
      +       should be made invisible  as  a  side-effect  of  leaveok.
              SVr4  curses  documentation  does  this, but the code does
      -       not.  Use curs_set to make the cursor invisible.
      +       not.  Use curs_set to make the cursor invisible.
       
       
       

      NOTES

      -       Note that clearok, leaveok, scrollok, idcok, nl, nonl  and
      -       setscrreg may be macros.
      +       Note that clearok, leaveok, scrollok, idcok, nl, nonl  and
      +       setscrreg may be macros.
       
      -       The immedok routine is useful for windows that are used as
      +       The immedok routine is useful for windows that are used as
              terminal emulators.
       
       
       

      SEE ALSO

      -       curses(3x),        curs_addch(3x),         curs_clear(3x),
      -       curs_initscr(3x), curs_scroll(3x), curs_refresh(3x)
      +       curses(3x),        curs_addch(3x),         curs_clear(3x),
      +       curs_initscr(3x), curs_scroll(3x), curs_refresh(3x)
      +
       
       
       
      diff --git a/doc/html/man/curs_overlay.3x.html b/doc/html/man/curs_overlay.3x.html
      index d2af67a8..64b4f71e 100644
      --- a/doc/html/man/curs_overlay.3x.html
      +++ b/doc/html/man/curs_overlay.3x.html
      @@ -1,66 +1,104 @@
      +
      +
       
      +
      +curs_overlay 3x
      +
      +
      +
       
      +

      curs_overlay 3x

      +
       
       
       

      NAME

      -       overlay, overwrite, copywin - overlay and manipulate over-
      -       lapped curses windows
      +       overlay, overwrite, copywin - overlay and manipulate over-
      +       lapped curses windows
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int overlay(const WINDOW *srcwin, WINDOW *dstwin);
      -       int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
      -       int copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow,
      -             int smincol, int dminrow, int dmincol, int dmaxrow,
      -             int dmaxcol, int overlay);
      +       int overlay(const WINDOW *srcwin, WINDOW *dstwin);
      +       int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
      +       int copywin(const  WINDOW  *srcwin,  WINDOW  *dstwin,  int
      +       sminrow,
      +             int smincol, int dminrow, int dmincol, int dmaxrow,
      +             int dmaxcol, int overlay);
       
       
       

      DESCRIPTION

      -       The overlay and overwrite routines overlay srcwin  on  top
      -       of  dstwin.   scrwin and dstwin are not required to be the
      -       same size; only text where  the  two  windows  overlap  is
      -       copied.  The difference is that overlay is non-destructive
      -       (blanks are not copied) whereas overwrite is  destructive.
      +       The  overlay  and overwrite routines overlay srcwin on top
      +       of dstwin.  scrwin and dstwin are not required to  be  the
      +       same  size;  only  text  where  the two windows overlap is
      +       copied.  The difference is that overlay is non-destructive
      +       (blanks  are not copied) whereas overwrite is destructive.
       
      -       The  copywin  routine provides a finer granularity of con-
      -       trol over the overlay and overwrite routines.  Like in the
      -       prefresh routine, a rectangle is specified in the destina-
      -       tion window, (dminrow, dmincol)  and  (dmaxrow,  dmaxcol),
      -       and  the  upper-left-corner coordinates of the source win-
      -       dow, (sminrow, smincol).  If the argument overlay is true,
      -       then copying is non-destructive, as in overlay.
      +       The copywin routine provides a finer granularity  of  con-
      +       trol over the overlay and overwrite routines.  Like in the
      +       prefresh routine, a rectangle is specified in the destina-
      +       tion  window,  (dminrow,  dmincol) and (dmaxrow, dmaxcol),
      +       and the upper-left-corner coordinates of the  source  win-
      +       dow, (sminrow, smincol).  If the argument overlay is true,
      +       then copying is non-destructive, as in overlay.
       
       
       

      RETURN VALUE

      -       Routines  that  return an integer return ERR upon failure,
      -       and OK (SVr4 only specifies "an integer value  other  than
      -       ERR") upon successful completion.
      +       Routines that return an integer return ERR  upon  failure,
      +       and  OK  (SVr4 only specifies "an integer value other than
      +       ERR") upon successful completion.
       
       
       

      NOTES

      -       Note that overlay and overwrite may be macros.
      +       Note that overlay and overwrite may be macros.
       
       
       

      PORTABILITY

              The XSI Curses standard, Issue 4 describes these functions
              (adding the const qualifiers).  It further specifies their
      -       behavior  in  the  presence  of characters with multi-byte
      -       renditions (not yet supported in this implementation).
      +       behavior in the presence of characters with multibyte ren-
      +       ditions (not yet supported in this implementation).
       
       
       

      SEE ALSO

      -       curses(3x), curs_pad(3x), curs_refresh(3x)
      -
      +       curses(3x), curs_pad(3x), curs_refresh(3x)
       
       
       
      diff --git a/doc/html/man/curs_pad.3x.html b/doc/html/man/curs_pad.3x.html
      index 6172c577..0da61e87 100644
      --- a/doc/html/man/curs_pad.3x.html
      +++ b/doc/html/man/curs_pad.3x.html
      @@ -1,95 +1,133 @@
      +
      +
       
      +
      +curs_pad 3x
      +
      +
      +
       
      +

      curs_pad 3x

      +
       
       
       

      NAME

      -       newpad, subpad, prefresh, pnoutrefresh, pechochar - create
      -       and display curses pads
      +       newpad, subpad, prefresh, pnoutrefresh, pechochar - create
      +       and display curses pads
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       WINDOW *newpad(int nlines, int ncols);
      -       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
      -             int begin_y, int begin_x);
      -       int prefresh(WINDOW *pad, int pminrow, int pmincol,
      -             int sminrow, int smincol, int smaxrow, int smaxcol);
      -       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
      -             int sminrow, int smincol, int smaxrow, int smaxcol);
      -       int pechochar(WINDOW *pad, chtype ch);
      +       WINDOW *newpad(int nlines, int ncols);
      +       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
      +             int begin_y, int begin_x);
      +       int prefresh(WINDOW *pad, int pminrow, int pmincol,
      +             int sminrow, int smincol, int smaxrow, int smaxcol);
      +       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
      +             int sminrow, int smincol, int smaxrow, int smaxcol);
      +       int pechochar(WINDOW *pad, chtype ch);
       
       
       

      DESCRIPTION

      -       The newpad routine creates and returns a pointer to a  new
      -       pad data structure with the given number of lines, nlines,
      -       and columns, ncols.  A pad is like a window,  except  that
      +       The newpad routine creates and returns a pointer to a  new
      +       pad data structure with the given number of lines, nlines,
      +       and columns, ncols.  A pad is like a window,  except  that
              it is not restricted by the screen size, and is not neces-
              sarily associated with a particular part  of  the  screen.
              Pads can be used when a large window is needed, and only a
              part of the window will be on  the  screen  at  one  time.
      -       Automatic refreshes of pads (e.g., from scrolling or echo-
      -       ing of input) do not occur.  It is not legal to call  wre-
      -       fresh  with a pad as an argument; the routines prefresh or
      -       pnoutrefresh should be called instead.   Note  that  these
      +       Automatic refreshes of pads (e.g., from scrolling or echo-
      +       ing of input) do not occur.  It is not legal to call  wre-
      +       fresh  with a pad as an argument; the routines prefresh or
      +       pnoutrefresh should be called instead.   Note  that  these
              routines require additional parameters to specify the part
              of the pad to be displayed and the location on the  screen
              to be used for the display.
       
      -       The subpad routine creates and returns a pointer to a sub-
      +       The subpad routine creates and returns a pointer to a sub-
              window within a  pad  with  the  given  number  of  lines,
      -       nlines,  and  columns,  ncols.   Unlike subwin, which uses
      -       screen coordinates, the window is  at  position  (begin_x,
      -       begin_y)  on the pad.  The window is made in the middle of
      -       the window orig, so that changes made to one window affect
      +       nlines,  and  columns,  ncols.   Unlike subwin, which uses
      +       screen coordinates, the window is  at  position  (begin_x,
      +       begin_y)  on the pad.  The window is made in the middle of
      +       the window orig, so that changes made to one window affect
              both  windows.   During  the  use of this routine, it will
      -       often be necessary to call touchwin or touchline  on  orig
      -       before calling prefresh.
      +       often be necessary to call touchwin or touchline  on  orig
      +       before calling prefresh.
       
      -       The  prefresh  and  pnoutrefresh routines are analogous to
      -       wrefresh and wnoutrefresh except that they relate to  pads
      +       The  prefresh  and  pnoutrefresh routines are analogous to
      +       wrefresh and wnoutrefresh except that they relate to  pads
              instead  of windows.  The additional parameters are needed
              to indicate what part of the pad and screen are  involved.
      -       pminrow  and pmincol specify the upper left-hand corner of
      -       the rectangle to be displayed in the pad.  sminrow,  smin-
      -       col, smaxrow, and smaxcol specify the edges of the rectan-
      +       pminrow  and pmincol specify the upper left-hand corner of
      +       the rectangle to be displayed in the pad.  sminrow,  smin-
      +       col, smaxrow, and smaxcol specify the edges of the rectan-
              gle to be displayed on the screen.  The  lower  right-hand
              corner of the rectangle to be displayed in the pad is cal-
              culated from the screen coordinates, since the  rectangles
              must  be  the same size.  Both rectangles must be entirely
              contained within their  respective  structures.   Negative
      -       values  of  pminrow,  pmincol,  sminrow,  or  smincol  are
      +       values  of  pminrow,  pmincol,  sminrow,  or  smincol  are
              treated as if they were zero.
       
      -       The pechochar routine is functionally equivalent to a call
      -       to  addch  followed by a call to refresh, a call to waddch
      -       followed by a call to wrefresh, or a call to  waddch  fol-
      -       lowed  by  a  call  to prefresh. The knowledge that only a
      +       The pechochar routine is functionally equivalent to a call
      +       to  addch  followed by a call to refresh, a call to waddch
      +       followed by a call to wrefresh, or a call to  waddch  fol-
      +       lowed  by  a  call  to prefresh. The knowledge that only a
              single character is being output is taken into  considera-
              tion  and, for non-control characters, a considerable per-
              formance gain  might  be  seen  by  using  these  routines
      -       instead  of  their equivalents.  In the case of pechochar,
      +       instead  of  their equivalents.  In the case of pechochar,
              the last location of the pad on the screen is  reused  for
      -       the arguments to prefresh.
      +       the arguments to prefresh.
       
       
       

      RETURN VALUE

      -       Routines  that  return  an integer return ERR upon failure
      -       and OK (SVr4 only specifies "an integer value  other  than
      -       ERR") upon successful completion.
      +       Routines  that  return  an integer return ERR upon failure
      +       and OK (SVr4 only specifies "an integer value  other  than
      +       ERR") upon successful completion.
       
      -       Routines  that  return  pointers return NULL on error, and
      -       set errno to ENOMEM.
      +       Routines  that  return  pointers return NULL on error, and
      +       set errno to ENOMEM.
       
       
       

      NOTES

      -       Note that pechochar may be a macro.
      +       Note that pechochar may be a macro.
       
       
       
      @@ -100,8 +138,8 @@

      SEE ALSO

      -       curses(3x),        curs_refresh(3x),       curs_touch(3x),
      -       curs_addch(3x).
      +       curses(3x),        curs_refresh(3x),       curs_touch(3x),
      +       curs_addch(3x).
       
       
       
      diff --git a/doc/html/man/curs_print.3x.html b/doc/html/man/curs_print.3x.html
      index 1319ba6d..adf7ccc0 100644
      --- a/doc/html/man/curs_print.3x.html
      +++ b/doc/html/man/curs_print.3x.html
      @@ -1,27 +1,65 @@
      +
      +
       
      +
      +curs_print 3x
      +
      +
      +
       
      +

      curs_print 3x

      +
       
       
       

      NAME

      -       mcprint - ship binary data to printer
      +       mcprint - ship binary data to printer
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int mcprint(char *data, int len);
      +       int mcprint(char *data, int len);
       
       
       

      DESCRIPTION

      -       This  function  uses the mc5p or mc4 and mc5 capabilities,
      +       This  function  uses the mc5p or mc4 and mc5 capabilities,
              if they are present, to  ship  given  data  to  a  printer
              attached to the terminal.
       
      -       Note  that  the mcprint code has no way to do flow control
      +       Note  that  the mcprint code has no way to do flow control
              with the printer or to know how  much  buffering  it  has.
              Your  application  is  responsible for keeping the rate of
              writes to the printer below its continuous throughput rate
      @@ -34,9 +72,9 @@
       
       

      RETURN VALUE

      -       The  mcprint  function  returns ERR if the write operation
      +       The  mcprint  function  returns ERR if the write operation
              aborted for some reason.  In this case, errno will contain
      -       either  an  error  associated  with write(2) or one of the
      +       either  an  error  associated  with write(2) or one of the
              following:
       
              ENODEV
      @@ -46,26 +84,26 @@
                   Couldn't allocate sufficient  memory  to  buffer  the
                   printer write.
       
      -            When mcprint succeeds, it returns the number of char-
      +            When mcprint succeeds, it returns the number of char-
                   acters actually sent to the printer.
       
       
       

      PORTABILITY

      -       The mcprint call was designed for ncurses(3x), and is  not
      +       The mcprint call was designed for ncurses(3x), and is  not
              found in SVr4 curses, 4.4BSD curses, or any other previous
              version of curses.
       
       
       

      BUGS

      -       Padding in the mc5p, mc4 and mc5 capabilities will not  be
      +       Padding in the mc5p, mc4 and mc5 capabilities will not  be
              interpreted.
       
       
       

      SEE ALSO

      -       curses(3x)
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/curs_printw.3x.html b/doc/html/man/curs_printw.3x.html
      index 95424b3a..0a61b82c 100644
      --- a/doc/html/man/curs_printw.3x.html
      +++ b/doc/html/man/curs_printw.3x.html
      @@ -1,63 +1,101 @@
      +
      +
       
      +
      +curs_printw 3x
      +
      +
      +
       
      +

      curs_printw 3x

      +
       
       
       

      NAME

      -       printw,  wprintw, mvprintw, mvwprintw, vwprintw, vw_printw
      -       - print formatted output in curses windows
      +       printw,  wprintw, mvprintw, mvwprintw, vwprintw, vw_printw
      +       - print formatted output in curses windows
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -
      -       int printw(char *fmt [, arg] ...);
      -       int wprintw(WINDOW *win, char *fmt [, arg] ...);
      -       int mvprintw(int y, int x, char *fmt [, arg] ...);
      -       int mvwprintw(WINDOW *win, int y, int x,
      -             char *fmt [, arg] ...);
      +       #include <curses.h>
       
      -       #include <varargs.h>
      -       int vwprintw(WINDOW *win, char *fmt, varglist);
      -       int vw_printw(WINDOW *win, char *fmt, varglist);
      +       int printw(char *fmt, ...);
      +       int wprintw(WINDOW *win, char *fmt, ...);
      +       int mvprintw(int y, int x, char *fmt, ...);
      +       int mvwprintw(WINDOW *win, int y, int x, char *fmt, ...);
      +       int vwprintw(WINDOW *win, char *fmt, va_list varglist);
      +       int vw_printw(WINDOW *win, char *fmt, va_list varglist);
       
       
       

      DESCRIPTION

      -       The printw, wprintw, mvprintw and mvwprintw  routines  are
      -       analogous  to  printf  [see  printf(3S)].   In effect, the
      -       string that would be output by printf is output instead as
      -       though waddstr were used on the given window.
      +       The printw, wprintw, mvprintw and mvwprintw  routines  are
      +       analogous  to  printf  [see  printf(3S)].   In effect, the
      +       string that would be output by printf is output instead as
      +       though waddstr were used on the given window.
       
      -       The   vwprintw   routine  is  analogous  to  vprintf  [see
      -       printf(3S)] and performs a wprintw using a variable  argu-
      -       ment  list.  The third argument is a va_list, a pointer to
      -       a list of arguments, as defined in <varargs.h>.
      +       The  vwprintw  and  wv_printw  routines  are  analogous to
      +       vprintf [see printf(3S)] and perform  a  wprintw  using  a
      +       variable  argument list.  The third argument is a va_list,
      +       a  pointer  to  a  list  of  arguments,  as   defined   in
      +       <stdarg.h>.
       
       
       

      RETURN VALUE

      -       Routines that return an integer return  ERR  upon  failure
      -       and  OK  (SVr4 only specifies "an integer value other than
      -       ERR") upon successful completion.
      +       Routines  that  return  an integer return ERR upon failure
      +       and OK (SVr4 only specifies "an integer value  other  than
      +       ERR") upon successful completion.
       
       
       

      PORTABILITY

      -       The XSI Curses standard, Issue  4  describes  these  func-
      -       tions.   The  function vwprintw is marked TO BE WITHDRAWN,
      -       and is to be replaced by a function  vw_printw  using  the
      -       <stdarg.h> interface.
      +       The  XSI  Curses  standard,  Issue 4 describes these func-
      +       tions.  The function vwprintw is marked TO  BE  WITHDRAWN,
      +       and  is  to  be replaced by a function vw_printw using the
      +       <stdarg.h> interface.  The Single Unix Specification, Ver-
      +       sion  2  states  that  vw_printw  is preferred to vwprintw
      +       since the latter  requires  including  <varargs.h>,  which
      +       cannot  be  used  in  the  same  file as <stdarg.h>.  This
      +       implementation uses  <stdarg.h>  for  both,  because  that
      +       header is included in <curses.h>.
       
       
       

      SEE ALSO

      -       curses(3x), printf(3S), vprintf(3S)
      -
      -
      -
      +       curses(3x), printf(3S), vprintf(3S)
       
       
       
      diff --git a/doc/html/man/curs_refresh.3x.html b/doc/html/man/curs_refresh.3x.html
      index a0c616c8..3ac1d00e 100644
      --- a/doc/html/man/curs_refresh.3x.html
      +++ b/doc/html/man/curs_refresh.3x.html
      @@ -1,88 +1,126 @@
      +
      +
       
      +
      +curs_refresh 3x
      +
      +
      +
       
      +

      curs_refresh 3x

      +
       
       
       

      NAME

      -       refresh, wrefresh, wnoutrefresh, doupdate, redrawwin, wre-
      -       drawln - refresh curses windows and lines
      +       doupdate,  redrawwin,  refresh,  wnoutrefresh,  wredrawln,
      +       wrefresh - refresh curses windows and lines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int refresh(void);
      -       int wrefresh(WINDOW *win);
      -       int wnoutrefresh(WINDOW *win);
      -       int doupdate(void);
      -       int redrawwin(WINDOW *win);
      -       int wredrawln(WINDOW *win, int beg_line, int num_lines);
      +       int refresh(void);
      +       int wrefresh(WINDOW *win);
      +       int wnoutrefresh(WINDOW *win);
      +       int doupdate(void);
      +       int redrawwin(WINDOW *win);
      +       int wredrawln(WINDOW *win, int beg_line, int num_lines);
       
       
       

      DESCRIPTION

      -       The refresh and wrefresh  routines  (or  wnoutrefresh  and
      -       doupdate)  must be called to get actual output to the ter-
      +       The refresh and wrefresh  routines  (or  wnoutrefresh  and
      +       doupdate)  must be called to get actual output to the ter-
              minal, as other routines  merely  manipulate  data  struc-
      -       tures.   The  routine  wrefresh copies the named window to
      +       tures.   The  routine  wrefresh copies the named window to
              the physical terminal screen, taking into account what  is
      -       already  there  in order to do optimizations.  The refresh
      -       routine is the same, using stdscr as the  default  window.
      -       Unless  leaveok  has  been enabled, the physical cursor of
      -       the terminal is left at the location  of  the  cursor  for
      -       that window.
      -
      -       The  wnoutrefresh  and  doupdate  routines  allow multiple
      -       updates with more  efficiency  than  wrefresh  alone.   In
      -       addition  to  all  the window structures, curses keeps two
      +       already there to do optimizations.  The refresh routine is
      +       the same, using stdscr  as  the  default  window.   Unless
      +       leaveok  has been enabled, the physical cursor of the ter-
      +       minal is left at the location of the cursor for that  win-
      +       dow.
      +
      +       The  wnoutrefresh  and  doupdate  routines  allow multiple
      +       updates with more  efficiency  than  wrefresh  alone.   In
      +       addition  to  all  the window structures, curses keeps two
              data structures representing the terminal screen: a physi-
              cal screen, describing what is actually on the screen, and
              a virtual screen, describing what the programmer wants  to
              have on the screen.
       
      -       The  routine wrefresh works by first calling wnoutrefresh,
      +       The  routine wrefresh works by first calling wnoutrefresh,
              which copies the named window to the virtual  screen,  and
      -       then  calling  doupdate, which compares the virtual screen
      +       then  calling  doupdate, which compares the virtual screen
              to the physical screen and does the actual update.  If the
              programmer  wishes  to  output  several windows at once, a
      -       series of calls to wrefresh results in  alternating  calls
      -       to  wnoutrefresh  and  doupdate, causing several bursts of
      -       output to the screen.  By first calling  wnoutrefresh  for
      -       each  window,  it  is then possible to call doupdate once,
      +       series of calls to wrefresh results in  alternating  calls
      +       to  wnoutrefresh  and  doupdate, causing several bursts of
      +       output to the screen.  By first calling  wnoutrefresh  for
      +       each  window,  it  is then possible to call doupdate once,
              resulting in only one burst of output,  with  fewer  total
      -       characters transmitted and less CPU time used.  If the win
      -       argument to wrefresh is the global  variable  curscr,  the
      +       characters transmitted and less CPU time used.  If the win
      +       argument to wrefresh is the global  variable  curscr,  the
              screen  is immediately cleared and repainted from scratch.
       
              The phrase "copies the named window to the virtual screen"
              above  is  ambiguous.   What  actually happens is that all
      -       touched (changed) lines in the window are  copied  to  the
      +       touched (changed) lines in the window are  copied  to  the
              virtual  screen.   This affects programs that use overlap-
              ping windows; it means that if two  windows  overlap,  you
              can  refresh  them  in either order and the overlap region
              will be modified only when it is explicitly changed.  (But
      -       see  the  section on PORTABILITY below for a warning about
      +       see  the  section on PORTABILITY below for a warning about
              exploiting this behavior.)
       
      -       The wredrawln routine indicates to curses that some screen
      +       The wredrawln routine indicates to curses that some screen
              lines  are corrupted and should be thrown away before any-
              thing is written over  them.   It  touches  the  indicated
      -       lines  (marking  them  changed).   The routine redrawwin()
      +       lines  (marking  them  changed).   The routine redrawwin()
              touches the entire window.
       
       
       

      RETURN VALUE

      -       Routines that return an integer return ERR  upon  failure,
      -       and  OK  (SVr4 only specifies "an integer value other than
      -       ERR") upon successful completion.
      +       Routines that return an integer return ERR  upon  failure,
      +       and  OK  (SVr4 only specifies "an integer value other than
      +       ERR") upon successful completion.
       
       
       

      NOTES

      -       Note that refresh and redrawwin may be macros.
      +       Note that refresh and redrawwin may be macros.
       
       
       
      @@ -90,19 +128,19 @@ The XSI Curses standard, Issue 4 describes these func- tions. - Whether wnoutrefresh() copies to the virtual screen the + Whether wnoutrefresh() copies to the virtual screen the entire contents of a window or just its changed portions has never been well-documented in historic curses versions (including SVr4). It might be unwise to rely on either behavior in programs that might have to be linked with other curses implementations. Instead, you can do an - explicit touchwin() before the wnoutrefresh() call to + explicit touchwin() before the wnoutrefresh() call to guarantee an entire-contents copy anywhere.

      SEE ALSO

      -       curses(3x), curs_outopts(3x)
      +       curses(3x), curs_outopts(3x)
       
       
       
      diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html
      index 1fb1ba9e..3e132c16 100644
      --- a/doc/html/man/curs_scanw.3x.html
      +++ b/doc/html/man/curs_scanw.3x.html
      @@ -1,62 +1,154 @@
      +
      +
       
      +
      +curs_scanw 3x
      +
      +
      +
       
      +

      curs_scanw 3x

      +
       
       
       

      NAME

      -       scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - con-
      -       vert formatted input from a curses window
      +       scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - con-
      +       vert formatted input from a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int scanw(char *fmt [, arg] ...);
      -       int wscanw(WINDOW *win, char *fmt [, arg] ...);
      -       int mvscanw(int y, int x, char *fmt [, arg] ...);
      -       int mvwscanw(WINDOW *win, int y, int x,
      -             char *fmt [, arg] ...);
      -       int vw_scanw(WINDOW *win, char *fmt, va_list varglist);
      -       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
      +       int scanw(char *fmt, ...);
      +       int wscanw(WINDOW *win, char *fmt, ...);
      +       int mvscanw(int y, int x, char *fmt, ...);
      +       int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...);
      +       int vw_scanw(WINDOW *win, char *fmt, va_list varglist);
      +       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
       
       
       

      DESCRIPTION

      -       The scanw, wscanw and mvscanw routines  are  analogous  to
      -       scanf [see scanf(3S)].  The effect of these routines is as
      -       though wgetstr were called on the window, and the  result-
      -       ing line used as input for sscanf(3).  Fields which do not
      -       map to a variable in the fmt field are lost.
      +       The scanw, wscanw and mvscanw routines  are  analogous  to
      +       scanf [see scanf(3S)].  The effect of these routines is as
      +       though wgetstr were called on the window, and the  result-
      +       ing line used as input for sscanf(3).  Fields which do not
      +       map to a variable in the fmt field are lost.
       
      -       The vwscanw routine is similar to vwprintw in that it per-
      -       forms  a wscanw using a variable argument list.  The third
      -       argument is a va_list, a pointer to a list  of  arguments,
      -       as defined in <varargs.h>.
      +       The vwscanw and vw_scanw routines are analogous to vscanf.
      +       They perform a wscanw using a variable argument list.  The
      +       third argument is a va_list, a pointer to a list of  argu-
      +       ments, as defined in <stdarg.h>.
       
       
       

      RETURN VALUE

      -       vwscanw returns ERR on failure and an integer equal to the
      +       vwscanw returns ERR on failure and an integer equal to the
              number of fields scanned on success.
       
      -       Applications may use the  return  value  from  the  scanw,
      -       wscanw,  mvscanw  and  mvwscanw  routines to determine the
      +       Applications may use the  return  value  from  the  scanw,
      +       wscanw,  mvscanw  and  mvwscanw  routines to determine the
              number of fields which were mapped in the call.
       
       
       

      PORTABILITY

              The XSI Curses standard, Issue  4  describes  these  func-
      -       tions.   The  function  vwscanw is marked TO BE WITHDRAWN,
      -       and is to be replaced by a  function  vw_scanw  using  the
      -       <stdarg.h> interface.
      +       tions.   The  function  vwscanw is marked TO BE WITHDRAWN,
      +       and is to be replaced by a  function  vw_scanw  using  the
      +       <stdarg.h> interface.  The Single Unix Specification, Ver-
      +       sion 2 states that vw_scanw  is preferred to vwscanw since
      +       the latter requires including <varargs.h>, which cannot be
      +       used in the same file as <stdarg.h>.  This  implementation
      +       uses  <stdarg.h> for both, because that header is included
      +       in <curses.h>.
      +
      +       Both XSI and The  Single  Unix  Specification,  Version  2
      +       state  that  these  functions return ERR or OK.  Since the
      +       underlying scanf can return the number of  items  scanned,
      +       and the SVr4 code was documented to use this feature, this
      +       is probably an editing error which was introduced in  XSI,
      +       rather  than  being done intentionally.  Portable applica-
      +       tions should only test if the return value is  ERR,  since
      +       the  OK value (zero) is likely to be misleading.  One pos-
      +       sible way to get useful results would be  to  use  a  "%n"
      +       conversion  at the end of the format string to ensure that
      +       something was processed.
       
       
       

      SEE ALSO

      -       curses(3x), curs_getstr(3x), curs_printw(3x), scanf(3S)
      +       curses(3x), curs_getstr(3x), curs_printw(3x), scanf(3S)
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
       
       
       
      diff --git a/doc/html/man/curs_scr_dump.3x.html b/doc/html/man/curs_scr_dump.3x.html
      index 7931102d..c64c48ce 100644
      --- a/doc/html/man/curs_scr_dump.3x.html
      +++ b/doc/html/man/curs_scr_dump.3x.html
      @@ -1,66 +1,104 @@
      +
      +
       
      +
      +curs_scr_dump 3x
      +
      +
      +
       
      +

      curs_scr_dump 3x

      +
       
       
       

      NAME

      -       scr_dump,  scr_restore, scr_init, scr_set - read (write) a
      -       curses screen from (to) a file
      +       scr_dump,  scr_restore, scr_init, scr_set - read (write) a
      +       curses screen from (to) a file
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int scr_dump(const char *filename);
      -       int scr_restore(const char *filename);
      -       int scr_init(const char *filename);
      -       int scr_set(const char *filename);
      +       int scr_dump(const char *filename);
      +       int scr_restore(const char *filename);
      +       int scr_init(const char *filename);
      +       int scr_set(const char *filename);
       
       
       

      DESCRIPTION

      -       The scr_dump routine dumps the  current  contents  of  the
      -       virtual screen to the file filename.
      +       The scr_dump routine dumps the  current  contents  of  the
      +       virtual screen to the file filename.
       
      -       The  scr_restore  routine  sets  the virtual screen to the
      -       contents of filename, which must have been  written  using
      -       scr_dump.   The  next call to doupdate restores the screen
      +       The  scr_restore  routine  sets  the virtual screen to the
      +       contents of filename, which must have been  written  using
      +       scr_dump.   The  next call to doupdate restores the screen
              to the way it looked in the dump file.
       
      -       The scr_init routine reads in the contents of filename and
      -       uses  them  to initialize the curses data structures about
      +       The scr_init routine reads in the contents of filename and
      +       uses  them  to initialize the curses data structures about
              what the terminal currently has on  its  screen.   If  the
      -       data  is  determined  to  be  valid, curses bases its next
      +       data  is  determined  to  be  valid, curses bases its next
              update of the  screen  on  this  information  rather  than
      -       clearing  the  screen and starting from scratch.  scr_init
      -       is used after initscr or  a  system  [see  system(BA_LIB)]
      +       clearing  the  screen and starting from scratch.  scr_init
      +       is used after initscr or  a  system  [see  system(BA_LIB)]
              call  to  share  the screen with another process which has
      -       done a scr_dump  after  its  endwin  call.   The  data  is
      -       declared  invalid  if  the terminfo capabilities rmcup and
      -       nrrmc exist; also if the  terminal  has  been  written  to
      -       since the preceding scr_dump call.
      -
      -       The  scr_set  routine  is a combination of scr_restore and
      -       scr_init.  It tells the program that  the  information  in
      -       filename is what is currently on the screen, and also what
      +       done a scr_dump  after  its  endwin  call.   The  data  is
      +       declared  invalid  if  the terminfo capabilities rmcup and
      +       nrrmc exist; also if the  terminal  has  been  written  to
      +       since the preceding scr_dump call.
      +
      +       The  scr_set  routine  is a combination of scr_restore and
      +       scr_init.  It tells the program that  the  information  in
      +       filename is what is currently on the screen, and also what
              the program wants on the screen.  This can be  thought  of
              as a screen inheritance function.
       
      -       To  read (write) a window from (to) a file, use the getwin
      -       and putwin routines [see curs_util(3x)].
      +       To  read (write) a window from (to) a file, use the getwin
      +       and putwin routines [see curs_util(3x)].
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon  failure  and  OK
      +       All routines return the integer ERR upon  failure  and  OK
              upon success.
       
       
       

      NOTES

      -       Note  that  scr_init,  scr_set,  and  scr_restore  may  be
      +       Note  that  scr_init,  scr_set,  and  scr_restore  may  be
              macros.
       
       
      @@ -68,15 +106,15 @@
       

      PORTABILITY

              The XSI Curses standard, Issue 4,  describes  these  func-
              tions (adding the const qualifiers).
      -       The SVr4 docs merely say under scr_init that the dump data
      +       The SVr4 docs merely say under scr_init that the dump data
              is also considered invalid "if the time-stamp of  the  tty
              is old" but don't define "old".
       
       
       

      SEE ALSO

      -       curses(3x),       curs_initscr(3x),      curs_refresh(3x),
      -       curs_util(3x), system(3S)
      +       curses(3x),       curs_initscr(3x),      curs_refresh(3x),
      +       curs_util(3x), system(3S)
       
       
       
      diff --git a/doc/html/man/curs_scroll.3x.html b/doc/html/man/curs_scroll.3x.html
      index fb2abac9..cd50d76e 100644
      --- a/doc/html/man/curs_scroll.3x.html
      +++ b/doc/html/man/curs_scroll.3x.html
      @@ -1,58 +1,96 @@
      +
      +
       
      +
      +curs_scroll 3x
      +
      +
      +
       
      +

      curs_scroll 3x

      +
       
       
       

      NAME

      -       scroll, scrl, wscrl - scroll a curses window
      +       scroll, scrl, wscrl - scroll a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int scroll(WINDOW *win);
      -       int scrl(int n);
      -       int wscrl(WINDOW *win, int n);
      +       int scroll(WINDOW *win);
      +       int scrl(int n);
      +       int wscrl(WINDOW *win, int n);
       
       
       

      DESCRIPTION

      -       The  scroll  routine scrolls the window up one line.  This
      +       The  scroll  routine scrolls the window up one line.  This
              involves moving the lines in the  window  data  structure.
              As  an optimization, if the scrolling region of the window
              is the entire screen, the physical screen may be  scrolled
              at the same time.
       
      -       For  positive  n,  the  scrl and wscrl routines scroll the
      -       window up n lines (line i+n becomes i);  otherwise  scroll
      -       the  window  down n lines.  This involves moving the lines
      +       For  positive  n,  the  scrl and wscrl routines scroll the
      +       window up n lines (line i+n becomes i);  otherwise  scroll
      +       the  window  down n lines.  This involves moving the lines
              in the window character image structure.  The current cur-
              sor position is not changed.
       
              For these functions to work, scrolling must be enabled via
      -       scrollok.
      +       scrollok.
       
       
       

      RETURN VALUE

      -       These routines return ERR upon failure, and OK (SVr4  only
      -       specifies "an integer value other than ERR") upon success-
      +       These routines return ERR upon failure, and OK (SVr4  only
      +       specifies "an integer value other than ERR") upon success-
              ful completion.
       
       
       

      NOTES

      -       Note that scrl and scroll may be macros.
      +       Note that scrl and scroll may be macros.
       
              The SVr4 documentation says that the optimization of phys-
              ically  scrolling  immediately if the scroll region is the
              entire screen "is"  performed,  not  "may  be"  performed.
              This  implementation  deliberately does not guarantee that
      -       this will occur, in order to leave open the possibility of
      -       smarter  optimization  of  multiple  scroll actions on the
      -       next update.
      +       this will occur, to leave open the possibility of  smarter
      +       optimization  of  multiple  scroll  actions  on  the  next
      +       update.
       
              Neither the SVr4 nor the XSI documentation specify whether
              the current attribute or current color-pair of blanks gen-
      @@ -68,7 +106,7 @@
       
       

      SEE ALSO

      -       curses(3x), curs_outopts(3x)
      +       curses(3x), curs_outopts(3x)
       
       

      diff --git a/doc/html/man/curs_slk.3x.html b/doc/html/man/curs_slk.3x.html index cf77d62d..9a0a29a4 100644 --- a/doc/html/man/curs_slk.3x.html +++ b/doc/html/man/curs_slk.3x.html @@ -1,47 +1,85 @@ + + + +curs_slk 3x + + + +

      curs_slk 3x

      +
       
       
       

      NAME

      -       slk_init,     slk_set,    slk_refresh,    slk_noutrefresh,
      -       slk_label, slk_clear, slk_restore, slk_touch,  slk_attron,
      -       slk_attrset,   slk_attroff,   slk_attr_on,   slk_attr_set,
      -       slk_attr_off, slk_attr slk_color - curses soft label  rou-
      +       slk_init,     slk_set,    slk_refresh,    slk_noutrefresh,
      +       slk_label, slk_clear, slk_restore, slk_touch,  slk_attron,
      +       slk_attrset,   slk_attroff,   slk_attr_on,   slk_attr_set,
      +       slk_attr_off, slk_attr, slk_color - curses soft label rou-
              tines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -
      -       int slk_init(int fmt);
      -       int slk_set(int labnum, const char *label, int fmt);
      -       int slk_refresh(void);
      -       int slk_noutrefresh(void);
      -       char *slk_label(int labnum);
      -       int slk_clear(void);
      -       int slk_restore(void);
      -       int slk_touch(void);
      -       int slk_attron(const chtype attrs);
      -       int slk_attroff(const chtype attrs);
      -       int slk_attrset(const chtype attrs);
      -       int slk_attr_on(attr_t attrs, void* opts);
      -       int slk_attr_off(const attr_t attrs, void * opts);
      -       int slk_attr_set(const attr_t attrs,
      -            short color_pair_number, void* opts);
      -       attr_t slk_attr(void);
      -       int slk_color(short color_pair_number);
      +       #include <curses.h>
      +
      +       int slk_init(int fmt);
      +       int slk_set(int labnum, const char *label, int fmt);
      +       int slk_refresh(void);
      +       int slk_noutrefresh(void);
      +       char *slk_label(int labnum);
      +       int slk_clear(void);
      +       int slk_restore(void);
      +       int slk_touch(void);
      +       int slk_attron(const chtype attrs);
      +       int slk_attroff(const chtype attrs);
      +       int slk_attrset(const chtype attrs);
      +       int slk_attr_on(attr_t attrs, void* opts);
      +       int slk_attr_off(const attr_t attrs, void * opts);
      +       int slk_attr_set(const attr_t attrs,
      +            short color_pair_number, void* opts);
      +       attr_t slk_attr(void);
      +       int slk_color(short color_pair_number);
       
       
       

      DESCRIPTION

              The slk* functions manipulate the set of soft function-key
              labels that exist on many terminals.  For those  terminals
      -       that do not have soft labels, curses takes over the bottom
      -       line of stdscr, reducing the size of stdscr and the  vari-
      -       able  LINES.  curses standardizes on eight labels of up to
      +       that do not have soft labels, curses takes over the bottom
      +       line of stdscr, reducing the size of stdscr and the  vari-
      +       able  LINES.  curses standardizes on eight labels of up to
              eight characters each. In addition to  this,  the  ncurses
              implementation  supports  a  mode  where  it  simulates 12
              labels of up to five characters each. This is most  common
      @@ -50,47 +88,47 @@
              at  the  bottom  of  the screen, it doesn't try to use any
              hardware support for this mode.
       
      -       The slk_init routine must  be  called  before  initscr  or
      -       newterm is called.  If initscr eventually uses a line from
      -       stdscr to emulate the soft labels, then fmt determines how
      -       the  labels  are arranged on the screen.  Setting fmt to 0
      -       indicates a 3-2-3 arrangement of the labels, 1 indicates a
      -       4-4 arrangement and 2 indicates the PC like 4-4-4 mode. If
      -       fmt is set to 3, it is again the PC like 4-4-4  mode,  but
      +       The slk_init routine must  be  called  before  initscr  or
      +       newterm is called.  If initscr eventually uses a line from
      +       stdscr to emulate the soft labels, then fmt determines how
      +       the  labels  are arranged on the screen.  Setting fmt to 0
      +       indicates a 3-2-3 arrangement of the labels, 1 indicates a
      +       4-4 arrangement and 2 indicates the PC like 4-4-4 mode. If
      +       fmt is set to 3, it is again the PC like 4-4-4  mode,  but
              in  addition  an index line is generated, helping the user
              to identify the key numbers easily.
       
      -       The slk_set routine requires labnum to be a label  number,
      -       from 1 to 8 (resp. 12); label must be the string to be put
      +       The slk_set routine requires labnum to be a label  number,
      +       from 1 to 8 (resp. 12); label must be the string to be put
              on the label, up  to  eight  (resp.  five)  characters  in
              length.   A  null string or a null pointer sets up a blank
      -       label. fmt is either 0, 1, or 2,  indicating  whether  the
      +       label. fmt is either 0, 1, or 2,  indicating  whether  the
              label  is  to be left-justified, centered, or right-justi-
              fied, respectively, within the label.
       
      -       The slk_refresh and slk_noutrefresh routines correspond to
      -       the wrefresh and wnoutrefresh routines.
      +       The slk_refresh and slk_noutrefresh routines correspond to
      +       the wrefresh and wnoutrefresh routines.
       
      -       The  slk_label routine returns the current label for label
      -       number labnum, with leading and trailing blanks  stripped.
      +       The  slk_label routine returns the current label for label
      +       number labnum, with leading and trailing blanks  stripped.
       
      -       The  slk_clear  routine  clears  the  soft labels from the
      +       The  slk_clear  routine  clears  the  soft labels from the
              screen.
       
      -       The slk_restore routine, restores the soft labels  to  the
      -       screen after a slk_clear has been performed.
      +       The slk_restore routine, restores the soft labels  to  the
      +       screen after a slk_clear has been performed.
       
      -       The  slk_touch  routine  forces  all the soft labels to be
      -       output the next time a slk_noutrefresh is performed.
      +       The  slk_touch  routine  forces  all the soft labels to be
      +       output the next time a slk_noutrefresh is performed.
       
      -       The slk_attron, slk_attrset, slk_attroff and slk_attr rou-
      -       tines correspond to attron, attrset, attroff and attr_get.
      +       The slk_attron, slk_attrset, slk_attroff and slk_attr rou-
      +       tines correspond to attron, attrset, attroff and attr_get.
              They have an effect only if soft labels are  simulated  on
              the  bottom line of the screen.  The default highlight for
              soft keys is A_STANDOUT (as in System V curses, which does
              not document this fact).
       
      -       The  slk_color routine corresponds to color_set. It has an
      +       The  slk_color routine corresponds to color_set. It has an
              effect only if soft labels are  simulated  on  the  bottom
              line of the screen.
       
      @@ -98,35 +136,35 @@
       
       

      RETURN VALUE

      -       These routines return ERR upon failure and OK (SVr4 speci-
      -       fies only "an integer value other than ERR") upon success-
      -       ful  completion.  slk_attr  returns the attribute used for
      +       These routines return ERR upon failure and OK (SVr4 speci-
      +       fies only "an integer value other than ERR") upon success-
      +       ful  completion.  slk_attr  returns the attribute used for
              the soft keys.
       
      -       slk_label returns NULL on error.
      +       slk_label returns NULL on error.
       
       
       

      NOTES

      -       Most applications would use slk_noutrefresh because a wre-
      -       fresh is likely to follow soon.
      +       Most applications would use slk_noutrefresh because a wre-
      +       fresh is likely to follow soon.
       
       
       

      PORTABILITY

              The  XSI  Curses  standard, Issue 4, describes these func-
              tions.  It changes the argument  type  of  the  attribute-
      -       manipulation     functions     slk_attron,    slk_attroff,
      -       slk_attrset to be attr_t, and adds const  qualifiers.  The
      -       format  codes  2  and  3  for  slk_init() and the function
      -       slk_attr are specific to ncurses.
      +       manipulation     functions     slk_attron,    slk_attroff,
      +       slk_attrset to be attr_t, and adds const  qualifiers.  The
      +       format  codes  2  and  3  for  slk_init() and the function
      +       slk_attr are specific to ncurses.
       
       
       
       

      SEE ALSO

      -       curses(3x),        curs_attr(3x),        curs_initscr(3x),
      -       curs_refresh(3x)
      +       curses(3x),        curs_attr(3x),        curs_initscr(3x),
      +       curs_refresh(3x)
       
       
       
      diff --git a/doc/html/man/curs_termattrs.3x.html b/doc/html/man/curs_termattrs.3x.html
      index 21191777..dc35ff7c 100644
      --- a/doc/html/man/curs_termattrs.3x.html
      +++ b/doc/html/man/curs_termattrs.3x.html
      @@ -1,109 +1,147 @@
      +
      +
       
      +
      +curs_termattrs 3x
      +
      +
      +
       
      +

      curs_termattrs 3x

      +
       
       
       

      NAME

      -       baudrate,  erasechar,  has_ic, has_il, killchar, longname,
      -       termattrs, termname - curses environment query routines
      +       baudrate, erasechar, erasewchar, has_ic, has_il, killchar,
      +       killwchar, longname,  term_attrs,  termattrs,  termname  -
      +       curses environment query routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int baudrate(void);
      -       char erasechar(void);
      -       bool has_ic(void);
      -       bool has_il(void);
      -       char killchar(void);
      -       char *longname(void);
      -       attr_t termattrs(void);
      -       char *termname(void);
      +       int baudrate(void);
      +       char erasechar(void);
      +       int erasewchar(wchar_t *ch);
      +       bool has_ic(void);
      +       bool has_il(void);
      +       char killchar(void);
      +       int killwchar(wchar_t *ch);
      +       char *longname(void);
      +       attr_t term_attrs(void);
      +       chtype termattrs(void);
      +       char *termname(void);
       
       
       

      DESCRIPTION

      -       The baudrate routine returns the output speed of the  ter-
      -       minal.   The  number  returned  is in bits per second, for
      -       example 9600, and is an integer.
      +       The  baudrate routine returns the output speed of the ter-
      +       minal.  The number returned is in  bits  per  second,  for
      +       example 9600, and is an integer.
       
      -       The erasechar routine returns  the  user's  current  erase
      +       The  erasechar  routine  returns  the user's current erase
              character.
       
      -       The has_ic routine is true if the terminal has insert- and
      +       The erasewchar routine stores the current erase  character
      +       in  the  location referenced by ch.  If no erase character
      +       has been defined, the routine fails and the location  ref-
      +       erenced by ch is not changed.
      +
      +       The has_ic routine is true if the terminal has insert- and
              delete- character capabilities.
       
      -       The has_il routine is true if the terminal has insert- and
      +       The has_il routine is true if the terminal has insert- and
              delete-line  capabilities,  or  can  simulate  them  using
              scrolling regions.  This might be used to determine if  it
              would  be  appropriate to turn on physical scrolling using
      -       scrollok.
      +       scrollok.
       
      -       The killchar routine returns the user's current line  kill
      +       The killchar routine returns the user's current line  kill
              character.
       
      -       The  longname  routine  returns a pointer to a static area
      -       containing a verbose description of the current  terminal.
      +       The killwchar routine stores the current line-kill charac-
      +       ter in the location referenced by  ch.   If  no  line-kill
      +       character  has  been  defined,  the  routine fails and the
      +       location referenced by ch is not changed.
      +
      +       The longname routine returns a pointer to  a  static  area
      +       containing  a verbose description of the current terminal.
              The maximum length of a verbose description is 128 charac-
      -       ters.  It is defined only after the  call  to  initscr  or
      -       newterm.   The area is overwritten by each call to newterm
      -       and is not restored by set_term, so the  value  should  be
      -       saved  between calls to newterm if longname is going to be
      +       ters.   It  is  defined  only after the call to initscr or
      +       newterm.  The area is overwritten by each call to  newterm
      +       and  is  not  restored by set_term, so the value should be
      +       saved between calls to newterm if longname is going to  be
              used with multiple terminals.
       
              If a given terminal doesn't support a video attribute that
      -       an  application  program is trying to use, curses may sub-
      -       stitute a different video attribute for it.  The termattrs
      -       function returns a logical OR of all video attributes sup-
      -       ported by the terminal.  This information is useful when a
      -       curses  program needs complete control over the appearance
      +       an application program is trying to use, curses  may  sub-
      +       stitute a different video attribute for it.  The termattrs
      +       and term_attrs functions return a logical OR of all  video
      +       attributes supported by the terminal using A_ and WA_ con-
      +       stants respectively.  This information is  useful  when  a
      +       curses  program needs complete control over the appearance
              of the screen.
       
      -       The  termname   routine   returns   the   value   of   the
      -       environmental  variable TERM (truncated to 14 characters).
      +       The termname routine returns the value of the  environmen-
      +       tal variable TERM (truncated to 14 characters).
       
       
       

      RETURN VALUE

      -       longname and termname return NULL on error.
      +       longname and termname return NULL on error.
       
      -       Routines that return an integer return  ERR  upon  failure
      -       and  OK  (SVr4 only specifies "an integer value other than
      -       ERR") upon successful completion.
      +       Routines  that  return  an integer return ERR upon failure
      +       and OK (SVr4 only specifies "an integer value  other  than
      +       ERR") upon successful completion.
       
       
       

      NOTES

      -       Note that termattrs may be a macro.
      +       Note that termattrs may be a macro.
       
       
       

      PORTABILITY

      -       The XSI Curses standard, Issue  4  describes  these  func-
      -       tions.  It changes the return type of termattrs to the new
      -       type attr_t.
      +       The  XSI  Curses  standard,  Issue 4 describes these func-
      +       tions.  It changes the return type of termattrs to the new
      +       type attr_t.
       
       
       

      SEE ALSO

      -       curses(3x), curs_initscr(3x), curs_outopts(3x)
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x), curs_initscr(3x), curs_outopts(3x)
       
       
       
      diff --git a/doc/html/man/curs_termcap.3x.html b/doc/html/man/curs_termcap.3x.html
      index a301dd18..f510812b 100644
      --- a/doc/html/man/curs_termcap.3x.html
      +++ b/doc/html/man/curs_termcap.3x.html
      @@ -1,82 +1,138 @@
      +
      +
       
      +
      +curs_termcap 3x
      +
      +
      +
       
      +

      curs_termcap 3x

      +
       
       
       

      NAME

      -       tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs - direct
      -       curses interface to the terminfo capability database
      +       tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs - direct
      +       curses interface to the terminfo capability database
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       #include <term.h>
      -       int tgetent(const char *bp, char *name);
      -       int tgetflag(const char *id);
      -       int tgetnum(const char *id);
      -       char *tgetstr(const char *id, char **area);
      -       char *tgoto(const char *cap, int col, int row);
      -       int tputs(const char *str, int affcnt, int (*putc)(int));
      +       #include <curses.h>
      +       #include <term.h>
      +       extern char PC; extern char * UP; extern char * BC; extern
      +       short ospeed;
      +       int tgetent(char *bp, const char *name);
      +       int tgetflag(char *id);
      +       int tgetnum(char *id);
      +       char *tgetstr(char *id, char **area);
      +       char *tgoto(const char *cap, int col, int row);
      +       int tputs(const char *str, int affcnt, int (*putc)(int));
       
       
       

      DESCRIPTION

      -       These routines are included as a conversion aid  for  pro-
      -       grams  that use the termcap library.  Their parameters are
      -       the same and the routines are emulated using the  terminfo
      -       database.   Thus, they can only be used to query the capa-
      -       bilities of entries for which a terminfo  entry  has  been
      +       These  routines  are included as a conversion aid for pro-
      +       grams that use the termcap library.  Their parameters  are
      +       the  same and the routines are emulated using the terminfo
      +       database.  Thus, they can only be used to query the  capa-
      +       bilities  of  entries  for which a terminfo entry has been
              compiled.
       
      -       The  tgetent routine loads the entry for name.  It returns
      -       1 on success, 0 if there is no such entry, and -1  if  the
      -       terminfo  database  could  not  be  found.   The emulation
      -       ignores the buffer pointer bp.
      +       The tgetent routine loads the entry for name.  It  returns
      +       1  on  success, 0 if there is no such entry, and -1 if the
      +       terminfo database  could  not  be  found.   The  emulation
      +       ignores the buffer pointer bp.
       
      -       The tgetflag routine gets the boolean  entry  for  id,  or
      +       The  tgetflag  routine  gets  the boolean entry for id, or
              zero if it is not available.
       
      -       The  tgetnum  routine gets the numeric entry for id, or -1
      +       The tgetnum routine gets the numeric entry for id,  or  -1
              if it is not available.
       
      -       The tgetstr routine returns the string entry  for  id,  or
      -       zero  if  it  is  not  available.  Use tputs to output the
      -       returned string.  The return value will also be copied  to
      -       the  buffer pointed to by area, and the area value will be
      +       The  tgetstr  routine  returns the string entry for id, or
      +       zero if it is not available.   Use  tputs  to  output  the
      +       returned  string.  The return value will also be copied to
      +       the buffer pointed to by area, and the area value will  be
              updated to point past the null ending this value.
       
      -       The tgoto routine instantiates  the  parameters  into  the
      +       Only the first two characters of the id parameter of tget-
      +       flag, tgetnum and tgetstr are compared in lookups.
      +
      +       The tgoto routine instantiates  the  parameters  into  the
              given  capability.   The output from this routine is to be
      -       passed to tputs.
      +       passed to tputs.
       
      -       The tputs routine is described  on  the  curs_terminfo(3x)
      +       The tputs routine is described  on  the  curs_terminfo(3x)
              manual page.  It can retrieve capabilities by either term-
              cap or terminfo name.
       
      +       The variables PC, UP and BC are set by tgetent to the ter-
      +       minfo   entry's   data   for   pad_char,   cursor_up   and
      +       backspace_if_not_bs, respectively.   UP  is  not  used  by
      +       ncurses.  PC is used in the tdelay_output function.  BC is
      +       used in the tgoto emulation.  The variable ospeed  is  set
      +       by ncurses in a system-specific coding to reflect the ter-
      +       minal speed.
      +
       
       
       

      RETURN VALUE

              Except where explicitly noted,  routines  that  return  an
      -       integer  return  ERR upon failure and OK (SVr4 only speci-
      -       fies "an integer value other than  ERR")  upon  successful
      +       integer  return  ERR upon failure and OK (SVr4 only speci-
      +       fies "an integer value other than  ERR")  upon  successful
              completion.
       
      -       Routines that return pointers return NULL on error.
      +       Routines that return pointers return NULL on error.
       
       
       

      BUGS

      -       If you call tgetstr to fetch ca or any other parameterized
      +       If you call tgetstr to fetch ca or any other parameterized
              string, be aware that it  will  be  returned  in  terminfo
              notation,  not  the older and not-quite-compatible termcap
              notation.  This won't cause problems if all you do with it
      -       is  call tgoto or tparm, which both expand terminfo-style.
      +       is  call  tgoto or tparm, which both expand terminfo-style
      +       strings as terminfo.  (The tgoto function,  if  configured
      +       to  support  termcap,  will  check if the string is indeed
      +       terminfo-style by looking for "%p" parameters  or  "$<..>"
      +       delays,  and  invoke  a termcap-style parser if the string
      +       does not appear to be terminfo).
       
              Because terminfo conventions for representing  padding  in
      -       string  capabilities  differ  from termcap's, tputs("50");
      +       string  capabilities  differ  from termcap's, tputs("50");
              will put out a literal "50" rather than  busy-waiting  for
              50 milliseconds.  Cope with it.
       
      @@ -88,42 +144,24 @@
              be removed in future versions.
       
              Neither  the  XSI  Curses  standard nor the SVr4 man pages
      -       documented the return values of tgetent correctly,  though
      -       all three were in fact returned ever since SVr1.
      +       documented the return values of tgetent correctly,  though
      +       all  three were in fact returned ever since SVr1.  In par-
      +       ticular, an omission in the XSI Curses  documentation  has
      +       been  misinterpreted  to  mean  that tgetent returns OK or
      +       ERR.  Because the purpose of these functions is to provide
      +       compatibility  with  the termcap library, that is a defect
      +       in XCurses, Issue 4, Version 2 rather than in ncurses.
      +
      +       External variables are provided  for  support  of  certain
      +       termcap  applications.  However, termcap applications' use
      +       of those variables is poorly documented, e.g., not distin-
      +       guishing  between  input  and output.  In particular, some
      +       applications are reported to declare and/or modify ospeed.
       
       
       

      SEE ALSO

      -       curses(3x), terminfo(5), putc(3S).
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x), terminfo(5), putc(3S).
       

      diff --git a/doc/html/man/curs_terminfo.3x.html b/doc/html/man/curs_terminfo.3x.html index 8a53cbca..4163fbb7 100644 --- a/doc/html/man/curs_terminfo.3x.html +++ b/doc/html/man/curs_terminfo.3x.html @@ -1,128 +1,167 @@ + + + +curs_terminfo 3x + + + +

      curs_terminfo 3x

      +
       
       
       

      NAME

      -       setupterm, setterm, set_curterm, del_curterm, restartterm,
      -       tparm, tputs, putp, vidputs,  vidattr,  mvcur,  tigetflag,
      -       tigetnum,   tigetstr   -  curses  interfaces  to  terminfo
      -       database
      +       del_curterm,  mvcur,  putp, restartterm, set_curterm, set-
      +       term, setupterm,  tigetflag,  tigetnum,  tigetstr,  tparm,
      +       tputs,  vid_attr,  vid_puts,  vidattr,  vidputs  -  curses
      +       interfaces to terminfo database
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       #include <term.h>
      -
      -       int setupterm(const char *term, int fildes, int *errret);
      -       int setterm(const char *term);
      -       TERMINAL *set_curterm(TERMINAL *nterm);
      -       int del_curterm(TERMINAL *oterm);
      -       int  restartterm(const  char  *term,   int   fildes,   int
      -       *errret);
      -       char *tparm(const char *str, ...);
      -       int tputs(const char *str, int affcnt, int (*putc)(int));
      -       int putp(const char *str);
      -       int vidputs(chtype attrs, int (*putc)(char));
      -       int vidattr(chtype attrs);
      -       int mvcur(int oldrow, int oldcol, int newrow, int newcol);
      -       int tigetflag(const char *capname);
      -       int tigetnum(const char *capname);
      -       char *tigetstr(const char *capname);
      +       #include <curses.h>
      +       #include <term.h>
      +
      +       int setupterm(char *term, int fildes, int *errret);
      +       int setterm(char *term);
      +       TERMINAL *set_curterm(TERMINAL *nterm);
      +       int del_curterm(TERMINAL *oterm);
      +       int restartterm(const char *term, int fildes, int *errret);
      +       char *tparm(char *str, ...);
      +       int tputs(const char *str, int affcnt, int (*putc)(int));
      +       int putp(const char *str);
      +       int vidputs(chtype attrs, int (*putc)(int));
      +       int vidattr(chtype attrs);
      +       int vid_puts(attr_t attrs, short pair, void *opts, int (*putc)(char));
      +       int vid_attr(attr_t attrs, short pair, void *opts);
      +       int mvcur(int oldrow, int oldcol, int newrow, int newcol);
      +       int tigetflag(char *capname);
      +       int tigetnum(char *capname);
      +       char *tigetstr(char *capname);
       
       
       

      DESCRIPTION

              These low-level routines must be called by  programs  that
      -       have to deal directly with the terminfo database to handle
      +       have to deal directly with the terminfo database to handle
              certain terminal capabilities, such as  programming  func-
      -       tion  keys.   For all other functionality, curses routines
      +       tion  keys.   For all other functionality, curses routines
              are more suitable and their use is recommended.
       
      -       Initially,  setupterm  should  be   called.    Note   that
      -       setupterm  is automatically called by initscr and newterm.
      +       Initially,  setupterm  should  be   called.    Note   that
      +       setupterm  is automatically called by initscr and newterm.
              This  defines  the  set  of  terminal-dependent  variables
      -       [listed in terminfo(5)].  The terminfo variables lines and
      -       columns  are  initialized  by  setupterm  as  follows:  If
      -       use_env(FALSE)  has  been  called,  values  for  lines and
      -       columns specified in terminfo are used.  Otherwise, if the
      -       environment  variables LINES and COLUMNS exist, their val-
      +       [listed in terminfo(5)].  The terminfo variables lines and
      +       columns  are  initialized  by  setupterm  as  follows:  If
      +       use_env(FALSE)  has  been  called,  values  for  lines and
      +       columns specified in terminfo are used.  Otherwise, if the
      +       environment  variables LINES and COLUMNS exist, their val-
              ues are used.  If these environment variables do not exist
              and the program is running in a window, the current window
              size is used.  Otherwise, if the environment variables  do
      -       not  exist,  the values for lines and columns specified in
      -       the terminfo database are used.
      +       not  exist,  the values for lines and columns specified in
      +       the terminfo database are used.
       
      -       The header files curses.h and term.h  should  be  included
      +       The header files curses.h and term.h  should  be  included
              (in  this order) to get the definitions for these strings,
              numbers,  and  flags.   Parameterized  strings  should  be
      -       passed  through  tparm  to instantiate them.  All terminfo
      -       strings [including the output of tparm] should be  printed
      -       with  tputs or putp.  Call the reset_shell_mode to restore
      -       the  tty  modes  before  exiting  [see   curs_kernel(3x)].
      -       Programs   which   use  cursor  addressing  should  output
      -       enter_ca_mode upon startup and should output  exit_ca_mode
      +       passed  through  tparm  to instantiate them.  All terminfo
      +       strings [including the output of tparm] should be  printed
      +       with  tputs or putp.  Call the reset_shell_mode to restore
      +       the tty modes before exiting [see curs_kernel(3x)].   Pro-
      +       grams   which   use   cursor   addressing   should  output
      +       enter_ca_mode upon startup and should output  exit_ca_mode
              before  exiting.   Programs  desiring shell escapes should
              call
       
      -       reset_shell_mode and output exit_ca_mode before the  shell
      -       is   called  and  should  output  enter_ca_mode  and  call
      -       reset_prog_mode after returning from the shell.
      -
      -       The setupterm routine reads in the terminfo database, ini-
      -       tializing the terminfo structures, but does not set up the
      -       output virtualization structures used by curses.  The ter-
      -       minal  type is the character string term; if term is null,
      -       the environment variable TERM is used.  All output  is  to
      -       file  descriptor  fildes  which is initialized for output.
      -       If errret is not null, then setupterm returns  OK  or  ERR
      +       reset_shell_mode and output exit_ca_mode before the  shell
      +       is   called  and  should  output  enter_ca_mode  and  call
      +       reset_prog_mode after returning from the shell.
      +
      +       The setupterm routine reads in the terminfo database, ini-
      +       tializing the terminfo structures, but does not set up the
      +       output virtualization structures used by curses.  The ter-
      +       minal  type is the character string term; if term is null,
      +       the environment variable TERM is used.  All output  is  to
      +       file  descriptor  fildes  which is initialized for output.
      +       If errret is not null, then setupterm returns  OK  or  ERR
              and  stores  a  status  value in the integer pointed to by
      -       errret.  A return value of OK combined with status of 1 in
      -       errret is normal.  If ERR is returned, examine errret:
      +       errret.  A return value of OK combined with status of 1 in
      +       errret is normal.  If ERR is returned, examine errret:
       
      -              1    means that the terminal is hardcopy, cannot be
      +              1    means that the terminal is hardcopy, cannot be
                          used for curses applications.
       
      -              0    means that the terminal could not be found, or
      +              0    means that the terminal could not be found, or
                          that  it  is a generic type, having too little
                          information for curses applications to run.
       
      -              -1   means that the terminfo database could not  be
      +              -1   means that the terminfo database could not  be
                          found.
       
      -       If  errret is null, setupterm prints an error message upon
      +       If  errret is null, setupterm prints an error message upon
              finding an error and exits.  Thus, the simplest call is:
       
      -             setupterm((char *)0, 1, (int *)0);,
      +             setupterm((char *)0, 1, (int *)0);,
       
      -       which uses all the defaults and sends the output  to  std-
      -       out.
      +       which uses all the defaults and sends the output  to  std-
      +       out.
       
      -       The  setterm  routine is being replaced by setupterm.  The
      +       The  setterm  routine is being replaced by setupterm.  The
              call:
       
      -             setupterm(term, 1, (int *)0)
      +             setupterm(term, 1, (int *)0)
       
      -       provides the same  functionality  as  setterm(term).   The
      -       setterm  routine  is  included here for BSD compatibility,
      +       provides the same  functionality  as  setterm(term).   The
      +       setterm  routine  is  included here for BSD compatibility,
              and is not recommended for new programs.
       
      -       The set_curterm routine  sets  the  variable  cur_term  to
      -       nterm, and makes all of the terminfo boolean, numeric, and
      -       string variables use the values from  nterm.   It  returns
      -       the old value of cur_term.
      +       The set_curterm routine  sets  the  variable  cur_term  to
      +       nterm, and makes all of the terminfo boolean, numeric, and
      +       string variables use the values from  nterm.   It  returns
      +       the old value of cur_term.
       
      -       The  del_curterm  routine  frees  the  space pointed to by
      -       oterm and makes it available for further use.  If oterm is
      -       the  same  as  cur_term, references to any of the terminfo
      +       The  del_curterm  routine  frees  the  space pointed to by
      +       oterm and makes it available for further use.  If oterm is
      +       the  same  as  cur_term, references to any of the terminfo
              boolean, numeric,  and  string  variables  thereafter  may
      -       refer  to invalid memory locations until another setupterm
      +       refer  to invalid memory locations until another setupterm
              has been called.
       
      -       The  restartterm  routine  is  similar  to  setupterm  and
      -       initscr,  except  that it is called after restoring memory
      +       The  restartterm  routine  is  similar  to  setupterm  and
      +       initscr,  except  that it is called after restoring memory
              to a previous state (for example, when  reloading  a  game
              saved  as a core image dump).  It assumes that the windows
              and the input and output options are the same as when mem-
      @@ -130,128 +169,127 @@
              different.  Accordingly, it saves various tty state  bits,
              does a setupterm, and then restores the bits.
       
      -       The tparm routine instantiates the string str with parame-
      -       ters pi.  A pointer is returned to the result of str  with
      +       The tparm routine instantiates the string str with parame-
      +       ters pi.  A pointer is returned to the result of str  with
              the parameters applied.
       
      -       The  tputs  routine  applies  padding  information  to the
      -       string str and outputs it.  The str  must  be  a  terminfo
      -       string  variable  or the return value from tparm, tgetstr,
      -       or tgoto.  affcnt is the number of lines affected, or 1 if
      -       not  applicable.   putc is a putchar-like routine to which
      +       The  tputs  routine  applies  padding  information  to the
      +       string str and outputs it.  The str  must  be  a  terminfo
      +       string  variable  or the return value from tparm, tgetstr,
      +       or tgoto.  affcnt is the number of lines affected, or 1 if
      +       not  applicable.   putc is a putchar-like routine to which
              the characters are passed, one at a time.
       
      -       The putp routine calls tputs(str, 1, putchar).  Note  that
      -       the  output  of  putp  always  goes  to stdout, not to the
      -       fildes specified in setupterm.
      -
      -       The vidputs routine displays the string on the terminal in
      -       the  video  attribute mode attrs, which is any combination
      -       of the attributes listed in  curses(3x).   The  characters
      -       are passed to the putchar-like routine putc.
      -
      -       The  vidattr  routine  is like the vidputs routine, except
      -       that it outputs through putchar.
      -
      -       The mvcur routine provides low-level  cursor  motion.   It
      +       The putp routine calls tputs(str, 1, putchar).  Note  that
      +       the  output  of  putp  always  goes  to stdout, not to the
      +       fildes specified in setupterm.
      +
      +       The vidputs routine displays the string on the terminal in
      +       the  video  attribute mode attrs, which is any combination
      +       of the attributes listed in  curses(3x).   The  characters
      +       are passed to the putchar-like routine putc.
      +
      +       The  vidattr  routine  is like the vidputs routine, except
      +       that it outputs through putchar.
      +
      +       The vid_attr and vid_puts routines correspond  to  vidattr
      +       and  vidputs,  respectively.   They use a set of arguments
      +       for representing the video attributes  plus  color,  i.e.,
      +       one of type attr_t for the attributes and one of short for
      +       the color_pair number.  The vid_attr and vid_puts routines
      +       are  designed  to use the attribute constants with the WA_
      +       prefix.  The opts argument is  reserved  for  future  use.
      +       Currently,  applications  must  provide a null pointer for
      +       that argument.
      +
      +       The mvcur routine provides low-level  cursor  motion.   It
              takes   effect   immediately  (rather  than  at  the  next
              refresh).
       
      -       The tigetflag, tigetnum and tigetstr routines  return  the
      -       value of the capability corresponding to the terminfo cap-
      -       name passed to them, such as xenl.
      +       The tigetflag, tigetnum and tigetstr routines  return  the
      +       value  of  the  capability  corresponding  to the terminfo
      +       capname passed to them, such as xenl.
       
      -       The tigetflag routine returns the value -1 if  capname  is
      -       not a boolean capability, or 0 if it is canceled or absent
      +       The tigetflag routine returns the value -1 if  capname  is
      +       not a boolean capability, or 0 if it is canceled or absent
              from the terminal description.
       
      -       The tigetnum routine returns the value -2  if  capname  is
      -       not  a  numeric  capability,  or  -1  if it is canceled or
      +       The tigetnum routine returns the value -2  if  capname  is
      +       not  a  numeric  capability,  or  -1  if it is canceled or
              absent from the terminal description.
       
      -       The tigetstr routine  returns  the  value  (char  *)-1  if
      -       capname is not a string capability, or 0 if it is canceled
      -       or absent from the terminal description.
      +       The tigetstr routine returns the value (char *)-1 if  cap-
      +       name is not a string capability, or 0 if it is canceled or
      +       absent from the terminal description.
       
      -       The capname for each capability is given in the table col-
      -       umn  entitled  capname code in the capabilities section of
      -       terminfo(5).
      +       The capname for each capability is given in the table col-
      +       umn  entitled  capname code in the capabilities section of
      +       terminfo(5).
       
      -       char *boolnames, *boolcodes, *boolfnames
      +       char *boolnames, *boolcodes, *boolfnames
       
      -       char *numnames, *numcodes, *numfnames
      +       char *numnames, *numcodes, *numfnames
       
      -       char *strnames, *strcodes, *strfnames
      +       char *strnames, *strcodes, *strfnames
       
      -       These null-terminated arrays  contain  the  capnames,  the
      -       termcap  codes, and the full C names, for each of the ter-
      -       minfo variables.
      +       These null-terminated arrays  contain  the  capnames,  the
      +       termcap  codes, and the full C names, for each of the ter-
      +       minfo variables.
       
       
       

      RETURN VALUE

      -       Routines that return an integer return  ERR  upon  failure
      -       and  OK  (SVr4 only specifies "an integer value other than
      -       ERR") upon successful completion, unless  otherwise  noted
      +       Routines that return an integer return  ERR  upon  failure
      +       and  OK  (SVr4 only specifies "an integer value other than
      +       ERR") upon successful completion, unless  otherwise  noted
              in the preceding routine descriptions.
       
      -       Routines that return pointers always return NULL on error.
      +       Routines that return pointers always return NULL on error.
       
       
       

      NOTES

      -       The setupterm routine should be used in place of  setterm.
      +       The setupterm routine should be used in place of  setterm.
              It  may be useful when you want to test for terminal capa-
              bilities without committing to the allocation  of  storage
      -       involved in initscr.
      +       involved in initscr.
       
      -       Note that vidattr and vidputs may be macros.
      +       Note that vidattr and vidputs may be macros.
       
       
       

      PORTABILITY

      -       The  function  setterm  is not described in the XSI Curses
      +       The  function  setterm  is not described in the XSI Curses
              standard and must be considered non-portable.   All  other
              functions are as described in the XSI curses standard.
       
      -       In  System V Release 4, set_curterm has an int return type
      -       and returns OK or ERR.  We have chosen  to  implement  the
      +       In  System V Release 4, set_curterm has an int return type
      +       and returns OK or ERR.  We have chosen  to  implement  the
              XSI Curses semantics.
       
      -       In System V Release 4, the third argument of tputs has the
      -       type int (*putc)(char).
      -
      -       The XSI Curses standard prototypes tparm with a fixed num-
      -       ber of parameters, rather than a variable argument list.
      -
      -       XSI  notes  that after calling mvcur, the curses state may
      -       not match the actual terminal state, and that an  applica-
      -       tion  should  touch and refresh the window before resuming
      -       normal curses calls.  Both ncurses and System V Release  4
      -       curses  implement mvcur using the SCREEN data allocated in
      -       either initscr or newterm.  So though it is documented  as
      -       a  terminfo  function,  mvcur  is really a curses function
      +       In System V Release 4, the third argument of tputs has the
      +       type int (*putc)(char).
      +
      +       The XSI Curses standard prototypes tparm with a fixed num-
      +       ber  of  parameters, rather than a variable argument list.
      +       This  implementation  uses  a  variable   argument   list.
      +       Portable  applications  should  provide 9 parameters after
      +       the format; zeroes are fine for this purpose.
      +
      +       XSI notes that after calling mvcur, the curses  state  may
      +       not  match the actual terminal state, and that an applica-
      +       tion should touch and refresh the window  before  resuming
      +       normal  curses calls.  Both ncurses and System V Release 4
      +       curses implement mvcur using the SCREEN data allocated  in
      +       either  initscr or newterm.  So though it is documented as
      +       a terminfo function, mvcur is  really  a  curses  function
              which is not well specified.
       
       
       

      SEE ALSO

      -       curses(3x), curs_initscr(3x), curs_kernel(3x),  curs_term-
      -       cap(3x), putc(3S), terminfo(5)
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x),  curs_initscr(3x), curs_kernel(3x), curs_term-
      +       cap(3x), putc(3S), terminfo(5)
       
       
       
      diff --git a/doc/html/man/curs_touch.3x.html b/doc/html/man/curs_touch.3x.html
      index 198fc852..eec4c7a1 100644
      --- a/doc/html/man/curs_touch.3x.html
      +++ b/doc/html/man/curs_touch.3x.html
      @@ -1,55 +1,93 @@
      +
      +
       
      +
      +curs_touch 3x
      +
      +
      +
       
      +

      curs_touch 3x

      +
       
       
       

      NAME

      -       touchwin, touchline, untouchwin, wtouchln, is_linetouched,
      -       is_wintouched - curses refresh control routines
      +       touchwin, touchline, untouchwin, wtouchln, is_linetouched,
      +       is_wintouched - curses refresh control routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       int touchwin(WINDOW *win);
      -       int touchline(WINDOW *win, int start, int count);
      -       int untouchwin(WINDOW *win);
      -       int wtouchln(WINDOW *win, int y, int n, int changed);
      -       bool is_linetouched(WINDOW *win, int line);
      -       bool is_wintouched(WINDOW *win);
      +       #include <curses.h>
      +       int touchwin(WINDOW *win);
      +       int touchline(WINDOW *win, int start, int count);
      +       int untouchwin(WINDOW *win);
      +       int wtouchln(WINDOW *win, int y, int n, int changed);
      +       bool is_linetouched(WINDOW *win, int line);
      +       bool is_wintouched(WINDOW *win);
       
       
       

      DESCRIPTION

      -       The touchwin and touchline routines throw away  all  opti-
      +       The touchwin and touchline routines throw away  all  opti-
              mization  information about which parts of the window have
              been touched, by pretending that  the  entire  window  has
              been  drawn  on.   This  is sometimes necessary when using
              overlapping windows, since a change to one window  affects
              the other window, but the records of which lines have been
              changed in the other window do  not  reflect  the  change.
      -       The  routine touchline only pretends that count lines have
      -       been changed, beginning with line start.
      +       The  routine touchline only pretends that count lines have
      +       been changed, beginning with line start.
       
      -       The untouchwin routine marks all lines in  the  window  as
      -       unchanged since the last call to wrefresh.
      +       The untouchwin routine marks all lines in  the  window  as
      +       unchanged since the last call to wrefresh.
       
      -       The wtouchln routine makes n lines in the window, starting
      -       at line y, look as if they have (changed=1)  or  have  not
      -       (changed=0)  been changed since the last call to wrefresh.
      +       The wtouchln routine makes n lines in the window, starting
      +       at line y, look as if they have (changed=1)  or  have  not
      +       (changed=0)  been changed since the last call to wrefresh.
       
      -       The is_linetouched and is_wintouched routines return  TRUE
      +       The is_linetouched and is_wintouched routines return  TRUE
              if  the  specified line/window was modified since the last
      -       call to wrefresh; otherwise they return FALSE.   In  addi-
      -       tion,  is_linetouched returns ERR if line is not valid for
      +       call to wrefresh; otherwise they return FALSE.   In  addi-
      +       tion,  is_linetouched returns ERR if line is not valid for
              the given window.
       
       
       

      RETURN VALUE

      -       All routines return the integer ERR upon  failure  and  an
      -       integer  value  other than ERR upon successful completion,
      +       All routines return the integer ERR upon  failure  and  an
      +       integer  value  other than ERR upon successful completion,
              unless otherwise noted in the preceding  routine  descrip-
              tions.
       
      @@ -61,18 +99,18 @@
       
              Some historic curses implementations had,  as  an  undocu-
              mented  feature,  the  ability  to  do  the  equivalent of
      -       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
      -       scr).  This will not work under ncurses.
      +       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
      +       scr).  This will not work under ncurses.
       
       
       

      NOTES

      -       Note that all routines except wtouchln may be macros.
      +       Note that all routines except wtouchln may be macros.
       
       
       

      SEE ALSO

      -       curses(3x), curs_refresh(3x).
      +       curses(3x), curs_refresh(3x).
       
       
       
      diff --git a/doc/html/man/curs_trace.3x.html b/doc/html/man/curs_trace.3x.html
      index 51d082c5..c4a52c4d 100644
      --- a/doc/html/man/curs_trace.3x.html
      +++ b/doc/html/man/curs_trace.3x.html
      @@ -1,48 +1,86 @@
      +
      +
       
      +
      +curs_trace 3x
      +
      +
      +
       
      +

      curs_trace 3x

      +
       
       
       

      NAME

      -       _tracef,      _tracedump,     _traceattr,     _traceattr2,
      -       _nc_tracebits,  _tracechar,  _tracechtype,  _tracechtype2,
      -       _tracemouse, trace - curses debugging routines
      +       _tracef,      _tracedump,     _traceattr,     _traceattr2,
      +       _nc_tracebits,  _tracechar,  _tracechtype,  _tracechtype2,
      +       _tracemouse, trace - curses debugging routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -       void _tracef(const char *format, ...);
      -       void _tracedump(const char *label, WINDOW *win);
      -       char *_traceattr(attr_t attr);
      -       char *_traceattr2(int buffer, chtype ch);
      -       char *_nc_tracebits(void);
      -       char *_tracechar(const unsigned char ch);
      -       char *_tracechtype(chtype ch);
      -       char *_tracechtype2(int buffer, chtype ch);
      -       char *_tracemouse(const MEVENT *event);
      -       void trace(const unsigned int param);
      +       #include <curses.h>
      +       void _tracef(const char *format, ...);
      +       void _tracedump(const char *label, WINDOW *win);
      +       char *_traceattr(attr_t attr);
      +       char *_traceattr2(int buffer, chtype ch);
      +       char *_nc_tracebits(void);
      +       char *_tracechar(const unsigned char ch);
      +       char *_tracechtype(chtype ch);
      +       char *_tracechtype2(int buffer, chtype ch);
      +       char *_tracemouse(const MEVENT *event);
      +       void trace(const unsigned int param);
       
       
       

      DESCRIPTION

      -       The  trace  routines  are  used  for debugging the ncurses
      +       The  trace  routines  are  used  for debugging the ncurses
              libraries, as well as applications which use  the  ncurses
              libraries.   These  functions  are normally available only
      -       with the debugging library libncurses_g.a, but may be com-
      +       with the debugging library libncurses_g.a, but may be com-
              piled into any model (shared, static, profile) by defining
      -       the symbol TRACE.
      +       the symbol TRACE.
       
      -       The principal parts of this interface are the  trace  rou-
      +       The principal parts of this interface are the  trace  rou-
              tine which selectively enables different tracing features,
      -       and the _tracef routine which writes formatted data to the
      -       trace file.
      +       and the _tracef routine which writes formatted data to the
      +       trace file.
       
      -       Calling  trace  with  a  nonzero  parameter opens the file
      -       trace in the current directory for output.  The  parameter
      -       is formed by OR'ing values from the list of TRACE_xxx def-
      -       initions in <curses.h>.  These include:
      +       Calling  trace  with  a  nonzero  parameter opens the file
      +       trace in the current directory for output.  The  parameter
      +       is formed by OR'ing values from the list of TRACE_xxx def-
      +       initions in <curses.h>.  These include:
       
              TRACE_DISABLE
                   turn off tracing.
      @@ -72,7 +110,7 @@
                   are traced, as well as return values.
       
              TRACE_VIRTPUT
      -            trace virtual character puts, i.e., calls to addch.
      +            trace virtual character puts, i.e., calls to addch.
       
              TRACE_IEVENT
                   trace low-level input processing, including timeouts.
      @@ -96,7 +134,7 @@
                   maximum trace level,  enables  all  of  the  separate
                   trace features.
       
      -            Some  tracing features are enabled whenever the trace
      +            Some  tracing features are enabled whenever the trace
                   parameter is nonzero.  Some  features  overlap.   The
                   specific names are used as a guideline.
       
      @@ -104,7 +142,7 @@
       

      RETURN VALUE

              Routines  which  return a value are designed to be used as
      -       parameters to the _tracef routine.
      +       parameters to the _tracef routine.
       
       
       
      @@ -117,7 +155,7 @@

      SEE ALSO

      -       curses(3x).
      +       curses(3x).
       
       
       
      diff --git a/doc/html/man/curs_util.3x.html b/doc/html/man/curs_util.3x.html
      index 5fc178cc..0fed7678 100644
      --- a/doc/html/man/curs_util.3x.html
      +++ b/doc/html/man/curs_util.3x.html
      @@ -1,113 +1,149 @@
      +
      +
       
      +
      +curs_util 3x
      +
      +
      +
       
      +

      curs_util 3x

      +
       
       
       

      NAME

      -       unctrl,   keyname,   filter,   use_env,   putwin,  getwin,
      -       delay_output, flushinp - miscellaneous curses utility rou-
      -       tines
      +       delay_output, filter, flushinp, getwin, key_name, keyname,
      +       putwin, unctrl, use_env, wunctrl  -  miscellaneous  curses
      +       utility routines
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       char *unctrl(chtype c);
      -       char *keyname(int c);
      -       void filter(void);
      -       void use_env(char bool);
      -       int putwin(WINDOW *win, FILE *filep);
      -       WINDOW *getwin(FILE *filep);
      -       int delay_output(int ms);
      -       int flushinp(void);
      +       char *unctrl(chtype c);
      +       char *wunctrl(wchar_t w);
      +       char *keyname(int c);
      +       char *key_name(wchar_t w);
      +       void filter(void);
      +       void use_env(bool f);
      +       int putwin(WINDOW *win, FILE *filep);
      +       WINDOW *getwin(FILE *filep);
      +       int delay_output(int ms);
      +       int flushinp(void);
       
       
       

      DESCRIPTION

      -       The  unctrl macro expands to a character string which is a
      -       printable representation  of  the  character  c.   Control
      -       characters  are  displayed  in  the ^X notation.  Printing
      -       characters are displayed as is.
      -
      -       The keyname routine returns a character string correspond-
      -       ing to the key c.
      -
      -       The filter routine, if used, must be called before initscr
      -       or newterm are called.  The effect is that,  during  those
      -       calls,  LINES  is  set  to 1; the capabilities clear, cup,
      -       cud, cud1, cuu1, cuu,  vpa  are  disabled;  and  the  home
      -       string is set to the value of cr.
      -
      -       The  use_env routine, if used, is called before initscr or
      -       newterm are called.  When called with FALSE  as  an  argu-
      -       ment,  the  values  of  lines and columns specified in the
      -       terminfo database will be used, even if environment  vari-
      -       ables  LINES  and COLUMNS (used by default) are set, or if
      -       curses is running in  a  window  (in  which  case  default
      -       behavior  would  be  to  use  the window size if LINES and
      -       COLUMNS are not set).
      -
      -       The putwin routine writes all data associated with  window
      -       win into the file to which filep points.  This information
      -       can be later retrieved using the getwin function.
      -
      -       The getwin routine reads window related data stored in the
      -       file  by putwin.  The routine then creates and initializes
      +       The  unctrl  routine returns a character string which is a
      +       printable representation  of  the  character  c,  ignoring
      +       attributes.   Control  characters  are displayed in the ^X
      +       notation.  Printing characters are displayed as  is.   The
      +       corresponding  wunctrl  returns a printable representation
      +       of a wide-character.
      +
      +       The keyname routine returns a character string correspond-
      +       ing to the key c.  Control characters are displayed in the
      +       ^X notation.  Values above 128 are either meta characters,
      +       shown  in the M-X notation, or the names of function keys,
      +       or null.  The corresponding key_name returns  a  character
      +       string  corresponding  to the wide-character value w.  The
      +       two functions do not return the same set of  strings;  the
      +       latter  returns null where the former would display a meta
      +       character.
      +
      +       The filter routine, if used, must be called before initscr
      +       or  newterm  are called.  The effect is that, during those
      +       calls, LINES is set to 1;  the  capabilities  clear,  cup,
      +       cud,  cud1,  cuu1,  cuu,  vpa  are  disabled; and the home
      +       string is set to the value of cr.
      +
      +       The use_env routine, if used, is called before initscr  or
      +       newterm  are  called.   When called with FALSE as an argu-
      +       ment, the values of lines and  columns  specified  in  the
      +       terminfo  database will be used, even if environment vari-
      +       ables LINES and COLUMNS (used by default) are set,  or  if
      +       curses  is  running  in  a  window  (in which case default
      +       behavior would be to use the  window  size  if  LINES  and
      +       COLUMNS are not set).
      +
      +       The  putwin routine writes all data associated with window
      +       win into the file to which filep points.  This information
      +       can be later retrieved using the getwin function.
      +
      +       The getwin routine reads window related data stored in the
      +       file by putwin.  The routine then creates and  initializes
              a new window using that data.  It returns a pointer to the
              new window.
       
      -       The  delay_output  routine inserts an ms millisecond pause
      -       in output.  This routine should not  be  used  extensively
      -       because  padding  characters  are  used  rather than a CPU
      +       The delay_output routine inserts an ms  millisecond  pause
      +       in  output.   This  routine should not be used extensively
      +       because padding characters are  used  rather  than  a  CPU
              pause.
      -       The flushinp routine throws away any  typeahead  that  has
      -       been  typed  by  the user and has not yet been read by the
      +
      +       The  flushinp  routine  throws away any typeahead that has
      +       been typed by the user and has not yet been  read  by  the
              program.
       
       
       

      RETURN VALUE

      -       Except for  flushinp,  routines  that  return  an  integer
      -       return  ERR  upon  failure and OK (SVr4 specifies only "an
      -       integer value other than ERR") upon successful completion.
      +       Except  for  flushinp,  routines  that  return  an integer
      +       return ERR upon failure and OK (SVr4  specifies  only  "an
      +       integer value other than ERR") upon successful completion.
       
      -       flushinp always returns OK.
      +       flushinp always returns OK.
       
      -       Routines that return pointers return NULL on error.
      +       Routines that return pointers return NULL on error.
       
       
       

      PORTABILITY

      -       The  XSI  Curses  standard,  Issue 4 describes these func-
      -       tions.
      -
      -       The SVr4 documentation describes the action of filter only
      -       in  the  vaguest  terms.   The description here is adapted
      -       from the XSI Curses standard (which erroneously  fails  to
      -       describe the disabling of cuu).
      -
      +       The XSI Curses standard, Issue  4  describes  these  func-
      +       tions.   It  states  that unctrl and wunctrl will return a
      +       null pointer if unsuccessful,  but  does  not  define  any
      +       error conditions.
       
      -
      -

      NOTES

      -       Note  that  unctrl  is  a macro, which is defined in <unc-
      -       trl.h>.
      +       The SVr4 documentation describes the action of filter only
      +       in the vaguest terms.  The  description  here  is  adapted
      +       from  the  XSI Curses standard (which erroneously fails to
      +       describe the disabling of cuu).
       
       
       

      SEE ALSO

      -       curses(3x), curs_initscr(3x), curs_scr_dump(3x).
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      +       curses(3x), curs_initscr(3x), curs_scr_dump(3x).
       
       
       
      diff --git a/doc/html/man/curs_window.3x.html b/doc/html/man/curs_window.3x.html
      index 1fae384f..0b9d2a34 100644
      --- a/doc/html/man/curs_window.3x.html
      +++ b/doc/html/man/curs_window.3x.html
      @@ -1,126 +1,164 @@
      +
      +
       
      +
      +curs_window 3x
      +
      +
      +
       
      +

      curs_window 3x

      +
       
       
       

      NAME

      -       newwin,  delwin,  mvwin, subwin, derwin, mvderwin, dupwin,
      -       wsyncup, syncok, wcursyncup,  wsyncdown  -  create  curses
      +       newwin,  delwin,  mvwin, subwin, derwin, mvderwin, dupwin,
      +       wsyncup, syncok, wcursyncup,  wsyncdown  -  create  curses
              windows
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      -
      -       WINDOW *newwin(int nlines, int ncols, int begin_y,
      -             int begin_x);
      -       int delwin(WINDOW *win);
      -       int mvwin(WINDOW *win, int y, int x);
      -       WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
      -             int begin_y, int begin_x);
      -       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
      -             int begin_y, int begin_x);
      -       int mvderwin(WINDOW *win, int par_y, int par_x);
      -       WINDOW *dupwin(WINDOW *win);
      -       void wsyncup(WINDOW *win);
      -       int syncok(WINDOW *win, bool bf);
      -       void wcursyncup(WINDOW *win);
      -       void wsyncdown(WINDOW *win);
      +       #include <curses.h>
      +
      +       WINDOW *newwin(int nlines, int ncols, int begin_y,
      +             int begin_x);
      +       int delwin(WINDOW *win);
      +       int mvwin(WINDOW *win, int y, int x);
      +       WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
      +             int begin_y, int begin_x);
      +       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
      +             int begin_y, int begin_x);
      +       int mvderwin(WINDOW *win, int par_y, int par_x);
      +       WINDOW *dupwin(WINDOW *win);
      +       void wsyncup(WINDOW *win);
      +       int syncok(WINDOW *win, bool bf);
      +       void wcursyncup(WINDOW *win);
      +       void wsyncdown(WINDOW *win);
       
       
       

      DESCRIPTION

      -       Calling newwin creates and returns a pointer to a new win-
      +       Calling newwin creates and returns a pointer to a new win-
              dow with the given number of lines and columns.  The upper
      -       left-hand  corner of the window is at line begin_y, column
      -       begin_x.  If either nlines or ncols is zero, they  default
      -       to  LINES - begin_y and COLS - begin_x.  A new full-screen
      -       window is created by calling newwin(0,0,0,0).
      +       left-hand  corner of the window is at line begin_y, column
      +       begin_x.  If either nlines or ncols is zero, they  default
      +       to  LINES - begin_y and COLS - begin_x.  A new full-screen
      +       window is created by calling newwin(0,0,0,0).
       
      -       Calling delwin deletes the named window, freeing all  mem-
      +       Calling delwin deletes the named window, freeing all  mem-
              ory  associated  with  it  (it does not actually erase the
              window's screen image).  Subwindows must be deleted before
              the main window can be deleted.
       
      -       Calling mvwin moves the window so that the upper left-hand
      -       corner is at position (x, y).  If the move would cause the
      +       Calling mvwin moves the window so that the upper left-hand
      +       corner is at position (x, y).  If the move would cause the
              window to be off the screen, it is an error and the window
              is not moved.  Moving subwindows is allowed, but should be
              avoided.
       
      -       Calling subwin creates and returns a pointer to a new win-
      -       dow with the given number of lines, nlines,  and  columns,
      -       ncols.   The  window  is at position (begin_y, begin_x) on
      +       Calling subwin creates and returns a pointer to a new win-
      +       dow with the given number of lines, nlines,  and  columns,
      +       ncols.   The  window  is at position (begin_y, begin_x) on
              the screen.  (This position is relative to the screen, and
      -       not to the window orig.)  The window is made in the middle
      -       of the window orig, so that changes  made  to  one  window
      +       not to the window orig.)  The window is made in the middle
      +       of the window orig, so that changes  made  to  one  window
              will  affect  both  windows.   The subwindow shares memory
      -       with the window orig.  When using this routine, it is nec-
      -       essary  to call touchwin or touchline on orig before call-
      -       ing wrefresh on the subwindow.
      +       with the window orig.  When using this routine, it is nec-
      +       essary  to call touchwin or touchline on orig before call-
      +       ing wrefresh on the subwindow.
       
      -       Calling derwin is the same as calling subwin, except  that
      -       begin_y and begin_x are relative to the origin of the win-
      -       dow orig rather than the screen.  There is  no  difference
      +       Calling derwin is the same as calling subwin, except  that
      +       begin_y and begin_x are relative to the origin of the win-
      +       dow orig rather than the screen.  There is  no  difference
              between the subwindows and the derived windows.
       
      -       Calling  mvderwin  moves  a  derived window (or subwindow)
      +       Calling  mvderwin  moves  a  derived window (or subwindow)
              inside its parent window.  The screen-relative  parameters
              of  the  window  are not changed.  This routine is used to
              display different parts of the parent window at  the  same
              physical position on the screen.
       
      -       Calling  dupwin  creates  an exact duplicate of the window
      -       win.
      +       Calling  dupwin  creates  an exact duplicate of the window
      +       win.
       
      -       Calling wsyncup touches all locations in ancestors of  win
      -       that  are changed in win.  If syncok is called with second
      -       argument TRUE then wsyncup is called  automatically  when-
      +       Calling wsyncup touches all locations in ancestors of  win
      +       that  are changed in win.  If syncok is called with second
      +       argument TRUE then wsyncup is called  automatically  when-
              ever there is a change in the window.
       
      -       The  wsyncdown  routine  touches each location in win that
      +       The  wsyncdown  routine  touches each location in win that
              has been touched in any of  its  ancestor  windows.   This
      -       routine  is  called by wrefresh, so it should almost never
      +       routine  is  called by wrefresh, so it should almost never
              be necessary to call it manually.
       
      -       The routine wcursyncup updates the current cursor position
      +       The routine wcursyncup updates the current cursor position
              of  all the ancestors of the window to reflect the current
              cursor position of the window.
       
       
       

      RETURN VALUE

      -       Routines that return an integer  return  the  integer  ERR
      -       upon failure and OK (SVr4 only specifies "an integer value
      -       other than ERR") upon successful completion.
      +       Routines that return an integer  return  the  integer  ERR
      +       upon failure and OK (SVr4 only specifies "an integer value
      +       other than ERR") upon successful completion.
       
      -       delwin returns the integer ERR upon failure  and  OK  upon
      +       delwin returns the integer ERR upon failure  and  OK  upon
              successful completion.
       
      -       Routines that return pointers return NULL on error.
      +       Routines that return pointers return NULL on error.
       
       
       

      NOTES

      -       If  many small changes are made to the window, the wsyncup
      +       If  many small changes are made to the window, the wsyncup
              option could degrade performance.
       
      -       Note that syncok may be a macro.
      +       Note that syncok may be a macro.
       
       
       

      BUGS

      -       The subwindow functions (subwin, derwin,  mvderwin,  wsyn-
      -       cup,  wsyncdown,  wcursyncup,  syncok)  are  flaky, incom-
      +       The subwindow functions (subwin, derwin,  mvderwin,  wsyn-
      +       cup,  wsyncdown,  wcursyncup,  syncok)  are  flaky, incom-
              pletely implemented, and not well tested.
       
              The System V curses documentation is  very  unclear  about
      -       what wsyncup and wsyncdown actually do.  It seems to imply
      +       what wsyncup and wsyncdown actually do.  It seems to imply
              that they are only supposed to touch exactly  those  lines
              that are affected by ancestor changes.  The language here,
      -       and the behavior of the  curses  implementation,  is  pat-
      +       and the behavior of the  curses  implementation,  is  pat-
              terned  on the XPG4 curses standard.  The weaker XPG4 spec
              may result in slower updates.
       
      @@ -133,7 +171,7 @@
       
       

      SEE ALSO

      -       curses(3x), curs_refresh(3x), curs_touch(3x)
      +       curses(3x), curs_refresh(3x), curs_touch(3x)
       
       
       
      diff --git a/doc/html/man/default_colors.3x.html b/doc/html/man/default_colors.3x.html
      index 8b6cdca4..d0be6fb6 100644
      --- a/doc/html/man/default_colors.3x.html
      +++ b/doc/html/man/default_colors.3x.html
      @@ -1,25 +1,64 @@
      +
      +
       
      +
      +default_colors 3x
      +
      +
      +
       
      +

      default_colors 3x

      +
       
       
       

      NAME

      -       default_colors:  use_default_colors, assume_default_colors
      -       - use terminal's default colors
      +       use_default_colors, assume_default_colors - use terminal's
      +       default colors
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int use_default_colors(void);
      -       int assume_default_colors(int fg, int bg);
      +       int use_default_colors(void);
      +       int assume_default_colors(int fg, int bg);
       
       
       

      DESCRIPTION

      -       The use_default_colors() and assume_default_colors() func-
      +       The use_default_colors() and assume_default_colors() func-
              tions are extensions to the curses library.  They are used
              with terminals that support ISO 6429 color, or equivalent.
              These terminals allow the application to reset color to an
      @@ -29,56 +68,56 @@
              whole  screen  do not take advantage of SGR 39 and SGR 49.
              Some applications are designed to work  with  the  default
              background,  using  colors  only  for  text.  For example,
      -       there are several implementations of the ls program  which
      +       there are several implementations of the ls program  which
              use  colors to denote different file types or permissions.
              These "color ls" programs do not  necessarily  modify  the
      -       background  color, typically using only the setaf terminfo
      +       background  color, typically using only the setaf terminfo
              capability  to  set  the  foreground  color.   Full-screen
              applications  that  use default colors can achieve similar
              visual effects.
       
      -       The first function, use_default_colors() tells the  curses
      +       The first function, use_default_colors() tells the  curses
              library  to  assign terminal default foreground/background
              colors to color number  -1.  So  init_pair(x,COLOR_RED,-1)
              will  initialize  pair  x as red on default background and
              init_pair(x,-1,COLOR_BLUE)  will  initialize  pair  x   as
              default foreground on blue.
       
      -       The  other,  assume_default_colors() is a refinement which
      +       The  other,  assume_default_colors() is a refinement which
              tells which colors to paint for color pair 0.  This  func-
              tion  recognizes  a special color number -1, which denotes
              the default terminal color.
       
              The following are equivalent:
      -              use_default_colors();
      -              assume_default_colors(-1,-1);
      +              use_default_colors();
      +              assume_default_colors(-1,-1);
       
              These are ncurses extensions.  For other curses  implemen-
              tations,  color  number -1 does not mean anything, just as
      -       for ncurses before a successful call  of  use_default_col-
      -       ors() or assume_default_colors().
      +       for ncurses before a successful call  of  use_default_col-
      +       ors() or assume_default_colors().
       
              Other  curses  implementations do not allow an application
              to modify color pair 0.  They assume that  the  background
              is COLOR_BLACK, but do not ensure that the color pair 0 is
              painted to match the assumption.  If your application does
      -       not use either use_default_colors() or assume_default_col-
      -       ors() ncurses will paint a white  foreground  (text)  with
      +       not use either use_default_colors() or assume_default_col-
      +       ors() ncurses will paint a white  foreground  (text)  with
              black background for color pair 0.
       
       
       

      RETURN VALUE

      -       These functions return the integer ERR upon failure and OK
      +       These functions return the integer ERR upon failure and OK
              on success.  They will fail if either  the  terminal  does
      -       not  support  the orig_pair or orig_colors capability.  If
      -       the initialize_pair capability is found,  this  causes  an
      +       not  support  the orig_pair or orig_colors capability.  If
      +       the initialize_pair capability is found,  this  causes  an
              error as well.
       
       
       

      NOTES

      -       Associated with this extension, the init_pair(3x) function
      +       Associated with this extension, the init_pair(3x) function
              accepts negative arguments to specify  default  foreground
              or background colors.
       
      @@ -93,7 +132,7 @@
       
       

      SEE ALSO

      -       curs_color(3x), ded(1).
      +       curs_color(3x), ded(1).
       
       
       
      diff --git a/doc/html/man/define_key.3x.html b/doc/html/man/define_key.3x.html index 7e914c7e..0be1e000 100644 --- a/doc/html/man/define_key.3x.html +++ b/doc/html/man/define_key.3x.html @@ -1,18 +1,57 @@ + + + +define_key 3x + + + +

      define_key 3x

      +
       
       
       

      NAME

      -       define_key - define a keycode
      +       define_key - define a keycode
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int define_key(char *definition, int keycode);
      +       int define_key(char *definition, int keycode);
       
       
       
      @@ -45,7 +84,7 @@

      SEE ALSO

      -       keyok(3x).
      +       keyok(3x).
       
       
       
      diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html index a15a7126..27ff8706 100644 --- a/doc/html/man/form.3x.html +++ b/doc/html/man/form.3x.html @@ -1,181 +1,220 @@ + + + +form 3x + + + +

      form 3x

      +
       
       
       

      NAME

      -       form - curses extension for programming forms
      +       form - curses extension for programming forms
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
       
       
       

      DESCRIPTION

      -       The  form library provides terminal-independent facilities
      +       The  form library provides terminal-independent facilities
              for composing form screens  on  character-cell  terminals.
              The  library  includes:  field  routines, which create and
              modify form fields; and form routines, which group  fields
              into forms, display forms on the screen, and handle inter-
              action with the user.
       
      -       The form library uses the curses libraries, and  a  curses
      -       initialization  routine  such  as  initscr  must be called
      -       before using any of these  functions.   To  use  the  form
      -       library, link with the options -lform -lcurses.
      +       The form library uses the curses libraries, and  a  curses
      +       initialization  routine  such  as  initscr  must be called
      +       before using any of these  functions.   To  use  the  form
      +       library, link with the options -lform -lcurses.
       
       
      -   Current Default Values for Field Attributes
      -       The  form  library  maintains  a  default  value for field
      +   Current Default Values for Field Attributes
      +       The  form  library  maintains  a  default  value for field
              attributes.  You can get or set this  default  by  calling
      -       the  appropriate  set_  or  retrieval  routine with a NULL
      -       field pointer.  Changing this default with a set_ function
      +       the  appropriate  set_  or  retrieval  routine with a NULL
      +       field pointer.  Changing this default with a set_ function
              affects  future  field  creations, but does not change the
              rendering of fields already created.
       
       
      -   Routine Name Index
      -       The following table lists each form routine and  the  name
      +   Routine Name Index
      +       The following table lists each form routine and  the  name
              of the manual page on which it is described.
       
      -       curses Routine Name    Manual Page Name
      +       curses Routine Name    Manual Page Name
              -------------------------------------------------
      -       current_field          form_page(3x)
      -       data_ahead             form_data(3x)
      -       data_behind            form_data(3x)
      -       dup_field              form_field_new(3x)
      -       dynamic_fieldinfo      form_field_info(3x)
      -       field_arg              form_field_validation(3x)
      -       field_back             form_field_attributes(3x)
      -       field_buffer           form_field_buffer(3x)
      -       field_count            form_field(3x)
      -       field_fore             form_field_attributes(3x)
      -       field_index            form_page(3x)
      -       field_info             form_field_info(3x)
      -       field_init             form_hook(3x)
      -       field_just             form_field_just(3x)
      -       field_opts             form_field_opts(3x)
      -       field_opts_off         form_field_opts(3x)
      -       field_opts_on          form_field_opts(3x)
      -       field_pad              form_field_attributes(3x)
      -
      -       field_status           form_field_buffer(3x)
      -       field_term             form_hook(3x)
      -       field_type             form_field_validation(3x)
      -       field_userptr          form_field_userptr(3x)
      -       form_driver            form_driver(3x)
      -       form_fields            form_field(3x)
      -       form_init              form_hook(3x)
      -       form_opts              form_opts(3x)
      -       form_opts_off          form_opts(3x)
      -       form_opts_on           form_opts(3x)
      -       form_page              form_page(3x)
      -       form_request_by_name   form_requestname(3x)
      -       form_request_name      form_requestname(3x)
      -       form_sub               form_win(3x)
      -       form_term              form_hook(3x)
      -       form_userptr           form_userptr(3x)
      -       form_win               form_win(3x)
      -       free_field             form_field_new(3x)
      -       free_form              form_new(3x)
      -       link_field             form_field_new(3x)
      -       link_fieldtype         form_fieldtype(3x)
      -       move_field             form_field(3x)
      -       new_field              form_field_new(3x)
      -       new_form               form_new(3x)
      -       new_page               form_new_page(3x)
      -       pos_form_cursor        form_cursor(3x)
      -       post_form              form_post(3x)
      -       scale_form             form_win(3x)
      -       set_current_field      form_page(3x)
      -       set_field_back         form_field_attributes(3x)
      -       set_field_buffer       form_field_buffer(3x)
      -       set_field_fore         form_field_attributes(3x)
      -       set_field_init         form_hook(3x)
      -       set_field_just         form_field_just(3x)
      -       set_field_opts         form_field_opts(3x)
      -       set_field_pad          form_field_attributes(3x)
      -       set_field_status       form_field_buffer(3x)
      -       set_field_term         form_hook(3x)
      -       set_field_type         form_field_validation(3x)
      -       set_field_userptr      form_field_userptr(3x)
      -       set_fieldtype_arg      form_fieldtype(3x)
      -       set_fieldtype_choice   form_fieldtype(3x)
      -       set_form_fields        form_field(3x)
      -       set_form_init          form_hook(3x)
      -       set_form_opts          form_field_opts(3x)
      -       set_form_page          form_page(3x)
      -       set_form_sub           form_win(3x)
      -       set_form_term          form_hook(3x)
      -       set_form_userptr       form_userptr(3x)
      -       set_form_win           form_win(3x)
      -       set_max_field          form_field_buffer(3x)
      -       set_new_page           form_new_page(3x)
      -       unpost_form            form_post(3x)
      +       current_field          form_page(3x)
      +       data_ahead             form_data(3x)
      +       data_behind            form_data(3x)
      +       dup_field              form_field_new(3x)
      +       dynamic_fieldinfo      form_field_info(3x)
      +       field_arg              form_field_validation(3x)
      +       field_back             form_field_attributes(3x)
      +       field_buffer           form_field_buffer(3x)
      +       field_count            form_field(3x)
      +       field_fore             form_field_attributes(3x)
      +       field_index            form_page(3x)
      +       field_info             form_field_info(3x)
      +       field_init             form_hook(3x)
      +       field_just             form_field_just(3x)
      +       field_opts             form_field_opts(3x)
      +       field_opts_off         form_field_opts(3x)
      +       field_opts_on          form_field_opts(3x)
      +       field_pad              form_field_attributes(3x)
      +
      +       field_status           form_field_buffer(3x)
      +       field_term             form_hook(3x)
      +       field_type             form_field_validation(3x)
      +       field_userptr          form_field_userptr(3x)
      +       form_driver            form_driver(3x)
      +       form_fields            form_field(3x)
      +       form_init              form_hook(3x)
      +       form_opts              form_opts(3x)
      +       form_opts_off          form_opts(3x)
      +       form_opts_on           form_opts(3x)
      +       form_page              form_page(3x)
      +       form_request_by_name   form_requestname(3x)
      +       form_request_name      form_requestname(3x)
      +       form_sub               form_win(3x)
      +       form_term              form_hook(3x)
      +       form_userptr           form_userptr(3x)
      +       form_win               form_win(3x)
      +       free_field             form_field_new(3x)
      +       free_form              form_new(3x)
      +       link_field             form_field_new(3x)
      +       link_fieldtype         form_fieldtype(3x)
      +       move_field             form_field(3x)
      +       new_field              form_field_new(3x)
      +       new_form               form_new(3x)
      +       new_page               form_new_page(3x)
      +       pos_form_cursor        form_cursor(3x)
      +       post_form              form_post(3x)
      +       scale_form             form_win(3x)
      +       set_current_field      form_page(3x)
      +       set_field_back         form_field_attributes(3x)
      +       set_field_buffer       form_field_buffer(3x)
      +       set_field_fore         form_field_attributes(3x)
      +       set_field_init         form_hook(3x)
      +       set_field_just         form_field_just(3x)
      +       set_field_opts         form_field_opts(3x)
      +       set_field_pad          form_field_attributes(3x)
      +       set_field_status       form_field_buffer(3x)
      +       set_field_term         form_hook(3x)
      +       set_field_type         form_field_validation(3x)
      +       set_field_userptr      form_field_userptr(3x)
      +       set_fieldtype_arg      form_fieldtype(3x)
      +       set_fieldtype_choice   form_fieldtype(3x)
      +       set_form_fields        form_field(3x)
      +       set_form_init          form_hook(3x)
      +       set_form_opts          form_field_opts(3x)
      +       set_form_page          form_page(3x)
      +       set_form_sub           form_win(3x)
      +       set_form_term          form_hook(3x)
      +       set_form_userptr       form_userptr(3x)
      +       set_form_win           form_win(3x)
      +       set_max_field          form_field_buffer(3x)
      +       set_new_page           form_new_page(3x)
      +       unpost_form            form_post(3x)
       
       
       

      RETURN VALUE

      -       Routines  that return pointers return NULL on error.  Rou-
      +       Routines  that return pointers return NULL on error.  Rou-
              tines that return an integer return one of  the  following
              error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_CONNECTED
      +       E_CONNECTED
                   The field is already connected to a form.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The form is already posted.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NO_ROOM
      +       E_NO_ROOM
                   Form is too large for its window.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The form has not been posted.
       
      -       E_UNKNOWN_COMMAND
      +       E_UNKNOWN_COMMAND
                   The form driver code saw an unknown request code.
       
      -       E_INVALID_FIELD
      +       E_INVALID_FIELD
                   Contents of a field are not valid.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No fields are connected to the form.
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The form driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x)  and  3x  pages  whose  names begin "form_" for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       files <curses.h> and <eti.h>.
      +       The header file <form.h> automatically includes the header
      +       files <curses.h> and <eti.h>.
       
              In  your  library  list,  libform.a should be before libn-
              curses.a; that is, you want to say `-lform -lncurses', not
              the  other  way  around (which would give you a link error
      -       using GNU ld(1) and many other linkers).
      +       using GNU ld(1) and many other linkers).
       
       
       
      diff --git a/doc/html/man/form_cursor.3x.html b/doc/html/man/form_cursor.3x.html index b99b8241..af7d8d7d 100644 --- a/doc/html/man/form_cursor.3x.html +++ b/doc/html/man/form_cursor.3x.html @@ -1,24 +1,63 @@ + + + +form_cursor 3x + + + +

      form_cursor 3x

      +
       
       
       

      NAME

      -       form_cursor - position a form window cursor
      +       form_cursor - position a form window cursor
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int pos_form_cursor(FORM *form);
       
       
       

      DESCRIPTION

      -       The  function  pos_form_cursor  restores the cursor to the
      +       The  function  pos_form_cursor  restores the cursor to the
              position required for the forms driver  to  continue  pro-
      -       cessing  requests.   This  is useful after curses routines
      +       cessing  requests.   This  is useful after curses routines
              have been called to do screen-painting in  response  to  a
              form operation.
       
      @@ -27,28 +66,28 @@
       

      RETURN VALUE

              This routine returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The form has not been posted.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_data.3x.html b/doc/html/man/form_data.3x.html index 502495ed..277b54bf 100644 --- a/doc/html/man/form_data.3x.html +++ b/doc/html/man/form_data.3x.html @@ -1,40 +1,79 @@ + + + +form_data 3x + + + +

      form_data 3x

      +
       
       
       

      NAME

      -       form_data - test for off-screen data in given forms
      +       form_data - test for off-screen data in given forms
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              bool data_ahead(const FORM *form);
              bool data_behind(const FORM *form);
       
       
       

      DESCRIPTION

      -       The  function data_ahead tests whether there is off-screen
      +       The  function data_ahead tests whether there is off-screen
              data ahead in the given form.   It  returns  TRUE  (1)  or
              FALSE (0).
       
      -       The function data_behind tests whether there is off-screen
      +       The function data_behind tests whether there is off-screen
              data behind in the given form.  It  returns  TRUE  (1)  or
              FALSE (0).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_driver.3x.html b/doc/html/man/form_driver.3x.html index 36a27aa8..061519f5 100644 --- a/doc/html/man/form_driver.3x.html +++ b/doc/html/man/form_driver.3x.html @@ -1,23 +1,61 @@ + + + +form_driver 3x + + + +

      form_driver 3x

      +
       
       
       

      NAME

      -       form_driver - command-processing loop of the form system
      +       form_driver - command-processing loop of the form system
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int form_driver(FORM *form, int c);
       
       
       

      DESCRIPTION

              Once a form has been posted (displayed), you should funnel
      -       input events to it through form_driver.  This routine  has
      +       input events to it through form_driver.  This routine  has
              two  major input cases; either the input is a form naviga-
              tion request or it's a  printable  ASCII  character.   The
              form driver requests are as follows:
      @@ -207,50 +245,50 @@
              If the second argument is neither printable ASCII nor  one
              of the above pre-defined form requests, the driver assumes
              it  is  an  application-specific   command   and   returns
      -       E_UNKNOWN_COMMAND.  Application-defined commands should be
      -       defined relative to  MAX_COMMAND,  the  maximum  value  of
      +       E_UNKNOWN_COMMAND.  Application-defined commands should be
      +       defined relative to  MAX_COMMAND,  the  maximum  value  of
              these pre-defined requests.
       
       
       

      RETURN VALUE

      -       form_driver return one of the following error codes:
      +       form_driver return one of the following error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine  was  called  from   an   initialization   or
                   termination function.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The form has not been posted.
       
      -       E_UNKNOWN_COMMAND
      +       E_UNKNOWN_COMMAND
                   The form driver code saw an unknown request code.
       
      -       E_INVALID_FIELD
      +       E_INVALID_FIELD
                   Contents of field is invalid.
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The form driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       files <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       files <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field.3x.html b/doc/html/man/form_field.3x.html index 2f14eafb..35d82339 100644 --- a/doc/html/man/form_field.3x.html +++ b/doc/html/man/form_field.3x.html @@ -1,17 +1,56 @@ + + + +form_field 3x + + + +

      form_field 3x

      +
       
       
       

      NAME

      -       form_field - make and break connections between fields and
      +       form_field - make and break connections between fields and
              forms
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_form_fields(FORM *form, FIELD **fields);
              FIELD **form_fields(const FORM *form);
              int field_count(const FORM *form);
      @@ -20,55 +59,55 @@
       
       

      DESCRIPTION

      -       The function set_form_fields  changes  the  field  pointer
      -       array  of the given form.  The array must be terminated by
      -       a NULL.
      +       The function set_form_fields  changes  the  field  pointer
      +       array  of the given form.  The array must be terminated by
      +       a NULL.
       
      -       The function form_fields returns the field  array  of  the
      +       The function form_fields returns the field  array  of  the
              given form.
       
      -       The  function  field_count  returns the count of fields in
      -       form.
      +       The  function  field_count  returns the count of fields in
      +       form.
       
      -       The function move_field move the given field  (which  must
      +       The function move_field move the given field  (which  must
              be disconnected) to a specified location on the screen.
       
       
       

      RETURN VALUES

      -       The function form_fields returns NULL on error.
      +       The function form_fields returns NULL on error.
       
      -       The  function  field_count returns ERR (the general curses
      +       The  function  field_count returns ERR (the general curses
              error return value) on error.
       
      -       The functions set_form_fields and move_field return one of
      +       The functions set_form_fields and move_field return one of
              the following codes on error:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The form is already posted.
       
      -       E_CONNECTED
      +       E_CONNECTED
                   The field is already connected to a form.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      @@ -77,7 +116,7 @@ were not supported on Version 7 or BSD versions. The SVr4 forms library documentation specifies the - field_count error value as -1 (which is the value of ERR). + field_count error value as -1 (which is the value of ERR).
      diff --git a/doc/html/man/form_field_attributes.3x.html b/doc/html/man/form_field_attributes.3x.html index 9e11aaf5..bb5e210d 100644 --- a/doc/html/man/form_field_attributes.3x.html +++ b/doc/html/man/form_field_attributes.3x.html @@ -1,39 +1,78 @@ + + + +form_field_attributes 3x + + + +

      form_field_attributes 3x

      +
       
       
       

      NAME

      -       form_field_attributes  -  color  and attribute control for
      +       form_field_attributes  -  color  and attribute control for
              form fields
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_fore(FIELD *field, chtype attr);
              chtype field_fore(const FIELD *field);
              int set_field_back(FIELD *field, chtype attr);
              chtype field_back(const FIELD *field);
              int set_field_pad(FIELD *field, int pad);
      -       chtype field_pad(const FIELD *field);
      +       int field_pad(const FIELD *field);
       
       
       

      DESCRIPTION

      -       The function set_field_fore sets the foreground  attribute
      -       of  field. This is the highlight used to display the field
      -       contents.  The function field_fore returns the  foreground
      -       attribute.  The default is A_STANDOUT.
      -
      -       The  function set_field_back sets the background attribute
      -       of form. This is the highlight used to display the  extent
      -       fields  in  the form.  The function field_back returns the
      -       background attribute.  The default is A_NORMAL.
      -
      -       The function set_field_pad sets the character used to fill
      -       the  field.   The  function  field_pad  returns  the given
      +       The function set_field_fore sets the foreground  attribute
      +       of  field. This is the highlight used to display the field
      +       contents.  The function field_fore returns the  foreground
      +       attribute.  The default is A_STANDOUT.
      +
      +       The  function set_field_back sets the background attribute
      +       of form. This is the highlight used to display the  extent
      +       fields  in  the form.  The function field_back returns the
      +       background attribute.  The default is A_NORMAL.
      +
      +       The function set_field_pad sets the character used to fill
      +       the  field.   The  function  field_pad  returns  the given
              form's pad character.  The default is a blank.
       
       
      @@ -41,26 +80,26 @@
       

      RETURN VALUE

              These routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x)  and  3x  pages  whose  names begin "form_" for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_buffer.3x.html b/doc/html/man/form_field_buffer.3x.html index a4f3dcda..c23ac003 100644 --- a/doc/html/man/form_field_buffer.3x.html +++ b/doc/html/man/form_field_buffer.3x.html @@ -1,16 +1,55 @@ + + + +form_field_buffer 3x + + + +

      form_field_buffer 3x

      +
       
       
       

      NAME

      -       form_field_buffer - field buffer control
      +       form_field_buffer - field buffer control
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int  set_field_buffer(FIELD  *field,  int  buf, const char
              *value);
              char *field_buffer(const FIELD *field, int buffer);
      @@ -21,12 +60,12 @@
       
       

      DESCRIPTION

      -       The function set_field_buffer sets the numbered buffer  of
      +       The function set_field_buffer sets the numbered buffer  of
              the  given  field  to contain a given string.  Buffer 0 is
              the displayed value of the field; other  numbered  buffers
      -       may be allocated by applications through the nbuf argument
      -       of (see form_field_new(3x)) but are not manipulated by the
      -       forms  library.   The  function  field_buffer  returns the
      +       may be allocated by applications through the nbuf argument
      +       of (see form_field_new(3x)) but are not manipulated by the
      +       forms  library.   The  function  field_buffer  returns the
              address of the buffer.  Please note that this  buffer  has
              always  the  length  of the buffer, that means that it may
              typically contain trailing spaces. If you entered  leading
      @@ -38,44 +77,44 @@
              buffer. So don't use it  for  long  term  storage  of  the
              entered form data.
       
      -       The  function  set_field_status sets the associated status
      -       flag of field; field_status gets the current  value.   The
      +       The  function  set_field_status sets the associated status
      +       flag of field; field_status gets the current  value.   The
              status  flag  is set to a nonzero value whenever the field
              changes.
       
      -       The function set_max_field sets the  maximum  size  for  a
      +       The function set_max_field sets the  maximum  size  for  a
              dynamic  field.   An  argument  of 0 turns off any maximum
              size threshold for that field.
       
       
       

      RETURN VALUE

      -       The field_buffer function returns NULL on error.
      +       The field_buffer function returns NULL on error.
       
      -       The field_status function returns TRUE or FALSE.
      +       The field_status function returns TRUE or FALSE.
       
              The remaining routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x)  and  3x  pages  whose  names begin "form_" for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_info.3x.html b/doc/html/man/form_field_info.3x.html index 40ef3a2d..db2e5247 100644 --- a/doc/html/man/form_field_info.3x.html +++ b/doc/html/man/form_field_info.3x.html @@ -1,61 +1,100 @@ + + + +form_field_info 3x + + + +

      form_field_info 3x

      +
       
       
       

      NAME

      -       form_field_info - retrieve field characteristics
      +       form_field_info - retrieve field characteristics
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int field_info(const FIELD *field, int *rows, int *cols,
                            int *frow, int *fcol, int *nrow, int *nbuf);
              int dynamic_field_info(const FIELD *field, int *rows,  int
      -       *cols, *max);
      +       *cols, int *max);
       
       
       

      DESCRIPTION

      -       The  function  field_info  returns  the  sizes  and  other
      +       The  function  field_info  returns  the  sizes  and  other
              attributes passed in to the field at  its  creation  time.
              The  attributes are: height, width, row of upper-left cor-
              ner, column of upper-left corner, number off-screen  rows,
              and number of working buffers.
       
      -       The function dynamic_field_info returns the actual size of
      +       The function dynamic_field_info returns the actual size of
              the field, and its maximum possible size.   If  the  field
              has  no  size  limit,  the location addressed by the third
              argument will be set to 0.  (A field can be  made  dynamic
      -       by turning off the O_STATIC).
      +       by turning off the O_STATIC).
       
       
       

      RETURN VALUE

              These routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x) and 3x pages  whose  names  begin  "form_"  for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_just.3x.html b/doc/html/man/form_field_just.3x.html index 1643c449..c4c989c6 100644 --- a/doc/html/man/form_field_just.3x.html +++ b/doc/html/man/form_field_just.3x.html @@ -1,24 +1,63 @@ + + + +form_field_just 3x + + + +

      form_field_just 3x

      +
       
       
       

      NAME

      -       form_field_just - retrieve field characteristics
      +       form_field_just - retrieve field characteristics
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_just(FIELD *field, int justification);
              int field_just(const FIELD *field);
       
       
       

      DESCRIPTION

      -       The   function   set_field_just   sets  the  justification
      -       attribute of a field; field_just returns a field's  justi-
      +       The   function   set_field_just   sets  the  justification
      +       attribute of a field; field_just returns a field's  justi-
              fication attribute.  The attribute may be one of NO_JUSTI-
              FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or  JUSTIFY_CENTER.
       
      @@ -26,31 +65,31 @@
       
       

      RETURN VALUE

      -       The  function field_just returns one of: NO_JUSTIFICATION,
      +       The  function field_just returns one of: NO_JUSTIFICATION,
              JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
       
      -       The function set_field_just return one of the following:
      +       The function set_field_just return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x)  and  3x  pages  whose  names begin "form_" for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_new.3x.html b/doc/html/man/form_field_new.3x.html index f6dd76a1..54e94e51 100644 --- a/doc/html/man/form_field_new.3x.html +++ b/doc/html/man/form_field_new.3x.html @@ -1,16 +1,55 @@ + + + +form_field_new 3x + + + +

      form_field_new 3x

      +
       
       
       

      NAME

      -       form_field_new - create and destroy form fields
      +       form_field_new - create and destroy form fields
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              FIELD *new_field(int height, int width,
                               int toprow, int leftcol,
                               int offscreen, int nbuffers);
      @@ -21,52 +60,52 @@
       
       

      DESCRIPTION

      -       The  function new_field allocates a new field and initial-
      +       The  function new_field allocates a new field and initial-
              izes it from the parameters given: height, width,  row  of
              upper-left  corner,  column  of  upper-left corner, number
              off-screen rows, and number of additional working buffers.
       
      -       The  function  dup_field duplicates a field at a new loca-
      +       The  function  dup_field duplicates a field at a new loca-
              tion.  Most attributes (including current contents,  size,
              validation  type, buffer count, growth threshold, justifi-
              cation, foreground, background,  pad  character,  options,
              and  user pointer) are copied.  Field status and the field
              page bit are not copied.
       
      -       The function link_field acts like dup_field, but  the  new
      +       The function link_field acts like dup_field, but  the  new
              field  shares  buffers with its parent.  Attribute data is
              separate.
       
      -       The function free_field  de-allocates  storage  associated
      +       The function free_field  de-allocates  storage  associated
              with a field.
       
       
       

      RETURN VALUE

      -       The function, new_field, dup_field, link_field return NULL
      +       The function, new_field, dup_field, link_field return NULL
              on error.
       
      -       The function free_field returns one of the following:
      +       The function free_field returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      @@ -75,7 +114,7 @@ were not supported on Version 7 or BSD versions. It may be unwise to count on the set of attributes copied - by dup_field(3x) being portable; the System V forms + by dup_field(3x) being portable; the System V forms library documents are not very explicit on what gets copied and was not. diff --git a/doc/html/man/form_field_opts.3x.html b/doc/html/man/form_field_opts.3x.html index 576dcad8..c1ff6a30 100644 --- a/doc/html/man/form_field_opts.3x.html +++ b/doc/html/man/form_field_opts.3x.html @@ -1,16 +1,55 @@ + + + +form_field_opts 3x + + + +

      form_field_opts 3x

      +
       
       
       

      NAME

      -       form_field_opts - set and get field options
      +       form_field_opts - set and get field options
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_opts(FIELD *field, OPTIONS opts);
              int field_opts_on(FIELD *field, OPTIONS opts);
              int field_opts_off(FIELD *field, OPTIONS opts);
      @@ -19,17 +58,17 @@
       
       

      DESCRIPTION

      -       The  function  set_field_opts  sets  all the given field's
      +       The  function  set_field_opts  sets  all the given field's
              option bits (field  option  bits  may  be  logically-OR'ed
              together).
       
      -       The function field_opts_on turns on the given option bits,
      +       The function field_opts_on turns on the given option bits,
              and leaves others alone.
       
      -       The function field_opts_off turns  off  the  given  option
      +       The function field_opts_off turns  off  the  given  option
              bits, and leaves others alone.
       
      -       The function field_opts returns the field's current option
      +       The function field_opts returns the field's current option
              bits.
       
              The following options are defined (all are on by default):
      @@ -74,25 +113,25 @@
       
       

      RETURN VALUE

      -       Except for field_opts, each routine  returns  one  of  the
      +       Except for field_opts, each routine  returns  one  of  the
              following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_CURRENT
      +       E_CURRENT
                   The field is the current field.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
      -       NOTES  The header file <form.h> automatically includes the
      -              header file <curses.h>.
      +       NOTES  The header file <form.h> automatically includes the
      +              header file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_userptr.3x.html b/doc/html/man/form_field_userptr.3x.html index 46977c9f..0041a562 100644 --- a/doc/html/man/form_field_userptr.3x.html +++ b/doc/html/man/form_field_userptr.3x.html @@ -1,17 +1,56 @@ + + + +form_field_userptr 3x + + + +

      form_field_userptr 3x

      +
       
       
       

      NAME

      -       form_field_userptr  -  associate  application  data with a
      +       form_field_userptr  -  associate  application  data with a
              form field
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_userptr(FIELD *field, void*userptr);
              void *field_userptr(const FIELD *field);
       
      @@ -25,24 +64,24 @@
       
       

      RETURN VALUE

      -       The  function  field_userptr  returns  NULL  on error. The
      -       function set_field_userptr returns one of the following:
      +       The  function  field_userptr  returns  NULL  on error. The
      +       function set_field_userptr returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_field_validation.3x.html b/doc/html/man/form_field_validation.3x.html index 34ae0dc7..93cae7f4 100644 --- a/doc/html/man/form_field_validation.3x.html +++ b/doc/html/man/form_field_validation.3x.html @@ -1,16 +1,54 @@ + + + +form_field_validation 3x + + + +

      form_field_validation 3x

      +
       
       
       

      NAME

      -       form_field_validation - data type validation for fields
      +       form_field_validation - data type validation for fields
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_type(FIELD *field, FIELDTYPE *type, ...);
              FIELDTYPE *field_type(const FIELD *field);
              void *field_arg(const FIELD *field);
      @@ -18,23 +56,23 @@
       
       

      DESCRIPTION

      -       The  function  set_field_type  declares  a data type for a
      +       The  function  set_field_type  declares  a data type for a
              given form field.  This is the type checked by  validation
              functions.  The types are as follows:
       
              TYPE_ALNUM
      -            Alphanumeric  data.  Requires a third int argument, a
      +            Alphanumeric  data.  Requires a third int argument, a
                   minimum field width.
       
              TYPE_ALPHA
      -            Character data.  Requires a  third  int  argument,  a
      +            Character data.  Requires a  third  int  argument,  a
                   minimum field width.
       
              TYPE_ENUM
                   Accept one of a specified set of strings.  Requires a
      -            third (char **) argument pointing to a string list; a
      -            fourth  int flag argument to enable case-sensitivity;
      -            and a fifth int flag argument  specifying  whether  a
      +            third (char **) argument pointing to a string list; a
      +            fourth  int flag argument to enable case-sensitivity;
      +            and a fifth int flag argument  specifying  whether  a
                   partial  match  must be a unique one (if this flag is
                   off, a prefix matches the first of any  set  of  more
                   than  one  list  elements  with  that prefix). Please
      @@ -44,37 +82,37 @@
                   on the stack.
       
              TYPE_INTEGER
      -            Integer  data,  parsable  to  an  integer by atoi(3).
      -            Requires a third int argument controlling the  preci-
      -            sion,  a  fourth  long  argument constraining minimum
      -            value, and a fifth long constraining  maximum  value.
      +            Integer  data,  parsable  to  an  integer by atoi(3).
      +            Requires a third int argument controlling the  preci-
      +            sion,  a  fourth  long  argument constraining minimum
      +            value, and a fifth long constraining  maximum  value.
                   If  the  maximum  value  is less or equal the minimum
                   value, the range is simply  ignored.  On  return  the
      -            field  buffer  is  formatted  according to the printf
      +            field  buffer  is  formatted  according to the printf
                   format  specification  ".*ld",  where  the   '*'   is
                   replaced  by  the precision argument.  For details of
      -            the precision handling see printf's man-page.
      +            the precision handling see printf's man-page.
       
              TYPE_NUMERIC
                   Numeric  data  (may  have  a   decimal-point   part).
      -            Requires  a third int argument controlling the preci-
      -            sion, a fourth double argument  constraining  minimum
      -            value, and a fifth double constraining maximum value.
      +            Requires  a third int argument controlling the preci-
      +            sion, a fourth double argument  constraining  minimum
      +            value, and a fifth double constraining maximum value.
                   If your system supports locale's, the  decimal  point
                   character  to  be  used  must be the one specified by
                   your locale.  If the maximum value is less  or  equal
                   the  minimum  value,  the range is simply ignored. On
                   return the field buffer is formatted according to the
      -            printf  format  specification ".*f", where the '*' is
      +            printf  format  specification ".*f", where the '*' is
                   replaced by the precision argument.  For  details  of
      -            the precision handling see printf's man-page.
      +            the precision handling see printf's man-page.
       
              TYPE_REGEXP
                   Regular  expression data.  Requires a regular expres-
      -            sion (char *) third argument; the data  is  valid  if
      +            sion (char *) third argument; the data  is  valid  if
                   the  regular  expression matches it.  Regular expres-
      -            sions  are  in  the   format   of   regcomp(3x)   and
      -            regexec(3x).  Please  notice that the regular expres-
      +            sions  are  in  the   format   of   regcomp(3x)   and
      +            regexec(3x).  Please  notice that the regular expres-
                   sion must match the whole  field.  If  you  have  for
                   example  an  eight  character  wide  field, a regular
                   expression "^[0-9]*$" always means that you  have  to
      @@ -95,30 +133,30 @@
                   implementations.
       
                   It is possible to set up new programmer-defined field
      -            types.  See the form_fieldtype(3x) manual page.
      +            types.  See the form_fieldtype(3x) manual page.
       
       
       

      RETURN VALUE

      -       The  functions  field_type  and  field_arg  return NULL on
      -       error. The function set_field_type returns one of the fol-
      +       The  functions  field_type  and  field_arg  return NULL on
      +       error. The function set_field_type returns one of the fol-
              lowing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_fieldtype.3x.html b/doc/html/man/form_fieldtype.3x.html index dec43a35..d4ff4f34 100644 --- a/doc/html/man/form_fieldtype.3x.html +++ b/doc/html/man/form_fieldtype.3x.html @@ -1,16 +1,55 @@ + + + +form_fieldtype 3x + + + +

      form_fieldtype 3x

      +
       
       
       

      NAME

      -       form_fieldtype - define validation-field types
      +       form_fieldtype - define validation-field types
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              FIELDTYPE *new_fieldtype(
                  bool (* const field_check)(FIELD *, const void *),
                  bool (* const char_check)(int, const void *));
      @@ -21,7 +60,7 @@
                  void *(* const copy_arg)(const void *),
                  void  (* const free_arg)(void *));
              int set_fieldtype_choice(
      -           FIELDTYPE *fieldtype
      +           FIELDTYPE *fieldtype,
                  bool (* const next_choice)(FIELD *, const void *),
                  bool (* const prev_choice)(FIELD *, const void *));
              FIELDTYPE *link_fieldtype(FIELDTYPE *type1,
      @@ -30,8 +69,8 @@
       
       

      DESCRIPTION

      -       The function new_fieldtype creates a new field type usable
      -       for data validation.  You supply it  with  field_check,  a
      +       The function new_fieldtype creates a new field type usable
      +       for data validation.  You supply it  with  field_check,  a
              predicate  to check the validity of an entered data string
              whenever the user attempt to leave a field.  The (FIELD *)
              argument  is passed in so the validation predicate can see
      @@ -39,32 +78,32 @@
              argument  is an argument-block structure, about which more
              below.
       
      -       You also supply new_fieldtype with char_check, a  function
      +       You also supply new_fieldtype with char_check, a  function
              to  validate input characters as they are entered; it will
              be passed the character to be checked and a pointer to  an
              argument-block structure.
       
      -       The  function free_fieldtype frees the space allocated for
      +       The  function free_fieldtype frees the space allocated for
              a given validation type.
       
      -       The function set_fieldtype associates  three  storage-man-
      -       agement functions with a field type.  The mak_arg function
      +       The function set_fieldtype associates  three  storage-man-
      +       agement functions with a field type.  The mak_arg function
              is automatically applied to the list of arguments you give
      -       set_field_type  when  attaching validation to a field; its
      +       set_field_type  when  attaching validation to a field; its
              job is to bundle these into  an  allocated  argument-block
              object which can later be passed to validation predicated.
              The other two hook arguments should copy  and  free  argu-
              ment-block  structures.   They  will be used by the forms-
      -       driver code. You must supply  the  mak_arg  function,  the
      +       driver code. You must supply  the  mak_arg  function,  the
              other  two  are optional, you may supply NULL for them. In
      -       this case it is assumed,  that  mak_arg  doesn't  allocate
      +       this case it is assumed,  that  mak_arg  doesn't  allocate
              memory  but simply loads the argument into a single scalar
              value.
       
      -       The   form    driver    requests    REQ_NEXT_CHOICE    and
      -       REQ_PREV_CHOICE assume that the possible values of a field
      +       The   form    driver    requests    REQ_NEXT_CHOICE    and
      +       REQ_PREV_CHOICE assume that the possible values of a field
              form an ordered set, and provide the forms user with a way
      -       to  move  through the set.  The set_fieldtype_choice func-
      +       to  move  through the set.  The set_fieldtype_choice func-
              tion allows forms programmers to define successor and pre-
              decessor  functions  for  the field type.  These functions
              take the field pointer and an argument-block structure  as
      @@ -78,31 +117,31 @@
              The  integer-valued  routines  return one of the following
              codes on error:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_CONNECTED
      +       E_CONNECTED
                   The field is already connected to a form.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
      -       All of the (char *) arguments of  these  functions  should
      -       actually  be (void *).  The type has been left uncorrected
      +       All of the (char *) arguments of  these  functions  should
      +       actually  be (void *).  The type has been left uncorrected
              for strict compatibility with System V.
       
       
      diff --git a/doc/html/man/form_hook.3x.html b/doc/html/man/form_hook.3x.html
      index 87628aa2..5f6af22f 100644
      --- a/doc/html/man/form_hook.3x.html
      +++ b/doc/html/man/form_hook.3x.html
      @@ -1,17 +1,56 @@
      +
      +
       
      +
      +form_hook 3x
      +
      +
      +
       
      +

      form_hook 3x

      +
       
       
       

      NAME

      -       form_hook - set hooks for automatic invocation by applica-
      +       form_hook - set hooks for automatic invocation by applica-
              tions
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_field_init(FORM *form, void (*func)(FORM *));
              void (*)(FORM *) field_init(const FORM *form);
              int set_field_term(FORM *form, void (*func)(FORM *));
      @@ -26,49 +65,49 @@
       

      DESCRIPTION

              These functions make it possible to set hook functions  to
              be called at various points in the automatic processing of
      -       input event codes by form_driver.
      +       input event codes by form_driver.
       
      -       The function set_field_init sets a hook to  be  called  at
      +       The function set_field_init sets a hook to  be  called  at
              form-post  time  and  each time the selected field changes
      -       (after the change).  field_init returns the current  field
      -       init hook, if any (NULL if there is no such hook).
      +       (after the change).  field_init returns the current  field
      +       init hook, if any (NULL if there is no such hook).
       
      -       The  function  set_field_term  sets a hook to be called at
      +       The  function  set_field_term  sets a hook to be called at
              form-unpost time and each time the selected field  changes
      -       (before the change).  field_term returns the current field
      -       term hook, if any (NULL if there is no such hook).
      +       (before the change).  field_term returns the current field
      +       term hook, if any (NULL if there is no such hook).
       
      -       The function set_form_init sets a hook  to  be  called  at
      +       The function set_form_init sets a hook  to  be  called  at
              form-post  time  and  just  after a page change once it is
      -       posted.  form_init returns the current form init hook,  if
      -       any (NULL if there is no such hook).
      +       posted.  form_init returns the current form init hook,  if
      +       any (NULL if there is no such hook).
       
      -       The  function  set_form_term  sets  a hook to be called at
      +       The  function  set_form_term  sets  a hook to be called at
              form-unpost time and just before a page change once it  is
      -       posted.   form_init returns the current form term hook, if
      -       any (NULL if there is no such hook).
      +       posted.   form_init returns the current form term hook, if
      +       any (NULL if there is no such hook).
       
       
       

      RETURN VALUE

      -       Routines that return pointers return NULL on error.  Other
      +       Routines that return pointers return NULL on error.  Other
              routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_new.3x.html b/doc/html/man/form_new.3x.html index 7b0d91bb..c90a023e 100644 --- a/doc/html/man/form_new.3x.html +++ b/doc/html/man/form_new.3x.html @@ -1,58 +1,97 @@ + + + +form_new 3x + + + +

      form_new 3x

      +
       
       
       

      NAME

      -       form_new - create and destroy forms
      +       form_new - create and destroy forms
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              FORM *new_form(FIELD **fields);
              int free_form(FORM *form);
       
       
       

      DESCRIPTION

      -       The  function  new_form  creates a new form connected to a
      -       specified field pointer array (which must  be  NULL-termi-
      +       The  function  new_form  creates a new form connected to a
      +       specified field pointer array (which must  be  NULL-termi-
              nated).
       
      -       The  function  free_form  disconnects  form from its field
      +       The  function  free_form  disconnects  form from its field
              array and frees the storage allocated for the form.
       
       
       

      RETURN VALUE

      -       The function new_form returns NULL on error.
      +       The function new_form returns NULL on error.
       
      -       The function free_form returns one of the following:
      +       The function free_form returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The form has already been posted.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_new_page.3x.html b/doc/html/man/form_new_page.3x.html index 1a8d4ea8..ae2cc2d9 100644 --- a/doc/html/man/form_new_page.3x.html +++ b/doc/html/man/form_new_page.3x.html @@ -1,55 +1,94 @@ + + + +form_new_page 3x + + + +

      form_new_page 3x

      +
       
       
       

      NAME

      -       form_new_page - form pagination functions
      +       form_new_page - form pagination functions
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_new_page(FIELD *field, bool new_page_flag);
              bool new_page(const FIELD *field);
       
       
       

      DESCRIPTION

      -       The  function  set_new_page  sets or resets a flag marking
      +       The  function  set_new_page  sets or resets a flag marking
              the given field as the beginning of  a  new  page  on  its
              form.
       
      -       The  function  new_page  is  a  predicate which tests if a
      +       The  function  new_page  is  a  predicate which tests if a
              given field marks a page beginning on its form.
       
       
       

      RETURN VALUE

      -       The function new_page returns TRUE or FALSE.
      +       The function new_page returns TRUE or FALSE.
       
      -       The function set_new_page return one of the following:
      +       The function set_new_page return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_CONNECTED
      +       E_CONNECTED
                   The given field is already connected to a form.
       
       
       

      SEE ALSO

      -       curses(3x) and 3x pages  whose  names  begin  "form_"  for
      +       curses(3x) and related pages whose names begin "form_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_opts.3x.html b/doc/html/man/form_opts.3x.html index 5ae1cc4a..38f970be 100644 --- a/doc/html/man/form_opts.3x.html +++ b/doc/html/man/form_opts.3x.html @@ -1,16 +1,55 @@ + + + +form_opts 3x + + + +

      form_opts 3x

      +
       
       
       

      NAME

      -       form_opts - set and get form options
      +       form_opts - set and get form options
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_form_opts(FORM *form, OPTIONS opts);
              int form_opts_on(FORM *form, OPTIONS opts);
              int form_opts_off(FORM *form, OPTIONS opts);
      @@ -19,52 +58,52 @@
       
       

      DESCRIPTION

      -       The  function  set_form_opts  sets  all  the  given form's
      +       The  function  set_form_opts  sets  all  the  given form's
              option bits  (form  option  bits  may  be  logically-OR'ed
              together).
       
      -       The  function form_opts_on turns on the given option bits,
      +       The  function form_opts_on turns on the given option bits,
              and leaves others alone.
       
      -       The function form_opts_off  turns  off  the  given  option
      +       The function form_opts_off  turns  off  the  given  option
              bits, and leaves others alone.
       
      -       The  function  form_opts returns the form's current option
      +       The  function  form_opts returns the form's current option
              bits.
       
              The following options are defined (all are on by default):
       
              O_NL_OVERLOAD
      -            Overload  the  REQ_NEW_LINE  forms  driver request so
      +            Overload  the  REQ_NEW_LINE  forms  driver request so
                   that calling it at the end of a  field  goes  to  the
                   next field.
       
              O_BS_OVERLOAD
      -            Overload  the  REQ_DEL_PREV  forms  driver request so
      +            Overload  the  REQ_DEL_PREV  forms  driver request so
                   that calling it at the beginning of a field  goes  to
                   the previous field.
       
       
       

      RETURN VALUE

      -       Except for form_opts, each routine returns one of the fol-
      +       Except for form_opts, each routine returns one of the fol-
              lowing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_page.3x.html b/doc/html/man/form_page.3x.html index 874bda87..84d9f7b7 100644 --- a/doc/html/man/form_page.3x.html +++ b/doc/html/man/form_page.3x.html @@ -1,16 +1,55 @@ + + + +form_page 3x + + + +

      form_page 3x

      +
       
       
       

      NAME

      -       form_page - set and get form page number
      +       form_page - set and get form page number
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_current_field(FORM *form, FIELD *field);
              FIELD *current_field(const FORM *);
              int set_form_page(FORM *form, int n);
      @@ -20,57 +59,57 @@
       
       

      DESCRIPTION

      -       The  function  set_current field sets the current field of
      -       the given form; current_field returns the current field of
      +       The  function  set_current field sets the current field of
      +       the given form; current_field returns the current field of
              the given form.
       
      -       The  function  set_form_page  sets  the form's page number
      -       (goes to page n of the form).
      +       The  function  set_form_page  sets  the form's page number
      +       (goes to page n of the form).
       
      -       The function form_page returns  the  form's  current  page
      +       The function form_page returns  the  form's  current  page
              number.
       
      -       The function field_index returns the index of the field in
      +       The function field_index returns the index of the field in
              the field array of the form it is connected to. It returns
      -       ERR  if  the  argument is the null pointer or the field is
      +       ERR  if  the  argument is the null pointer or the field is
              not connected.
       
       
       

      RETURN VALUE

      -       Except for form_page, each routine returns one of the fol-
      +       Except for form_page, each routine returns one of the fol-
              lowing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_INVALID_FIELD
      +       E_INVALID_FIELD
                   Contents of a field are not valid.
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The form driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_post.3x.html b/doc/html/man/form_post.3x.html index e52967e8..2730fddb 100644 --- a/doc/html/man/form_post.3x.html +++ b/doc/html/man/form_post.3x.html @@ -1,30 +1,69 @@ + + + +form_post 3x + + + +

      form_post 3x

      +
       
       
       

      NAME

      -       form_post  -  write or erase forms from associated subwin-
      +       form_post  -  write or erase forms from associated subwin-
              dows
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int post_form(FORM *form);
              int unpost_form(FORM *form);
       
       
       

      DESCRIPTION

      -       The function post_form displays a form to  its  associated
      +       The function post_form displays a form to  its  associated
              subwindow.   To trigger physical display of the subwindow,
      -       use  refresh  or  some  equivalent  curses  routine   (the
      -       implicit  doupdate  triggered  by  an curses input request
      +       use  refresh  or  some  equivalent  curses  routine   (the
      +       implicit  doupdate  triggered  by  an curses input request
              will do).
       
      -       The function unpost_form erases form from  its  associated
      +       The function unpost_form erases form from  its  associated
              subwindow.
       
       
      @@ -32,41 +71,41 @@
       

      RETURN VALUE

              These routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The form has already been posted.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NO_ROOM
      +       E_NO_ROOM
                   Form is too large for its window.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The form has not been posted.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the form.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_requestname.3x.html b/doc/html/man/form_requestname.3x.html index dcf5065e..093f1f12 100644 --- a/doc/html/man/form_requestname.3x.html +++ b/doc/html/man/form_requestname.3x.html @@ -1,45 +1,84 @@ + + + +form_requestname 3x + + + +

      form_requestname 3x

      +
       
       
       

      NAME

      -       form_requestname - handle printable form request names
      +       form_requestname - handle printable form request names
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              const char *form_request_name(int request);
              int form_request_by_name(const char *name);
       
       
       

      DESCRIPTION

      -       The  function form_request_name returns the printable name
      +       The  function form_request_name returns the printable name
              of a form request code.
      -       The function form_request_by_name searches  in  the  name-
      +       The function form_request_by_name searches  in  the  name-
              table  for  a  request with the given name and returns its
              request code. Otherwise E_NO_MATCH is returned.
       
       
       

      RETURN VALUE

      -       form_request_name returns NULL on error and sets errno  to
      -       E_BAD_ARGUMENT.
      -       form_request_by_name returns E_NO_MATCH on error.
      +       form_request_name returns NULL on error and sets errno  to
      +       E_BAD_ARGUMENT.
      +       form_request_by_name returns E_NO_MATCH on error.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_userptr.3x.html b/doc/html/man/form_userptr.3x.html index 4ac76f8b..325df02b 100644 --- a/doc/html/man/form_userptr.3x.html +++ b/doc/html/man/form_userptr.3x.html @@ -1,16 +1,55 @@ + + + +form_userptr 3x + + + +

      form_userptr 3x

      +
       
       
       

      NAME

      -       form_userptr - associate application data with a form item
      +       form_userptr - associate application data with a form item
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_form_userptr(FORM *form, void *userptr);
              void* form_userptr(const FORM *form);
       
      @@ -25,24 +64,24 @@
       
       

      RETURN VALUE

      -       The  function  form_userptr  returns  NULL  on error.  The
      -       function set_form_userptr returns one of the following:
      +       The  function  form_userptr  returns  NULL  on error.  The
      +       function set_form_userptr returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/form_win.3x.html b/doc/html/man/form_win.3x.html index 4f73a641..13d39e3a 100644 --- a/doc/html/man/form_win.3x.html +++ b/doc/html/man/form_win.3x.html @@ -1,17 +1,56 @@ + + + +form_win 3x + + + +

      form_win 3x

      +
       
       
       

      NAME

      -       form_win  - make and break form window and subwindow asso-
      +       form_win  - make and break form window and subwindow asso-
              ciations
       
       
       

      SYNOPSIS

      -       #include <form.h>
      +       #include <form.h>
              int set_form_win(FORM *form, WINDOW *win);
              WINDOW *form_win(const FORM *form);
              int set_form_sub(FORM *form, WINDOW *sub);
      @@ -21,56 +60,56 @@
       
       

      DESCRIPTION

      -       Every  form has an associated pair of curses windows.  The
      +       Every  form has an associated pair of curses windows.  The
              form window displays any title and border associated  with
              the  window;  the form subwindow displays the items of the
              form that are currently available for selection.
       
              The first four functions get and set those windows.  It is
              not necessary to set either window; by default, the driver
      -       code uses stdscr for both.
      +       code uses stdscr for both.
       
      -       In the set_ functions, window argument of NULL is  treated
      -       as  though  it  were  stsdcr.   A form argument of NULL is
      +       In the set_ functions, window argument of NULL is  treated
      +       as  though  it  were  stsdcr.   A form argument of NULL is
              treated as a request to change  the  system  default  form
              window or subwindow.
       
      -       The  function scale_form returns the minimum size required
      -       for the subwindow of form.
      +       The  function scale_form returns the minimum size required
      +       for the subwindow of form.
       
       
       

      RETURN VALUE

      -       Routines that return pointers return NULL on error.   Rou-
      +       Routines that return pointers return NULL on error.   Rou-
              tines  that  return an integer return one of the following
              error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The form has already been posted.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the form.
       
       
       

      SEE ALSO

      -       curses(3x), form(3x).
      +       curses(3x), form(3x).
       
       
       
       

      NOTES

      -       The header file <form.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <form.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html index 5f77495f..099b3ef0 100644 --- a/doc/html/man/infocmp.1m.html +++ b/doc/html/man/infocmp.1m.html @@ -1,201 +1,245 @@ + + + +infocmp 1m + + + +

      infocmp 1m

      +
       
       
       

      NAME

      -       infocmp - compare or print out terminfo descriptions
      +       infocmp - compare or print out terminfo descriptions
       
       
       

      SYNOPSIS

      -       infocmp [-dceEGgnpqrILCuV1] [-v n] [-s d| i| l| c]
      -             [-w width] [-A directory] [-B directory]
      -             [termname...]
      +       infocmp [-1CEFGILTVcdegilnpqrtu]
      +             [-v n] [-s d| i| l| c] [-R subset]
      +             [-w width] [-A directory] [-B directory]
      +             [termname...]
       
       
       

      DESCRIPTION

      -       infocmp  can  be  used  to compare a binary terminfo entry
      -       with other terminfo entries, rewrite a  terminfo  descrip-
      -       tion  to  take  advantage  of  the use= terminfo field, or
      -       print out a terminfo  description  from  the  binary  file
      -       (term) in a variety of formats.  In all cases, the boolean
      +       infocmp  can  be  used  to compare a binary terminfo entry
      +       with other terminfo entries, rewrite a  terminfo  descrip-
      +       tion  to  take  advantage  of  the use= terminfo field, or
      +       print out a terminfo  description  from  the  binary  file
      +       (term) in a variety of formats.  In all cases, the boolean
              fields will be printed  first,  followed  by  the  numeric
              fields, followed by the string fields.
       
      -   Default Options
      -       If  no options are specified and zero or one termnames are
      -       specified, the -I option will be assumed.   If  more  than
      -       one  termname is specified, the -d option will be assumed.
      +   Default Options
      +       If  no options are specified and zero or one termnames are
      +       specified, the -I option will be assumed.   If  more  than
      +       one  termname is specified, the -d option will be assumed.
       
      -   Comparison Options [-d] [-c] [-n]
      -       infocmp compares the terminfo  description  of  the  first
      -       terminal  termname  with each of the descriptions given by
      -       the entries for the  other  terminal's  termnames.   If  a
      +   Comparison Options [-d] [-c] [-n]
      +       infocmp compares the terminfo  description  of  the  first
      +       terminal  termname  with each of the descriptions given by
      +       the entries for the  other  terminal's  termnames.   If  a
              capability  is  defined for only one of the terminals, the
              value returned will depend on the type of the  capability:
      -       F  for  boolean  variables,  -1 for integer variables, and
      -       NULL for string variables.
      +       F  for  boolean  variables,  -1 for integer variables, and
      +       NULL for string variables.
       
      -       The -d option produces a list of each capability  that  is
      +       The -d option produces a list of each capability  that  is
              different  between  two entries.  This option is useful to
              show the difference between two entries, created  by  dif-
              ferent people, for the same or similar terminals.
       
      -       The  -c  option produces a list of each capability that is
      +       The  -c  option produces a list of each capability that is
              common between two entries.  Capabilities that are not set
              are  ignored.  This option can be used as a quick check to
      -       see if the -u option is worth using.
      +       see if the -u option is worth using.
       
      -       The -n option produces a list of each capability  that  is
      -       in neither entry.  If no termnames are given, the environ-
      -       ment variable TERM will be used for both of the termnames.
      +       The -n option produces a list of each capability  that  is
      +       in neither entry.  If no termnames are given, the environ-
      +       ment variable TERM will be used for both of the termnames.
              This  can  be used as a quick check to see if anything was
              left out of a description.
       
      -   Source Listing Options [-I] [-L] [-C] [-r]
      -       The -I, -L, and -C options will produce a  source  listing
      +   Source Listing Options [-I] [-L] [-C] [-r]
      +       The -I, -L, and -C options will produce a  source  listing
              for each terminal named.
       
      -      -I   use the terminfo names
      -      -L   use the long C variable name listed in <term.h>
      +      -I   use the terminfo names
       
      -      -C   use the termcap names
      -      -r   when using -C, put out all capabilities in termcap form
      +      -L   use the long C variable name listed in <term.h>
      +      -C   use the termcap names
      +      -r   when using -C, put out all capabilities in termcap form
       
      -       If  no  termnames are given, the environment variable TERM
      +       If  no  termnames are given, the environment variable TERM
              will be used for the terminal name.
       
      -       The source produced by the -C option may be used  directly
      -       as  a termcap entry, but not all parameterized strings can
      -       be changed to the termcap format.  infocmp will attempt to
      +       The source produced by the -C option may be used  directly
      +       as  a termcap entry, but not all parameterized strings can
      +       be changed to the termcap format.  infocmp will attempt to
              convert  most  of  the parameterized information, and any-
              thing not converted will be plainly marked in  the  output
              and commented out.  These should be edited by hand.
       
              All  padding  information  for  strings  will be collected
              together and placed at the beginning of the  string  where
      -       termcap  expects  it.  Mandatory padding (padding informa-
      +       termcap  expects  it.  Mandatory padding (padding informa-
              tion with a trailing '/') will become optional.
       
      -       All termcap variables no longer supported by terminfo, but
      -       which are derivable from other terminfo variables, will be
      -       output.  Not all terminfo capabilities will be translated;
      -       only  those variables which were part of termcap will nor-
      -       mally be output.  Specifying the -r option will  take  off
      +       All termcap variables no longer supported by terminfo, but
      +       which are derivable from other terminfo variables, will be
      +       output.  Not all terminfo capabilities will be translated;
      +       only  those variables which were part of termcap will nor-
      +       mally be output.  Specifying the -r option will  take  off
              this  restriction,  allowing all capabilities to be output
      -       in termcap form.
      +       in termcap form.
       
              Note that because padding is collected to the beginning of
              the  capability,  not all capabilities are output.  Manda-
      -       tory padding is not supported.   Because  termcap  strings
      +       tory padding is not supported.   Because  termcap  strings
              are  not as flexible, it is not always possible to convert
      -       a terminfo string capability into  an  equivalent  termcap
      -       format.   A subsequent conversion of the termcap file back
      -       into terminfo format will not  necessarily  reproduce  the
      -       original terminfo source.
      +       a terminfo string capability into  an  equivalent  termcap
      +       format.   A subsequent conversion of the termcap file back
      +       into terminfo format will not  necessarily  reproduce  the
      +       original terminfo source.
       
      -       Some  common  terminfo  parameter sequences, their termcap
      +       Some  common  terminfo  parameter sequences, their termcap
              equivalents, and some terminal types which  commonly  have
              such sequences, are:
       
      -     terminfo                    termcap   Representative Terminals
      +     terminfo                    termcap   Representative Terminals
            ---------------------------------------------------------------
      -     %p1%c                       %.        adm
      -     %p1%d                       %d        hp, ANSI standard, vt100
      -     %p1%'x'%+%c                 %+x       concept
      -     %i                          %iq       ANSI standard, vt100
      -     %p1%?%'x'%>%t%p1%'y'%+%;    %>xy      concept
      -     %p2 is printed before %p1   %r        hp
      -
      -   Use= Option [-u]
      -       The  -u  option  produces a terminfo source description of
      -       the first terminal termname which is relative to  the  sum
      +     %p1%c                       %.        adm
      +     %p1%d                       %d        hp, ANSI standard, vt100
      +     %p1%'x'%+%c                 %+x       concept
      +     %i                          %iq       ANSI standard, vt100
      +     %p1%?%'x'%>%t%p1%'y'%+%;    %>xy      concept
      +     %p2 is printed before %p1   %r        hp
      +
      +   Use= Option [-u]
      +       The  -u  option  produces a terminfo source description of
      +       the first terminal termname which is relative to  the  sum
              of  the  descriptions  given  by the entries for the other
      -       terminals termnames.  It does this by analyzing  the  dif-
      -       ferences   between   the  first  termname  and  the  other
      -       termnames and producing a description with use= fields for
      +       terminals  termnames.   It  does  this  by  analyzing  the
      +       differences  between  the  first  termname  and  the other
      +       termnames and producing a description with use= fields for
              the  other  terminals.   In this manner, it is possible to
              retrofit  generic  terminfo  entries  into  a   terminal's
              description.  Or, if two similar terminals exist, but were
              coded at different times or by different  people  so  that
      -       each description is a full description, using infocmp will
      +       each description is a full description, using infocmp will
              show what can be done to change one description to be rel-
              ative to the other.
       
              A capability will get printed with an at-sign (@) if it no
      -       longer exists in the first termname, but one of the  other
      -       termname  entries contains a value for it.  A capability's
      -       value gets printed if the value in the first  termname  is
      -       not  found in any of the other termname entries, or if the
      -       first of the other termname entries that has this capabil-
      +       longer exists in the first termname, but one of the  other
      +       termname  entries contains a value for it.  A capability's
      +       value gets printed if the value in the first  termname  is
      +       not  found in any of the other termname entries, or if the
      +       first of the other termname entries that has this capabil-
              ity  gives  a different value for the capability than that
      -       in the first termname.
      +       in the first termname.
       
      -       The order of the other termname  entries  is  significant.
      -       Since  the terminfo compiler tic does a left-to-right scan
      -       of the capabilities, specifying two use= entries that con-
      +       The order of the other termname  entries  is  significant.
      +       Since  the terminfo compiler tic does a left-to-right scan
      +       of the capabilities, specifying two use= entries that con-
              tain differing entries for the same capabilities will pro-
              duce different results depending on  the  order  that  the
      -       entries  are  given in.  infocmp will flag any such incon-
      -       sistencies between the other termname entries as they  are
      +       entries  are  given in.  infocmp will flag any such incon-
      +       sistencies between the other termname entries as they  are
              found.
       
      -       Alternatively,  specifying a capability after a use= entry
      +       Alternatively,  specifying a capability after a use= entry
              that contains that capability will cause the second speci-
      -       fication  to  be  ignored.   Using  infocmp  to recreate a
      +       fication  to  be  ignored.   Using  infocmp  to recreate a
              description can be a useful check to make sure that every-
              thing  was  specified  correctly  in  the  original source
              description.
       
              Another error  that  does  not  cause  incorrect  compiled
              files,  but will slow down the compilation time, is speci-
      -       fying extra use= fields  that  are  superfluous.   infocmp
      -       will  flag  any  other  termname use= fields that were not
      +       fying extra use= fields  that  are  superfluous.   infocmp
      +       will  flag  any  other  termname use= fields that were not
              needed.
       
      -   Changing Databases [-A directory] [-B directory]
      -       The location of the compiled terminfo  database  is  taken
      -       from  the environment variable TERMINFO .  If the variable
      +   Changing Databases [-A directory] [-B directory]
      +       The location of the compiled terminfo  database  is  taken
      +       from  the environment variable TERMINFO .  If the variable
              is not defined, or the terminal is not found in that loca-
      -       tion,  the  system  terminfo  database, in /usr/share/ter-
      -       minfo, will be used.  The options -A and -B may be used to
      -       override  this  location.  The -A option will set TERMINFO
      -       for the first termname and the -B option will set TERMINFO
      -       for  the  other  termnames.   With this, it is possible to
      +       tion,  the  system  terminfo  database, in /usr/share/ter-
      +       minfo, will be used.  The options -A and -B may be used to
      +       override  this  location.  The -A option will set TERMINFO
      +       for the first termname and the -B option will set TERMINFO
      +       for  the  other  termnames.   With this, it is possible to
              compare descriptions for a terminal  with  the  same  name
              located  in  two  different databases.  This is useful for
              comparing descriptions for the same  terminal  created  by
              different people.
       
      -   Other  Options  [-s d|i|l|c] [-1FTVefip] [-Rsubset] [-v n] [-w
      -       width]
      -       The -s option sorts the fields within each type  according
      -       to the argument below:
      -
      -       d    leave fields in the order that they are stored in the
      -            terminfo database.
      -
      -       i    sort by terminfo name.
      +   Other Options
      +       -1   causes  the  fields  to be printed out one to a line.
      +            Otherwise, the fields will be printed  several  to  a
      +            line to a maximum width of 60 characters.
       
      -       l    sort by the long C variable name.
      +       -a   tells  infocmp  to  retain commented-out capabilities
      +            rather than discarding them.  Capabilities  are  com-
      +            mented by prefixing them with a period.
       
      -       c    sort by the termcap name.
      +       -E   Dump  the  capabilities  of  the  given  terminal  as
      +            tables, needed in the C initializer  for  a  TERMTYPE
      +            structure  (the  terminal capability structure in the
      +            <term.h>).  This option is useful for preparing  ver-
      +            sions  of  the  curses  library hardwired for a given
      +            terminal type.  The tables are all  declared  static,
      +            and  are  named according to the type and the name of
      +            the corresponding terminal entry.
       
      -            If the -s option is not given, the fields printed out
      -            will  be  sorted  alphabetically by the terminfo name
      -            within each type, except in the case of the -C or the
      -            -L options, which cause the sorting to be done by the
      -            termcap name or the long  C  variable  name,  respec-
      -            tively.
      +            Before ncurses 5.0, the split between the -e  and  -E
      +            options  was  not  needed;  but  support for extended
      +            names required making the arrays of terminal capabil-
      +            ities separate from the TERMTYPE structure.
       
      -       -1   causes  the  fields  to be printed out one to a line.
      -            Otherwise, the fields will be printed  several  to  a
      -            line to a maximum width of 60 characters.
      +       -e   Dump  the  capabilities  of the given terminal as a C
      +            initializer for a TERMTYPE  structure  (the  terminal
      +            capability  structure  in the <term.h>).  This option
      +            is  useful  for  preparing  versions  of  the  curses
      +            library hardwired for a given terminal type.
       
      -       -F   compare  terminfo  files.  This assumes that two fol-
      +       -F   compare  terminfo  files.  This assumes that two fol-
                   lowing  arguments  are  filenames.   The  files   are
                   searched  for  pairwise matches between entries, with
                   two entries considered to match if any of their names
      @@ -206,79 +250,31 @@
                   Normally,  to  reduce  the  volume of the report, use
                   references are not resolved before looking  for  dif-
                   ferences, but resolution can be forced by also speci-
      -            fying -r.
      -
      -       -G   Display constant literals in decimal form rather than
      -            their character equivalents.
      +            fying -r.
       
      -       -a   tells  infocmp  to  retain commented-out capabilities
      -            rather than discarding them.  Capabilities  are  com-
      -            mented by prefixing them with a period.
      -
      -       -q   Make  the comparison listing shorter by omitting sub-
      -            headings, and using "-" for absent capabilities,  "@"
      -            for canceled rather than "NULL".
      -
      -       -Rsubset
      -            Restrict  output  to  a given subset.  This option is
      -            for use with archaic versions of terminfo like  those
      -            on  SVr1,  Ultrix,  or  HP/UX that do not support the
      -            full set of SVR4/XSI Curses  terminfo;  and  variants
      -            such as AIX that have their own extensions incompati-
      -            ble with SVr4/XSI.  Available  terminfo  subsets  are
      -            "SVr1",  "Ultrix",  "HP",  and "AIX"; see terminfo(5)
      -            for details.  You can also choose  the  subset  "BSD"
      -            which  selects only capabilities with termcap equiva-
      -            lents recognized by 4.4BSD.
      -
      -       -T   eliminates size-restrictions on the  generated  text.
      -            This is mainly useful for testing and analysis, since
      -            the compiled descriptions are limited (e.g., 1023 for
      -            termcap, 4096 for terminfo).
      -
      -       -V   reports the version of ncurses which was used in this
      -            program, and exits.
      -
      -       -e   Dump the capabilities of the given terminal  as  a  C
      -            initializer  for  a  TERMTYPE structure (the terminal
      -            capability structure in the <term.h>).   This  option
      -            is  useful  for  preparing  versions  of  the  curses
      -            library hardwired for a given terminal type.
      -
      -       -E   Dump  the  capabilities  of  the  given  terminal  as
      -            tables,  needed  in  the C initializer for a TERMTYPE
      -            structure (the terminal capability structure  in  the
      -            <term.h>).   This option is useful for preparing ver-
      -            sions of the curses library  hardwired  for  a  given
      -            terminal  type.   The tables are all declared static,
      -            and are named according to the type and the  name  of
      -            the corresponding terminal entry.
      -
      -            Before  ncurses  5.0, the split between the -e and -E
      -            options was not  needed;  but  support  for  extended
      -            names required making the arrays of terminal capabil-
      -            ities separate from the TERMTYPE structure.
      -
      -       -f   Display  complex  terminfo  strings   which   contain
      +       -f   Display  complex  terminfo  strings   which   contain
                   if/then/else/endif expressions indented for readabil-
                   ity.
       
      -       -g   Display constant character literals  in  quoted  form
      +       -G   Display constant literals in decimal form rather than
      +            their character equivalents.
      +
      +       -g   Display  constant  character  literals in quoted form
                   rather than their decimal equivalents.
       
      -       -i   Analyze the initialization (is1, is2, is3), and reset
      -            (rs1, rs2, rs3), strings  in  the  entry.   For  each
      -            string,  the code tries to analyze it into actions in
      +       -i   Analyze the initialization (is1, is2, is3), and reset
      +            (rs1,  rs2,  rs3),  strings  in  the entry.  For each
      +            string, the code tries to analyze it into actions  in
                   terms of the other capabilities in the entry, certain
      -            X3.64/ISO  6429/ECMA-48 capabilities, and certain DEC
      -            VT-series private modes (the set of  recognized  spe-
      -            cial  sequences  has  been  selected for completeness
      -            over the existing terminfo  database).   Each  report
      -            line  consists  of the capability name, followed by a
      +            X3.64/ISO 6429/ECMA-48 capabilities, and certain  DEC
      +            VT-series  private  modes (the set of recognized spe-
      +            cial sequences has  been  selected  for  completeness
      +            over  the  existing  terminfo database).  Each report
      +            line consists of the capability name, followed  by  a
                   colon and space, followed by a printable expansion of
      -            the  capability  string with sections matching recog-
      -            nized   actions    translated    into    {}-bracketed
      -            descriptions.  Here is a list of the DEC/ANSI special
      +            the capability string with sections  matching  recog-
      +            nized  actions  translated into {}-bracketed descrip-
      +            tions.  Here  is  a  list  of  the  DEC/ANSI  special
                   sequences recognized:
       
                         Action        Meaning
      @@ -309,62 +305,107 @@
                         DEC[+-]AWM    wraparound mode
                         DEC[+-]ARM    auto-repeat mode
       
      -            It also recognizes  a  SGR  action  corresponding  to
      -            ANSI/ISO  6429/ECMA  Set Graphics Rendition, with the
      -            values NORMAL, BOLD, UNDERLINE, BLINK,  and  REVERSE.
      -            All  but NORMAL may be prefixed with `+' (turn on) or
      +            It  also  recognizes  a  SGR  action corresponding to
      +            ANSI/ISO 6429/ECMA Set Graphics Rendition,  with  the
      +            values  NORMAL,  BOLD, UNDERLINE, BLINK, and REVERSE.
      +            All but NORMAL may be prefixed with `+' (turn on)  or
                   `-' (turn off).
       
      -            An  SGR0  designates  an  empty  highlight   sequence
      +            An   SGR0  designates  an  empty  highlight  sequence
                   (equivalent to {SGR:NORMAL}).
      +       -
      +       l    Set output format to terminfo.
      +
      +       -p   Ignore padding specifications when comparing strings.
      +
      +       -q   Make  the comparison listing shorter by omitting sub-
      +            headings, and using "-" for absent capabilities,  "@"
      +            for canceled rather than "NULL".
      +
      +       -Rsubset
      +            Restrict  output  to  a given subset.  This option is
      +            for use with archaic versions of terminfo like  those
      +            on  SVr1,  Ultrix,  or  HP/UX that do not support the
      +            full set of SVR4/XSI Curses  terminfo;  and  variants
      +            such as AIX that have their own extensions incompati-
      +            ble with SVr4/XSI.  Available  terminfo  subsets  are
      +            "SVr1",  "Ultrix",  "HP",  and "AIX"; see terminfo(5)
      +            for details.  You can also choose  the  subset  "BSD"
      +            which  selects only capabilities with termcap equiva-
      +            lents recognized by 4.4BSD.
      +
      +       -s [d|i|l|c]
      +            The -s option  sorts  the  fields  within  each  type
      +            according to the argument below:
      +
      +            d    leave  fields  in the order that they are stored
      +                 in the terminfo database.
      +
      +            i    sort by terminfo name.
      +
      +            l    sort by the long C variable name.
      +
      +            c    sort by the termcap name.
      +
      +            If the -s option is not given, the fields printed out
      +            will  be  sorted  alphabetically by the terminfo name
      +            within each type, except in the case of the -C or the
      +            -L options, which cause the sorting to be done by the
      +            termcap name or the long  C  variable  name,  respec-
      +            tively.
      +
      +       -T   eliminates  size-restrictions  on the generated text.
      +            This is mainly useful for testing and analysis, since
      +            the compiled descriptions are limited (e.g., 1023 for
      +            termcap, 4096 for terminfo).
       
      -       -p   Ignore padding specifications when comparing strings.
      +       -t   tells  tic  to  discard  commented-out  capabilities.
      +            Normally  when  translating from terminfo to termcap,
      +            untranslatable capabilities are commented-out.
      +
      +       -V   reports the version of ncurses which was used in this
      +            program, and exits.
       
      -       -v n prints out tracing information on standard  error  as
      -            the  program runs.  Higher values of n induce greater
      +       -v n prints  out  tracing information on standard error as
      +            the program runs.  Higher values of n induce  greater
                   verbosity.
       
      -       -w width
      -            changes the output to width characters.
      +       -w width
      +            changes the output to width characters.
       
       
       

      FILES

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

      EXTENSIONS

      -       The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -p, and -q
      -       options are not supported in SVr4 curses.
      +       The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q
      +       and -t options are not supported in SVr4 curses.
       
      -       The -r option's notion of `termcap' capabilities is System
      -       V  Release  4's.   Actual  BSD curses versions will have a
      -       more restricted set.  To see only the 4.4BSD set,  use  -r
      +       The -r option's notion of `termcap' capabilities is System
      +       V Release 4's.  Actual BSD curses  versions  will  have  a
      +       more  restricted  set.  To see only the 4.4BSD set, use -r
              -RBSD.
       
       
       

      BUGS

      -       The -F option of infocmp(1m) should be a toe(1m) mode.
      +       The -F option of infocmp(1m) should be a toe(1m) mode.
       
       
       

      SEE ALSO

      -       infocmp(1m),    captoinfo(1m),   infotocap(1m),   tic(1m),
      -       toe(1m), curses(3x), terminfo(5).
      +       infocmp(1m),   captoinfo(1m),   infotocap(1m),    tic(1m),
      +       toe(1m), curses(3x), terminfo(5).
       
       
       

      AUTHOR

      -       Eric S.  Raymond  <esr@snark.thyrsus.com>  and  Thomas  E.
      -       Dickey <dickey@herndon4.his.com>
      -
      -
      -
      -
      +       Eric S. Raymond <esr@snark.thyrsus.com> and
      +       Thomas E. Dickey <dickey@herndon4.his.com>
       
       
       
      diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
      index 38ab95cc..b4738d72 100644
      --- a/doc/html/man/infotocap.1m.html
      +++ b/doc/html/man/infotocap.1m.html
      @@ -1,37 +1,76 @@
      +
      +
       
      +
      +infotocap 1m
      +
      +
      +
       
      +

      infotocap 1m

      +
       
       
       

      NAME

      -       infotocap  - convert a terminfo description into a termcap
      +       infotocap  - convert a terminfo description into a termcap
              description
       
       
       

      SYNOPSIS

      -       infotocap [-vn width]  [-V] [-1] [-w width] file . . .
      +       infotocap [-vn width]  [-V] [-1] [-w width] file . . .
       
       
       

      DESCRIPTION

      -       infotocap looks in file for  terminfo  descriptions.   For
      -       each one found, an equivalent termcap description is writ-
      -       ten to standard output.   Terminfo  use  capabilities  are
      -       translated directly to termcap tc capabilities.
      +       infotocap looks in file for  terminfo  descriptions.   For
      +       each one found, an equivalent termcap description is writ-
      +       ten to standard output.   Terminfo  use  capabilities  are
      +       translated directly to termcap tc capabilities.
       
      -       -v   print  out  tracing  information on standard error as
      +       -v   print  out  tracing  information on standard error as
                   the program runs.
       
      -       -V   print out the version of the program in use on  stan-
      +       -V   print out the version of the program in use on  stan-
                   dard error and exit.
       
      -       -1   cause  the fields to print out one to a line.  Other-
      +       -1   cause  the fields to print out one to a line.  Other-
                   wise, the fields will be printed several to a line to
                   a maximum width of 60 characters.
       
      -       -w   change the output to width characters.
      +       -w   change the output to width characters.
       
       
       
      @@ -42,13 +81,13 @@

      NOTES

      -       This utility is actually a link to tic(1m), running in  -C
      -       mode.  You can use other tic options such as -f and  -x.
      +       This utility is actually a link to tic(1m), running in  -C
      +       mode.  You can use other tic options such as -f and  -x.
       
       
       

      SEE ALSO

      -       curses(3x), tic(1m), infocmp(1m), terminfo(5)
      +       curses(3x), tic(1m), infocmp(1m), terminfo(5)
       
       
       
      diff --git a/doc/html/man/keybound.3x.html b/doc/html/man/keybound.3x.html
      index 11af1ac3..99da0c76 100644
      --- a/doc/html/man/keybound.3x.html
      +++ b/doc/html/man/keybound.3x.html
      @@ -1,18 +1,57 @@
      +
      +
       
      +
      +keyok 3x
      +
      +
      +
       
      +

      keyok 3x

      +
       
       
       

      NAME

      -       keybound - return definition of keycode
      +       keybound - return definition of keycode
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int keybound(int keycode, int count);
      +       char * keybound(int keycode, int count);
       
       
       
      @@ -40,7 +79,7 @@

      SEE ALSO

      -       define_key(3x), keyok(3x).
      +       define_key(3x), keyok(3x).
       
       
       
      diff --git a/doc/html/man/keyok.3x.html b/doc/html/man/keyok.3x.html index 1dbe4551..001445e2 100644 --- a/doc/html/man/keyok.3x.html +++ b/doc/html/man/keyok.3x.html @@ -1,25 +1,64 @@ + + + +keyok 3x + + + +

      keyok 3x

      +
       
       
       

      NAME

      -       keyok - enable or disable a keycode
      +       keyok - enable or disable a keycode
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int keyok(int keycode, bool enable);
      +       int keyok(int keycode, bool enable);
       
       
       

      DESCRIPTION

              This is an extension to the curses library.  It permits an
              application to disable specific keycodes, rather than  use
      -       the  keypad  function  to disable all keycodes.  Keys that
      +       the  keypad  function  to disable all keycodes.  Keys that
              have been disabled can be reenabled.
       
       
      @@ -27,7 +66,7 @@
       

      RETURN VALUE

              The keycode  must  be  greater  than  zero,  else  ERR  is
              returned.   If  it  does  not correspond to a defined key,
      -       then ERR is returned.  If the enable  parameter  is  true,
      +       then ERR is returned.  If the enable  parameter  is  true,
              then  the  key  must  have  been disabled, and vice versa.
              Otherwise, the function returns OK.
       
      @@ -42,7 +81,7 @@
       
       

      SEE ALSO

      -       define_key(3x).
      +       define_key(3x).
       
       
       
      diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html index c72b67f0..d77562a9 100644 --- a/doc/html/man/menu.3x.html +++ b/doc/html/man/menu.3x.html @@ -1,174 +1,213 @@ + + + +menu 3x + + + +

      menu 3x

      +
       
       
       

      NAME

      -       menu - curses extension for programming menus
      +       menu - curses extension for programming menus
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
       
       
       

      DESCRIPTION

      -       The  menu library provides terminal-independent facilities
      +       The  menu library provides terminal-independent facilities
              for composing menu systems  on  character-cell  terminals.
              The library includes: item routines, which create and mod-
              ify menu items; and menu routines, which group items  into
              menus, display menus on the screen, and handle interaction
              with the user.
       
      -       The menu library uses the curses libraries, and  a  curses
      -       initialization  routine  such  as  initscr  must be called
      -       before using any of these  functions.   To  use  the  menu
      -       library, link with the options -lmenu -lcurses.
      +       The menu library uses the curses libraries, and  a  curses
      +       initialization  routine  such  as  initscr  must be called
      +       before using any of these  functions.   To  use  the  menu
      +       library, link with the options -lmenu -lcurses.
       
       
      -   Current Default Values for Item Attributes
      -       The  menu  library  maintains  a  default  value  for item
      +   Current Default Values for Item Attributes
      +       The  menu  library  maintains  a  default  value  for item
              attributes.  You can get or set this  default  by  calling
      -       the  appropriate  get_  or  set_  routine with a NULL item
      -       pointer.  Changing  this  default  with  a  set_  function
      +       the  appropriate  get_  or  set_  routine with a NULL item
      +       pointer.  Changing  this  default  with  a  set_  function
              affects  future  item  creations,  but does not change the
              rendering of items already created.
       
       
      -   Routine Name Index
      -       The following table lists each menu routine and  the  name
      +   Routine Name Index
      +       The following table lists each menu routine and  the  name
              of the manual page on which it is described.
       
      -       curses Routine Name    Manual Page Name
      +       curses Routine Name    Manual Page Name
              --------------------------------------------
      -       current_item           mitem_current(3x)
      -       free_item              mitem_new(3x)
      -       free_menu              menu_new(3x)
      -       item_count             menu_items(3x)
      -       item_description       mitem_name(3x)
      -       item_index             mitem_current(3x)
      -       item_init              menu_hook(3x)
      -       item_name              mitem_name(3x)
      -       item_opts              mitem_opts(3x)
      -       item_opts_off          mitem_opts(3x)
      -       item_opts_on           mitem_opts(3x)
      -       item_term              menu_hook(3x)
      -       item_userptr           mitem_userptr(3x)
      -       item_value             mitem_value(3x)
      -       item_visible           mitem_visible(3x)
      -       menu_back              menu_attributes(3x)
      -       menu_driver            menu_driver(3x)
      -       menu_fore              menu_attributes(3x)
      -
      -       menu_format            menu_format(3x)
      -       menu_grey              menu_attributes(3x)
      -       menu_init              menu_hook(3x)
      -       menu_items             menu_items(3x)
      -       menu_mark              menu_mark(3x)
      -       menu_opts              menu_opts(3x)
      -       menu_opts_off          menu_opts(3x)
      -       menu_opts_on           menu_opts(3x)
      -       menu_pad               menu_attributes(3x)
      -       menu_pattern           menu_pattern(3x)
      -       menu_request_by_name   menu_requestname(3x)
      -       menu_request_name      menu_requestname(3x)
      -       menu_spacing           menu_spacing(3x)
      -       menu_sub               menu_win(3x)
      -       menu_term              menu_hook(3x)
      -       menu_userptr           menu_userptr(3x)
      -       menu_win               menu_win(3x)
      -       new_item               mitem_new(3x)
      -       new_menu               menu_new(3x)
      -       pos_menu_cursor        menu_cursor(3x)
      -       post_menu              menu_post(3x)
      -       scale_menu             menu_win(3x)
      -       set_current_item       mitem_current(3x)
      -       set_item_init          menu_hook(3x)
      -       set_item_opts          mitem_opts(3x)
      -       set_item_term          menu_hook(3x)
      -       set_item_userptr       mitem_userptr(3x)
      -       set_item_value         mitem_value(3x)
      -       set_menu_back          menu_attributes(3x)
      -       set_menu_fore          menu_attributes(3x)
      -       set_menu_format        menu_format(3x)
      -       set_menu_grey          menu_attributes(3x)
      -       set_menu_init          menu_hook(3x)
      -       set_menu_items         menu_items(3x)
      -       set_menu_mark          menu_mark(3x)
      -       set_menu_opts          mitem_opts(3x)
      -       set_menu_pad           menu_attributes(3x)
      -       set_menu_pattern       menu_pattern(3x)
      -       set_menu_spacing       menu_spacing(3x)
      -       set_menu_sub           menu_win(3x)
      -       set_menu_term          menu_hook(3x)
      -       set_menu_userptr       menu_userptr(3x)
      -       set_menu_win           menu_win(3x)
      -       set_top_row            mitem_current(3x)
      -       top_row                mitem_current(3x)
      -       unpost_menu            menu_post(3x)
      +       current_item           mitem_current(3x)
      +       free_item              mitem_new(3x)
      +       free_menu              menu_new(3x)
      +       item_count             menu_items(3x)
      +       item_description       mitem_name(3x)
      +       item_index             mitem_current(3x)
      +       item_init              menu_hook(3x)
      +       item_name              mitem_name(3x)
      +       item_opts              mitem_opts(3x)
      +       item_opts_off          mitem_opts(3x)
      +       item_opts_on           mitem_opts(3x)
      +       item_term              menu_hook(3x)
      +       item_userptr           mitem_userptr(3x)
      +       item_value             mitem_value(3x)
      +       item_visible           mitem_visible(3x)
      +       menu_back              menu_attributes(3x)
      +       menu_driver            menu_driver(3x)
      +       menu_fore              menu_attributes(3x)
      +
      +       menu_format            menu_format(3x)
      +       menu_grey              menu_attributes(3x)
      +       menu_init              menu_hook(3x)
      +       menu_items             menu_items(3x)
      +       menu_mark              menu_mark(3x)
      +       menu_opts              menu_opts(3x)
      +       menu_opts_off          menu_opts(3x)
      +       menu_opts_on           menu_opts(3x)
      +       menu_pad               menu_attributes(3x)
      +       menu_pattern           menu_pattern(3x)
      +       menu_request_by_name   menu_requestname(3x)
      +       menu_request_name      menu_requestname(3x)
      +       menu_spacing           menu_spacing(3x)
      +       menu_sub               menu_win(3x)
      +       menu_term              menu_hook(3x)
      +       menu_userptr           menu_userptr(3x)
      +       menu_win               menu_win(3x)
      +       new_item               mitem_new(3x)
      +       new_menu               menu_new(3x)
      +       pos_menu_cursor        menu_cursor(3x)
      +       post_menu              menu_post(3x)
      +       scale_menu             menu_win(3x)
      +       set_current_item       mitem_current(3x)
      +       set_item_init          menu_hook(3x)
      +       set_item_opts          mitem_opts(3x)
      +       set_item_term          menu_hook(3x)
      +       set_item_userptr       mitem_userptr(3x)
      +       set_item_value         mitem_value(3x)
      +       set_menu_back          menu_attributes(3x)
      +       set_menu_fore          menu_attributes(3x)
      +       set_menu_format        menu_format(3x)
      +       set_menu_grey          menu_attributes(3x)
      +       set_menu_init          menu_hook(3x)
      +       set_menu_items         menu_items(3x)
      +       set_menu_mark          menu_mark(3x)
      +       set_menu_opts          mitem_opts(3x)
      +       set_menu_pad           menu_attributes(3x)
      +       set_menu_pattern       menu_pattern(3x)
      +       set_menu_spacing       menu_spacing(3x)
      +       set_menu_sub           menu_win(3x)
      +       set_menu_term          menu_hook(3x)
      +       set_menu_userptr       menu_userptr(3x)
      +       set_menu_win           menu_win(3x)
      +       set_top_row            mitem_current(3x)
      +       top_row                mitem_current(3x)
      +       unpost_menu            menu_post(3x)
       
       
       

      RETURN VALUE

      -       Routines  that return pointers return NULL on error.  Rou-
      +       Routines  that return pointers return NULL on error.  Rou-
              tines that return an integer return one of  the  following
              error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu is already posted.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NO_ROOM
      +       E_NO_ROOM
                   Menu is too large for its window.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The menu has not been posted.
       
      -       E_UNKNOWN_COMMAND
      +       E_UNKNOWN_COMMAND
                   The menu driver code saw an unknown request code.
       
      -       E_NO_MATCH
      +       E_NO_MATCH
                   Character failed to match.
       
      -       E_NOT_SELECTABLE
      +       E_NOT_SELECTABLE
                   The designated item cannot be selected.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the menu.
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The menu driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x)  and  3x  pages  whose  names begin "menu_" for
      +       curses(3x) and related pages whose names begin "menu_" for
              detailed descriptions of the entry points.
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       files <curses.h> and <eti.h>.
      +       The header file <menu.h> automatically includes the header
      +       files <curses.h> and <eti.h>.
       
              In  your  library  list,  libmenu.a should be before libn-
              curses.a; that is, you want to say `-lmenu -lncurses', not
              the  other  way  around (which would give you a link error
      -       using GNU ld(1) and many other linkers).
      +       using GNU ld(1) and many other linkers).
       
       
       
      diff --git a/doc/html/man/menu_attributes.3x.html b/doc/html/man/menu_attributes.3x.html index d6e82b0a..2332f98f 100644 --- a/doc/html/man/menu_attributes.3x.html +++ b/doc/html/man/menu_attributes.3x.html @@ -1,16 +1,55 @@ + + + +menu_attributes 3x + + + +

      menu_attributes 3x

      +
       
       
       

      NAME

      -       menu_attributes - color and attribute control for menus
      +       menu_attributes - color and attribute control for menus
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_fore(MENU *menu, chtype attr);
              chtype menu_fore(const MENU *menu);
              int set_menu_back(MENU *menu, chtype attr);
      @@ -23,26 +62,26 @@
       
       

      DESCRIPTION

      -       The  function  set_menu_fore sets the foreground attribute
      -       of menu. This is the  highlight  used  for  selected  menu
      -       items.   menu_fore  returns the foreground attribute.  The
      -       default is A_STANDOUT.
      +       The  function  set_menu_fore sets the foreground attribute
      +       of menu. This is the  highlight  used  for  selected  menu
      +       items.   menu_fore  returns the foreground attribute.  The
      +       default is A_STANDOUT.
       
      -       The function set_menu_back sets the  background  attribute
      -       of  menu.  This  is the highlight used for selectable (but
      +       The function set_menu_back sets the  background  attribute
      +       of  menu.  This  is the highlight used for selectable (but
              not  currently  selected)  menu   items.    The   function
      -       menu_back  returns  the background attribute.  The default
      -       is A_NORMAL.
      +       menu_back  returns  the background attribute.  The default
      +       is A_NORMAL.
       
      -       The function set_menu_grey  sets  the  grey  attribute  of
      -       menu.  This  is  the highlight used for un-selectable menu
      +       The function set_menu_grey  sets  the  grey  attribute  of
      +       menu.  This  is  the highlight used for un-selectable menu
              items in menus that permit more than one  selection.   The
      -       function   menu_grey  returns  the  grey  attribute.   The
      -       default is A_UNDERLINE.
      +       function   menu_grey  returns  the  grey  attribute.   The
      +       default is A_UNDERLINE.
       
      -       The function set_menu_pad sets the character used to  fill
      +       The function set_menu_pad sets the character used to  fill
              the space between the name and description parts of a menu
      -       item.  menu_pad returns the given  menu's  pad  character.
      +       item.  menu_pad returns the given  menu's  pad  character.
              The default is a blank.
       
       
      @@ -50,27 +89,27 @@
       

      RETURN VALUE

              These routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x) and 3x pages  whose  names  begin  "menu_"  for
      +       curses(3x) and related pages whose names begin "menu_" for
              detailed descriptions of the entry points.
       
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_cursor.3x.html b/doc/html/man/menu_cursor.3x.html index aed8af81..61647f46 100644 --- a/doc/html/man/menu_cursor.3x.html +++ b/doc/html/man/menu_cursor.3x.html @@ -1,24 +1,63 @@ + + + +menu_cursor 3x + + + +

      menu_cursor 3x

      +
       
       
       

      NAME

      -       menu_cursor - position a menu's cursor
      +       menu_cursor - position a menu's cursor
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int pos_menu_cursor(const MENU *menu);
       
       
       

      DESCRIPTION

      -       The  function  pos_menu_cursor  restores the cursor to the
      +       The  function  pos_menu_cursor  restores the cursor to the
              current position associated with the menu's selected item.
      -       This  is  useful after curses routines have been called to
      +       This  is  useful after curses routines have been called to
              do screen-painting in response to a menu select.
       
       
      @@ -26,28 +65,28 @@
       

      RETURN VALUE

              This routine returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The menu has not been posted.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_driver.3x.html b/doc/html/man/menu_driver.3x.html index 48ea272f..2c4f5e6e 100644 --- a/doc/html/man/menu_driver.3x.html +++ b/doc/html/man/menu_driver.3x.html @@ -1,23 +1,61 @@ + + + +menu_driver 3x + + + +

      menu_driver 3x

      +
       
       
       

      NAME

      -       menu_driver - command-processing loop of the menu system
      +       menu_driver - command-processing loop of the menu system
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int menu_driver(MENU *menu, int c);
       
       
       

      DESCRIPTION

              Once a menu has been posted (displayed), you should funnel
      -       input events to it through menu_driver.  This routine  has
      +       input events to it through menu_driver.  This routine  has
              three  major input cases; either the input is a menu navi-
              gation request, it's a printable ASCII character or it  is
              the  KEY_MOUSE special key associated with an mouse event.
      @@ -78,7 +116,7 @@
              If the second argument is a printable ASCII character, the
              code appends it to the pattern buffer and attempts to move
              to the next item matching the new pattern.  If there is no
      -       such match, menu_driver returns E_NO_MATCH and deletes the
      +       such match, menu_driver returns E_NO_MATCH and deletes the
              appended character from the buffer.
       
              If the second argument is one  of  the  above  pre-defined
      @@ -98,64 +136,64 @@
              you click at an item inside the display area of the  menu,
              the menu cursor is positioned to that item. If you double-
              click at  an  item  a  REQ_TOGGLE_ITEM  is  generated  and
      -       E_UNKNOWN_COMMAND  is  returned.  This  return value makes
      +       E_UNKNOWN_COMMAND  is  returned.  This  return value makes
              sense, because a double click usually means that an  item-
              specific  action should be returned. It's exactly the pur-
              pose of this return value to signal  that  an  application
              specific command should be executed. If a translation into
      -       a request was done, menu_driver returns the result of this
      +       a request was done, menu_driver returns the result of this
              request.   If  you  clicked outside the user window or the
              mouse event couldn't be translated into a menu request  an
      -       E_REQUEST_DENIED is returned.
      +       E_REQUEST_DENIED is returned.
       
              If  the second argument is neither printable ASCII nor one
              of the above pre-defined menu requests or  KEY_MOUSE,  the
              drive  assumes  it  is an application-specific command and
      -       returns E_UNKNOWN_COMMAND.   Application-defined  commands
      -       should  be  defined  relative  to MAX_COMMAND, the maximum
      +       returns E_UNKNOWN_COMMAND.   Application-defined  commands
      +       should  be  defined  relative  to MAX_COMMAND, the maximum
              value of these pre-defined requests.
       
       
       
       

      RETURN VALUE

      -       menu_driver return one of the following error codes:
      +       menu_driver return one of the following error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The menu has not been posted.
       
      -       E_UNKNOWN_COMMAND
      +       E_UNKNOWN_COMMAND
                   The menu driver code saw an unknown request code.
       
      -       E_NO_MATCH
      +       E_NO_MATCH
                   Character failed to match.
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The menu driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       files <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       files <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_format.3x.html b/doc/html/man/menu_format.3x.html index 8702733b..e4c24d90 100644 --- a/doc/html/man/menu_format.3x.html +++ b/doc/html/man/menu_format.3x.html @@ -1,66 +1,105 @@ + + + +menu_format 3x + + + +

      menu_format 3x

      +
       
       
       

      NAME

      -       menu_format - set and get menu sizes
      +       menu_format - set and get menu sizes
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_format(MENU *menu, int rows, int cols);
      -       int menu_format(const MENU *menu, int *rows, int *cols);
      +       void menu_format(const MENU *menu, int *rows, int *cols);
       
       
       

      DESCRIPTION

      -       The function set_menu_format sets the maximum display size
      +       The function set_menu_format sets the maximum display size
              of the given menu.  If this size is too small  to  display
              all  menu items, the menu will be made scrollable. If this
              size is larger than the menus subwindow and the  subwindow
      -       is  too  small to display all menu items, post_menu() will
      +       is  too  small to display all menu items, post_menu() will
              fail.
       
              The  default  format  is  16  rows,  1  column.    Calling
      -       set_menu_format  with a null menu pointer will change this
      -       default.  A zero row or column argument to set_menu_format
      +       set_menu_format  with a null menu pointer will change this
      +       default.  A zero row or column argument to set_menu_format
              is  interpreted  as  a  request  not to change the current
              value.
       
      -       The function menu_format  returns  the  maximum-size  con-
      +       The function menu_format  returns  the  maximum-size  con-
              straints  for the given menu into the storage addressed by
      -       rows and cols.
      +       rows and cols.
       
       
       

      RETURN VALUE

              These routines returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu is already posted.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_hook.3x.html b/doc/html/man/menu_hook.3x.html index 59519cd4..b2c784ec 100644 --- a/doc/html/man/menu_hook.3x.html +++ b/doc/html/man/menu_hook.3x.html @@ -1,17 +1,56 @@ + + + +menu_hook 3x + + + +

      menu_hook 3x

      +
       
       
       

      NAME

      -       menu_hook - set hooks for automatic invocation by applica-
      +       menu_hook - set hooks for automatic invocation by applica-
              tions
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_item_init(MENU *menu, void (*func)(MENU *));
              void (*)(MENU *) item_init(const MENU *menu);
              int set_item_term(MENU *menu, void (*func)(MENU *));
      @@ -26,49 +65,49 @@
       

      DESCRIPTION

              These functions make it possible to set hook functions  to
              be called at various points in the automatic processing of
      -       input event codes by menu_driver.
      +       input event codes by menu_driver.
       
      -       The function set_item_init sets a hook  to  be  called  at
      +       The function set_item_init sets a hook  to  be  called  at
              menu-post  time  and  each  time the selected item changes
      -       (after the change).  item_init returns  the  current  item
      -       init hook, if any (NULL if there is no such hook).
      +       (after the change).  item_init returns  the  current  item
      +       init hook, if any (NULL if there is no such hook).
       
      -       The  function  set_item_term  sets  a hook to be called at
      +       The  function  set_item_term  sets  a hook to be called at
              menu-unpost time and each time the selected  item  changes
      -       (before  the  change).  item_term returns the current item
      -       term hook, if any (NULL if there is no such hook).
      +       (before  the  change).  item_term returns the current item
      +       term hook, if any (NULL if there is no such hook).
       
      -       The function set_menu_init sets a hook  to  be  called  at
      +       The function set_menu_init sets a hook  to  be  called  at
              menu-post  time  and  just  after  the top row on the menu
      -       changes once it is posted.  menu_init returns the  current
      -       menu init hook, if any (NULL if there is no such hook).
      +       changes once it is posted.  menu_init returns the  current
      +       menu init hook, if any (NULL if there is no such hook).
       
      -       The  function  set_menu_term  sets  a hook to be called at
      +       The  function  set_menu_term  sets  a hook to be called at
              menu-unpost time and just before the top row on  the  menu
      -       changes  once it is posted.  menu_term returns the current
      -       menu term hook, if any (NULL if there is no such hook).
      +       changes  once it is posted.  menu_term returns the current
      +       menu term hook, if any (NULL if there is no such hook).
       
       
       

      RETURN VALUE

      -       Routines that return pointers return NULL on error.  Other
      +       Routines that return pointers return NULL on error.  Other
              routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_items.3x.html b/doc/html/man/menu_items.3x.html index d2bde33d..65dd1c7c 100644 --- a/doc/html/man/menu_items.3x.html +++ b/doc/html/man/menu_items.3x.html @@ -1,17 +1,56 @@ + + + +menu_items 3x + + + +

      menu_items 3x

      +
       
       
       

      NAME

      -       menu_items  - make and break connections between items and
      +       menu_items  - make and break connections between items and
              menus
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_items(MENU *menu, ITEM **items);
              ITEM **menu_items(const MENU *menu);
              int item_count(const MENU *menu);
      @@ -19,52 +58,52 @@
       
       

      DESCRIPTION

      -       The function set_menu_items changes the item pointer array
      -       of  the  given  menu.   The  array must be terminated by a
      -       NULL.
      +       The function set_menu_items changes the item pointer array
      +       of  the  given  menu.   The  array must be terminated by a
      +       NULL.
       
      -       The function menu_items returns  the  item  array  of  the
      +       The function menu_items returns  the  item  array  of  the
              given menu.
       
      -       The  function  item_count  returns  the  count of items in
      -       menu.
      +       The  function  item_count  returns  the  count of items in
      +       menu.
       
       
       

      RETURN VALUES

      -       The function menu_items returns NULL on error.
      +       The function menu_items returns NULL on error.
       
      -       The function item_count returns ERR  (the  general  curses
      +       The function item_count returns ERR  (the  general  curses
              error return value) on error.
       
      -       The  function  set_menu_items returns one of the following
      +       The  function  set_menu_items returns one of the following
              codes on error:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu is already posted.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the menu.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      @@ -73,7 +112,7 @@ were not supported on Version 7 or BSD versions. The SVr4 menu library documentation specifies the - item_count error value as -1 (which is the value of ERR). + item_count error value as -1 (which is the value of ERR).
      diff --git a/doc/html/man/menu_mark.3x.html b/doc/html/man/menu_mark.3x.html index f2eeac90..588cb945 100644 --- a/doc/html/man/menu_mark.3x.html +++ b/doc/html/man/menu_mark.3x.html @@ -1,16 +1,55 @@ + + + +menu_mark 3x + + + +

      menu_mark 3x

      +
       
       
       

      NAME

      -       menu_mark - get and set the menu mark string
      +       menu_mark - get and set the menu mark string
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_mark(MENU *menu, const char *mark);
              const char *menu_mark(const MENU *menu);
       
      @@ -22,43 +61,43 @@
              library  marks  selected  items  in  a  menu with a prefix
              string.
       
      -       The function set_menu_mark sets the mark  string  for  the
      -       given  menu.   Calling set_menu_mark with a null menu item
      +       The function set_menu_mark sets the mark  string  for  the
      +       given  menu.   Calling set_menu_mark with a null menu item
              will abolish the mark  string.   Note  that  changing  the
              length  of  the  mark  string for a menu while the menu is
              posted is likely to produce unhelpful behavior.
       
      -       The default string is "-" (a dash). Calling  set_menu_mark
      -       with a NULL menu argument will change this default.
      +       The default string is "-" (a dash). Calling  set_menu_mark
      +       with a NULL menu argument will change this default.
       
      -       The  function menu_mark returns the menu's mark string (or
      -       NULL if there is none).
      +       The  function menu_mark returns the menu's mark string (or
      +       NULL if there is none).
       
       
       

      RETURN VALUE

      -       The function menu_mark returns NULL on error.   The  func-
      -       tion set_menu_mark may return the following error codes:
      +       The function menu_mark returns NULL on error.   The  func-
      +       tion set_menu_mark may return the following error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_new.3x.html b/doc/html/man/menu_new.3x.html index 33e39ad9..bd337a09 100644 --- a/doc/html/man/menu_new.3x.html +++ b/doc/html/man/menu_new.3x.html @@ -1,58 +1,97 @@ + + + +menu_new 3x + + + +

      menu_new 3x

      +
       
       
       

      NAME

      -       menu_new - create and destroy menus
      +       menu_new - create and destroy menus
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              MENU *new_menu(ITEM **items);
              int free_menu(MENU *menu);
       
       
       

      DESCRIPTION

      -       The  function  new_menu  creates a new menu connected to a
      -       specified item pointer array (which  must  be  NULL-termi-
      +       The  function  new_menu  creates a new menu connected to a
      +       specified item pointer array (which  must  be  NULL-termi-
              nated).
       
      -       The  function  free_menu  disconnects  menu  from its item
      +       The  function  free_menu  disconnects  menu  from its item
              array and frees the storage allocated for the menu.
       
       
       

      RETURN VALUE

      -       The function new_menu returns NULL on error.
      +       The function new_menu returns NULL on error.
       
      -       The function free_menu returns one of the following:
      +       The function free_menu returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu has already been posted.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_opts.3x.html b/doc/html/man/menu_opts.3x.html index 5730121f..a306b2a1 100644 --- a/doc/html/man/menu_opts.3x.html +++ b/doc/html/man/menu_opts.3x.html @@ -1,16 +1,55 @@ + + + +menu_opts 3x + + + +

      menu_opts 3x

      +
       
       
       

      NAME

      -       menu_opts - set and get menu options
      +       menu_opts - set and get menu options
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_opts(MENU *menu, OPTIONS opts);
              int menu_opts_on(MENU *menu, OPTIONS opts);
              int menu_opts_off(MENU *menu, OPTIONS opts);
      @@ -19,17 +58,17 @@
       
       

      DESCRIPTION

      -       The  function  set_menu_opts  sets  all  the  given menu's
      +       The  function  set_menu_opts  sets  all  the  given menu's
              option bits  (menu  option  bits  may  be  logically-OR'ed
              together).
       
      -       The  function menu_opts_on turns on the given option bits,
      +       The  function menu_opts_on turns on the given option bits,
              and leaves others alone.
       
      -       The function menu_opts_off  turns  off  the  given  option
      +       The function menu_opts_off  turns  off  the  given  option
              bits, and leaves others alone.
       
      -       The  function  menu_opts returns the menu's current option
      +       The  function  menu_opts returns the menu's current option
              bits.
       
              The following options are defined (all are on by default):
      @@ -58,28 +97,28 @@
       
       

      RETURN VALUE

      -       Except for menu_opts, each routine returns one of the fol-
      +       Except for menu_opts, each routine returns one of the fol-
              lowing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_POSTED
      +       E_POSTED
                   The menu is already posted.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_pattern.3x.html b/doc/html/man/menu_pattern.3x.html index 2db0a3af..ea3a8cce 100644 --- a/doc/html/man/menu_pattern.3x.html +++ b/doc/html/man/menu_pattern.3x.html @@ -1,16 +1,54 @@ + + + +menu_pattern 3x + + + +

      menu_pattern 3x

      +
       
       
       

      NAME

      -       menu_pattern - get and set a menu's pattern buffer
      +       menu_pattern - get and set a menu's pattern buffer
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_pattern(MENU *menu, const char *pattern);
              char *menu_pattern(const MENU *menu);
       
      @@ -20,45 +58,45 @@
              Every  menu  has  an  associated pattern match buffer.  As
              input events that are printable ASCII characters come  in,
              they  are  appended  to this match buffer and tested for a
      -       match, as described in menu_driver(3x).
      +       match, as described in menu_driver(3x).
       
      -       The function set_menu_pattern sets the pattern buffer  for
      +       The function set_menu_pattern sets the pattern buffer  for
              the  given menu and tries to find the first matching item.
              If it succeeds, that item becomes  current;  if  not,  the
              current item does not change.
       
      -       The  function  menu_pattern  returns the pattern buffer of
      -       the given menu.
      +       The  function  menu_pattern  returns the pattern buffer of
      +       the given menu.
       
       
       

      RETURN VALUE

      -       The function menu_pattern  returns  NULL  on  error.   The
      -       function  set_menu_pattern  may return the following error
      +       The function menu_pattern  returns  NULL  on  error.   The
      +       function  set_menu_pattern  may return the following error
              codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_NO_MATCH
      +       E_NO_MATCH
                   Character failed to match.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_post.3x.html b/doc/html/man/menu_post.3x.html index ca734478..82d90e9f 100644 --- a/doc/html/man/menu_post.3x.html +++ b/doc/html/man/menu_post.3x.html @@ -1,31 +1,70 @@ + + + +menu_post 3x + + + +

      menu_post 3x

      +
       
       
       

      NAME

      -       menu_post  -  write or erase menus from associated subwin-
      +       menu_post  -  write or erase menus from associated subwin-
              dows
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int post_menu(MENU *menu);
              int unpost_menu(MENU *menu);
       
       
       

      DESCRIPTION

      -       The function post_menu displays a menu to  its  associated
      +       The function post_menu displays a menu to  its  associated
              subwindow.   To trigger physical display of the subwindow,
      -       use  refresh  or  some  equivalent  curses  routine   (the
      -       implicit  doupdate  triggered  by  an curses input request
      -       will do). post_menu resets the  selection  status  of  all
      +       use  refresh  or  some  equivalent  curses  routine   (the
      +       implicit  doupdate  triggered  by  an curses input request
      +       will do). post_menu resets the  selection  status  of  all
              items.
       
      -       The  function  unpost_menu erases menu from its associated
      +       The  function  unpost_menu erases menu from its associated
              subwindow.
       
       
      @@ -33,42 +72,42 @@
       

      RETURN VALUE

              These routines return one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu has already been posted.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NO_ROOM
      +       E_NO_ROOM
                   Menu is too large for its window. You should consider
      -            to use set_menu_format() to solve the problem.
      +            to use set_menu_format() to solve the problem.
       
      -       E_NOT_POSTED
      +       E_NOT_POSTED
                   The menu has not been posted.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the menu.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_requestname.3x.html b/doc/html/man/menu_requestname.3x.html index 388d1fe2..fa475d1b 100644 --- a/doc/html/man/menu_requestname.3x.html +++ b/doc/html/man/menu_requestname.3x.html @@ -1,45 +1,84 @@ + + + +menu_requestname 3x + + + +

      menu_requestname 3x

      +
       
       
       

      NAME

      -       menu_requestname - handle printable menu request names
      +       menu_requestname - handle printable menu request names
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              const char *menu_request_name(int request);
              int menu_request_by_name(const char *name);
       
       
       

      DESCRIPTION

      -       The  function menu_request_name returns the printable name
      +       The  function menu_request_name returns the printable name
              of a menu request code.
      -       The function menu_request_by_name searches  in  the  name-
      +       The function menu_request_by_name searches  in  the  name-
              table  for  a  request with the given name and returns its
              request code. Otherwise E_NO_MATCH is returned.
       
       
       

      RETURN VALUE

      -       menu_request_name returns NULL on error and sets errno  to
      -       E_BAD_ARGUMENT.
      -       menu_request_by_name returns E_NO_MATCH on error.
      +       menu_request_name returns NULL on error and sets errno  to
      +       E_BAD_ARGUMENT.
      +       menu_request_by_name returns E_NO_MATCH on error.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_spacing.3x.html b/doc/html/man/menu_spacing.3x.html index ba2cd1cd..998cdb12 100644 --- a/doc/html/man/menu_spacing.3x.html +++ b/doc/html/man/menu_spacing.3x.html @@ -1,63 +1,102 @@ + + + +menu_spacing 3x + + + +

      menu_spacing 3x

      +
       
       
       

      NAME

      -       menu_spacing - Control spacing between menu items.
      +       menu_spacing - Control spacing between menu items.
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_spacing(MENU *menu,
      -                            int spc_description
      +                            int spc_description,
                                   int spc_rows,
                                   int spc_columns);
              int menu_spacing(const MENU *menu,
      -                        int* spc_description
      +                        int* spc_description,
                               int* spc_rows,
                               int* spc_columns);
       
       
       

      DESCRIPTION

      -       The  function  set_menu_spacing  sets the spacing informa-
      -       tions for the menu.  spc_description controls  the  number
      +       The  function  set_menu_spacing  sets the spacing informa-
      +       tions for the menu.  spc_description controls  the  number
              of spaces between an item name and an item description. It
      -       must not be larger than TABSIZE. The menu system  puts  in
      +       must not be larger than TABSIZE. The menu system  puts  in
              the  middle  of  this  spacing area the pad character. The
      -       remaining parts are filled with spaces.  spc_rows controls
      +       remaining parts are filled with spaces.  spc_rows controls
              the  number of rows that are used for an item. It must not
              be larger than 3. The menu system inserts then blank lines
              between  item rows, these lines will contain the pad char-
      -       acter in the appropriate positions.  spc_columns  controls
      +       acter in the appropriate positions.  spc_columns  controls
              the number of blanks between columns of items. It must not
              be larger than TABSIZE.  A value of 0 for all the  spacing
              values  resets  them to the default, which is 1 for all of
              them.
      -       The function menu_spacing passes back the spacing info for
      +       The function menu_spacing passes back the spacing info for
              the menu. If a pointer is NULL, this specific info is sim-
              ply not returned.
       
       
       

      RETURN VALUE

      -       Both routines return E_OK on success. set_menu_spacing may
      -       return  E_POSTED  if the menu is posted, or E_BAD_ARGUMENT
      +       Both routines return E_OK on success. set_menu_spacing may
      +       return  E_POSTED  if the menu is posted, or E_BAD_ARGUMENT
              if one of the spacing values is out of range.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_userptr.3x.html b/doc/html/man/menu_userptr.3x.html index 5eebdb8f..6fadbe52 100644 --- a/doc/html/man/menu_userptr.3x.html +++ b/doc/html/man/menu_userptr.3x.html @@ -1,16 +1,55 @@ + + + +menu_userptr 3x + + + +

      menu_userptr 3x

      +
       
       
       

      NAME

      -       menu_userptr - associate application data with a menu item
      +       menu_userptr - associate application data with a menu item
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_userptr(MENU *menu, void *userptr);
              void *menu_userptr(const MENU *menu);
       
      @@ -25,24 +64,24 @@
       
       

      RETURN VALUE

      -       Except  for  menu_userptr  (which  returns NULL on error),
      +       Except  for  menu_userptr  (which  returns NULL on error),
              each function returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/menu_win.3x.html b/doc/html/man/menu_win.3x.html index c2fb72a6..d873d16d 100644 --- a/doc/html/man/menu_win.3x.html +++ b/doc/html/man/menu_win.3x.html @@ -1,17 +1,56 @@ + + + +menu_win 3x + + + +

      menu_win 3x

      +
       
       
       

      NAME

      -       menu_win  - make and break menu window and subwindow asso-
      +       menu_win  - make and break menu window and subwindow asso-
              ciations
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_menu_win(MENU *menu, WINDOW *win);
              WINDOW *menu_win(const MENU *menu);
              int set_menu_sub(MENU *menu, WINDOW *sub);
      @@ -21,56 +60,56 @@
       
       

      DESCRIPTION

      -       Every  menu has an associated pair of curses windows.  The
      +       Every  menu has an associated pair of curses windows.  The
              menu window displays any title and border associated  with
              the  window;  the menu subwindow displays the items of the
              menu that are currently available for selection.
       
              The first four functions get and set those windows.  It is
              not necessary to set either window; by default, the driver
      -       code uses stdscr for both.
      +       code uses stdscr for both.
       
      -       In the set_ functions, window argument of NULL is  treated
      -       as  though  it  were  stsdcr.   A menu argument of NULL is
      +       In the set_ functions, window argument of NULL is  treated
      +       as  though  it  were  stsdcr.   A menu argument of NULL is
              treated as a request to change  the  system  default  menu
              window or subwindow.
       
      -       The  function scale_menu returns the minimum size required
      -       for the subwindow of menu.
      +       The  function scale_menu returns the minimum size required
      +       for the subwindow of menu.
       
       
       

      RETURN VALUE

      -       Routines that return pointers return NULL on error.   Rou-
      +       Routines that return pointers return NULL on error.   Rou-
              tines  that  return an integer return one of the following
              error codes:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_POSTED
      +       E_POSTED
                   The menu has already been posted.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the menu.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_current.3x.html b/doc/html/man/mitem_current.3x.html index ab74dffb..82614bbd 100644 --- a/doc/html/man/mitem_current.3x.html +++ b/doc/html/man/mitem_current.3x.html @@ -1,16 +1,55 @@ + + + +mitem_current 3x + + + +

      mitem_current 3x

      +
       
       
       

      NAME

      -       mitem_current - set and get current_menu_item
      +       mitem_current - set and get current_menu_item
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_current_item(MENU *menu, const ITEM *item);
              ITEM *current_item(const MENU *menu);
              int set_top_row(MENU *menu, int row);
      @@ -20,58 +59,58 @@
       
       

      DESCRIPTION

      -       The  function  set_current_item sets the current item (the
      -       item on  which  the  menu  cursor  is  positioned).   cur-
      -       rent_item  returns  a  pointer  to the current item in the
      +       The  function  set_current_item sets the current item (the
      +       item on  which  the  menu  cursor  is  positioned).   cur-
      +       rent_item  returns  a  pointer  to the current item in the
              given menu.
       
      -       The function set_top_row sets the top row of the  menu  to
      +       The function set_top_row sets the top row of the  menu  to
              show  the  given  row  (the top row is initially 0, and is
      -       reset to this value whenever the O_ROWMAJOR option is tog-
      +       reset to this value whenever the O_ROWMAJOR option is tog-
              gled).   The  item  leftmost on the given row becomes cur-
      -       rent.  The function top_row returns the number of the  top
      +       rent.  The function top_row returns the number of the  top
              menu row being displayed.
       
      -       The function item_index returns the (zero-origin) index of
      -       item in the menu's item pointer list.
      +       The function item_index returns the (zero-origin) index of
      +       item in the menu's item pointer list.
       
       
       

      RETURN VALUE

      -       current_item returns NULL on error.
      +       current_item returns NULL on error.
       
      -       top_row and item_index  return  ERR  (the  general  curses
      +       top_row and item_index  return  ERR  (the  general  curses
              error value) on error.
       
      -       set_current_item and set_top_row return one of the follow-
      +       set_current_item and set_top_row return one of the follow-
              ing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine detected an incorrect or  out-of-range  argu-
                   ment.
       
      -       E_BAD_STATE
      +       E_BAD_STATE
                   Routine was called from an initialization or termina-
                   tion function.
       
      -       E_NOT_CONNECTED
      +       E_NOT_CONNECTED
                   No items are connected to the menu.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      @@ -79,9 +118,9 @@ These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. - The SVr4 menu library documentation specifies the top_row - and index_item error value as -1 (which is the value of - ERR). + The SVr4 menu library documentation specifies the top_row + and index_item error value as -1 (which is the value of + ERR).
      diff --git a/doc/html/man/mitem_name.3x.html b/doc/html/man/mitem_name.3x.html index 803f966d..a60a1d7f 100644 --- a/doc/html/man/mitem_name.3x.html +++ b/doc/html/man/mitem_name.3x.html @@ -1,42 +1,81 @@ + + + +mitem_name 3x + + + +

      mitem_name 3x

      +
       
       
       

      NAME

      -       mitem_name - get menu item name and description fields
      +       mitem_name - get menu item name and description fields
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              const char *item_name(const ITEM *item);
              const char *item_description(const ITEM *item);
       
       
       

      DESCRIPTION

      -       The  function item_name returns the name part of the given
      +       The  function item_name returns the name part of the given
              item.
      -       The function item_description returns the description part
      +       The function item_description returns the description part
              of the given item.
       
       
       

      RETURN VALUE

      -       These routines returns NULL on error.
      +       These routines returns NULL on error.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_new.3x.html b/doc/html/man/mitem_new.3x.html index 9918f6cf..86603d1a 100644 --- a/doc/html/man/mitem_new.3x.html +++ b/doc/html/man/mitem_new.3x.html @@ -1,30 +1,69 @@ + + + +mitem_new 3x + + + +

      mitem_new 3x

      +
       
       
       

      NAME

      -       mitem_new - create and destroy menu items
      +       mitem_new - create and destroy menu items
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              ITEM *new_item(const char *name, const char *description);
              int free_item(ITEM *item);
       
       
       

      DESCRIPTION

      -       The function new_item allocates a new item and initializes
      -       it  from  the name and description pointers. Please notice
      +       The function new_item allocates a new item and initializes
      +       it  from  the name and description pointers. Please notice
              that the item stores only the pointers  to  the  name  and
              description. Those pointers must be valid during the life-
              time of the item. So you  should  be  very  carefull  with
              names  or descriptions allocated on the stack of some rou-
              tines.
      -       The function free_item de-allocates an item. Please notice
      +       The function free_item de-allocates an item. Please notice
              that  it  is  the  responsibility  of  the  application to
              release the memory for the name or the description of  the
              item.
      @@ -32,32 +71,32 @@
       
       

      RETURN VALUE

      -       The function new_item returns NULL on error.
      +       The function new_item returns NULL on error.
       
      -       The function free_item returns one of the following:
      +       The function free_item returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_BAD_ARGUMENT
      +       E_BAD_ARGUMENT
                   Routine  detected  an incorrect or out-of-range argu-
                   ment.
       
      -       E_CONNECTED
      +       E_CONNECTED
                   Item is connected to a menu.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_opts.3x.html b/doc/html/man/mitem_opts.3x.html index 17abe429..cc43f6a4 100644 --- a/doc/html/man/mitem_opts.3x.html +++ b/doc/html/man/mitem_opts.3x.html @@ -1,16 +1,55 @@ + + + +mitem_opts 3x + + + +

      mitem_opts 3x

      +
       
       
       

      NAME

      -       mitem_opts - set and get menu item options
      +       mitem_opts - set and get menu item options
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_item_opts(ITEM *item, OPTIONS opts);
              int item_opts_on(ITEM *item, OPTIONS opts);
              int item_opts_off(ITEM *item, OPTIONS opts);
      @@ -19,44 +58,44 @@
       
       

      DESCRIPTION

      -       The  function  set_item_opts  sets  all  the  given item's
      +       The  function  set_item_opts  sets  all  the  given item's
              option bits  (menu  option  bits  may  be  logically-OR'ed
              together).
       
      -       The  function item_opts_on turns on the given option bits,
      +       The  function item_opts_on turns on the given option bits,
              and leaves others alone.
       
      -       The function item_opts_off  turns  off  the  given  option
      +       The function item_opts_off  turns  off  the  given  option
              bits, and leaves others alone.
       
      -       The  function  item_opts returns the item's current option
      +       The  function  item_opts returns the item's current option
              bits.
       
      -       There is only one defined option bit  mask,  O_SELECTABLE.
      +       There is only one defined option bit  mask,  O_SELECTABLE.
              When this is on, the item may be selected during menu pro-
              cessing.  This option defaults to on.
       
       
       

      RETURN VALUE

      -       Except for item_opts, each routine returns one of the fol-
      +       Except for item_opts, each routine returns one of the fol-
              lowing:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_userptr.3x.html b/doc/html/man/mitem_userptr.3x.html index 7d7c5618..997a6762 100644 --- a/doc/html/man/mitem_userptr.3x.html +++ b/doc/html/man/mitem_userptr.3x.html @@ -1,17 +1,56 @@ + + + +mitem_userptr 3x + + + +

      mitem_userptr 3x

      +
       
       
       

      NAME

      -       mitem_userptr  -  associate  application  data with a menu
      +       mitem_userptr  -  associate  application  data with a menu
              item
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_item_userptr(ITEM *item, void *userptr);
              void *item_userptr(const ITEM *item);
       
      @@ -25,24 +64,24 @@
       
       

      RETURN VALUE

      -       Except  for  item_userptr  (which  returns NULL on error),
      +       Except  for  item_userptr  (which  returns NULL on error),
              each function returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_value.3x.html b/doc/html/man/mitem_value.3x.html index a83ece25..e38d5e1b 100644 --- a/doc/html/man/mitem_value.3x.html +++ b/doc/html/man/mitem_value.3x.html @@ -1,54 +1,92 @@ + + + +mitem_value 3x + + + +

      mitem_value 3x

      +
       
       
       

      NAME

      -       mitem_value - set and get menu item values
      +       mitem_value - set and get menu item values
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              int set_item_value(ITEM *item, bool value);
              bool item_value(const ITEM *item);
       
       
       

      DESCRIPTION

      -       If  you  turn  off  the menu option O_ONEVALUE (e.g., with
      -       set_menu_opts or menu_opts_off;  see  menu_opts(3x)),  the
      +       If  you  turn  off  the menu option O_ONEVALUE (e.g., with
      +       set_menu_opts or menu_opts_off;  see  menu_opts(3x)),  the
              menu becomes multi-valued; that is, more than one item may
              simultaneously be selected.
       
      -       In a multi_valued menu, you  can  used  set_item_value  to
      -       select the given menu item (second argument TRUE) or dese-
      -       lect it (second argument FALSE).
      +       In a multi_valued menu, you  can  used  set_item_value  to
      +       select the given menu item (second argument TRUE) or dese-
      +       lect it (second argument FALSE).
       
       
       

      RETURN VALUE

      -       The function set_item_value returns one of the following:
      +       The function set_item_value returns one of the following:
       
      -       E_OK The routine succeeded.
      +       E_OK The routine succeeded.
       
      -       E_SYSTEM_ERROR
      -            System error occurred (see errno).
      +       E_SYSTEM_ERROR
      +            System error occurred (see errno).
       
      -       E_REQUEST_DENIED
      +       E_REQUEST_DENIED
                   The menu driver could not process the request.
       
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/mitem_visible.3x.html b/doc/html/man/mitem_visible.3x.html index bc105a0a..0b36dec5 100644 --- a/doc/html/man/mitem_visible.3x.html +++ b/doc/html/man/mitem_visible.3x.html @@ -1,16 +1,55 @@ + + + +mitem_visible 3x + + + +

      mitem_visible 3x

      +
       
       
       

      NAME

      -       mitem_visible - check visibility of a menu item
      +       mitem_visible - check visibility of a menu item
       
       
       

      SYNOPSIS

      -       #include <menu.h>
      +       #include <menu.h>
              bool item_visible(const ITEM *item);
       
       
      @@ -24,13 +63,13 @@
       
       

      SEE ALSO

      -       curses(3x), menu(3x).
      +       curses(3x), menu(3x).
       
       
       

      NOTES

      -       The header file <menu.h> automatically includes the header
      -       file <curses.h>.
      +       The header file <menu.h> automatically includes the header
      +       file <curses.h>.
       
       
       
      diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html index 5fb8400f..83995f9e 100644 --- a/doc/html/man/ncurses.3x.html +++ b/doc/html/man/ncurses.3x.html @@ -1,538 +1,672 @@ + + + +ncurses 3x + + + +

      ncurses 3x

      +
       
       
       

      NAME

      -       ncurses - CRT screen handling and optimization package
      +       ncurses - CRT screen handling and optimization package
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
       
       

      DESCRIPTION

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

      RETURN VALUE

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

      ENVIRONMENT

              The   following   environment   symbols   are  useful  for
      -       customizing the runtime behavior of the  ncurses  library.
      +       customizing the runtime behavior of the  ncurses  library.
              The  most  important  ones  have been already discussed in
              detail.
       
      @@ -540,12 +674,12 @@
                   The debugging library checks this environment  symbol
                   when the application has redirected output to a file.
                   The symbol's numeric value is used for the  baudrate.
      -            If  no value is found ncurses uses 9600.  This allows
      +            If  no value is found ncurses uses 9600.  This allows
                   testers to construct repeatable test-cases that  take
                   into account costs that depend on baudrate.
       
              CC   When set, change occurrences of the command_character
      -            (i.e., the cmdch capability) of the  loaded  terminfo
      +            (i.e., the cmdch capability) of the  loaded  terminfo
                   entries  to  the  value  of  this  symbol.   Very few
                   terminfo entries provide this feature.
       
      @@ -555,8 +689,8 @@
                   usually are able to obtain the width of the window in
                   which  they  are  executing.  If neither the $COLUMNS
                   value nor the terminal's screen  size  is  available,
      -            ncurses  uses  the size which may be specified in the
      -            terminfo database (i.e., the cols capability).
      +            ncurses  uses  the size which may be specified in the
      +            terminfo database (i.e., the cols capability).
       
                   It is important that your application use  a  correct
                   size  for  the  screen.   However, this is not always
      @@ -569,11 +703,11 @@
                   independently.  This is mainly useful  to  circumvent
                   legacy  misfeatures  of  terminal descriptions, e.g.,
                   xterm which commonly specifies a 65 line screen.  For
      -            best  results, lines and cols should not be specified
      +            best  results, lines and cols should not be specified
                   in a terminal description for terminals which are run
                   as emulations.
       
      -            Use the use_env function to disable this feature.
      +            Use the use_env function to disable this feature.
       
              ESCDELAY
                   Specifies  the total time, in milliseconds, for which
      @@ -596,7 +730,7 @@
                   timeout applies to the composed multi-click event  as
                   well as the individual clicks.
       
      -       HOME Tells  ncurses where your home directory is.  That is
      +       HOME Tells  ncurses where your home directory is.  That is
                   where  it  may  read  and  write  auxiliary  terminal
                   descriptions:
       
      @@ -618,80 +752,92 @@
       
                   This symbol lets you customize the mouse.  The symbol
                   must be three numeric digits 1-3 in any order,  e.g.,
      -            123  or  321.   If  it is not specified, ncurses uses
      +            123  or  321.   If  it is not specified, ncurses uses
                   132.
       
      +       NCURSES_ASSUMED_COLORS
      +            Override  the   compiled-in   assumption   that   the
      +            terminal's  default  colors  are  white-on-black (see
      +            assume_default_colors(3x)).    You   may   set    the
      +            foreground  and  background  color  values  with this
      +            environment variable by  proving  a  2-element  list:
      +            foreground,background.   For example, to tell ncurses
      +            to not assume anything about the colors, set this  to
      +            "-1,-1".  To make it green-on-black, set it to "2,0".
      +            Any  positive  value  from  zero  to   the   terminfo
      +            max_colors value is allowed.
      +
              NCURSES_NO_PADDING
      -            Most of the terminal  descriptions  in  the  terminfo
      -            database  are  written for real "hardware" terminals.
      -            Many people use terminal emulators  which  run  in  a
      -            windowing    environment    and    use   curses-based
      -            applications.  Terminal emulators can  duplicate  all
      -            of  the important aspects of a hardware terminal, but
      -            they do not have the  same  limitations.   The  chief
      +            Most  of  the  terminal  descriptions in the terminfo
      +            database are written for real  "hardware"  terminals.
      +            Many  people  use  terminal  emulators which run in a
      +            windowing   environment    and    use    curses-based
      +            applications.   Terminal  emulators can duplicate all
      +            of the important aspects of a hardware terminal,  but
      +            they  do  not  have  the same limitations.  The chief
                   limitation of a hardware terminal from the standpoint
      -            of your application is the  management  of  dataflow,
      -            i.e.,   timing.    Unless   a  hardware  terminal  is
      -            interfaced into a terminal concentrator  (which  does
      -            flow  control),  it (or your application) must manage
      +            of  your  application  is the management of dataflow,
      +            i.e.,  timing.   Unless  a   hardware   terminal   is
      +            interfaced  into  a terminal concentrator (which does
      +            flow control), it (or your application)  must  manage
                   dataflow, preventing overruns.  The cheapest solution
      -            (no  hardware cost) is for your program to do this by
      +            (no hardware cost) is for your program to do this  by
                   pausing  after  operations  that  the  terminal  does
                   slowly, such as clearing the display.
       
      -            As  a  result,  many terminal descriptions (including
      -            the vt100) have delay times embedded.  You  may  wish
      -            to  use  these  descriptions, but not want to pay the
      +            As a result, many  terminal  descriptions  (including
      +            the  vt100)  have delay times embedded.  You may wish
      +            to use these descriptions, but not want  to  pay  the
                   performance penalty.
       
      -            Set the NCURSES_NO_PADDING symbol to disable all  but
      -            mandatory  padding.   Mandatory  padding is used as a
      -            part of special control sequences such as flash.
      +            Set  the NCURSES_NO_PADDING symbol to disable all but
      +            mandatory padding.  Mandatory padding is  used  as  a
      +            part of special control sequences such as flash.
       
              NCURSES_NO_SETBUF
      -            Normally  ncurses  enables  buffered  output   during
      -            terminal  initialization.   This  is done (as in SVr4
      -            curses)  for  performance   reasons.    For   testing
      -            purposes,  both  of ncurses and certain applications,
      -            this  feature  is   made   optional.    Setting   the
      +            Normally   ncurses  enables  buffered  output  during
      +            terminal initialization.  This is done  (as  in  SVr4
      +            curses)   for   performance   reasons.   For  testing
      +            purposes, both of ncurses and  certain  applications,
      +            this   feature   is   made   optional.   Setting  the
                   NCURSES_NO_SETBUF variable disables output buffering,
      -            leaving the output  in  the  original  (usually  line
      +            leaving  the  output  in  the  original (usually line
                   buffered) mode.
       
              NCURSES_TRACE
      -            During  initialization, the ncurses debugging library
      -            checks the NCURSES_TRACE symbol.  If it  is  defined,
      -            to a numeric value, ncurses calls the trace function,
      +            During initialization, the ncurses debugging  library
      +            checks  the  NCURSES_TRACE symbol.  If it is defined,
      +            to a numeric value, ncurses calls the trace function,
                   using that value as the argument.
       
      -            The argument values, which are defined  in  curses.h,
      -            provide  several  types of information.  When running
      -            with traces enabled, your application will write  the
      -            file trace to the current directory.
      +            The  argument  values, which are defined in curses.h,
      +            provide several types of information.   When  running
      +            with  traces enabled, your application will write the
      +            file trace to the current directory.
       
      -       TERM Denotes  your  terminal  type.  Each terminal type is
      +       TERM Denotes your terminal type.  Each  terminal  type  is
                   distinct, though many are similar.
       
              TERMCAP
      -            If the  ncurses  library  has  been  configured  with
      -            termcap  support, ncurses will check for a terminal's
      +            If  the  ncurses  library  has  been  configured with
      +            termcap support, ncurses will check for a  terminal's
                   description in termcap form if it is not available in
                   the terminfo database.
       
      -            The   TERMCAP   symbol  contains  either  a  terminal
      -            description (with newlines stripped out), or  a  file
      -            name  telling  where  the  information denoted by the
      -            TERM symbol  exists.   In  either  case,  setting  it
      -            directs  ncurses  to  ignore the usual place for this
      +            The  TERMCAP  symbol  contains  either   a   terminal
      +            description  (with  newlines stripped out), or a file
      +            name telling where the  information  denoted  by  the
      +            TERM  symbol  exists.   In  either  case,  setting it
      +            directs ncurses to ignore the usual  place  for  this
                   information, e.g., /etc/termcap.
       
              TERMINFO
      -            Overrides the directory in which ncurses searches for
      +            Overrides the directory in which ncurses searches for
                   your terminal description.  This is the simplest, but
      -            not the only way to change the list  of  directories.
      +            not  the  only way to change the list of directories.
                   The complete list of directories in order follows:
       
      -            -  the last directory to which ncurses wrote, if any,
      +            -  the last directory to which ncurses wrote, if any,
                      is searched first.
       
                   -  the directory specified by the TERMINFO symbol
      @@ -705,19 +851,20 @@
                      /usr/share/terminfo
       
              TERMINFO_DIRS
      -            Specifies  a  list  of  directories  to  search   for
      -            terminal  descriptions.   The  list  is  separated by
      -            colons (i.e., ":").  All of the terminal descriptions
      -            are  in  terminfo  form,  which  makes a subdirectory
      -            named for the first  letter  of  the  terminal  names
      -            therein.
      +            Specifies   a  list  of  directories  to  search  for
      +            terminal descriptions.   The  list  is  separated  by
      +            colons  (i.e.,  ":") on Unix, semicolons on OS/2 EMX.
      +            All of the  terminal  descriptions  are  in  terminfo
      +            form,  which makes a subdirectory named for the first
      +            letter of the terminal names therein.
       
              TERMPATH
      -            If  TERMCAP  does  not  hold a file name then ncurses
      -            checks the  TERMPATH  symbol.   This  is  a  list  of
      -            filenames  separated  by  colons (i.e., ":").  If the
      -            TERMPATH symbol is not  set,  ncurses  looks  in  the
      -            files   /etc/termcap,   /usr/share/misc/termcap   and
      +            If TERMCAP does not hold a  file  name  then  ncurses
      +            checks  the  TERMPATH  symbol.   This  is  a  list of
      +            filenames separated by spaces or colons  (i.e.,  ":")
      +            on  Unix,  semicolons  on  OS/2 EMX.  If the TERMPATH
      +            symbol  is  not  set,  ncurses  looks  in  the  files
      +            /etc/termcap,       /usr/share/misc/termcap       and
                   $HOME/.termcap, in that order.
       
              The library may be configured to disregard  the  following
      @@ -736,133 +883,99 @@
       
       

      SEE ALSO

      -       terminfo(5)  and  3x  pages  whose names begin "curs_" for
      -       detailed routine descriptions.
      +       terminfo(5)  and  related  pages whose names begin "curs_"
      +       for detailed routine descriptions.
       
       
       

      EXTENSIONS

      -       The  ncurses  library  can  be  compiled  with  an  option
      -       (-DUSE_GETCAP)   that   falls   back   to   the  old-style
      +       The  ncurses  library  can  be  compiled  with  an  option
      +       (-DUSE_GETCAP)   that   falls   back   to   the  old-style
              /etc/termcap file if the terminal setup code cannot find a
      -       terminfo entry corresponding to TERM.  Use of this feature
      +       terminfo entry corresponding to TERM.  Use of this feature
              is not recommended, as it essentially includes  an  entire
      -       termcap   compiler   in   the  ncurses  startup  code,  at
      +       termcap   compiler   in   the  ncurses  startup  code,  at
              significant cost in core and startup cycles.
       
      -       The ncurses  library  includes  facilities  for  capturing
      +       The ncurses  library  includes  facilities  for  capturing
              mouse  events  on certain terminals (including xterm). See
      -       the curs_mouse(3x) manual page for details.
      +       the curs_mouse(3x) manual page for details.
       
      -       The ncurses library includes facilities for responding  to
      +       The ncurses library includes facilities for responding  to
              window  resizing  events,  e.g., when running in an xterm.
      -       See the resizeterm(3x) and wresize(3x)  manual  pages  for
      +       See the resizeterm(3x) and wresize(3x)  manual  pages  for
              details.   In addition, the library may be configured with
              a SIGWINCH handler.
       
      -       The ncurses library extends the fixed set of function  key
      +       The ncurses library extends the fixed set of function  key
              capabilities  of  terminals  by  allowing  the application
              designer to define additional key  sequences  at  runtime.
      -       See  the  define_key(3x)  and  keyok(3x)  manual pages for
      +       See  the  define_key(3x)  and  keyok(3x)  manual pages for
              details.
       
      -       The  ncurses  library  can  exploit  the  capabilities  of
      +       The  ncurses  library  can  exploit  the  capabilities  of
              terminals  which  implement the ISO-6429 SGR 39 and SGR 49
              controls, which allow an application to reset the terminal
              to  its  original  foreground and background colors.  From
              the users' perspective, the application is  able  to  draw
              colored   text   on   a  background  whose  color  is  set
              independently,  providing  better   control   over   color
      -       contrasts.  See the use_default_colors(3x) manual page for
      +       contrasts.   See  the  default_colors(3x)  manual page for
              details.
      -       The ncurses library  includes  a  function  for  directing
      +
      +       The ncurses library  includes  a  function  for  directing
              application  output  to a printer attached to the terminal
      -       device.  See the curs_print(3x) manual page for details.
      +       device.  See the curs_print(3x) manual page for details.
       
       
       

      PORTABILITY

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

      NOTES

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

      diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html index a07930d5..31ab3480 100644 --- a/doc/html/man/panel.3x.html +++ b/doc/html/man/panel.3x.html @@ -1,5 +1,43 @@ + + + +panel 3x + + + +

      panel 3x

      +
       
       
      @@ -10,35 +48,35 @@
       
       

      SYNOPSIS

      -       #include <panel.h>
      -
      -       cc [flags] sourcefiles -lpanel -lncurses
      -
      -       PANEL *new_panel(WINDOW *win)
      -       int bottom_panel(PANEL *pan)
      -       int top_panel(PANEL *pan)
      -       int show_panel(PANEL *pan)
      -       void update_panels();
      -       int hide_panel(PANEL *pan)
      -       WINDOW *panel_window(const PANEL *pan)
      -       int replace_panel(PANEL *pan, WINDOW *window)
      -       int move_panel(PANEL *pan, int starty, int startx)
      -       int panel_hidden(const PANEL *pan)
      -       PANEL *panel_above(const PANEL *pan)
      -       PANEL *panel_below(const PANEL *pan)
      -       int set_panel_userptr(PANEL *pan, const void *ptr)
      -       const void *panel_userptr(const PANEL *pan)
      -       int del_panel(PANEL *pan)
      +       #include <panel.h>
      +
      +       cc [flags] sourcefiles -lpanel -lncurses
      +
      +       PANEL *new_panel(WINDOW *win)
      +       int bottom_panel(PANEL *pan)
      +       int top_panel(PANEL *pan)
      +       int show_panel(PANEL *pan)
      +       void update_panels();
      +       int hide_panel(PANEL *pan)
      +       WINDOW *panel_window(const PANEL *pan)
      +       int replace_panel(PANEL *pan, WINDOW *window)
      +       int move_panel(PANEL *pan, int starty, int startx)
      +       int panel_hidden(const PANEL *pan)
      +       PANEL *panel_above(const PANEL *pan)
      +       PANEL *panel_below(const PANEL *pan)
      +       int set_panel_userptr(PANEL *pan, const void *ptr)
      +       const void *panel_userptr(const PANEL *pan)
      +       int del_panel(PANEL *pan)
       
       
       

      DESCRIPTION

      -       Panels  are  curses(3x)  windows with the added feature of
      +       Panels  are  curses(3x)  windows with the added feature of
              depth.  Panel functions allow the use of  stacked  windows
              and  ensure  the  proper  portions  of each window and the
      -       curses stdscr window are hidden or displayed  when  panels
      +       curses stdscr window are hidden or displayed  when  panels
              are  added,  moved,  modified or removed.  The set of cur-
      -       rently visible panels is the stack of panels.  The  stdscr
      +       rently visible panels is the stack of panels.  The  stdscr
              window  is  beneath all panels, and is not considered part
              of the stack.
       
      @@ -47,20 +85,20 @@
              as well as position a panel at any desired location in the
              stack.
       
      -       Panel routines are a functional layer added to curses(3x),
      +       Panel routines are a functional layer added to curses(3x),
              make only high-level curses calls, and work anywhere  ter-
              minfo curses does.
       
       
       

      FUNCTIONS

      -       new_panel(win)
      -              allocates   a   PANEL structure, associates it with
      -              win, places the panel  on  the  top  of  the  stack
      +       new_panel(win)
      +              allocates   a   PANEL structure, associates it with
      +              win, places the panel  on  the  top  of  the  stack
                     (causes   it  to   be   displayed  above  any other
                     panel) and returns a pointer to the new panel.
       
      -       void update_panels()
      +       void update_panels()
                     refreshes the virtual screen to reflect  the  rela-
                     tions between the panels in the stack, but does not
                     call doupdate() to  refresh  the  physical  screen.
      @@ -69,67 +107,67 @@
                     a  call  to doupdate(), but doupdate() is the func-
                     tion responsible for updating the physical  screen.
       
      -       del_panel(pan)
      +       del_panel(pan)
                     removes the given panel from the  stack and deallo-
      -              cates the PANEL structure (but not  its  associated
      +              cates the PANEL structure (but not  its  associated
                     window).
       
      -       hide_panel(pan)
      +       hide_panel(pan)
                     removes  the  given  panel from the panel stack and
      -              thus hides it from view. The PANEL structure is not
      +              thus hides it from view. The PANEL structure is not
                     lost, merely removed from the stack.
       
      -       show_panel(pan)
      +       show_panel(pan)
                     makes  a  hidden panel visible by placing it on top
                     of the panels in the panel stack. See COMPATIBILITY
                     below.
       
      -       top_panel(pan)
      +       top_panel(pan)
                     puts  the  given visible panel on top of all panels
                     in the stack.  See COMPATIBILITY below.
       
      -       bottom_panel(pan)
      +       bottom_panel(pan)
                     puts panel at the bottom of all panels.
       
      -       move_panel(pan,starty,startx)
      +       move_panel(pan,starty,startx)
                     moves the given panel window so that its upper-left
      -              corner  is  at  starty, startx.  It does not change
      +              corner  is  at  starty, startx.  It does not change
                     the position of the panel in the stack.  Be sure to
      -              use  this  function,  not  mvwin(), to move a panel
      +              use  this  function,  not  mvwin(), to move a panel
                     window.
       
      -       replace_panel(pan,window)
      -              replaces the current window of  panel  with  window
      +       replace_panel(pan,window)
      +              replaces the current window of  panel  with  window
                     (useful, for example if you want to resize a panel;
      -              if you're using ncurses, you can call replace_panel
      -              on  the output of wresize(3x)).  It does not change
      +              if you're using ncurses, you can call replace_panel
      +              on  the output of wresize(3x)).  It does not change
                     the position of the panel in the stack.
       
      -       panel_above(pan)
      +       panel_above(pan)
                     returns a pointer to the panel above pan.   If  the
      -              panel  argument is (PANEL *)0, it returns a pointer
      +              panel  argument is (PANEL *)0, it returns a pointer
                     to the bottom panel in the stack.
       
      -       panel_below(pan)
      +       panel_below(pan)
                     returns a pointer to the panel just below pan.   If
      -              the  panel  argument  is  (PANEL  *)0, it returns a
      +              the  panel  argument  is  (PANEL  *)0, it returns a
                     pointer to the top panel in the stack.
       
      -       set_panel_userptr(pan,ptr)
      +       set_panel_userptr(pan,ptr)
                     sets the panel's user pointer.
       
      -       panel_userptr(pan)
      +       panel_userptr(pan)
                     returns the user pointer for a given panel.
       
      -       panel_window(pan)
      +       panel_window(pan)
                     returns a pointer to the window of the given panel.
       
       
       

      DIAGNOSTICS

      -       Each  routine  that  returns  a pointer returns NULL if an
      +       Each  routine  that  returns  a pointer returns NULL if an
              error occurs. Each  routine  that  returns  an  int  value
      -       returns OK if it executes successfully and ERR if not.
      +       returns OK if it executes successfully and ERR if not.
       
       
       
      @@ -137,15 +175,15 @@ Reasonable care has been taken to ensure compatibility with the native panel facility introduced in SVr3.2 (inspection of the SVr4 manual pages suggests the program- - ming interface is unchanged). The PANEL data structures + ming interface is unchanged). The PANEL data structures are merely similar. The programmer is cautioned not to - directly use PANEL fields. + directly use PANEL fields. - The functions show_panel() and top_panel() are identical + The functions show_panel() and top_panel() are identical in this implementation, and work equally well with dis- played or hidden panels. In the native System V implemen- - tation, show_panel() is intended for making a hidden panel - visible (at the top of the stack) and top_panel() is + tation, show_panel() is intended for making a hidden panel + visible (at the top of the stack) and top_panel() is intended for making an already-visible panel move to the top of the stack. You are cautioned to use the correct function to ensure compatibility with native panel @@ -157,7 +195,7 @@ In your library list, libpanel.a should be before libn- curses.a; that is, you want to say `-lpanel -lncurses', not the other way around (which would give you a link - error using GNU ld(1) and some other linkers). + error using GNU ld(1) and some other linkers).
      @@ -169,7 +207,7 @@

      SEE ALSO

      -       curses(3x)
      +       curses(3x)
       
       
       
      diff --git a/doc/html/man/resizeterm.3x.html b/doc/html/man/resizeterm.3x.html index 712dee10..9ad4fe77 100644 --- a/doc/html/man/resizeterm.3x.html +++ b/doc/html/man/resizeterm.3x.html @@ -1,58 +1,107 @@ + + + +resizeterm 3x + + + +

      resizeterm 3x

      +
       
       
       

      NAME

      -       resizeterm - change the curses terminal size
      +       is_term_resized,  resize_term,  resizeterm  -  change  the
      +       curses terminal size
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int resizeterm(int lines, int columns);
      +       bool is_term_resized(int lines, int columns);
      +       int resize_term(int lines, int columns);
      +       int resizeterm(int lines, int columns);
       
       
       

      DESCRIPTION

      -       This  is  an extension to the curses library.  It provides
      -       callers with a hook into the ncurses data to  resize  win-
      +       This is an extension to the curses library.   It  provides
      +       callers  with  a hook into the ncurses data to resize win-
              dows, primarily for use by programs running in an X Window
      -       terminal (e.g., xterm).  The function  resizeterm  resizes
      -       the  standard  and current windows to the specified dimen-
      -       sions, and adjusts other  bookkeeping  data  used  by  the
      -       ncurses library that record the window dimensions.
      -
      -       When  resizing  the  windows, the function blank-fills the
      -       areas that are extended. The  calling  application  should
      -       fill in these areas with appropriate data.
      -
      -       The function attempts to resize all windows.  However, due
      -       to the calling convention of pads, it is not  possible  to
      -       resize  these  without  additional  interaction  with  the
      -       application.
      +       terminal  (e.g.,  xterm).  The function resizeterm resizes
      +       the standard and current windows to the  specified  dimen-
      +       sions,  and  adjusts  other  bookkeeping  data used by the
      +       ncurses library that record the window dimensions.
      +
      +       Most  of  the  work  is  done  by   the   inner   function
      +       resize_term.  The outer function resizeterm adds bookkeep-
      +       ing for the SIGWINCH handler.  When resizing the  windows,
      +       resize_term  blank-fills the areas that are extended.  The
      +       calling application should fill in these areas with appro-
      +       priate  data.  The resize_term function attempts to resize
      +       all windows.  However, due to the  calling  convention  of
      +       pads,  it  is  not  possible to resize these without addi-
      +       tional interaction with the application.
      +
      +       A support function is_term_resized  is  provided  so  that
      +       applications  can  check if the resize_term function would
      +       modify the window structures.  It returns TRUE if the win-
      +       dows would be modified, and FALSE otherwise.
       
       
       

      RETURN VALUE

      -       The function returns the integer ERR upon failure  and  OK
      -       on success.  It will fail if either of the dimensions less
      -       than or equal  to  zero,  or  if  an  error  occurs  while
      -       (re)allocating memory for the windows.
      +       Except  as  notes,  these  function return the integer ERR
      +       upon failure and OK on success.  They will fail if  either
      +       of the dimensions are less than or equal to zero, or if an
      +       error occurs while (re)allocating memory for the  windows.
       
       
       

      NOTES

      -       While  this  function  is intended to be used to support a
      +       While these functions are intended to be used to support a
              signal handler (i.e., for SIGWINCH), care should be  taken
      -       to  avoid invoking it in a context where malloc or realloc
      -       may have been interrupted, since it uses those  functions.
      +       to  avoid invoking them in a context where malloc or real-
      +       loc may have been interrupted, since it uses  those  func-
      +       tions.
       
              If  ncurses  is configured to supply its own SIGWINCH han-
      -       dler, the resizeterm function ungetch's a KEY_RESIZE which
      -       will  be  read on the next call to getch.  This is used to
      +       dler, the resizeterm function ungetch's a KEY_RESIZE which
      +       will  be  read on the next call to getch.  This is used to
              alert an application that the screen size has changed, and
              that  it should repaint special features such as pads that
              cannot be done automatically.
      @@ -60,7 +109,7 @@
       
       

      SEE ALSO

      -       wresize(3x).
      +       wresize(3x).
       
       
       
      @@ -70,6 +119,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html index b4c1ed07..394d0f7c 100644 --- a/doc/html/man/term.5.html +++ b/doc/html/man/term.5.html @@ -1,5 +1,43 @@ + + + +TERM 5 + + + +

      TERM 5

      +
       
       
      @@ -10,27 +48,27 @@
       
       

      SYNOPSIS

      -       term
      +       term
       
       
       

      DESCRIPTION

              Compiled terminfo descriptions are placed under the direc-
      -       tory /usr/share/terminfo.  In  order  to  avoid  a  linear
      +       tory /usr/share/terminfo.  In  order  to  avoid  a  linear
              search of a huge UNIX system directory, a two-level scheme
      -       is used: /c/name where name is the name of  the  terminal,
      -       and  c  is the first character of name.  Thus, act4 can be
      -       found in the  file  /usr/share/terminfo/a/act4.   Synonyms
      -       for the same terminal are implemented by multiple links to
      -       the same compiled file.
      +       is used: /usr/share/terminfo/c/name where name is the name
      +       of  the  terminal,  and  c is the first character of name.
      +       Thus, act4  can  be  found  in  the  file  /usr/share/ter-
      +       minfo/a/act4.   Synonyms  for the same terminal are imple-
      +       mented by multiple links to the same compiled file.
       
              The format has been chosen so that it will be the same  on
              all  hardware.   An  8 or more bit byte is assumed, but no
              assumptions about byte  ordering  or  sign  extension  are
              made.
       
      -       The  compiled  file  is  created with the tic program, and
      -       read by the routine setupterm.  The file is  divided  into
      +       The  compiled  file  is  created with the tic program, and
      +       read by the routine setupterm.  The file is  divided  into
              six parts: the header, terminal names, boolean flags, num-
              bers, strings, and string table.
       
      @@ -92,13 +130,13 @@
              the values of string capabilities referenced in the string
              section.  Each string is null terminated.
       
      -       Note that it is possible for setupterm to expect a differ-
      +       Note that it is possible for setupterm to expect a differ-
              ent  set  of capabilities than are actually present in the
              file.  Either the database may  have  been  updated  since
      -       setupterm has been recompiled (resulting in extra unrecog-
      +       setupterm has been recompiled (resulting in extra unrecog-
              nized entries in the file) or the program  may  have  been
              recompiled  more  recently  than  the database was updated
      -       (resulting in missing  entries).   The  routine  setupterm
      +       (resulting in missing  entries).   The  routine  setupterm
              must  be prepared for both possibilities - this is why the
              numbers and sizes are included.   Also,  new  capabilities
              must  always  be added at the end of the lists of boolean,
      @@ -112,7 +150,7 @@
              OSF/1)  which  diverged from System V terminfo after SVr1,
              and have added extension capabilities to the string  table
              that  (in the binary format) collide with System V and XSI
      -       Curses extensions.  See terminfo(5) for  detailed  discus-
      +       Curses extensions.  See terminfo(5) for  detailed  discus-
              sion of terminfo source compatibility issues.
       
              As  an  example, here is a hex dump of the description for
      @@ -123,7 +161,7 @@
                      am,
                      cols#80, lines#24,
                      bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
      -               cuf1=^L, cup==%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
      +               cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
                      home=^^, ind=^J,
       
              0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
      @@ -162,7 +200,7 @@
       
       

      SEE ALSO

      -       curses(3x), terminfo(5).
      +       curses(3x), terminfo(5).
       
       
       
      diff --git a/doc/html/man/term.7.html b/doc/html/man/term.7.html
      index 55df37df..96798643 100644
      --- a/doc/html/man/term.7.html
      +++ b/doc/html/man/term.7.html
      @@ -1,5 +1,43 @@
      +
      +
       
      +
      +TERM 7
      +
      +
      +
       
      +

      TERM 7

      +
       
       
      @@ -10,15 +48,15 @@
       
       

      DESCRIPTION

      -       The  environment variable TERM should normally contain the
      +       The  environment variable TERM should normally contain the
              type name of the terminal, console or display-device  type
              you  are  using.   This  information  is  critical for all
              screen-oriented  programs,  including  your   editor   and
              mailer.
       
      -       A  default  TERM  value will be set on a per-line basis by
      -       either /etc/inittab (Linux and  System-V-like  UNIXes)  or
      -       /etc/ttys  (BSD  UNIXes).  This will nearly always suffice
      +       A  default  TERM  value will be set on a per-line basis by
      +       either /etc/inittab (Linux and  System-V-like  UNIXes)  or
      +       /etc/ttys  (BSD  UNIXes).  This will nearly always suffice
              for workstation and microcomputer consoles.
       
              If you use a dialup line, the type of device  attached  to
      @@ -28,7 +66,7 @@
              VT100-compatible terminals  and  personal-computer  emula-
              tors.
       
      -       Modern  telnets  pass  your TERM environment variable from
      +       Modern  telnets  pass  your TERM environment variable from
              the local side to the remote one.  There can  be  problems
              if  the  remote terminfo or termcap entry for your type is
              not compatible with yours, but this situation is rare  and
      @@ -36,13 +74,13 @@
              `vt100' (assuming you are in fact using  a  VT100-superset
              console, terminal, or terminal emulator.)
       
      -       In any case, you are free to override the system TERM set-
      -       ting to your taste in your  shell  profile.   The  tset(1)
      +       In any case, you are free to override the system TERM set-
      +       ting to your taste in your  shell  profile.   The  tset(1)
              utility  may  be  of  assistance; you can give it a set of
              rules for deducing or requesting a terminal type based  on
              the tty device and baud rate.
       
      -       Setting your own TERM value may also be useful if you have
      +       Setting your own TERM value may also be useful if you have
              created a custom  entry  incorporating  options  (such  as
              visual  bell  or reverse-video) which you wish to override
              the system default type for your line.
      @@ -55,23 +93,23 @@
       
              from your shell.  These capability files are in  a  binary
              format optimized for retrieval speed (unlike the old text-
      -       based termcap format they replace); to examine  an  entry,
      -       you  must  use  the infocmp(1) command.  Invoke it as fol-
      +       based termcap format they replace); to examine  an  entry,
      +       you  must  use  the infocmp(1) command.  Invoke it as fol-
              lows:
       
      -            infocmp entry-name
      +            infocmp entry-name
       
      -       where entry-name is the name of the type you wish to exam-
      +       where entry-name is the name of the type you wish to exam-
              ine  (and the name of its capability file the subdirectory
              of /usr/share/terminfo named for its first letter).   This
              command  dumps  a  capability  file  in  the  text  format
      -       described by terminfo(5).
      +       described by terminfo(5).
       
      -       The first line of  a  terminfo(5)  description  gives  the
      +       The first line of  a  terminfo(5)  description  gives  the
              names by which terminfo knows a terminal, separated by `|'
              (pipe-bar) characters with the last name field  terminated
      -       by  a  comma.   The first name field is the type's primary
      -       name, and is the one to use when setting TERM.   The  last
      +       by  a  comma.   The first name field is the type's primary
      +       name, and is the one to use when setting TERM.   The  last
              name  field  (if  distinct  from  the first) is actually a
              description of the terminal type (it may  contain  blanks;
              the others must be single words).  Name fields between the
      @@ -100,25 +138,25 @@
       
              The  root  name for a terminal or workstation console type
              should almost always begin with a vendor prefix  (such  as
      -       hp  for Hewlett-Packard, wy for Wyse, or att for AT&T ter-
      -       minals), or a common name of the terminal line (vt for the
      -       VT  series of terminals from DEC, or sun for Sun Microsys-
      -       tems workstation consoles, or regent for the  ADDS  Regent
      +       hp  for Hewlett-Packard, wy for Wyse, or att for AT&T ter-
      +       minals), or a common name of the terminal line (vt for the
      +       VT  series of terminals from DEC, or sun for Sun Microsys-
      +       tems workstation consoles, or regent for the  ADDS  Regent
              series.   You  can list the terminfo tree to see what pre-
              fixes are already in common use.   The  root  name  prefix
              should  be  followed  when  appropriate by a model number;
      -       thus vt100, hp2621, wy50.
      +       thus vt100, hp2621, wy50.
       
              The root name for a PC-Unix console type should be the  OS
      -       name,  i.e.  linux, bsdos, freebsd, netbsd.  It should not
      -       be console or any other generic that might cause confusion
      +       name,  i.e.  linux, bsdos, freebsd, netbsd.  It should not
      +       be console or any other generic that might cause confusion
              in  a  multi-platform environment!  If a model number fol-
              lows, it should indicate either the OS  release  level  or
              the console driver release level.
              The root name for a terminal emulator (assuming it doesn't
              fit one of the standard ANSI or vt100 types) should be the
              program  name or a readily recognizable abbreviation of it
      -       (i.e. versaterm, ctrm).
      +       (i.e. versaterm, ctrm).
       
              Following the root name, you may add any reasonable number
              of hyphen-separated feature suffixes.
      @@ -159,16 +197,16 @@
              intended to specify a line height, that suffix  should  go
              first.  So, for a hypothetical FuBarCo model 2317 terminal
              in 30-line mode with reverse video,  best  form  would  be
      -       fubar-30-rv (rather than, say, `fubar-rv-30').
      +       fubar-30-rv (rather than, say, `fubar-rv-30').
       
              Terminal types that are written not as standalone entries,
              but rather as components to be plugged into other  entries
      -       via  use capabilities, are distinguished by using embedded
      +       via  use capabilities, are distinguished by using embedded
              plus signs rather than dashes.
       
              Commands which use a  terminal  type  to  control  display
              often  accept  a  -T  option  that accepts a terminal name
      -       argument.  Such programs should  fall  back  on  the  TERM
      +       argument.  Such programs should  fall  back  on  the  TERM
              environment variable when no -T option is specified.
       
       
      @@ -193,7 +231,7 @@
       
       

      SEE ALSO

      -       curses(3x), terminfo(5), term(5).
      +       curses(3x), terminfo(5), term(5).
       
       
       
      diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
      index 20bb063d..366da654 100644
      --- a/doc/html/man/terminfo.5.html
      +++ b/doc/html/man/terminfo.5.html
      @@ -1,5 +1,52 @@
      +
      +
       
      +
      +TERMINFO 5   File Formats
      +
      +
      +
       
      +

      TERMINFO 5 File Formats

      +
       
       
      @@ -15,17 +62,17 @@
       
       

      DESCRIPTION

      -       Terminfo  is  a  data  base  describing terminals, used by
      -       screen-oriented programs  such  as  nvi(1),  rogue(1)  and
      -       libraries  such  as curses(3x).  Terminfo describes termi-
      +       Terminfo  is  a  data  base  describing terminals, used by
      +       screen-oriented programs  such  as  nvi(1),  rogue(1)  and
      +       libraries  such  as curses(3x).  Terminfo describes termi-
              nals by giving a set of capabilities which they  have,  by
              specifying how to perform screen operations, and by speci-
              fying padding requirements and initialization sequences.
       
      -       Entries in terminfo consist of a sequence of `,' separated
      -       fields  (embedded  commas may be escaped with a  backslash
      -       or notated as \072).  White space after the `,'  separator
      -       is  ignored.   The first entry for each terminal gives the
      +       Entries in terminfo consist of a sequence of `,' separated
      +       fields (embedded commas may be escaped with a backslash or
      +       notated as \054).  White space after the `,' separator  is
      +       ignored.   The  first  entry  for  each terminal gives the
              names which are known for the terminal, separated  by  `|'
              characters.   The  first  name  given  is  the most common
              abbreviation for the terminal, the last name given  should
      @@ -45,9 +92,9 @@
              vt100-w.  The following suffixes should be used where pos-
              sible:
       
      -      Suffix                  Meaning                   Example
      -      -nn      Number of lines on the screen            aaa-60
      -      -np      Number of pages of memory                c100-4p
      +      Suffix                  Meaning                   Example
      +      -nn      Number of lines on the screen            aaa-60
      +      -np      Number of pages of memory                c100-4p
             -am      With automargins (usually the default)   vt100-am
             -m       Mono mode; suppress color                ansi-m
             -mc      Magic cookie; spaces when highlighting   wy30-mc
      @@ -60,18 +107,18 @@
             -vb      Use visible bell instead of beep         wy370-vb
             -w       Wide mode (> 80 columns, usually 132)    vt100-w
       
      -       For  more  on terminal naming conventions, see the term(7)
      +       For  more  on terminal naming conventions, see the term(7)
              manual page.
       
      -   Capabilities
      +   Capabilities
              The following is a  complete  table  of  the  capabilities
              included  in a terminfo description block and available to
              terminfo-using code.  In each line of the table,
       
      -       The variable is the name by which the programmer  (at  the
      +       The variable is the name by which the programmer  (at  the
              terminfo level) accesses the capability.
       
      -       The  capname  is  the  short  name used in the text of the
      +       The  capname  is  the  short  name used in the text of the
              database, and is used by a person updating  the  database.
              Whenever  possible,  capnames are chosen to be the same as
              or similar to the ANSI X3.64-1979 standard (now superseded
      @@ -79,13 +126,13 @@
              Semantics are also intended to match those of the specifi-
              cation.
       
      -       The  termcap code is the old termcap capability name (some
      +       The  termcap code is the old termcap capability name (some
              capabilities are new, and have names which termcap did not
              originate).
       
              Capability  names have no hard length limit, but an infor-
              mal limit of 5 characters has been adopted  to  keep  them
      -       short  and  to  allow  the tabs in the source file Caps to
      +       short  and  to  allow  the tabs in the source file Caps to
              line up nicely.
       
              Finally, the description  field  attempts  to  convey  the
      @@ -95,18 +142,18 @@
              (P)    indicates that padding may be specified
       
              #[1-9] in the description field indicates that the  string
      -              is passed through tparm with parms as given (#i).
      +              is passed through tparm with parms as given (#i).
       
              (P*)   indicates  that  padding  may vary in proportion to
                     the number of lines affected
       
      -       (#i)   indicates the ith parameter.
      +       (#i)   indicates the ith parameter.
       
       
              These are the boolean capabilities:
       
      -               Variable          Cap-  TCap      Description
      -               Booleans          name  Code
      +               Variable          Cap-  TCap      Description
      +               Booleans          name  Code
              auto_left_margin          bw    bw    cub1 wraps from col-
                                                    umn 0 to last column
              auto_right_margin         am    am    terminal has auto-
      @@ -162,28 +209,30 @@
                                                    in insert mode
              move_standout_mode        msgr  ms    safe to move while
                                                    in standout mode
      -       needs_xon_xoff            nxon  nx    padding won't work,
      -                                             xon/xoff required
      +       needs_xon_xoff            nxon  nx    padding will not
      +                                             work, xon/xoff
      +                                             required
              no_esc_ctlc               xsb   xb    beehive (f1=escape,
                                                    f2=ctrl C)
              no_pad_char               npc   NP    pad character does
                                                    not exist
      +
      +
              non_dest_scroll_region    ndscr ND    scrolling region is
                                                    non-destructive
      -
              non_rev_rmcup             nrrmc NR    smcup does not
                                                    reverse rmcup
              over_strike               os    os    terminal can over-
                                                    strike
      -       prtr_silent               mc5i  5i    printer won't echo
      -                                             on screen
      +       prtr_silent               mc5i  5i    printer will not
      +                                             echo on screen
              row_addr_glitch           xvpa  YD    only positive motion
                                                    for vpa/mvpa caps
              semi_auto_right_margin    sam   YE    printing in last
                                                    column causes cr
              status_line_esc_ok        eslok es    escape can be used
                                                    on the status line
      -       tilde_glitch              hz    hz    can't print ~'s
      +       tilde_glitch              hz    hz    cannot print ~'s
                                                    (hazeltine)
              transparent_underline     ul    ul    underline character
                                                    overstrikes
      @@ -192,8 +241,8 @@
       
              These are the numeric capabilities:
       
      -            Variable         Cap-     TCap       Description
      -             Numeric         name     Code
      +            Variable         Cap-     TCap       Description
      +             Numeric         name     Code
              columns               cols     co     number of columns in
                                                    a line
              init_tabs             it       it     tabs initially every
      @@ -219,12 +268,12 @@
              maximum_windows       wnum     MW     maximum number of
                                                    defineable windows
              no_color_video        ncv      NC     video attributes
      -                                             that can't be used
      +                                             that cannot be used
                                                    with colors
      -       num_labels            nlab     Nl     number of labels on
      -                                             screen
       
       
      +       num_labels            nlab     Nl     number of labels on
      +                                             screen
              padding_baud_rate     pb       pb     lowest baud rate
                                                    where padding needed
              virtual_terminal      vt       vt     virtual terminal
      @@ -232,12 +281,12 @@
              width_status_line     wsl      ws     number of columns in
                                                    status line
       
      -       The following numeric  capabilities  are  present  in  the
      -       SVr4.0  term  structure, but are not yet documented in the
      +       The  following  numeric  capabilities  are  present in the
      +       SVr4.0 term structure, but are not yet documented  in  the
              man page.  They came in with SVr4's printer support.
       
      -             Variable         Cap-    TCap       Description
      -             Numeric          name    Code
      +             Variable         Cap-    TCap       Description
      +             Numeric          name    Code
              bit_image_entwining    bitwin  Yo     number of passes for
                                                    each bit-image row
              bit_image_type         bitype  Yp     type of bit-image
      @@ -275,14 +324,16 @@
                                                    in units per inch
              print_rate             cps     Ym     print rate in char-
                                                    acters per second
      +
      +
              wide_char_size         widcs   Yn     character step size
                                                    when in double wide
                                                    mode
       
              These are the string capabilities:
       
      -               Variable          Cap-   TCap     Description
      -                String           name   Code
      +               Variable          Cap-   TCap     Description
      +                String           name   Code
              acs_chars                 acsc   ac   graphics charset
                                                    pairs, based on
                                                    vt100
      @@ -327,12 +378,13 @@
              cursor_address            cup    cm   move to row #1
                                                    columns #2
              cursor_down               cud1   do   down one line
      +
      +
              cursor_home               home   ho   home cursor (if no
                                                    cup)
              cursor_invisible          civis  vi   make cursor invisi-
                                                    ble
              cursor_left               cub1   le   move left one space
      -
              cursor_mem_address        mrcup  CM   memory relative cur-
                                                    sor addressing, move
                                                    to row #1 columns #2
      @@ -381,12 +433,12 @@
                                                    riage motion
              enter_micro_mode          smicm  ZJ   Start micro-motion
                                                    mode
      +
              enter_near_letter_quality snlq   ZK   Enter NLQ mode
              enter_normal_quality      snrmq  ZL   Enter normal-quality
                                                    mode
              enter_protected_mode      prot   mp   turn on protected
                                                    mode
      -
              enter_reverse_mode        rev    mr   turn on reverse
                                                    video mode
              enter_secure_mode         invis  mk   turn on blank mode
      @@ -435,12 +487,12 @@
              flash_hook                hook   fh   flash switch hook
              flash_screen              flash  vb   visible bell (may
                                                    not move cursor)
      +
              form_feed                 ff     ff   hardcopy terminal
                                                    page eject (P*)
              from_status_line          fsl    fs   return from status
                                                    line
              goto_window               wingo  WG   go to window #1
      -
              hangup                    hup    HU   hang-up phone
              init_1string              is1    i1   initialization
                                                    string
      @@ -488,13 +540,14 @@
                                                    in insert mode
              key_end                   kend   @7   end key
              key_enter                 kent   @8   enter/send key
      +
      +
              key_eol                   kel    kE   clear-to-end-of-line
                                                    key
              key_eos                   ked    kS   clear-to-end-of-
                                                    screen key
              key_exit                  kext   @9   exit key
              key_f0                    kf0    k0   F0 function key
      -
              key_f1                    kf1    k1   F1 function key
              key_f10                   kf10   k;   F10 function key
              key_f11                   kf11   F1   F11 function key
      @@ -542,13 +595,13 @@
              key_f5                    kf5    k5   F5 function key
              key_f50                   kf50   Fe   F50 function key
              key_f51                   kf51   Ff   F51 function key
      +
              key_f52                   kf52   Fg   F52 function key
              key_f53                   kf53   Fh   F53 function key
              key_f54                   kf54   Fi   F54 function key
              key_f55                   kf55   Fj   F55 function key
              key_f56                   kf56   Fk   F56 function key
              key_f57                   kf57   Fl   F57 function key
      -
              key_f58                   kf58   Fm   F58 function key
              key_f59                   kf59   Fn   F59 function key
              key_f6                    kf6    k6   F6 function key
      @@ -596,13 +649,13 @@
                                                    key
              key_select                kslt   *6   select key
              key_send                  kEND   *7   shifted end key
      +
              key_seol                  kEOL   *8   shifted clear-to-
                                                    end-of-line key
              key_sexit                 kEXT   *9   shifted exit key
              key_sf                    kind   kF   scroll-forward key
              key_sfind                 kFND   *0   shifted find key
              key_shelp                 kHLP   #1   shifted help key
      -
              key_shome                 kHOM   #2   shifted home key
              key_sic                   kIC    #3   shifted insert-char-
                                                    acter key
      @@ -649,6 +702,8 @@
                                                    key f6 if not f6
              lab_f7                    lf7    l7   label on function
                                                    key f7 if not f7
      +
      +
              lab_f8                    lf8    l8   label on function
                                                    key f8 if not f8
              lab_f9                    lf9    l9   label on function
      @@ -656,7 +711,6 @@
              label_format              fln    Lf   label format
              label_off                 rmln   LF   turn off soft labels
              label_on                  smln   LO   turn on soft labels
      -
              meta_off                  rmm    mo   turn off meta mode
              meta_on                   smm    mm   turn on meta mode
                                                    (8th-bit on)
      @@ -703,14 +757,12 @@
                                                    sor in micro mode
              parm_rindex               rin    SR   scroll back #1 lines
                                                    (P)
      +
              parm_up_cursor            cuu    UP   up #1 lines (P*)
              parm_up_micro             mcuu   Zi   Like parm_up_cursor
                                                    in micro mode
              pkey_key                  pfkey  pk   program function key
                                                    #1 to type string #2
      -
      -
      -
              pkey_local                pfloc  pl   program function key
                                                    #1 to execute string
                                                    #2
      @@ -759,12 +811,11 @@
                                                    line #1 or (if smgtp
                                                    is not given) #2
                                                    lines from bottom
      +
              set_clock                 sclk   SC   set clock, #1 hrs #2
                                                    mins #3 secs
              set_color_pair            scp    sp   Set current color
                                                    pair to #1
      -
      -
              set_foreground            setf   Sf   Set foreground color
                                                    #1
              set_left_margin           smgl   ML   set left soft margin
      @@ -814,11 +865,11 @@
                                                    move past it
              up_half_line              hu     hu   half a line up
              user0                     u0     u0   User string #0
      +
              user1                     u1     u1   User string #1
              user2                     u2     u2   User string #2
              user3                     u3     u3   User string #3
              user4                     u4     u4   User string #4
      -
              user5                     u5     u5   User string #5
              user6                     u6     u6   User string #6
              user7                     u7     u7   User string #7
      @@ -830,12 +881,12 @@
              zero_motion               zerom  Zx   No motion for subse-
                                                    quent character
       
      -       The  following  string  capabilities  are  present  in the
      -       SVr4.0 term structure, but were originally not  documented
      +       The following  string  capabilities  are  present  in  the
      +       SVr4.0  term structure, but were originally not documented
              in the man page.
       
      -               Variable          Cap-     TCap    Description
      -                String           name     Code
      +               Variable          Cap-     TCap    Description
      +                String           name     Code
              alt_scancode_esc          scesa    S8   Alternate escape
                                                      for scancode emu-
                                                      lation
      @@ -868,11 +919,9 @@
                                                      mode
              exit_pc_charset_mode      rmpch    S3   Exit PC character
                                                      display mode
      +
              exit_scancode_mode        rmsc     S5   Exit PC scancode
                                                      mode
      -
      -
      -
              get_mouse                 getm     Gm   Curses should get
                                                      button events,
                                                      parameter #1 not
      @@ -891,15 +940,11 @@
                                                      position
              scancode_escape           scesc    S7   Escape for scan-
                                                      code emulation
      -       set0_des_seq              s0ds     s0   Shift to code set
      -                                               0 (EUC set 0,
      -                                               ASCII)
      -       set1_des_seq              s1ds     s1   Shift to code set
      -                                               1
      -       set2_des_seq              s2ds     s2   Shift to code set
      -                                               2
      -       set3_des_seq              s3ds     s3   Shift to code set
      -                                               3
      +       set0_des_seq              s0ds     s0   Shift to codeset 0
      +                                               (EUC set 0, ASCII)
      +       set1_des_seq              s1ds     s1   Shift to codeset 1
      +       set2_des_seq              s2ds     s2   Shift to codeset 2
      +       set3_des_seq              s3ds     s3   Shift to codeset 3
              set_a_background          setab    AB   Set background
                                                      color to #1, using
                                                      ANSI escape
      @@ -919,16 +964,17 @@
                                                      bottom margins to
                                                      #1, #2
       
      -        The XSI Curses  standard  added  these.   They  are  some
      -        post-4.1  versions  of System V curses, e.g., Solaris 2.5
      -        and IRIX 6.x.  The ncurses termcap  names  for  them  are
      +        The  XSI  Curses  standard  added  these.   They are some
      +        post-4.1 versions of System V curses, e.g.,  Solaris  2.5
      +        and  IRIX  6.x.   The  ncurses termcap names for them are
               invented; according to the XSI Curses standard, they have
      -        no termcap names.  If your compiled terminfo entries  use
      -        these,  they  may  not be binary-compatible with System V
      +        no  termcap names.  If your compiled terminfo entries use
      +        these, they may not be binary-compatible  with  System  V
               terminfo entries after SVr4.1; beware!
       
      -                Variable         Cap-   TCap     Description
      -                 String          name   Code
      +                Variable         Cap-   TCap     Description
      +
      +                 String          name   Code
               enter_horizontal_hl_mode ehhlm  Xh   Enter horizontal
                                                    highlight mode
               enter_left_hl_mode       elhlm  Xl   Enter left highlight
      @@ -949,9 +995,9 @@
                                                    an inch
       
       
      -   A Sample Entry
      +   A Sample Entry
              The following entry, describing an ANSI-standard terminal,
      -       is  representative  of  what a terminfo entry for a modern
      +       is representative of what a terminfo entry  for  a  modern
              terminal typically looks like.
       
            ansi|ansi/pc-term compatible with color,
      @@ -975,181 +1021,180 @@
                    sgr0=\E[0;10m, tbc=\E[2g, u6=\E[%d;%dR, u7=\E[6n,
                    u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%p1%dd,
       
      -       Entries may continue onto multiple lines by placing  white
      -       space  at  the  beginning  of  each line except the first.
      -       Comments may be included on lines  beginning  with  ``#''.
      -       Capabilities in terminfo are of three types: Boolean capa-
      +       Entries  may continue onto multiple lines by placing white
      +       space at the beginning of  each  line  except  the  first.
      +       Comments  may  be  included on lines beginning with ``#''.
      +       Capabilities in terminfo are of three types: Boolean capa-
              bilities which indicate that the terminal has some partic-
      -       ular  feature, numeric capabilities giving the size of the
      -       terminal or the size  of  particular  delays,  and  string
      -       capabilities,  which  give a sequence which can be used to
      +       ular feature, numeric capabilities giving the size of  the
      +       terminal  or  the  size  of  particular delays, and string
      +       capabilities, which give a sequence which can be  used  to
              perform particular terminal operations.
       
       
      -   Types of Capabilities
      -       All capabilities have names.  For instance, the fact  that
      -       ANSI-standard  terminals  have automatic margins (i.e., an
      -       automatic return and line-feed when the end of a  line  is
      -       reached)  is  indicated  by  the capability am.  Hence the
      -       description of ansi includes am.  Numeric capabilities are
      -       followed  by  the character `#' and then a positive value.
      -       Thus cols, which indicates the number of columns the  ter-
      -       minal  has,  gives  the  value  `80' for ansi.  Values for
      +   Types of Capabilities
      +       All  capabilities have names.  For instance, the fact that
      +       ANSI-standard terminals have automatic margins  (i.e.,  an
      +       automatic  return  and line-feed when the end of a line is
      +       reached) is indicated by the  capability  am.   Hence  the
      +       description of ansi includes am.  Numeric capabilities are
      +       followed by the character `#' and then a  positive  value.
      +       Thus  cols, which indicates the number of columns the ter-
      +       minal has, gives the value  `80'  for  ansi.   Values  for
              numeric capabilities may be specified in decimal, octal or
      -       hexadecimal,  using the C programming language conventions
      +       hexadecimal, using the C programming language  conventions
              (e.g., 255, 0377 and 0xff or 0xFF).
       
      -       Finally, string valued capabilities, such as el (clear  to
      +       Finally,  string valued capabilities, such as el (clear to
              end of line sequence) are given by the two-character code,
      -       an `=', and then a string ending  at  the  next  following
      +       an  `=',  and  then  a string ending at the next following
              `,'.
       
      -       A  number  of  escape sequences are provided in the string
      +       A number of escape sequences are provided  in  the  string
              valued capabilities for easy encoding of characters there.
      -       Both  \E  and  \e map to an ESCAPE character, ^x maps to a
      -       control-x for any appropriate x, and the sequences  \n  \l
      -       \r  \t  \b  \f  \s give a newline, line-feed, return, tab,
      -       backspace, form-feed, and space.  Other escapes include \^
      -       for  ^, \\ for \, \, for comma, \: for :, and \0 for null.
      -       (\0 will produce \200, which does not terminate  a  string
      +       Both \E and \e map to an ESCAPE character, ^x  maps  to  a
      +       control-x  for  any appropriate x, and the sequences \n \l
      +       \r \t \b \f \s give a  newline,  line-feed,  return,  tab,
      +       backspace, form-feed, and space.  Other escapes include \^
      +       for ^, \\ for \, \, for comma, \: for :, and \0 for  null.
      +       (\0  will  produce \200, which does not terminate a string
              but behaves as a null character on most terminals, provid-
      -       ing CS7 is specified.  See stty(1).)  Finally,  characters
      -       may be given as three octal digits after a \.
      +       ing  CS7 is specified.  See stty(1).)  Finally, characters
      +       may be given as three octal digits after a \.
       
      -       A  delay  in  milliseconds may appear anywhere in a string
      -       capability, enclosed in $<..> brackets, as in  el=\EK$<5>,
      -       and  padding  characters  are supplied by tputs to provide
      -       this delay.  The delay must be a number with at  most  one
      +       A delay in milliseconds may appear anywhere  in  a  string
      +       capability,  enclosed in $<..> brackets, as in el=\EK$<5>,
      +       and padding characters are supplied by  tputs  to  provide
      +       this  delay.   The delay must be a number with at most one
              decimal place of precision; it may be followed by suffixes
      -       `*' or '/' or both.  A  `*'  indicates  that  the  padding
      -       required  is  proportional to the number of lines affected
      -       by the  operation,  and  the  amount  given  is  the  per-
      -       affected-unit  padding  required.   (In the case of insert
      -       character,  the  factor  is  still  the  number  of  lines
      -       affected.)   Normally,  padding  is advisory if the device
      -       has the xon capability; it is used  for  cost  computation
      -       but  does not trigger delays.  A `/' suffix indicates that
      -       the padding is mandatory and forces a delay of  the  given
      -       number  of  milliseconds  even on devices for which xon is
      +       `*'  or  '/'  or  both.   A `*' indicates that the padding
      +       required is proportional to the number of  lines  affected
      +       by  the  operation,  and  the  amount  given  is  the per-
      +       affected-unit padding required.  (In the  case  of  insert
      +       character,  the  factor  is  still  the  number  of  lines
      +       affected.)  Normally, padding is advisory  if  the  device
      +       has  the  xon  capability; it is used for cost computation
      +       but does not trigger delays.  A `/' suffix indicates  that
      +       the  padding  is mandatory and forces a delay of the given
      +       number of milliseconds even on devices for  which  xon  is
              present to indicate flow control.
       
      -       Sometimes individual capabilities must be  commented  out.
      -       To  do this, put a period before the capability name.  For
      -       example, see the second ind in the example above.
      +       Sometimes  individual  capabilities must be commented out.
      +       To do this, put a period before the capability name.   For
      +       example, see the second ind in the example above.
       
      -
      -   Fetching Compiled Descriptions
      -       If the environment variable TERMINFO is set, it is  inter-
      -       preted  as the pathname of a directory containing the com-
      +   Fetching Compiled Descriptions
      +       If  the environment variable TERMINFO is set, it is inter-
      +       preted as the pathname of a directory containing the  com-
              piled description you are working on.  Only that directory
              is searched.
       
      -       If  TERMINFO  is  not set, the ncurses version of the ter-
      -       minfo reader code  will  instead  look  in  the  directory
      -       $HOME/.terminfo  for  a compiled description.  If it fails
      -       to find one  there,  and  the  environment  variable  TER-
      -       MINFO_DIRS  is set, it will interpret the contents of that
      -       variable as a list of colon- separated directories  to  be
      -       searched  (an  empty  entry is interpreted as a command to
      -       search /usr/share/terminfo).  If no description  is  found
      -       in  any of the TERMINFO_DIRS directories, the fetch fails.
      -
      -       If neither TERMINFO nor TERMINFO_DIRS  is  set,  the  last
      -       place   tried  will  be  the  system  terminfo  directory,
      -       /usr/share/terminfo.
      -
      -       (Neither the  $HOME/.terminfo  lookups  nor  TERMINFO_DIRS
      -       extensions   are  supported  under  stock  System  V  ter-
      +       If TERMINFO is not set, the ncurses version  of  the  ter-
      +       minfo  reader  code  will  instead  look  in the directory
      +       $HOME/.terminfo for a compiled description.  If  it  fails
      +       to  find  one  there,  and  the  environment variable TER-
      +       MINFO_DIRS is set, it will interpret the contents of  that
      +       variable  as  a list of colon- separated directories to be
      +       searched (an empty entry is interpreted as  a  command  to
      +       search  /usr/share/terminfo).   If no description is found
      +       in any of the TERMINFO_DIRS directories, the fetch  fails.
      +
      +       If  neither  TERMINFO  nor  TERMINFO_DIRS is set, the last
      +       place  tried  will  be  the  system  terminfo   directory,
      +       /usr/share/terminfo.
      +
      +       (Neither  the  $HOME/.terminfo  lookups  nor TERMINFO_DIRS
      +       extensions  are  supported  under  stock  System  V   ter-
              minfo/curses.)
       
       
      -   Preparing Descriptions
      -       We now outline how to prepare descriptions  of  terminals.
      -       The  most  effective way to prepare a terminal description
      -       is by imitating the description of a similar  terminal  in
      -       terminfo  and  to  build up a description gradually, using
      -       partial descriptions with vi or some other screen-oriented
      -       program  to  check that they are correct.  Be aware that a
      +   Preparing Descriptions
      +       We  now  outline how to prepare descriptions of terminals.
      +       The most effective way to prepare a  terminal  description
      +       is  by  imitating the description of a similar terminal in
      +       terminfo and to build up a  description  gradually,  using
      +       partial descriptions with vi or some other screen-oriented
      +       program to check that they are correct.  Be aware  that  a
              very unusual terminal may expose deficiencies in the abil-
      -       ity  of  the  terminfo  file to describe it or bugs in the
      +       ity of the terminfo file to describe it  or  bugs  in  the
              screen-handling code of the test program.
       
      -       To get the padding for insert line right (if the  terminal
      +       To  get the padding for insert line right (if the terminal
              manufacturer did not document it) a severe test is to edit
      -       a large file at 9600 baud, delete 16 or so lines from  the
      -       middle  of  the screen, then hit the `u' key several times
      -       quickly.  If the terminal messes up, more padding is  usu-
      -       ally  needed.  A similar test can be used for insert char-
      +       a  large file at 9600 baud, delete 16 or so lines from the
      +       middle of the screen, then hit the `u' key  several  times
      +       quickly.   If the terminal messes up, more padding is usu-
      +       ally needed.  A similar test can be used for insert  char-
              acter.
       
       
      -   Basic Capabilities
      -       The number of columns on each line  for  the  terminal  is
      -       given  by the cols numeric capability.  If the terminal is
      -       a CRT, then the number of lines on the screen is given  by
      -       the lines capability.  If the terminal wraps around to the
      -       beginning of the next  line  when  it  reaches  the  right
      -       margin,  then  it  should  have the am capability.  If the
      -       terminal can clear its screen, leaving the cursor  in  the
      -       home  position,  then  this  is  given by the clear string
      -       capability.  If  the  terminal  overstrikes  (rather  than
      -       clearing  a position when a character is struck over) then
      -       it should have the os capability.  If the  terminal  is  a
      -       printing terminal, with no soft copy unit, give it both hc
      -       and os.  (os applies to storage scope terminals,  such  as
      +   Basic Capabilities
      +       The  number  of  columns  on each line for the terminal is
      +       given by the cols numeric capability.  If the terminal  is
      +       a  CRT, then the number of lines on the screen is given by
      +       the lines capability.  If the terminal wraps around to the
      +       beginning  of the next line when it reaches the right mar-
      +       gin, then it should have the am capability.  If the termi-
      +       nal  can  clear its screen, leaving the cursor in the home
      +       position,  then  this  is  given  by  the   clear   string
      +       capability.   If  the  terminal  overstrikes  (rather than
      +       clearing a position when a character is struck over)  then
      +       it  should  have  the os capability.  If the terminal is a
      +       printing terminal, with no soft copy unit, give it both hc
      +       and  os.   (os applies to storage scope terminals, such as
              TEKTRONIX 4010 series, as well as hard copy and APL termi-
      -       nals.)  If there is a code to move the cursor to the  left
      -       edge  of the current row, give this as cr.  (Normally this
      -       will be carriage return, control M.)  If there is  a  code
      -       to  produce  an audible signal (bell, beep, etc) give this
      -       as bel.
      -
      -       If there is a code to move the cursor one position to  the
      -       left  (such  as backspace) that capability should be given
      -       as cub1.  Similarly, codes to move to the right,  up,  and
      -       down should be given as cuf1, cuu1, and cud1.  These local
      -       cursor motions should not alter the text they  pass  over,
      -       for  example,  you would not normally use `cuf1= ' because
      +       nals.)   If there is a code to move the cursor to the left
      +       edge of the current row, give this as cr.  (Normally  this
      +       will  be  carriage return, control M.)  If there is a code
      +       to produce an audible signal (bell, beep, etc)  give  this
      +       as bel.
      +
      +       If  there is a code to move the cursor one position to the
      +       left (such as backspace) that capability should  be  given
      +       as  cub1.   Similarly, codes to move to the right, up, and
      +       down should be given as cuf1, cuu1, and cud1.  These local
      +       cursor  motions  should not alter the text they pass over,
      +       for example, you would not normally use  `cuf1= '  because
              the space would erase the character moved over.
       
      -       A very important point  here  is  that  the  local  cursor
      -       motions  encoded in terminfo are undefined at the left and
      -       top edges  of  a  CRT  terminal.   Programs  should  never
      -       attempt  to  backspace  around the left edge, unless bw is
      +       A  very  important  point  here  is  that the local cursor
      +       motions encoded in terminfo are undefined at the left  and
      +       top  edges  of  a  CRT  terminal.   Programs  should never
      +       attempt to backspace around the left edge,  unless  bw  is
              given, and never attempt to go up locally off the top.  In
      -       order  to  scroll text up, a program will go to the bottom
      -       left corner of the screen and send the ind (index) string.
      +       order to scroll text up, a program will go to  the  bottom
      +       left corner of the screen and send the ind (index) string.
       
              To scroll text down, a program goes to the top left corner
      -       of the screen and sends the  ri  (reverse  index)  string.
      -       The  strings  ind  and  ri are undefined when not on their
      +       of  the  screen  and  sends the ri (reverse index) string.
      +       The strings ind and ri are undefined  when  not  on  their
              respective corners of the screen.
       
      -       Parameterized versions of the scrolling sequences are indn
      -       and rin which have the same semantics as ind and ri except
      -       that they take one parameter, and scroll that many  lines.
      -       They  are also undefined except at the appropriate edge of
      +       Parameterized versions of the scrolling sequences are indn
      +       and rin which have the same semantics as ind and ri except
      +       that  they take one parameter, and scroll that many lines.
      +       They are also undefined except at the appropriate edge  of
              the screen.
       
      -       The am capability tells whether the cursor sticks  at  the
      -       right  edge  of  the  screen when text is output, but this
      -       does not necessarily apply to a cuf1 from the last column.
      -       The  only local motion which is defined from the left edge
      -       is if bw is given, then a cub1 from  the  left  edge  will
      -       move  to the right edge of the previous row.  If bw is not
      -       given, the effect is undefined.  This is useful for  draw-
      -       ing  a box around the edge of the screen, for example.  If
      -       the terminal has switch selectable automatic margins,  the
      -       terminfo  file  usually assumes that this is on; i.e., am.
      -       If the terminal has a command which  moves  to  the  first
      -       column  of the next line, that command can be given as nel
      -       (newline).  It does not matter if the command  clears  the
      -       remainder  of  the current line, so if the terminal has no
      -       cr and lf it may still be possible to craft a working  nel
      +       The  am  capability tells whether the cursor sticks at the
      +       right edge of the screen when text  is  output,  but  this
      +       does not necessarily apply to a cuf1 from the last column.
      +       The only local motion which is defined from the left  edge
      +       is  if  bw  is  given, then a cub1 from the left edge will
      +       move to the right edge of the previous row.  If bw is  not
      +       given,  the effect is undefined.  This is useful for draw-
      +       ing a box around the edge of the screen, for example.   If
      +       the  terminal has switch selectable automatic margins, the
      +       terminfo file usually assumes that this is on;  i.e.,  am.
      +       If  the  terminal  has  a command which moves to the first
      +       column of the next line, that command can be given as  nel
      +       (newline).   It  does not matter if the command clears the
      +       remainder of the current line, so if the terminal  has  no
      +       cr  and lf it may still be possible to craft a working nel
              out of one or both of them.
       
              These  capabilities  suffice  to  describe  hard-copy  and
      -       "glass-tty" terminals.  Thus  the  model  33  teletype  is
      +       "glass-tty"  terminals.   Thus  the  model  33 teletype is
              described as
       
            33|tty33|tty|model 33 teletype,
      @@ -1162,42 +1207,41 @@
            ind=^J, lines#24,
       
       
      -   Parameterized Strings
      -       Cursor  addressing  and other strings requiring parameters
      -       in the terminal are described by  a  parameterized  string
      -       capability,  with  printf(3S)  like escapes %x in it.  For
      -       example, to address the  cursor,  the  cup  capability  is
      +   Parameterized Strings
      +       Cursor addressing and other strings  requiring  parameters
      +       in  the  terminal  are described by a parameterized string
      +       capability, with printf(3S) like escapes %x  in  it.   For
      +       example,  to  address  the  cursor,  the cup capability is
              given, using two parameters: the row and column to address
              to.  (Rows and columns are numbered from zero and refer to
              the physical screen visible to the user, not to any unseen
      -       memory.)  If  the  terminal  has  memory  relative  cursor
      -       addressing, that can be indicated by mrcup.
      +       memory.)   If  the  terminal  has  memory  relative cursor
      +       addressing, that can be indicated by mrcup.
       
      -       The  parameter  mechanism uses a stack and special % codes
      -       to manipulate it.  Typically a sequence will push  one  of
      -       the  parameters  onto  the stack and then print it in some
      +       The parameter mechanism uses a stack and special  %  codes
      +       to  manipulate  it.  Typically a sequence will push one of
      +       the parameters onto the stack and then print  it  in  some
              format.  Often more complex operations are necessary.
       
      -       The % encodings have the following meanings:
      +       The % encodings have the following meanings:
       
                   %%        outputs `%'
      -            %[[:]flags][width[.precision]][doxXs]
      -                      as in printf, flags are [-+#] and space
      +            %[[:]flags][width[.precision]][doxXs]
      +                      as in printf, flags are [-+#] and space
                   %c        print pop() like %c in printf()
                   %s        print pop() like %s in printf()
       
      -            %p[1-9]   push i'th parm
      +            %p[1-9]   push i'th parm
                   %P[a-z]   set dynamic variable [a-z] to pop()
                   %g[a-z]   get dynamic variable [a-z] and push it
                   %P[A-Z]   set static variable [a-z] to pop()
                   %g[A-Z]   get static variable [a-z] and push it
      -            %'c'      char constant c
      -            %{nn}     integer constant nn
      +            %'c'      char constant c
      +            %{nn}     integer constant nn
                   %l        push strlen(pop)
       
                   %+ %- %* %/ %m
                             arithmetic (%m is mod): push(pop() op pop())
      -
                   %& %| %^  bit operations: push(pop() op pop())
                   %= %> %<  logical operations: push(pop() op pop())
                   %A, %O    logical and & or operations (for conditionals)
      @@ -1211,281 +1255,281 @@
                             ci are conditions, bi are bodies.
       
              Binary operations are in postfix form with the operands in
      -       the  usual  order.   That  is,  to  get  x-5 one would use
      -       "%gx%{5}%-".  %P and %g variables  are  persistent  across
      +       the usual order.  That  is,  to  get  x-5  one  would  use
      +       "%gx%{5}%-".   %P  and  %g variables are persistent across
              escape-string evaluations.
       
              Consider the HP2645, which, to get to row 3 and column 12,
      -       needs to be sent \E&a12c03Y  padded  for  6  milliseconds.
      -       Note  that  the  order of the rows and columns is inverted
      -       here, and that the row and column are printed as two  dig-
      -       its.  Thus its cup capability is "cup=6\E&%p2%2dc%p1%2dY".
      +       needs  to  be  sent  \E&a12c03Y padded for 6 milliseconds.
      +       Note that the order of the rows and  columns  is  inverted
      +       here,  and that the row and column are printed as two dig-
      +       its.  Thus its cup capability is "cup=6\E&%p2%2dc%p1%2dY".
       
              The Microterm ACT-IV needs the current row and column sent
      -       preceded  by  a ^T, with the row and column simply encoded
      -       in binary, "cup=^T%p1%c%p2%c".  Terminals which  use  "%c"
      -       need  to  be  able  to backspace the cursor (cub1), and to
      -       move the cursor up one line on the screen (cuu1).  This is
      -       necessary  because it is not always safe to transmit \n ^D
      -       and \r, as the system may change or  discard  them.   (The
      -       library  routines  dealing  with terminfo set tty modes so
      +       preceded by a ^T, with the row and column  simply  encoded
      +       in  binary,  "cup=^T%p1%c%p2%c".  Terminals which use "%c"
      +       need to be able to backspace the  cursor  (cub1),  and  to
      +       move the cursor up one line on the screen (cuu1).  This is
      +       necessary because it is not always safe to transmit \n  ^D
      +       and  \r,  as  the system may change or discard them.  (The
      +       library routines dealing with terminfo set  tty  modes  so
              that tabs are never expanded, so \t is safe to send.  This
              turns out to be essential for the Ann Arbor 4080.)
       
              A final example is the LSI ADM-3a, which uses row and col-
              umn  offset  by  a  blank  character,  thus  "cup=\E=%p1%'
      -       '%+%c%p2%'  '%+%c".   After sending `\E=', this pushes the
      -       first parameter, pushes the ASCII value for a space  (32),
      -       adds  them  (pushing  the sum on the stack in place of the
      -       two previous values) and outputs that value as  a  charac-
      -       ter.   Then  the  same  is  done for the second parameter.
      +       '%+%c%p2%' '%+%c".  After sending `\E=', this  pushes  the
      +       first  parameter, pushes the ASCII value for a space (32),
      +       adds them (pushing the sum on the stack in  place  of  the
      +       two  previous  values) and outputs that value as a charac-
      +       ter.  Then the same is  done  for  the  second  parameter.
              More complex arithmetic is possible using the stack.
       
       
      -   Cursor Motions
      +   Cursor Motions
              If the terminal has a fast way to home the cursor (to very
      -       upper  left  corner  of  screen) then this can be given as
      -       home; similarly a fast way of getting to the  lower  left-
      -       hand  corner can be given as ll; this may involve going up
      -       with cuu1 from the home position,  but  a  program  should
      -       never  do this itself (unless ll does) because it can make
      -       no assumption about the effect of moving up from the  home
      -       position.   Note  that  the  home  position is the same as
      +       upper left corner of screen) then this  can  be  given  as
      +       home;  similarly  a fast way of getting to the lower left-
      +       hand corner can be given as ll; this may involve going  up
      +       with  cuu1  from  the  home position, but a program should
      +       never do this itself (unless ll does) because it can  make
      +       no  assumption about the effect of moving up from the home
      +       position.  Note that the home  position  is  the  same  as
              addressing to (0,0): to the top left corner of the screen,
      -       not  of  memory.   (Thus, the \EH sequence on HP terminals
      -       cannot be used for home.)
      +       not of memory.  (Thus, the \EH sequence  on  HP  terminals
      +       cannot be used for home.)
       
              If the terminal has row or column absolute cursor address-
      -       ing,  these  can be given as single parameter capabilities
      -       hpa (horizontal position absolute) and vpa (vertical posi-
      +       ing, these can be given as single  parameter  capabilities
      +       hpa (horizontal position absolute) and vpa (vertical posi-
              tion absolute).  Sometimes these are shorter than the more
      -       general two parameter sequence (as with  the  hp2645)  and
      -       can be used in preference to cup.  If there are parameter-
      -       ized local motions (e.g., move  n  spaces  to  the  right)
      -       these can be given as cud, cub, cuf, and cuu with a single
      -       parameter indicating how many spaces to move.   These  are
      -       primarily  useful  if the terminal does not have cup, such
      +       general  two  parameter  sequence (as with the hp2645) and
      +       can be used in preference to cup.  If there are parameter-
      +       ized  local  motions  (e.g.,  move  n spaces to the right)
      +       these can be given as cud, cub, cuf, and cuu with a single
      +       parameter  indicating  how many spaces to move.  These are
      +       primarily useful if the terminal does not have  cup,  such
              as the TEKTRONIX 4025.
       
              If the terminal needs to be in a special mode when running
              a program that uses these capabilities, the codes to enter
      -       and exit this mode can be given as smcup and rmcup.   This
      -       arises,  for example, from terminals like the Concept with
      -       more than one page of memory.  If the  terminal  has  only
      -       memory  relative cursor addressing and not screen relative
      +       and  exit this mode can be given as smcup and rmcup.  This
      +       arises, for example, from terminals like the Concept  with
      +       more  than  one  page of memory.  If the terminal has only
      +       memory relative cursor addressing and not screen  relative
              cursor addressing, a one screen-sized window must be fixed
      -       into  the terminal for cursor addressing to work properly.
      -       This is also used for the TEKTRONIX 4025, where smcup sets
      -       the  command character to be the one used by terminfo.  If
      -       the smcup sequence will not restore the  screen  after  an
      -       rmcup sequence is output (to the state prior to outputting
      -       rmcup), specify nrrmc.
      +       into the terminal for cursor addressing to work  properly.
      +       This is also used for the TEKTRONIX 4025, where smcup sets
      +       the command character to be the one used by terminfo.   If
      +       the  smcup  sequence  will not restore the screen after an
      +       rmcup sequence is output (to the state prior to outputting
      +       rmcup), specify nrrmc.
       
       
      -   Area Clears
      +   Area Clears
              If the terminal can clear from the current position to the
      -       end  of  the  line,  leaving  the cursor where it is, this
      -       should be given as el.  If the terminal can clear from the
      -       beginning  of  the line to the current position inclusive,
      -       leaving the cursor where it is, this should  be  given  as
      -       el1.   If the terminal can clear from the current position
      -       to the end of the display, then this should  be  given  as
      -       ed.   Ed  is only defined from the first column of a line.
      -       (Thus, it can be simulated by a request to delete a  large
      -       number of lines, if a true ed is not available.)
      -
      -
      -   Insert/delete line and vertical motions
      -       If  the terminal can open a new blank line before the line
      -       where the cursor is, this should be given as il1; this  is
      -       done  only  from the first position of a line.  The cursor
      +       end of the line, leaving the  cursor  where  it  is,  this
      +       should be given as el.  If the terminal can clear from the
      +       beginning of the line to the current  position  inclusive,
      +       leaving  the  cursor  where it is, this should be given as
      +       el1.  If the terminal can clear from the current  position
      +       to  the  end  of the display, then this should be given as
      +       ed.  Ed is only defined from the first column of  a  line.
      +       (Thus,  it can be simulated by a request to delete a large
      +       number of lines, if a true ed is not available.)
      +
      +
      +   Insert/delete line and vertical motions
      +       If the terminal can open a new blank line before the  line
      +       where  the cursor is, this should be given as il1; this is
      +       done only from the first position of a line.   The  cursor
              must then appear on the newly blank line.  If the terminal
      -       can  delete  the  line  which  the cursor is on, then this
      -       should be given as dl1; this is done only from  the  first
      -       position  on  the line to be deleted.  Versions of il1 and
      -       dl1 which take a single parameter  and  insert  or  delete
      -       that many lines can be given as il and dl.
      -
      -       If  the terminal has a settable scrolling region (like the
      -       vt100) the command to set this can be described  with  the
      -       csr  capability,  which  takes two parameters: the top and
      +       can delete the line which the  cursor  is  on,  then  this
      +       should  be  given as dl1; this is done only from the first
      +       position on the line to be deleted.  Versions of  il1  and
      +       dl1  which  take  a  single parameter and insert or delete
      +       that many lines can be given as il and dl.
      +
      +       If the terminal has a settable scrolling region (like  the
      +       vt100)  the  command to set this can be described with the
      +       csr capability, which takes two parameters:  the  top  and
              bottom lines of the scrolling region.  The cursor position
              is, alas, undefined after using this command.
       
      -       It  is possible to get the effect of insert or delete line
      -       using csr on a properly chosen region; the sc and rc (save
      -       and  restore  cursor)  commands may be useful for ensuring
      -       that your synthesized insert/delete string does  not  move
      -       the  cursor.  (Note that the ncurses(3x) library does this
      -       synthesis  automatically,  so   you   need   not   compose
      -       insert/delete strings for an entry with csr).
      +       It is possible to get the effect of insert or delete  line
      +       using csr on a properly chosen region; the sc and rc (save
      +       and restore cursor) commands may be  useful  for  ensuring
      +       that  your  synthesized insert/delete string does not move
      +       the cursor.  (Note that the ncurses(3x) library does  this
      +       synthesis   automatically,   so   you   need  not  compose
      +       insert/delete strings for an entry with csr).
       
              Yet another way to construct insert and delete might be to
      -       use a combination of index with  the  memory-lock  feature
      -       found  on some terminals (like the HP-700/90 series, which
      +       use  a  combination  of index with the memory-lock feature
      +       found on some terminals (like the HP-700/90 series,  which
              however also has insert/delete).
       
      -       Inserting lines at the top or bottom  of  the  screen  can
      -       also  be  done using ri or ind on many terminals without a
      -       true insert/delete line, and is often faster even on  ter-
      +       Inserting  lines  at  the  top or bottom of the screen can
      +       also be done using ri or ind on many terminals  without  a
      +       true  insert/delete line, and is often faster even on ter-
              minals with those features.
       
      -       The  boolean  non_dest_scroll_region should be set if each
      -       scrolling window is effectively a view port on  a  screen-
      -       sized  canvas.   To  test  for  this  capability, create a
      -       scrolling region in the middle of the screen, write  some-
      -       thing  to  the  bottom line, move the cursor to the top of
      -       the region, and do ri followed by dl1 or ind.  If the data
      -       scrolled  off  the  bottom  of  the  region  by the ri re-
      -       appears, then scrolling is non-destructive.  System V  and
      -       XSI  Curses  expect that ind, ri, indn, and rin will simu-
      -       late destructive scrolling; their  documentation  cautions
      -       you  not  to  define csr unless this is true.  This curses
      +       The boolean non_dest_scroll_region should be set  if  each
      +       scrolling  window  is effectively a view port on a screen-
      +       sized canvas.  To  test  for  this  capability,  create  a
      +       scrolling  region in the middle of the screen, write some-
      +       thing to the bottom line, move the cursor to  the  top  of
      +       the region, and do ri followed by dl1 or ind.  If the data
      +       scrolled off the bottom  of  the  region  by  the  ri  re-
      +       appears,  then scrolling is non-destructive.  System V and
      +       XSI Curses expect that ind, ri, indn, and rin  will  simu-
      +       late  destructive  scrolling; their documentation cautions
      +       you not to define csr unless this is  true.   This  curses
              implementation is more liberal and will do explicit erases
      -       after scrolling if ndstr is defined.
      +       after scrolling if ndstr is defined.
       
              If the terminal has the ability to define a window as part
      -       of memory, which all commands affect, it should  be  given
      -       as the parameterized string wind.  The four parameters are
      -       the starting and ending lines in memory and  the  starting
      +       of  memory,  which all commands affect, it should be given
      +       as the parameterized string wind.  The four parameters are
      +       the  starting  and ending lines in memory and the starting
              and ending columns in memory, in that order.
       
      -       If  the terminal can retain display memory above, then the
      -       da capability should be given; if display  memory  can  be
      -       retained  below,  then db should be given.  These indicate
      -       that deleting a line  or  scrolling  may  bring  non-blank
      -       lines  up  from  below  or that scrolling back with ri may
      +       If the terminal can retain display memory above, then  the
      +       da  capability  should  be given; if display memory can be
      +       retained below, then db should be given.   These  indicate
      +       that  deleting  a  line  or  scrolling may bring non-blank
      +       lines up from below or that scrolling  back  with  ri  may
              bring down non-blank lines.
       
       
      -   Insert/Delete Character
      -       There are two basic kinds of  intelligent  terminals  with
      -       respect  to insert/delete character which can be described
      -       using terminfo.  The most common  insert/delete  character
      -       operations  affect only the characters on the current line
      -       and shift characters off the  end  of  the  line  rigidly.
      -       Other  terminals,  such  as the Concept 100 and the Perkin
      -       Elmer Owl, make a distinction between  typed  and  untyped
      -       blanks  on  the  screen, shifting upon an insert or delete
      -       only to an untyped blank on the  screen  which  is  either
      -       eliminated,  or  expanded  to two untyped blanks.  You can
      -       determine the kind of terminal you have  by  clearing  the
      -       screen  and  then typing text separated by cursor motions.
      -       Type "abc    def" using local cursor motions (not  spaces)
      +   Insert/Delete Character
      +       There  are  two  basic kinds of intelligent terminals with
      +       respect to insert/delete character which can be  described
      +       using  terminfo.   The most common insert/delete character
      +       operations affect only the characters on the current  line
      +       and  shift  characters  off  the  end of the line rigidly.
      +       Other terminals, such as the Concept 100  and  the  Perkin
      +       Elmer  Owl,  make  a distinction between typed and untyped
      +       blanks on the screen, shifting upon an  insert  or  delete
      +       only  to  an  untyped  blank on the screen which is either
      +       eliminated, or expanded to two untyped  blanks.   You  can
      +       determine  the  kind  of terminal you have by clearing the
      +       screen and then typing text separated by  cursor  motions.
      +       Type  "abc    def" using local cursor motions (not spaces)
              between the "abc" and the "def".  Then position the cursor
      -       before the "abc" and put the terminal in insert mode.   If
      -       typing  characters  causes  the  rest of the line to shift
      +       before  the "abc" and put the terminal in insert mode.  If
      +       typing characters causes the rest of  the  line  to  shift
              rigidly and characters to fall off the end, then your ter-
      -       minal  does  not  distinguish  between  blanks and untyped
      -       positions.  If the "abc" shifts over to  the  "def"  which
      -       then  move together around the end of the current line and
      -       onto the next as you insert, you have the second  type  of
      -       terminal,  and should give the capability in, which stands
      +       minal does not  distinguish  between  blanks  and  untyped
      +       positions.   If  the  "abc" shifts over to the "def" which
      +       then move together around the end of the current line  and
      +       onto  the  next as you insert, you have the second type of
      +       terminal, and should give the capability in, which  stands
              for "insert null".  While these are two logically separate
      -       attributes  (one line vs. multi-line insert mode, and spe-
      -       cial treatment of untyped spaces) we have seen  no  termi-
      -       nals whose insert mode cannot be described with the single
      -       attribute.
      +       attributes (one line versus multi-line  insert  mode,  and
      +       special  treatment of untyped spaces) we have seen no ter-
      +       minals whose insert mode cannot be described with the sin-
      +       gle attribute.
       
      -       Terminfo can describe both terminals which have an  insert
      +       Terminfo  can describe both terminals which have an insert
              mode, and terminals which send a simple sequence to open a
      -       blank position on the current  line.   Give  as  smir  the
      -       sequence  to  get  into  insert  mode.   Give  as rmir the
      -       sequence to leave insert  mode.   Now  give  as  ich1  any
      +       blank  position  on  the  current  line.  Give as smir the
      +       sequence to get  into  insert  mode.   Give  as  rmir  the
      +       sequence  to  leave  insert  mode.   Now  give as ich1 any
              sequence needed to be sent just before sending the charac-
      -       ter to be inserted.  Most terminals  with  a  true  insert
      -       mode  will  not give ich1; terminals which send a sequence
      +       ter  to  be  inserted.   Most terminals with a true insert
      +       mode will not give ich1; terminals which send  a  sequence
              to open a screen position should give it here.
       
      -       If your terminal has both, insert mode is usually  prefer-
      -       able  to  ich1.   Technically,  you  should  not give both
      -       unless the terminal actually requires both to be  used  in
      -       combination.   Accordingly,  some  non-curses applications
      -       get confused if both are present; the symptom  is  doubled
      +       If  your terminal has both, insert mode is usually prefer-
      +       able to ich1.   Technically,  you  should  not  give  both
      +       unless  the  terminal actually requires both to be used in
      +       combination.  Accordingly,  some  non-curses  applications
      +       get  confused  if both are present; the symptom is doubled
              characters in an update using insert.  This requirement is
      -       now rare; most ich sequences do not require previous smir,
      -       and most smir insert modes do not require ich1 before each
      -       character.  Therefore, the  new  curses  actually  assumes
      -       this  is the case and uses either rmir/smir or ich/ich1 as
      +       now rare; most ich sequences do not require previous smir,
      +       and most smir insert modes do not require ich1 before each
      +       character.   Therefore,  the  new  curses actually assumes
      +       this is the case and uses either rmir/smir or ich/ich1  as
              appropriate (but not both).  If you have to write an entry
      -       to  be  used under new curses for a terminal old enough to
      -       need both, include the rmir/smir sequences in ich1.
      +       to be used under new curses for a terminal old  enough  to
      +       need both, include the rmir/smir sequences in ich1.
       
              If post insert padding is needed, give this as a number of
      -       milliseconds  in ip (a string option).  Any other sequence
      -       which may need to be sent after  an  insert  of  a  single
      -       character may also be given in ip.  If your terminal needs
      +       milliseconds in ip (a string option).  Any other  sequence
      +       which  may  need  to  be  sent after an insert of a single
      +       character may also be given in ip.  If your terminal needs
              both to be placed into an `insert mode' and a special code
      -       to  precede  each  inserted character, then both smir/rmir
      -       and ich1 can be given, and both will  be  used.   The  ich
      -       capability, with one parameter, n, will repeat the effects
      -       of ich1 n times.
      +       to precede each inserted character,  then  both  smir/rmir
      +       and  ich1  can  be  given, and both will be used.  The ich
      +       capability, with one parameter, n, will repeat the effects
      +       of ich1 n times.
       
              If padding is necessary between characters typed while not
      -       in  insert  mode,  give  this  as a number of milliseconds
      -       padding in rmp.
      -
      -       It is occasionally  necessary  to  move  around  while  in
      -       insert  mode  to delete characters on the same line (e.g.,
      -       if there is a tab after the insertion position).  If  your
      -       terminal  allows  motion while in insert mode you can give
      -       the capability mir to speed up  inserting  in  this  case.
      -       Omitting  mir  will  affect  only  speed.   Some terminals
      -       (notably Datamedia's) must not have mir because of the way
      +       in insert mode, give this  as  a  number  of  milliseconds
      +       padding in rmp.
      +
      +       It  is  occasionally  necessary  to  move  around while in
      +       insert mode to delete characters on the same  line  (e.g.,
      +       if  there is a tab after the insertion position).  If your
      +       terminal allows motion while in insert mode you  can  give
      +       the  capability  mir  to  speed up inserting in this case.
      +       Omitting mir  will  affect  only  speed.   Some  terminals
      +       (notably Datamedia's) must not have mir because of the way
              their insert mode works.
       
      -       Finally,  you  can specify dch1 to delete a single charac-
      -       ter, dch with one parameter, n, to  delete  n  characters,
      -       and  delete mode by giving smdc and rmdc to enter and exit
      -       delete mode (any mode the terminal needs to be  placed  in
      -       for dch1 to work).
      +       Finally, you can specify dch1 to delete a  single  charac-
      +       ter,  dch  with  one parameter, n, to delete n characters,
      +       and delete mode by giving smdc and rmdc to enter and  exit
      +       delete  mode  (any mode the terminal needs to be placed in
      +       for dch1 to work).
       
      -       A  command to erase n characters (equivalent to outputting
      -       n blanks without moving the cursor) can be  given  as  ech
      +       A command to erase n characters (equivalent to  outputting
      +       n  blanks  without  moving the cursor) can be given as ech
              with one parameter.
       
       
      -   Highlighting, Underlining, and Visible Bells
      +   Highlighting, Underlining, and Visible Bells
              If  your  terminal  has  one  or  more  kinds  of  display
      -       attributes, these can be represented in a number  of  dif-
      -       ferent ways.  You should choose one display form as stand-
      -       out mode, representing a good, high contrast, easy-on-the-
      -       eyes,  format  for  highlighting  error messages and other
      -       attention getters.  (If you have a choice,  reverse  video
      -       plus  half-bright  is  good, or reverse video alone.)  The
      -       sequences to enter and exit standout  mode  are  given  as
      -       smso  and  rmso, respectively.  If the code to change into
      -       or out of standout mode  leaves  one  or  even  two  blank
      -       spaces  on the screen, as the TVI 912 and Teleray 1061 do,
      -       then xmc should be given to tell how many spaces are left.
      -
      -       Codes  to  begin  underlining  and  end underlining can be
      -       given as smul and rmul respectively.  If the terminal  has
      -       a  code  to  underline  the current character and move the
      +       attributes,  these  can be represented in a number of dif-
      +       ferent ways.  You should choose one display form as stand-
      +       out mode, representing a good, high contrast, easy-on-the-
      +       eyes, format for highlighting  error  messages  and  other
      +       attention  getters.   (If you have a choice, reverse video
      +       plus half-bright is good, or reverse  video  alone.)   The
      +       sequences  to  enter  and  exit standout mode are given as
      +       smso and rmso, respectively.  If the code to  change  into
      +       or  out  of  standout  mode  leaves  one or even two blank
      +       spaces on the screen, as the TVI 912 and Teleray 1061  do,
      +       then xmc should be given to tell how many spaces are left.
      +
      +       Codes to begin underlining  and  end  underlining  can  be
      +       given  as smul and rmul respectively.  If the terminal has
      +       a code to underline the current  character  and  move  the
              cursor one space to the right, such as the Microterm Mime,
      -       this can be given as uc.
      -
      -       Other  capabilities  to  enter  various highlighting modes
      -       include blink (blinking) bold (bold or extra  bright)  dim
      -       (dim  or  half-bright)  invis (blanking or invisible text)
      -       prot (protected) rev (reverse video) sgr0  (turn  off  all
      -       attribute  modes)  smacs  (enter  alternate  character set
      -       mode) and  rmacs  (exit  alternate  character  set  mode).
      -       Turning  on  any of these modes singly may or may not turn
      +       this can be given as uc.
      +
      +       Other capabilities to  enter  various  highlighting  modes
      +       include  blink  (blinking) bold (bold or extra bright) dim
      +       (dim or half-bright) invis (blanking  or  invisible  text)
      +       prot  (protected)  rev  (reverse video) sgr0 (turn off all
      +       attribute modes)  smacs  (enter  alternate  character  set
      +       mode)  and  rmacs  (exit  alternate  character  set mode).
      +       Turning on any of these modes singly may or may  not  turn
              off other modes.
       
      -       If there is a sequence to set  arbitrary  combinations  of
      -       modes,  this should be given as sgr (set attributes), tak-
      -       ing 9 parameters.  Each parameter is either 0 or  nonzero,
      +       If  there  is  a sequence to set arbitrary combinations of
      +       modes, this should be given as sgr (set attributes),  tak-
      +       ing  9 parameters.  Each parameter is either 0 or nonzero,
              as the corresponding attribute is on or off.  The 9 param-
      -       eters are, in order: standout, underline, reverse,  blink,
      -       dim,  bold,  blank, protect, alternate character set.  Not
      -       all modes need be supported by sgr, only those  for  which
      +       eters  are, in order: standout, underline, reverse, blink,
      +       dim, bold, blank, protect, alternate character  set.   Not
      +       all  modes  need be supported by sgr, only those for which
              corresponding separate attribute commands exist.
       
              For example, the DEC vt220 supports most of the modes:
       
      -           tparm parameter   attribute    escape sequence
      +           tparm parameter   attribute    escape sequence
       
                  none              none         \E[0m
                  p1                standout     \E[0;1;7m
      @@ -1498,33 +1542,33 @@
                  p8                protect      not used
                  p9                altcharset   ^O (off) ^N (on)
       
      -       We  begin each escape sequence by turning off any existing
      -       modes, since there is no quick way  to  determine  whether
      +       We begin each escape sequence by turning off any  existing
      +       modes,  since  there  is no quick way to determine whether
              they are active.  Standout is set up to be the combination
      -       of reverse and bold.  The vt220  terminal  has  a  protect
      -       mode,  though  it  is  not commonly used in sgr because it
      -       protects characters on the screen  from  the  host's  era-
      -       sures.   The  altcharset mode also is different in that it
      -       is either ^O or ^N, depending on whether it is off or  on.
      -       If  all  modes  are  turned  on, the resulting sequence is
      +       of  reverse  and  bold.   The vt220 terminal has a protect
      +       mode, though it is not commonly used  in  sgr  because  it
      +       protects  characters  on  the  screen from the host's era-
      +       sures.  The altcharset mode also is different in  that  it
      +       is  either ^O or ^N, depending on whether it is off or on.
      +       If all modes are turned  on,  the  resulting  sequence  is
              \E[0;1;4;5;7;8m^N.
       
      -       Some sequences are common to different modes.   For  exam-
      -       ple,  ;7  is output when either p1 or p3 is true, that is,
      +       Some  sequences  are common to different modes.  For exam-
      +       ple, ;7 is output when either p1 or p3 is true,  that  is,
              if either standout or reverse modes are turned on.
       
      -       Writing out the above sequences, along with  their  depen-
      +       Writing  out  the above sequences, along with their depen-
              dencies yields
       
      -         sequence    when to output     terminfo translation
      +         sequence    when to output     terminfo translation
       
                \E[0       always              \E[0
                ;1         if p1 or p6         %?%p1%p6%|%t;1%;
                ;4         if p2               %?%p2%|%t;4%;
      -
                ;5         if p4               %?%p4%|%t;5%;
                ;7         if p1 or p3         %?%p1%p3%|%t;7%;
                ;8         if p7               %?%p7%|%t;8%;
      +
                m          always              m
                ^N or ^O   if p9 ^N, else ^O   %?%p9%t^N%e^O%;
       
      @@ -1533,147 +1577,148 @@
                  sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
                      %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
       
      -       Remember  that  if  you specify sgr, you must also specify
      +       Remember that if you specify sgr, you  must  also  specify
              sgr0.
       
      -       Terminals with the ``magic cookie'' glitch  (xmc)  deposit
      -       special   ``cookies''   when   they  receive  mode-setting
      -       sequences, which affect the display algorithm rather  than
      -       having  extra  bits  for  each character.  Some terminals,
      -       such as the HP 2621,  automatically  leave  standout  mode
      -       when  they  move to a new line or the cursor is addressed.
      -       Programs using standout mode  should  exit  standout  mode
      -       before  moving the cursor or sending a newline, unless the
      -       msgr capability, asserting that it  is  safe  to  move  in
      +       Terminals  with  the ``magic cookie'' glitch (xmc) deposit
      +       special  ``cookies''  when   they   receive   mode-setting
      +       sequences,  which affect the display algorithm rather than
      +       having extra bits for  each  character.   Some  terminals,
      +       such  as  the  HP  2621, automatically leave standout mode
      +       when they move to a new line or the cursor  is  addressed.
      +       Programs  using  standout  mode  should exit standout mode
      +       before moving the cursor or sending a newline, unless  the
      +       msgr  capability,  asserting  that  it  is safe to move in
              standout mode, is present.
       
      -       If  the terminal has a way of flashing the screen to indi-
      -       cate an error quietly (a bell replacement) then  this  can
      -       be given as flash; it must not move the cursor.
      +       If the terminal has a way of flashing the screen to  indi-
      +       cate  an  error quietly (a bell replacement) then this can
      +       be given as flash; it must not move the cursor.
       
      -       If  the  cursor  needs to be made more visible than normal
      +       If the cursor needs to be made more  visible  than  normal
              when it is not on the bottom line (to make, for example, a
      -       non-blinking  underline  into  an  easier to find block or
      -       blinking underline) give this sequence as cvvis.  If there
      -       is  a  way  to  make the cursor completely invisible, give
      -       that as civis.  The capability cnorm should be given which
      +       non-blinking underline into an easier  to  find  block  or
      +       blinking underline) give this sequence as cvvis.  If there
      +       is a way to make the  cursor  completely  invisible,  give
      +       that as civis.  The capability cnorm should be given which
              undoes the effects of both of these modes.
       
              If your terminal correctly generates underlined characters
      -       (with no special codes needed) even  though  it  does  not
      -       overstrike,  then you should give the capability ul.  If a
      -       character overstriking another leaves both  characters  on
      -       the screen, specify the capability os.  If overstrikes are
      -       erasable with a blank, then this should  be  indicated  by
      -       giving eo.
      +       (with  no  special  codes  needed) even though it does not
      +       overstrike, then you should give the capability ul.  If  a
      +       character  overstriking  another leaves both characters on
      +       the screen, specify the capability os.  If overstrikes are
      +       erasable  with  a  blank, then this should be indicated by
      +       giving eo.
       
       
      -   Keypad and Function Keys
      +   Keypad and Function Keys
              If the terminal has a keypad that transmits codes when the
      -       keys are pressed, this information can be given. Note that
      -       it  is  not  possible to handle terminals where the keypad
      -       only works in local (this applies,  for  example,  to  the
      -       unshifted  HP  2621  keys).   If  the keypad can be set to
      -       transmit or not transmit, give these  codes  as  smkx  and
      -       rmkx.  Otherwise the keypad is assumed to always transmit.
      -       The codes sent by the left arrow, right arrow,  up  arrow,
      -       down  arrow,  and  home keys can be given as kcub1, kcuf1,
      -       kcuu1, kcud1, and khome respectively.  If there are  func-
      -       tion  keys  such  as f0, f1, ..., f10, the codes they send
      -       can be given as kf0, kf1, ..., kf10.  If these  keys  have
      -       labels  other  than the default f0 through f10, the labels
      -       can be given as lf0, lf1, ..., lf10.  The codes  transmit-
      -       ted  by certain other special keys can be given: kll (home
      -       down), kbs  (backspace),  ktbc  (clear  all  tabs),  kctab
      -       (clear the tab stop in this column), kclr (clear screen or
      -       erase key), kdch1 (delete character), kdl1 (delete  line),
      -       krmir  (exit insert mode), kel (clear to end of line), ked
      -       (clear to end of screen), kich1 (insert character or enter
      -       insert  mode),  kil1  (insert  line), knp (next page), kpp
      -       (previous page), kind (scroll forward/down),  kri  (scroll
      -       backward/up),  khts  (set  a tab stop in this column).  In
      -       addition, if the keypad has a 3 by 3 array of keys includ-
      -       ing  the four arrow keys, the other five keys can be given
      -       as ka1, ka3, kb2, kc1, and kc3.   These  keys  are  useful
      -       when the effects of a 3 by 3 directional pad are needed.
      -
      -       Strings  to  program  function keys can be given as pfkey,
      -       pfloc, and pfx.  A string to program screen labels  should
      -       be  specified  as  pln.   Each  of these strings takes two
      +       keys  are  pressed,  this  information can be given.  Note
      +       that it is not possible to handle terminals where the key-
      +       pad only works in local (this applies, for example, to the
      +       unshifted HP 2621 keys).  If the  keypad  can  be  set  to
      +       transmit  or  not  transmit,  give these codes as smkx and
      +       rmkx.  Otherwise the keypad is assumed to always transmit.
      +       The  codes  sent by the left arrow, right arrow, up arrow,
      +       down arrow, and home keys can be given  as  kcub1,  kcuf1,
      +       kcuu1,  kcud1,  and  khome  respectively.   If  there  are
      +       function keys such as f0, f1, ...,  f10,  the  codes  they
      +       send  can  be given as kf0, kf1, ..., kf10.  If these keys
      +       have labels other than the default  f0  through  f10,  the
      +       labels  can  be  given  as lf0, lf1, ..., lf10.  The codes
      +       transmitted by certain other special keys  can  be  given:
      +       kll  (home  down), kbs (backspace), ktbc (clear all tabs),
      +       kctab (clear the tab stop in  this  column),  kclr  (clear
      +       screen  or  erase  key),  kdch1  (delete  character), kdl1
      +       (delete line), krmir (exit insert mode), kel (clear to end
      +       of  line),  ked  (clear  to  end of screen), kich1 (insert
      +       character or enter insert mode), kil1 (insert  line),  knp
      +       (next  page),  kpp  (previous  page),  kind  (scroll  for-
      +       ward/down), kri (scroll backward/up), khts (set a tab stop
      +       in  this column).  In addition, if the keypad has a 3 by 3
      +       array of keys including the four  arrow  keys,  the  other
      +       five  keys  can  be  given as ka1, ka3, kb2, kc1, and kc3.
      +       These keys are useful when the effects of a 3 by 3  direc-
      +       tional pad are needed.
      +
      +       Strings  to  program  function keys can be given as pfkey,
      +       pfloc, and pfx.  A string to program screen labels  should
      +       be  specified  as  pln.   Each  of these strings takes two
              parameters: the function key number to program (from 0  to
              10)  and the string to program it with.  Function key num-
              bers out of this range may program  undefined  keys  in  a
              terminal  dependent  manner.   The  difference between the
      -       capabilities is that pfkey causes pressing the  given  key
      -       to  be the same as the user typing the given string; pfloc
      +       capabilities is that pfkey causes pressing the  given  key
      +       to  be the same as the user typing the given string; pfloc
              causes the string to be executed by the terminal in local;
      -       and  pfx  causes  the string to be transmitted to the com-
      +       and  pfx  causes  the string to be transmitted to the com-
              puter.
       
      -       The capabilities nlab, lw and lh define the number of pro-
      +       The capabilities nlab, lw and lh define the number of pro-
              grammable  screen  labels  and their width and height.  If
              there are commands to turn the labels  on  and  off,  give
      -       them  in smln and rmln.  smln is normally output after one
      +       them  in smln and rmln.  smln is normally output after one
              or more pln sequences to make sure that the change becomes
              visible.
       
       
      -   Tabs and Initialization
      +   Tabs and Initialization
              If  the terminal has hardware tabs, the command to advance
      -       to the next tab stop can be given as ht  (usually  control
      +       to the next tab stop can be given as ht  (usually  control
              I).   A  ``back-tab''  command which moves leftward to the
      -       preceding tab stop can be given as cbt.  By convention, if
      +       preceding tab stop can be given as cbt.  By convention, if
              the  teletype  modes indicate that tabs are being expanded
              by the computer rather than being sent  to  the  terminal,
      -       programs  should  not  use ht or cbt even if they are pre-
      +       programs  should  not  use ht or cbt even if they are pre-
              sent, since the user may not have the tab  stops  properly
              set.   If  the  terminal  has hardware tabs which are ini-
      -       tially set every n spaces when the terminal is powered up,
      -       the  numeric  parameter it is given, showing the number of
      +       tially set every n spaces when the terminal is powered up,
      +       the  numeric  parameter it is given, showing the number of
              spaces the tabs are set to.  This is normally used by  the
      -       tset  command  to  determine  whether  to set the mode for
      +       tset  command  to  determine  whether  to set the mode for
              hardware tab expansion, and whether to set the tab  stops.
              If  the  terminal  has tab stops that can be saved in non-
              volatile memory, the terminfo description can assume  that
              they are properly set.
       
      -       Other  capabilities include is1, is2, and is3, initializa-
      -       tion strings for the terminal, iprog, the path name  of  a
      -       program  to be run to initialize the terminal, and if, the
      +       Other  capabilities include is1, is2, and is3, initializa-
      +       tion strings for the terminal, iprog, the path name  of  a
      +       program  to be run to initialize the terminal, and if, the
              name of a file  containing  long  initialization  strings.
              These  strings are expected to set the terminal into modes
              consistent with the  rest  of  the  terminfo  description.
      -       They are normally sent to the terminal, by the init option
      -       of the tput program, each time the  user  logs  in.   They
      +       They are normally sent to the terminal, by the init option
      +       of the tput program, each time the  user  logs  in.   They
              will  be  printed  in the following order: run the program
      -       iprog; output is1; is2; set the margins  using  mgc,  smgl
      -       and  smgr;  set tabs using tbc and hts; print the file if;
      -       and finally output is3.
      +       iprog; output is1; is2; set the margins  using  mgc,  smgl
      +       and  smgr;  set tabs using tbc and hts; print the file if;
      +       and finally output is3.
       
      -       Most initialization is done with  is2.   Special  terminal
      +       Most initialization is done with  is2.   Special  terminal
              modes can be set up without duplicating strings by putting
      -       the common sequences in is2 and special cases in  is1  and
      -       is3.   A pair of sequences that does a harder reset from a
      -       totally unknown state can be  analogously  given  as  rs1,
      -       rs2,  rf, and rs3, analogous to is2 and if.  These strings
      -       are output by the reset program, which is  used  when  the
      +       the common sequences in is2 and special cases in  is1  and
      +       is3.   A pair of sequences that does a harder reset from a
      +       totally unknown state can be  analogously  given  as  rs1,
      +       rs2,  rf, and rs3, analogous to is2 and if.  These strings
      +       are output by the reset program, which is  used  when  the
              terminal  gets into a wedged state.  Commands are normally
      -       placed in rs1, rs2 rs3 and rf only if they produce  annoy-
      +       placed in rs1, rs2 rs3 and rf only if they produce  annoy-
              ing  effects on the screen and are not necessary when log-
              ging in.  For example, the command to set the  vt100  into
      -       80-column  mode  would  normally  be  part  of is2, but it
      +       80-column  mode  would  normally  be  part  of is2, but it
              causes an annoying glitch of the screen and  is  not  nor-
              mally  needed  since the terminal is usually already in 80
              column mode.
       
              If there are commands to set and clear tab stops, they can
      -       be  given  as tbc (clear all tab stops) and hts (set a tab
      +       be  given  as tbc (clear all tab stops) and hts (set a tab
              stop in the current column of every row).  If a more  com-
              plex  sequence  is  needed  to  set  the  tabs than can be
      -       described by this, the sequence can be placed  in  is2  or
      -       if.
      +       described by this, the sequence can be placed  in  is2  or
      +       if.
       
      -   Delays and Padding
      +   Delays and Padding
              Many  older  and  slower  terminals  don't  support either
              XON/XOFF or DTR handshaking, including hard copy terminals
              and  some  very  archaic CRTs (including, for example, DEC
      @@ -1682,7 +1727,7 @@
       
              If the terminal uses xon/xoff handshaking for flow control
              (that is, it automatically emits ^S back to the host  when
      -       its input buffers are close to full), set xon.  This capa-
      +       its input buffers are close to full), set xon.  This capa-
              bility suppresses the emission of padding.  You  can  also
              set  it for memory-mapped console devices effectively that
              don't have a  speed  limit.   Padding  information  should
      @@ -1690,61 +1735,61 @@
              sions about relative costs, but actual pad characters will
              not be transmitted.
       
      -       If  pb (padding baud rate) is given, padding is suppressed
      -       at baud rates below the value of pb.  If the entry has  no
      +       If  pb (padding baud rate) is given, padding is suppressed
      +       at baud rates below the value of pb.  If the entry has  no
              padding  baud rate, then whether padding is emitted or not
      -       is completely controlled by xon.
      +       is completely controlled by xon.
       
              If the terminal requires other than a null (zero)  charac-
      -       ter  as  a  pad,  then this can be given as pad.  Only the
      -       first character of the pad string is used.
      +       ter  as  a  pad,  then this can be given as pad.  Only the
      +       first character of the pad string is used.
       
       
      -   Status Lines
      +   Status Lines
              Some terminals have an extra `status line'  which  is  not
              normally  used  by  software  (and thus not counted in the
      -       terminal's lines capability).
      +       terminal's lines capability).
       
              The simplest case  is  a  status  line  which  is  cursor-
              addressable  but  not part of the main scrolling region on
              the screen; the Heathkit H19 has a  status  line  of  this
              kind,  as  would  a 24-line VT100 with a 23-line scrolling
              region set up on initialization.  This situation is  indi-
      -       cated by the hs capability.
      +       cated by the hs capability.
       
              Some terminals with status lines need special sequences to
              access the status line.   These  may  be  expressed  as  a
      -       string with single parameter tsl which takes the cursor to
      +       string with single parameter tsl which takes the cursor to
              a given zero-origin column on the status line.  The  capa-
      -       bility fsl must return to the main-screen cursor positions
      -       before the last tsl.  You may need  to  embed  the  string
      -       values  of sc (save cursor) and rc (restore cursor) in tsl
      -       and fsl to accomplish this.
      +       bility fsl must return to the main-screen cursor positions
      +       before the last tsl.  You may need  to  embed  the  string
      +       values  of sc (save cursor) and rc (restore cursor) in tsl
      +       and fsl to accomplish this.
       
              The status line is normally assumed to be the  same  width
              as  the width of the terminal.  If this is untrue, you can
      -       specify it with the numeric capability wsl.
      +       specify it with the numeric capability wsl.
       
              A command to erase or blank the status line may be  speci-
      -       fied as dsl.
      +       fied as dsl.
       
      -       The   boolean   capability  eslok  specifies  that  escape
      -       sequences, tabs, etc. work ordinarily in the status  line.
      +       The   boolean   capability  eslok  specifies  that  escape
      +       sequences, tabs, etc., work ordinarily in the status line.
       
      -       The  ncurses  implementation does not yet use any of these
      +       The  ncurses  implementation does not yet use any of these
              capabilities.  They are documented here in case they  ever
              become important.
       
       
      -   Line Graphics
      +   Line Graphics
              Many  terminals  have  alternate character sets useful for
      -       forms-drawing.  Terminfo and curses build in  support  for
      +       forms-drawing.  Terminfo and curses build in  support  for
              the  drawing  characters supported by the VT100, with some
              characters from the AT&T  4410v1  added.   This  alternate
      -       character set may be specified by the acsc capability.
      +       character set may be specified by the acsc capability.
       
      -                Glyph             ACS            Ascii      VT100
      -                 Name             Name           Default    Name
      +                Glyph             ACS            Ascii      VT100
      +                 Name             Name           Default    Name
              UK pound sign              ACS_STERLING   f          }
              arrow pointing down        ACS_DARROW     v          .
              arrow pointing left        ACS_LARROW     <          ,
      @@ -1781,13 +1826,13 @@
              The  best  way to define a new device's graphics set is to
              add a column to a copy of this table  for  your  terminal,
              giving   the   character   which   (when  emitted  between
      -       smacs/rmacs switches) will be rendered as the  correspond-
      +       smacs/rmacs switches) will be rendered as the  correspond-
              ing  graphic.  Then read off the VT100/your terminal char-
              acter pairs right to left in sequence;  these  become  the
              ACSC string.
       
       
      -   Color Handling
      +   Color Handling
              Most  color  terminals are either `Tektronix-like' or `HP-
              like'.  Tektronix-like terminals have a predefined set  of
              N  colors  (where N usually 8), and can set character-cell
      @@ -1799,75 +1844,75 @@
              ANSI-compatible terminals are Tektronix-like.
       
              Some basic color capabilities are independent of the color
      -       method.  The numeric capabilities colors and pairs specify
      +       method.  The numeric capabilities colors and pairs specify
              the  maximum numbers of colors and color-pairs that can be
      -       displayed simultaneously.  The op (original  pair)  string
      +       displayed simultaneously.  The op (original  pair)  string
              resets  foreground  and background colors to their default
      -       values for the terminal.  The oc string resets all  colors
      +       values for the terminal.  The oc string resets all  colors
              or  color-pairs  to their default values for the terminal.
              Some terminals  (including  many  PC  terminal  emulators)
              erase  screen  areas  with  the  current  background color
              rather than the power-up default background; these  should
      -       have the boolean capability bce.
      +       have the boolean capability bce.
       
              To  change the current foreground or background color on a
      -       Tektronix-type terminal, use setaf (set  ANSI  foreground)
      -       and  setab  (set ANSI background) or setf (set foreground)
      -       and setb (set background).  These take one parameter,  the
      +       Tektronix-type terminal, use setaf (set  ANSI  foreground)
      +       and  setab  (set ANSI background) or setf (set foreground)
      +       and setb (set background).  These take one parameter,  the
              color  number.   The  SVr4  documentation  describes  only
      -       setaf/setab; the XPG4 draft says  that  "If  the  terminal
      +       setaf/setab; the XPG4 draft says  that  "If  the  terminal
              supports ANSI escape sequences to set background and fore-
      -       ground, they should be coded as setaf and  setab,  respec-
      +       ground, they should be coded as setaf and  setab,  respec-
              tively.   If  the terminal supports other escape sequences
              to set background and foreground, they should be coded  as
      -       setf  and  setb, respectively.  The vidputs() function and
      -       the refresh functions use setaf  and  setab  if  they  are
      +       setf  and  setb, respectively.  The vidputs() function and
      +       the refresh functions use setaf  and  setab  if  they  are
              defined."
       
      -       The  setaf/setab  and setf/setb capabilities take a single
      +       The  setaf/setab  and setf/setb capabilities take a single
              numeric argument each.  Argument values 0-7  are  portably
              defined  as  follows  (the  middle  column is the symbolic
      -       #define available in the header for the curses or  ncurses
      +       #define available in the header for the curses or  ncurses
              libraries).  The terminal hardware is free to map these as
              it likes, but the RGB values indicate normal locations  in
              color space.
       
      -             Color       #define       Value       RGB
      -             black     COLOR_BLACK       0     0, 0, 0
      -             red       COLOR_RED         1     max,0,0
      -             green     COLOR_GREEN       2     0,max,0
      -             yellow    COLOR_YELLOW      3     max,max,0
      -             blue      COLOR_BLUE        4     0,0,max
      -             magenta   COLOR_MAGENTA     5     max,0,max
      -             cyan      COLOR_CYAN        6     0,max,max
      -             white     COLOR_WHITE       7     max,max,max
      -
      -       On  an  HP-like terminal, use scp with a color-pair number
      +             Color       #define       Value       RGB
      +             black     COLOR_BLACK       0     0, 0, 0
      +             red       COLOR_RED         1     max,0,0
      +             green     COLOR_GREEN       2     0,max,0
      +             yellow    COLOR_YELLOW      3     max,max,0
      +             blue      COLOR_BLUE        4     0,0,max
      +             magenta   COLOR_MAGENTA     5     max,0,max
      +             cyan      COLOR_CYAN        6     0,max,max
      +             white     COLOR_WHITE       7     max,max,max
      +
      +       On  an  HP-like terminal, use scp with a color-pair number
              parameter to set which color pair is current.
       
      -       On a Tektronix-like terminal, the capability  ccc  may  be
      +       On a Tektronix-like terminal, the capability  ccc  may  be
              present  to  indicate that colors can be modified.  If so,
      -       the initc capability will take a color number (0 to colors
      +       the initc capability will take a color number (0 to colors
              -  1)and  three  more parameters which describe the color.
              These three parameters default to being interpreted as RGB
      -       (Red,  Green, Blue) values.  If the boolean capability hls
      +       (Red,  Green, Blue) values.  If the boolean capability hls
              is present, they are instead as HLS (Hue, Lightness, Satu-
              ration) indices.  The ranges are terminal-dependent.
       
      -       On  an  HP-like  terminal, initp may give a capability for
      +       On  an  HP-like  terminal, initp may give a capability for
              changing a color-pair value.  It will take  seven  parame-
      -       ters;  a  color-pair  number (0 to max_pairs - 1), and two
      +       ters;  a  color-pair  number (0 to max_pairs - 1), and two
              triples describing first background  and  then  foreground
              colors.   These  parameters  must be (Red, Green, Blue) or
      -       (Hue, Lightness, Saturation) depending on hls.
      +       (Hue, Lightness, Saturation) depending on hls.
       
              On some color terminals, colors collide  with  highlights.
      -       You can register these collisions with the ncv capability.
      +       You can register these collisions with the ncv capability.
              This is a bit-mask of attributes not to be used when  col-
              ors  are  enabled.  The correspondence with the attributes
      -       understood by curses is as follows:
      +       understood by curses is as follows:
       
      -                      Attribute      Bit   Decimal
      +                      Attribute      Bit   Decimal
                             A_STANDOUT     0     1
                             A_UNDERLINE    1     2
                             A_REVERSE      2     4
      @@ -1880,100 +1925,100 @@
       
              For example,  on  many  IBM  PC  consoles,  the  underline
              attribute  collides  with the foreground color blue and is
      -       not available in color mode.  These  should  have  an  ncv
      +       not available in color mode.  These  should  have  an  ncv
              capability of 2.
       
      -       SVr4  curses  does nothing with ncv, ncurses recognizes it
      +       SVr4  curses  does nothing with ncv, ncurses recognizes it
              and optimizes the output in favor of colors.
       
       
      -   Miscellaneous
      +   Miscellaneous
              If the terminal requires other than a null (zero)  charac-
              ter  as  a  pad,  then this can be given as pad.  Only the
              first character of the pad string is used.  If the  termi-
              nal does not have a pad character, specify npc.  Note that
      -       ncurses implements  the  termcap-compatible  PC  variable;
      +       ncurses implements  the  termcap-compatible  PC  variable;
              though  the  application  may  set this value to something
      -       other than a null, ncurses will test  npc  first  and  use
      +       other than a null, ncurses will test  npc  first  and  use
              napms if the terminal has no pad character.
       
              If  the terminal can move up or down half a line, this can
      -       be indicated with hu  (half-line  up)  and  hd  (half-line
      -       down).   This  is  primarily  useful  for superscripts and
      -       subscripts on hard-copy terminals.  If a hard-copy  termi-
      -       nal  can  eject to the next page (form feed), give this as
      -       ff (usually control L).
      +       be indicated with hu  (half-line  up)  and  hd  (half-line
      +       down).  This is primarily useful for superscripts and sub-
      +       scripts on hard-copy terminals.  If a  hard-copy  terminal
      +       can  eject  to  the next page (form feed), give this as ff
      +       (usually control L).
       
              If there is a command to repeat a given character a  given
              number  of times (to save time transmitting a large number
              of identical characters) this can be  indicated  with  the
      -       parameterized  string  rep.   The  first  parameter is the
      +       parameterized  string  rep.   The  first  parameter is the
              character to be repeated and the second is the  number  of
              times  to repeat it.  Thus, tparm(repeat_char, 'x', 10) is
              the same as `xxxxxxxxxx'.
       
              If the terminal has a settable command character, such  as
      -       the  TEKTRONIX  4025, this can be indicated with cmdch.  A
      +       the  TEKTRONIX  4025, this can be indicated with cmdch.  A
              prototype command character is chosen which is used in all
      -       capabilities.   This character is given in the cmdch capa-
      +       capabilities.   This character is given in the cmdch capa-
              bility to identify it.  The following convention  is  sup-
              ported  on  some  UNIX  systems:  The environment is to be
      -       searched for a CC variable, and if found, all  occurrences
      +       searched for a CC variable, and if found, all  occurrences
              of the prototype character are replaced with the character
              in the environment variable.
       
              Terminal descriptions that do  not  represent  a  specific
      -       kind of known terminal, such as switch, dialup, patch, and
      -       network, should include the  gn  (generic)  capability  so
      +       kind of known terminal, such as switch, dialup, patch, and
      +       network, should include the  gn  (generic)  capability  so
              that  programs  can  complain that they do not know how to
              talk to the terminal.  (This capability does not apply  to
      -       virtual   terminal   descriptions  for  which  the  escape
      +       virtual   terminal   descriptions  for  which  the  escape
              sequences are known.)
       
              If the terminal has a ``meta key'' which acts as  a  shift
              key,  setting  the  8th  bit of any character transmitted,
      -       this fact can be indicated with km.   Otherwise,  software
      +       this fact can be indicated with km.   Otherwise,  software
              will assume that the 8th bit is parity and it will usually
              be cleared.  If strings exist to turn this  ``meta  mode''
      -       on and off, they can be given as smm and rmm.
      +       on and off, they can be given as smm and rmm.
       
              If  the terminal has more lines of memory than will fit on
              the screen at once, the number of lines of memory  can  be
      -       indicated  with  lm.   A  value of lm#0 indicates that the
      +       indicated  with  lm.   A  value of lm#0 indicates that the
              number of lines is not fixed, but that there is still more
              memory than fits on the screen.
       
              If the terminal is one of those supported by the UNIX vir-
              tual terminal protocol, the terminal number can  be  given
      -       as vt.
      +       as vt.
       
              Media copy strings which control an auxiliary printer con-
      -       nected to the terminal can be given as mc0: print the con-
      -       tents  of  the screen, mc4: turn off the printer, and mc5:
      +       nected to the terminal can be given as mc0: print the con-
      +       tents  of  the screen, mc4: turn off the printer, and mc5:
              turn on the printer.  When the printer  is  on,  all  text
              sent  to  the terminal will be sent to the printer.  It is
              undefined whether the text is also displayed on the termi-
      -       nal screen when the printer is on.  A variation mc5p takes
      +       nal screen when the printer is on.  A variation mc5p takes
              one parameter, and leaves the printer on for as many char-
              acters  as  the  value  of  the  parameter, then turns the
              printer off.  The parameter should not  exceed  255.   All
      -       text,  including  mc4,  is  transparently  passed  to  the
      -       printer while an mc5p is in effect.
      +       text,  including  mc4,  is  transparently  passed  to  the
      +       printer while an mc5p is in effect.
       
       
      -   Glitches and Braindamage
      +   Glitches and Braindamage
              Hazeltine terminals, which do not allow `~' characters  to
      -       be displayed should indicate hz.
      +       be displayed should indicate hz.
       
      -       Terminals which ignore a line-feed immediately after an am
      -       wrap, such as the Concept and vt100, should indicate xenl.
      +       Terminals which ignore a line-feed immediately after an am
      +       wrap, such as the Concept and vt100, should indicate xenl.
       
      -       If  el  is  required  to  get  rid of standout (instead of
      -       merely writing normal text on top of it),  xhp  should  be
      +       If  el  is  required  to  get  rid of standout (instead of
      +       merely writing normal text on top of it),  xhp  should  be
              given.
       
              Teleray  terminals,  where  tabs turn all characters moved
      -       over to blanks, should  indicate  xt  (destructive  tabs).
      +       over to blanks, should  indicate  xt  (destructive  tabs).
              Note:    the    variable    indicating    this    is   now
              `dest_tabs_magic_smso'; in older  versions,  it  was  tel-
              eray_glitch.  This glitch is also taken to mean that it is
      @@ -1983,7 +2028,7 @@
              tation ignores this glitch.
       
              The  Beehive Superbee, which is unable to correctly trans-
      -       mit the escape or control C characters, has xsb,  indicat-
      +       mit the escape or control C characters, has xsb,  indicat-
              ing  that the f1 key is used for escape and f2 for control
              C.  (Only certain Superbees have this  problem,  depending
              on  the  ROM.)  Note that in older terminfo versions, this
      @@ -1991,35 +2036,34 @@
              `no_esc_ctl_c'.
       
              Other  specific  terminal  problems  may  be  corrected by
      -       adding more capabilities of the form xx.
      +       adding more capabilities of the form xx.
       
       
      -   Similar Terminals
      +   Similar Terminals
              If there are two very similar terminals, one (the variant)
              can  be  defined  as  being just like the other (the base)
              with certain exceptions.  In the definition of  the  vari-
      -       ant,  the string capability use can be given with the name
      -       of the base terminal.  The capabilities given  before  use
      -       override  those  in  the base type named by use.  If there
      -       are multiple use capabilities, they are merged in  reverse
      -       order.   That is, the rightmost use reference is processed
      +       ant,  the string capability use can be given with the name
      +       of the base terminal.  The capabilities given  before  use
      +       override  those  in  the base type named by use.  If there
      +       are multiple use capabilities, they are merged in  reverse
      +       order.   That is, the rightmost use reference is processed
              first, then the one to its left, and so forth.   Capabili-
              ties  given explicitly in the entry override those brought
      -       in by use references.
      +       in by use references.
       
      -       A capability can be canceled by placing xx@ to the left of
      -       the  use  reference that imports it, where xx is the capa-
      +       A capability can be canceled by placing xx@ to the left of
      +       the  use  reference that imports it, where xx is the capa-
              bility.  For example, the entry
      -
                          2621-nl, smkx@, rmkx@, use=2621,
       
      -       defines a 2621-nl that does not  have  the  smkx  or  rmkx
      +       defines a 2621-nl that does not  have  the  smkx  or  rmkx
              capabilities,  and hence does not turn on the function key
              labels when in visual mode.  This is useful for  different
              modes for a terminal, or for different user preferences.
       
       
      -   Pitfalls of Long Entries
      +   Pitfalls of Long Entries
              Long  terminfo  entries  are  unlikely to be a problem; to
              date, no entry has even approached terminfo's  4K  string-
              table  maximum.   Unfortunately,  the termcap translations
      @@ -2097,13 +2141,13 @@
              minal types and users whose TERM variable does not have  a
              termcap entry.
       
      -       When in -C (translate to termcap) mode, the ncurses imple-
      -       mentation of tic(1) issues warning messages when the  pre-
      +       When in -C (translate to termcap) mode, the ncurses imple-
      +       mentation of tic(1) issues warning messages when the  pre-
              tc  length  of  a termcap translation is too long.  The -c
              (check) option also checks resolved (after  tc  expansion)
              lengths.
       
      -   Binary Compatibility
      +   Binary Compatibility
              It  is not wise to count on portability of binary terminfo
              entries between commercial UNIX versions.  The problem  is
              that  there  are  at least two versions of terminfo (under
      @@ -2115,30 +2159,31 @@
       
       

      EXTENSIONS

      -       Some  SVr4  curses  implementations,  and  all previous to
      +       Some  SVr4  curses  implementations,  and  all previous to
              SVr4, don't interpret the %A and %O operators in parameter
              strings.
      -       SVr4/XPG4  do  not  specify whether msgr licenses movement
      +
      +       SVr4/XPG4  do  not  specify whether msgr licenses movement
              while in an alternate-character-set mode (such modes  may,
              among other things, map CR and NL to characters that don't
      -       trigger  local  motions).   The   ncurses   implementation
      -       ignores  msgr  in ALTCHARSET mode.  This raises the possi-
      +       trigger  local  motions).   The   ncurses   implementation
      +       ignores  msgr  in ALTCHARSET mode.  This raises the possi-
              bility that an XPG4  implementation  making  the  opposite
      -       interpretation  may need terminfo entries made for ncurses
      -       to have msgr turned off.
      +       interpretation  may need terminfo entries made for ncurses
      +       to have msgr turned off.
       
      -       The ncurses library handles insert-character  and  insert-
      -       character modes in a slightly non-standard way in order to
      -       get better update efficiency.  See the Insert/Delete Char-
      -       acter subsection above.
      +       The ncurses library handles insert-character  and  insert-
      +       character modes in a slightly non-standard way to get bet-
      +       ter update efficiency.  See  the  Insert/Delete  Character
      +       subsection above.
       
      -       The   parameter   substitutions  for  set_clock  and  dis-
      -       play_clock are not documented in SVr4 or  the  XSI  Curses
      +       The   parameter   substitutions  for  set_clock  and  dis-
      +       play_clock are not documented in SVr4 or  the  XSI  Curses
              standard.  They are deduced from the documentation for the
              AT&T 505 terminal.
       
      -       Be careful assigning the kmous  capability.   The  ncurses
      -       wants  to  interpret it as KEY_MOUSE, for use by terminals
      +       Be careful assigning the kmous  capability.   The  ncurses
      +       wants  to  interpret it as KEY_MOUSE, for use by terminals
              and emulators like xterm that  can  return  mouse-tracking
              information in the keyboard-input stream.
       
      @@ -2147,28 +2192,28 @@
              cases) different extension sets.  Here is a summary, accu-
              rate as of October 1995:
       
      -       SVR4, Solaris, ncurses -- These support all SVr4 capabili-
      +       SVR4, Solaris, ncurses -- These support all SVr4 capabili-
              ties.
       
      -       SGI  --  Supports  the  SVr4  set,  adds  one undocumented
      -       extended string capability (set_pglen).
      +       SGI  --  Supports  the  SVr4  set,  adds  one undocumented
      +       extended string capability (set_pglen).
       
      -       SVr1, Ultrix -- These support a restricted subset of  ter-
      -       minfo  capabilities.   The booleans end with xon_xoff; the
      -       numerics with  width_status_line;  and  the  strings  with
      -       prtr_non.
      +       SVr1, Ultrix -- These support a restricted subset of  ter-
      +       minfo  capabilities.   The booleans end with xon_xoff; the
      +       numerics with  width_status_line;  and  the  strings  with
      +       prtr_non.
       
      -       HP/UX  --  Supports  the  SVr1  subset,  plus the SVr[234]
      -       numerics num_labels, label_height, label_width, plus func-
      -       tion  keys  11  through  63, plus plab_norm, label_on, and
      -       label_off, plus some incompatible extensions in the string
      +       HP/UX  --  Supports  the  SVr1  subset,  plus the SVr[234]
      +       numerics num_labels, label_height, label_width, plus func-
      +       tion  keys  11  through  63, plus plab_norm, label_on, and
      +       label_off, plus some incompatible extensions in the string
              table.
       
      -       AIX  --  Supports  the  SVr1 subset, plus function keys 11
      +       AIX  --  Supports  the  SVr1 subset, plus function keys 11
              through 63, plus a number  of  incompatible  string  table
              extensions.
       
      -       OSF  -- Supports both the SVr4 set and the AIX extensions.
      +       OSF  -- Supports both the SVr4 set and the AIX extensions.
       
       
       
      @@ -2177,9 +2222,10 @@ descriptions +

      SEE ALSO

      -       tic(1m), curses(3x), printf(3S), term(5).
      +       tic(1m), curses(3x), printf(3S), term(5).
       
       
       
      @@ -2229,6 +2275,8 @@ + + diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html index eddb8195..e7963e61 100644 --- a/doc/html/man/tic.1m.html +++ b/doc/html/man/tic.1m.html @@ -1,156 +1,199 @@ + + + +tic 1m + + + +

      tic 1m

      +
       
       
       

      NAME

      -       tic - the terminfo entry-description compiler
      +       tic - the terminfo entry-description compiler
       
       
       

      SYNOPSIS

      -       tic  [-1CINRTVacfrsx]  [-e names] [-o dir] [-v[n]] [-w[n]]
      -       file
      +       tic  [-1CGILNTVacfgrstx]  [-e  names] [-o dir] [-R subset]
      +       [-v[n]] [-w[n]] file
       
       
       

      DESCRIPTION

      -       The command tic translates a  terminfo  file  from  source
      +       The command tic translates a  terminfo  file  from  source
              format  into compiled format.  The compiled format is nec-
      -       essary for use with the library routines in ncurses(3x).
      +       essary for use with the library routines in ncurses(3x).
       
              The results are normally placed  in  the  system  terminfo
      -       directory  /usr/share/terminfo.   There  are  two  ways to
      +       directory  /usr/share/terminfo.   There  are  two  ways to
              change this behavior.
       
              First, you may override the system default by setting  the
      -       variable  TERMINFO  in  your  shell environment to a valid
      +       variable  TERMINFO  in  your  shell environment to a valid
              (existing) directory name.
       
      -       Secondly, if tic cannot get access to  /usr/share/terminfo
      +       Secondly, if tic cannot get access to  /usr/share/terminfo
              or  your  TERMINFO  directory,  it looks for the directory
      -       $HOME/.terminfo; if that directory exists,  the  entry  is
      +       $HOME/.terminfo; if that directory exists,  the  entry  is
              placed there.
       
              Libraries that read terminfo entries are expected to check
      -       for a TERMINFO directory first, look at $HOME/.terminfo if
      -       TERMINFO  is  not set, and finally look in /usr/share/ter-
      -       minfo.
      +       for a TERMINFO directory first, look at $HOME/.terminfo if
      +       TERMINFO  is  not set, and finally look in /usr/share/ter-
      +       minfo.
      +
      +       -1     restricts the output to a single column
       
      -       -a     tells  tic  to  retain  commented-out  capabilities
      +       -a     tells  tic  to  retain  commented-out  capabilities
                     rather than discarding them.  Capabilities are com-
                     mented by prefixing them with a period.  This  sets
      -              the  -x option, because it treats the commented-out
      +              the  -x option, because it treats the commented-out
                     entries as user-defined names.
       
      -       -c     tells tic to only check file for errors,  including
      +       -C     Force source translation to termcap format.   Note:
      +              this  differs  from the -C option of infocmp(1m) in
      +              that it does not merely translate capability names,
      +              but  also  translates  terminfo  strings to termcap
      +              format.  Capabilities that are not translatable are
      +              left  in  the  entry under their terminfo names but
      +              commented out with two preceding dots.
      +
      +       -c     tells tic to only check file for errors,  including
                     syntax  problems and bad use links.  If you specify
      -              -C (-I) with this option, the code will print warn-
      +              -C (-I) with this option, the code will print warn-
                     ings about entries which, after use resolution, are
                     more than 1023 (4096) bytes long.  Due to  a  fixed
                     buffer  length  in  older  termcap libraries (and a
                     documented limit in terminfo),  these  entries  may
                     cause core dumps.
       
      -       -vn    specifies that (verbose) output be written to stan-
      -              dard  error   trace   information   showing   tic's
      -              progress.   The optional integer n is a number from
      -              1 to 10, inclusive, indicating the desired level of
      -              detail  of  information.   If  n  is  omitted,  the
      -              default level is 1.  If n is specified and  greater
      -              than 1, the level of detail is increased.
      -
      -       -odir  Write   compiled   entries   to   given  directory.
      -              Overrides the TERMINFO environment variable.
      -
      -       -wn    specifies the width of the output.
      -
      -       -1     restricts the output to a single column
      +       -e names
      +              Limit  writes  and  translations  to  the following
      +              comma-separated list of terminals.  If any name  or
      +              alias of a terminal matches one of the names in the
      +              list, the entry will be written  or  translated  as
      +              normal.   Otherwise no output will be generated for
      +              it.  The option value is interpreted as a file con-
      +              taining  the  list  if  it  contains a '/'.  (Note:
      +              depending on how tic was compiled, this option  may
      +              require -I or -C.)
       
      -       -C     Force source translation to termcap format.   Note:
      -              this  differs  from the -C option of infocmp(1m) in
      -              that it does not merely translate capability names,
      -              but  also  translates  terminfo  strings to termcap
      -              format.  Capabilities that are not translatable are
      -              left  in  the  entry under their terminfo names but
      -              commented out with two preceding dots.
      +       -f     Display  complex  terminfo  strings  which  contain
      +              if/then/else/endif expressions indented  for  read-
      +              ability.
       
      -       -G     Display constant literals in  decimal  form  rather
      +       -G     Display  constant  literals  in decimal form rather
                     than their character equivalents.
       
      -       -I     Force source translation to terminfo format.
      +       -g     Display constant character literals in quoted  form
      +              rather than their decimal equivalents.
       
      -       -L     Force  source  translation to terminfo format using
      -              the long C variable names listed in <term.h>
      +       -I     Force source translation to terminfo format.
       
      -       -N     Disable smart defaults.  Normally, when translating
      +       -L     Force  source  translation to terminfo format using
      +              the long C variable names listed in <term.h>
      +
      +       -N     Disable smart defaults.  Normally, when translating
                     from termcap to terminfo, the compiler makes a num-
                     ber of assumptions about  the  defaults  of  string
      -              capabilities  reset1_string,  carriage_return, cur-
      -              sor_left, cursor_down,  scroll_forward,  tab,  new-
      -              line,  key_backspace,  key_left, and key_down, then
      +              capabilities  reset1_string,  carriage_return, cur-
      +              sor_left, cursor_down,  scroll_forward,  tab,  new-
      +              line,  key_backspace,  key_left, and key_down, then
                     attempts to use obsolete  termcap  capabilities  to
                     deduce correct values.  It also normally suppresses
      -              output of obsolete termcap capabilities such as bs.
      +              output of obsolete termcap capabilities such as bs.
                     This  option forces a more literal translation that
                     also preserves the obsolete capabilities.
       
      -       -Rsubset
      -              Restrict output to a given subset.  This option  is
      -              for  use  with  archaic  versions  of terminfo like
      -              those on SVr1, Ultrix, or HP/UX that don't  support
      -              the  full set of SVR4/XSI Curses terminfo; and out-
      +       -odir  Write compiled entries to given  directory.   Over-
      +              rides the TERMINFO environment variable.
      +
      +       -Rsubset
      +              Restrict  output to a given subset.  This option is
      +              for use with  archaic  versions  of  terminfo  like
      +              those on SVr1, Ultrix, or HP/UX that do not support
      +              the full set of SVR4/XSI Curses terminfo; and  out-
                     right broken ports like AIX 3.x that have their own
      -              extensions  incompatible  with SVr4/XSI.  Available
      +              extensions incompatible with  SVr4/XSI.   Available
                     subsets  are  "SVr1",  "Ultrix",  "HP",  "BSD"  and
      -              "AIX"; see terminfo(5) for details.
      +              "AIX"; see terminfo(5) for details.
       
      -       -T     eliminates size-restrictions on the generated text.
      -              This is mainly useful  for  testing  and  analysis,
      -              since  the compiled descriptions are limited (e.g.,
      -              1023 for termcap, 4096 for terminfo).
      +       -r     Force entry resolution (so there are  no  remaining
      +              tc  capabilities)  even  when  doing translation to
      +              termcap format.  This may  be  needed  if  you  are
      +              preparing  a  termcap  file  for  a termcap library
      +              (such as GNU termcap through  version  1.3  or  BSD
      +              termcap through 4.3BSD) that does not handle multi-
      +              ple tc capabilities per entry.
       
      -       -V     reports the version of ncurses which  was  used  in
      -              this program, and exits.
      +       -s     Summarize the compile by showing the directory into
      +              which  entries  are  written,  and  the  number  of
      +              entries which are compiled.
       
      -       -r     Force  entry  resolution (so there are no remaining
      -              tc capabilities) even  when  doing  translation  to
      -              termcap  format.   This  may  be  needed if you are
      -              preparing a termcap  file  for  a  termcap  library
      -              (such as GNU termcap up to version 1.3 or BSD term-
      -              cap up to 4.3BSD) that doesn't handle  multiple  tc
      -              capabilities per entry.
      +       -T     eliminates size-restrictions on the generated text.
      +              This  is  mainly  useful  for testing and analysis,
      +              since the compiled descriptions are limited  (e.g.,
      +              1023 for termcap, 4096 for terminfo).
       
      -       -e     Limit  writes  and  translations  to  the following
      -              comma-separated list of terminals.  If any name  or
      -              alias of a terminal matches one of the names in the
      -              list, the entry will be written  or  translated  as
      -              normal.   Otherwise no output will be generated for
      -              it.  The option value is interpreted as a file con-
      -              taining  the  list  if  it  contains a '/'.  (Note:
      -              depending on how tic was compiled, this option  may
      -              require -I or -C.)
      +       -t     tells  tic  to  discard commented-out capabilities.
      +              Normally when translating from terminfo to termcap,
      +              untranslatable capabilities are commented-out.
       
      -       -f     Display  complex  terminfo  strings  which  contain
      -              if/then/else/endif expressions indented  for  read-
      -              ability.
      +       -V     reports  the  version  of ncurses which was used in
      +              this program, and exits.
       
      -       -g     Display  constant character literals in quoted form
      -              rather than their decimal equivalents.
      +       -vn    specifies that (verbose) output be written to stan-
      +              dard   error   trace   information   showing  tic's
      +              progress.  The optional integer n is a number  from
      +              1 to 10, inclusive, indicating the desired level of
      +              detail  of  information.   If  n  is  omitted,  the
      +              default  level is 1.  If n is specified and greater
      +              than 1, the level of detail is increased.
       
      -       -s     Summarize the compile by showing the directory into
      -              which  entries  are  written,  and  the  number  of
      -              entries which are compiled.
      +       -wn    specifies the width of the output.
       
      -       -x     Treat unknown capabilities as  user-defined.   That
      -              is,  if you supply a capability name which tic does
      +       -x     Treat unknown capabilities as  user-defined.   That
      +              is,  if you supply a capability name which tic does
                     not recognize, it will  infer  its  type  (boolean,
                     number  or  string)  from  the  syntax  and make an
                     extended table entry for that.
       
      -       file   contains one or more terminfo terminal descriptions
      -              in  source format [see terminfo(5)].  Each descrip-
      +       file   contains one or more terminfo terminal descriptions
      +              in  source format [see terminfo(5)].  Each descrip-
                     tion in the file describes the  capabilities  of  a
                     particular terminal.
       
      @@ -171,91 +214,86 @@
              9      All  values  computed  in  construction of the hash
                     table
       
      -       If n is not given, it is taken to be one.
      +       If the debug level n is not given, it is taken to be  one.
       
      -       All but one of the capabilities recognized by tic are doc-
      -       umented in terminfo(5).  The exception is the use capabil-
      +       All but one of the capabilities recognized by tic are doc-
      +       umented in terminfo(5).  The exception is the use capabil-
              ity.
       
      -       When a use=entry-name field is discovered  in  a  terminal
      -       entry  currently  being  compiled, tic reads in the binary
      -       from /usr/share/terminfo to complete the entry.   (Entries
      -       created  from file will be used first.  If the environment
      -       variable TERMINFO  is  set,  that  directory  is  searched
      -       instead of /usr/share/terminfo.)  tic duplicates the capa-
      -       bilities in entry-name for the  current  entry,  with  the
      -       exception   of  those  capabilities  that  explicitly  are
      +       When  a  use=entry-name  field is discovered in a terminal
      +       entry currently being compiled, tic reads  in  the  binary
      +       from  /usr/share/terminfo to complete the entry.  (Entries
      +       created from file will be used first.  If the  environment
      +       variable  TERMINFO  is  set,  that  directory  is searched
      +       instead of /usr/share/terminfo.)  tic duplicates the capa-
      +       bilities  in  entry-name  for  the current entry, with the
      +       exception  of  those  capabilities  that  explicitly   are
              defined in the current entry.
       
      -       When   an   entry,   e.g.,   entry_name_1,   contains    a
      -       use=entry_name_2   field,  any  canceled  capabilities  in
      -       entry_name_2 must also appear in entry_name_1 before  use=
      -       for these capabilities to be canceled in entry_name_1.
      +       When    an   entry,   e.g.,   entry_name_1,   contains   a
      +       use=entry_name_2  field,  any  canceled  capabilities   in
      +       entry_name_2  must also appear in entry_name_1 before use=
      +       for these capabilities to be canceled in entry_name_1.
       
      -       If  the environment variable TERMINFO is set, the compiled
      -       results are placed there instead of /usr/share/terminfo.
      +       If the environment variable TERMINFO is set, the  compiled
      +       results are placed there instead of /usr/share/terminfo.
       
              Total compiled entries cannot exceed 4096 bytes.  The name
      -       field  cannot  exceed 512 bytes.  Terminal names exceeding
      -       the maximum alias length (32 characters  on  systems  with
      +       field cannot exceed 512 bytes.  Terminal  names  exceeding
      +       the  maximum  alias  length (32 characters on systems with
              long filenames, 14 characters otherwise) will be truncated
      -       to the maximum alias length and a warning message will  be
      +       to  the maximum alias length and a warning message will be
              printed.
       
       
       

      COMPATIBILITY

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

      EXTENSIONS

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

      FILES

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

      SEE ALSO

      -       infocmp(1m),   captoinfo(1m),   infotocap(1m),    toe(1m),
      -       curses(3x), terminfo(5).
      -
      -
      -
      -
      -
      +       infocmp(1m),    captoinfo(1m),   infotocap(1m),   toe(1m),
      +       curses(3x), terminfo(5).
       
       
       
      diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
      index 887a9c49..441ff700 100644
      --- a/doc/html/man/toe.1m.html
      +++ b/doc/html/man/toe.1m.html
      @@ -1,21 +1,59 @@
      +
      +
       
      +
      +toe 1m
      +
      +
      +
       
      +

      toe 1m

      +
       
       
       

      NAME

      -       toe - table of (terminfo) entries
      +       toe - table of (terminfo) entries
       
       
       

      SYNOPSIS

      -       toe [-v[n]] [-huUV] file...
      +       toe [-v[n]] [-huUV] file...
       
       
       

      DESCRIPTION

      -       With no options, toe lists all available terminal types by
      +       With no options, toe lists all available terminal types by
              primary name with descriptions.   File  arguments  specify
              the  directories  to  be scanned; if no such arguments are
              given, your default terminfo directory is scanned.  If you
      @@ -25,7 +63,7 @@
              There are other options intended for use by terminfo  file
              maintainers:
       
      -       -u file
      +       -u file
                     says to issue a report on dependencies in the given
                     file. This report  condenses  the  `use'  relation:
                     each  line consists of the primary name of a termi-
      @@ -34,7 +72,7 @@
                     of all terminals which occur in those use capabili-
                     ties, followed by a newline
       
      -       -U file
      +       -U file
                     says  to  issue a report on reverse dependencies in
                     the given file.  This  report  reverses  the  `use'
                     relation: each line consists of the primary name of
      @@ -43,25 +81,25 @@
                     rated primary names of all terminals  which  depend
                     on it, followed by a newline.
       
      -       -vn    specifies that (verbose) output be written to stan-
      -              dard  error   trace   information   showing   toe's
      -              progress.   The optional integer n is a number from
      -              1 to 10, interpreted as for tic(1).
      +       -vn    specifies that (verbose) output be written to stan-
      +              dard  error   trace   information   showing   toe's
      +              progress.   The optional integer n is a number from
      +              1 to 10, interpreted as for tic(1).
       
      -       -V   reports the version of ncurses which was used in this
      +       -V   reports the version of ncurses which was used in this
                   program, and exits.
       
       
       

      FILES

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

      SEE ALSO

      -       tic(1m),    infocmp(1m),   captoinfo(1m),   infotocap(1m),
      -       curses(3x), terminfo(5).
      +       tic(1m),    infocmp(1m),   captoinfo(1m),   infotocap(1m),
      +       curses(3x), terminfo(5).
       
       
       
      diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
      index 17c55aad..e9029a53 100644
      --- a/doc/html/man/tput.1.html
      +++ b/doc/html/man/tput.1.html
      @@ -1,240 +1,334 @@
      +
      +
       
      +
      +tput 1
      +
      +
      +
       
      +

      tput 1

      +
       
       
       

      NAME

      -       tput,  reset  -  initialize  a  terminal or query terminfo
      +       tput,  reset  -  initialize  a  terminal or query terminfo
              database
       
       
       

      SYNOPSIS

      -       tput [-Ttype] capname [parms ... ]
      -       tput [-Ttype] init
      -       tput [-Ttype] reset
      -       tput [-Ttype] longname
      -       tput -S  <<
      -       tput -V
      +       tput [-Ttype] capname [parms ... ]
      +       tput [-Ttype] init
      +       tput [-Ttype] reset
      +       tput [-Ttype] longname
      +       tput -S  <<
      +       tput -V
       
       
       

      DESCRIPTION

      -       The tput utility uses the terminfo database  to  make  the
      +       The tput utility uses the terminfo database  to  make  the
              values  of terminal-dependent capabilities and information
      -       available to the shell (see sh(1)), to initialize or reset
      +       available to the shell (see sh(1)), to initialize or reset
              the  terminal,  or  return  the long name of the requested
      -       terminal type.  tput outputs a  string  if  the  attribute
      -       (capability  name) is of type string, or an integer if the
      +       terminal type.  tput outputs a  string  if  the  attribute
      +       (capability  name) is of type string, or an integer if the
              attribute is of type integer.  If the attribute is of type
      -       boolean, tput simply sets the exit code (0 for TRUE if the
      -       terminal has the capability, 1 for FALSE if it does  not),
      +       boolean, tput simply sets the exit code (0 for TRUE if the
      +       terminal has the capability, 1 for FALSE if it does  not),
              and  produces no output.  Before using a value returned on
      -       standard output, the user should test the exit  code  [$?,
      -       see  sh(1)]  to  be sure it is 0.  (See the EXIT CODES and
      -       DIAGNOSTICS sections.)  For a complete list  of  capabili-
      -       ties  and  the  capname  associated  with  each,  see ter-
      -       minfo(5).
      +       standard output, the user should test the exit  code  [$?,
      +       see  sh(1)]  to  be sure it is 0.  (See the EXIT CODES and
      +       DIAGNOSTICS sections.)  For a complete list  of  capabili-
      +       ties  and  the  capname  associated  with  each,  see ter-
      +       minfo(1).
       
      -       -Ttype indicates the  type  of  terminal.   Normally  this
      +       -Ttype indicates the  type  of  terminal.   Normally  this
                     option is unnecessary, because the default is taken
      -              from the environment variable TERM.  If -T is spec-
      -              ified,  then  the shell variables LINES and COLUMNS
      +              from the environment variable TERM.  If -T is spec-
      +              ified,  then  the shell variables LINES and COLUMNS
                     will be ignored,and the operating system  will  not
                     be queried for the actual screen size.
       
      -       capname
      -              indicates the attribute from the terminfo database.
      -              When termcap support is compiled  in,  the  termcap
      +       capname
      +              indicates the attribute from the terminfo database.
      +              When termcap support is compiled  in,  the  termcap
                     name for the attribute is also accepted.
       
      -       parms  If the attribute is a string that takes parameters,
      -              the arguments parms will be instantiated  into  the
      -              string.   An all numeric argument will be passed to
      +       parms  If the attribute is a string that takes parameters,
      +              the arguments parms will be instantiated  into  the
      +              string.   An all-numeric argument will be passed to
                     the attribute as a number.
       
      -       -S     allows more than one capability per  invocation  of
      -              tput.  The capabilities must be passed to tput from
      +              Only a few  terminfo  capabilities  require  string
      +              parameters;  tput  uses  a table to decide which to
      +              pass as strings.  Normally tput uses tparm (3x)  to
      +              perform  the  substitution.   If  no parameters are
      +              given for the attribute,  tput  writes  the  string
      +              without performing the substitution.
      +
      +       -S     allows  more  than one capability per invocation of
      +              tput.  The capabilities must be passed to tput from
                     the standard input instead of from the command line
      -              (see  example).   Only  one  capname is allowed per
      -              line.  The -S option changes the meaning of  the  0
      -              and  1  boolean and string exit codes (see the EXIT
      +              (see example).  Only one  capname  is  allowed  per
      +              line.   The  -S option changes the meaning of the 0
      +              and 1 boolean and string exit codes (see  the  EXIT
                     CODES section).
       
      -       -V     reports the version of ncurses which  was  used  in
      +              Again, tput uses a table and the presence of param-
      +              eters in its input to decide whether to  use  tparm
      +              (3x), and how to interpret the parameters.
      +
      +       -V     reports  the  version  of ncurses which was used in
                     this program, and exits.
       
      -       init   If  the  terminfo  database is present and an entry
      -              for the user's terminal exists (see -Ttype, above),
      -              the  following will occur: (1) if present, the ter-
      -              minal's initialization strings will be output (is1,
      -              is2,  is3,  if,  iprog), (2) any delays (e.g., new-
      +       init   If the terminfo database is present  and  an  entry
      +              for the user's terminal exists (see -Ttype, above),
      +              the following will occur: (1) if present, the  ter-
      +              minal's initialization strings will be output (is1,
      +              is2, is3, if, iprog), (2) any  delays  (e.g.,  new-
                     line) specified in the entry will be set in the tty
                     driver, (3) tabs expansion will be turned on or off
      -              according to the specification in  the  entry,  and
      +              according  to  the  specification in the entry, and
                     (4) if tabs are not expanded, standard tabs will be
                     set (every 8 spaces).  If an entry does not contain
      -              the  information  needed  for any of the four above
      +              the information needed for any of  the  four  above
                     activities, that activity will silently be skipped.
       
      -       reset  Instead  of putting out initialization strings, the
      -              terminal's reset strings will be output if  present
      -              (rs1,  rs2, rs3, rf).  If the reset strings are not
      -              present, but initialization strings are,  the  ini-
      -              tialization  strings  will  be  output.  Otherwise,
      -              reset acts identically to init.
      +       reset  Instead of putting out initialization strings,  the
      +              terminal's  reset strings will be output if present
      +              (rs1, rs2, rs3, rf).  If the reset strings are  not
      +              present,  but  initialization strings are, the ini-
      +              tialization strings  will  be  output.   Otherwise,
      +              reset acts identically to init.
       
      -       longname
      -              If the terminfo database is present  and  an  entry
      -              for  the user's terminal exists (see -Ttype above),
      +       longname
      +              If  the  terminfo  database is present and an entry
      +              for the user's terminal exists (see -Ttype  above),
                     then the long name of the terminal will be put out.
                     The long name is the last name in the first line of
      -              the terminal's description in the terminfo database
      -              [see term(5)].
      +              the terminal's description in the terminfo database
      +              [see term(5)].
       
      -       If  tput  is  invoked  by a link named reset, this has the
      -       same effect as tput reset.  See tset for comparison, which
      +       If tput is invoked by a link named  reset,  this  has  the
      +       same effect as tput reset.  See tset for comparison, which
              has similar behavior.
       
       
       

      EXAMPLES

      -       tput init
      +       tput init
                   Initialize the terminal according to the type of ter-
      -            minal in the environmental variable TERM.  This  com-
      -            mand  should be included in everyone's .profile after
      -            the environmental variable TERM has been exported, as
      -            illustrated on the profile(4) manual page.
      -
      -       tput -T5620 reset
      -            Reset  an  AT&T 5620 terminal, overriding the type of
      -            terminal in the environmental variable TERM.
      -
      -       tput cup 0 0
      -            Send the sequence to move the cursor to row 0, column
      -            0 (the upper left corner of the screen, usually known
      +            minal  in the environmental variable TERM.  This com-
      +            mand should be included in everyone's .profile  after
      +            the environmental variable TERM has been exported, as
      +            illustrated on the profile(5) manual page.
      +
      +       tput -T5620 reset
      +            Reset an AT&T 5620 terminal, overriding the  type  of
      +            terminal in the environmental variable TERM.
      +
      +       tput cup 0 0
      +            Send the sequence to move the cursor to row 0, column
      +            0 (the upper left corner of the screen, usually known
                   as the "home" cursor position).
       
      -       tput clear
      -            Echo  the  clear-screen  sequence  for  the   current
      -            terminal.
      +       tput clear
      +            Echo the clear-screen sequence for the current termi-
      +            nal.
       
      -       tput cols
      +       tput cols
                   Print the number of columns for the current terminal.
       
      -       tput -T450 cols
      +       tput -T450 cols
                   Print the number of columns for the 450 terminal.
       
      -       bold=`tput smso` offbold=`tput rmso`
      -            Set the shell variables bold, to begin stand-out mode
      -            sequence, and offbold, to end standout mode sequence,
      -            for the current terminal.  This might be followed  by
      -            a  prompt:  echo  "${bold}Please  type  in your name:
      -            ${offbold}\c"
      +       bold=`tput smso` offbold=`tput rmso`
      +            Set the shell variables bold, to begin stand-out mode
      +            sequence, and offbold, to end standout mode sequence,
      +            for  the current terminal.  This might be followed by
      +            a prompt: echo  "${bold}Please  type  in  your  name:
      +            ${offbold}\c"
       
      -       tput hc
      -            Set exit code to indicate if the current terminal  is
      +       tput hc
      +            Set  exit code to indicate if the current terminal is
                   a hard copy terminal.
       
      -       tput cup 23 4
      -            Send  the sequence to move the cursor to row 23, col-
      +       tput cup 23 4
      +            Send the sequence to move the cursor to row 23,  col-
                   umn 4.
       
      -       tput longname
      -            Print the long name from the  terminfo  database  for
      +       tput cup
      +            Send the terminfo string for cursor-movement, with no
      +            parameters substituted.
      +
      +       tput longname
      +            Print the long name from the  terminfo  database  for
                   the  type  of terminal specified in the environmental
      -            variable TERM.
      +            variable TERM.
       
      -            tput -S <<!
      -            > clear
      -            > cup 10 10
      -            > bold
      -            > !
      +            tput -S <<!
      +            > clear
      +            > cup 10 10
      +            > bold
      +            > !
       
      -            This example shows tput processing several  capabili-
      -            ties  in  one  invocation.   This  example clears the
      -            screen, moves the cursor to position 10, 10 and turns
      -            on  bold (extra bright) mode.  The list is terminated
      -            by an exclamation mark (!) on a line by itself.
      +            This example shows tput processing several  capabili-
      +            ties  in one invocation.  It clears the screen, moves
      +            the cursor to position  10,  10  and  turns  on  bold
      +            (extra  bright)  mode.   The list is terminated by an
      +            exclamation mark (!) on a line by itself.
       
       
       

      FILES

      -       /usr/share/terminfo
      +       /usr/share/terminfo
                     compiled terminal description database
       
      -       /usr/include/curses.h
      -              curses(3x) header file
      +       /usr/include/curses.h
      +              curses(3x) header file
       
      -       /usr/include/term.h
      -              terminfo header file
      +       /usr/include/term.h
      +              terminfo header file
       
      -       /usr/share/tabset/*
      +       /usr/share/tabset/*
                     tab settings for some terminals, in a format appro-
                     priate   to  be  output  to  the  terminal  (escape
                     sequences that set  margins  and  tabs);  for  more
                     information, see the "Tabs and Initialization" sec-
      -              tion of terminfo(4)
      -
      -
      -
      -

      SEE ALSO

      -       clear(1), stty(1), tabs(5).   profile(5),  terminfo(4)  in
      -       the  System  Administrator's Reference Manual.  Chapter 10
      -       of the Programmer's Guide.
      +              tion of terminfo(5)
       
       
       

      EXIT CODES

      -       If capname is of type boolean, a value of  0  is  set  for
      -       TRUE and 1 for FALSE unless the -S option is used.
      -
      -       If  capname  is of type string, a value of 0 is set if the
      -       capname is defined for this terminal type  (the  value  of
      -       capname  is  returned on standard output); a value of 1 is
      -       set if capname is not defined for this  terminal  type  (a
      -       null value is returned on standard output).
      -
      -       If  capname is of type boolean or string and the -S option
      -       is used, a value of 0 is returned  to  indicate  that  all
      -       lines were successful.  No indication of which line failed
      -       can be given so exit code 1 will never appear.  Exit codes
      -       2, 3, and 4 retain their usual interpretation.
      -
      -       If capname is of type integer, a value of 0 is always set,
      -       whether or not capname is defined for this terminal  type.
      -       To determine if capname is defined for this terminal type,
      -       the user must test the value of standard output.  A  value
      -       of  -1 means that capname is not defined for this terminal
      -       type.
      -
      -       Any other exit code indicates an error; see  the  DIAGNOS-
      +       If the -S option is used, tput checks for errors from each
      +       line,  and if any errors are found, will set the exit code
      +       to 4 plus the number of lines with errors.  If  no  errors
      +       are  found,  the  exit  code is 0.  No indication of which
      +       line failed can be given so exit code 1 will never appear.
      +       Exit  codes 2, 3, and 4 retain their usual interpretation.
      +       If the -S option is not used, the exit code depends on the
      +       type of capname:
      +
      +            boolean
      +                   a  value of 0 is set for TRUE and 1 for FALSE.
      +
      +            string a value of 0 is set if the capname is  defined
      +                   for  this  terminal type (the value of capname
      +                   is returned on standard output); a value of  1
      +                   is set if capname is not defined for this ter-
      +                   minal type (nothing  is  written  to  standard
      +                   output).
      +
      +            integer
      +                   a  value  of  0  is always set, whether or not
      +                   capname is defined for this terminal type.  To
      +                   determine  if capname is defined for this ter-
      +                   minal type, the user must test the value writ-
      +                   ten  to  standard output.  A value of -1 means
      +                   that capname is not defined for this  terminal
      +                   type.
      +
      +            other  reset  or  init may fail to find their respec-
      +                   tive files.  In that case, the  exit  code  is
      +                   set to 4 + errno.
      +
      +       Any  other  exit code indicates an error; see the DIAGNOS-
              TICS section.
       
       
      +
       

      DIAGNOSTICS

      -       tput prints the following error messages and sets the cor-
      +       tput prints the following error messages and sets the cor-
              responding exit codes.
       
              exit code   error message
              ---------------------------------------------------------------------
      -       0           (capname is a numeric variable that is not specified  in
      -                   the  terminfo(5)  database  for this terminal type, e.g.
      -                   tput -T450 lines and tput -T2621 xmc)
      -       1           no error message is printed, see the EXIT CODES section.
      -       2           usage error
      -       3           unknown terminal type or no terminfo database
      -       4           unknown terminfo capability capname
      +       0           (capname  is a numeric variable that is not specified in
      +                   the terminfo(1) database for this  terminal  type,  e.g.
      +                   tput -T450 lines and tput -T2621 xmc)
      +       1           no error message is printed, see the EXIT CODES section.
      +       2           usage error
      +       3           unknown terminal type or no terminfo database
      +       4           unknown terminfo capability capname
      +       >4          error occurred in -S
              ---------------------------------------------------------------------
       
       
       

      PORTABILITY

      -       The longname and -S options, and  the  parameter-substitu-
      -       tion  features  used in the cup example, are not supported
      +       The  longname  and -S options, and the parameter-substitu-
      +       tion features used in the cup example, are  not  supported
              in BSD curses or in AT&T/USL curses before SVr4.
      +
      +
      +
      +

      SEE ALSO

      +       clear(1), stty(1), tabs(1), terminfo(5).
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
       
       

      diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html index 635ddd53..5d806bda 100644 --- a/doc/html/man/tset.1.html +++ b/doc/html/man/tset.1.html @@ -1,36 +1,74 @@ + + + +tset 1 + + + +

      tset 1

      +
       
       
       

      NAME

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

      SYNOPSIS

      -       tset  [-IQVqrs]  [-]  [-e ch] [-i ch] [-k ch] [-m mapping]
      -       [terminal]
      -       reset [-IQVqrs] [-] [-e ch] [-i ch] [-k ch]  [-m  mapping]
      -       [terminal]
      +       tset  [-IQVqrs]  [-]  [-e ch] [-i ch] [-k ch] [-m mapping]
      +       [terminal]
      +       reset [-IQVqrs] [-] [-e ch] [-i ch] [-k ch]  [-m  mapping]
      +       [terminal]
       
       
       

      DESCRIPTION

      -       Tset  initializes  terminals.   Tset  first determines the
      +       Tset  initializes  terminals.   Tset  first determines the
              type of terminal that you are using.   This  determination
              is done as follows, using the first terminal type found.
       
      -       1. The terminal argument specified on the command line.
      +       1. The terminal argument specified on the command line.
       
      -       2. The value of the TERM environmental variable.
      +       2. The value of the TERM environmental variable.
       
              3.  (BSD  systems only.) The terminal type associated with
      -       the standard error output device in  the  /etc/ttys  file.
      -       (On Linux and System-V-like UNIXes, getty does this job by
      -       setting TERM  according  to  the  type  passed  to  it  by
      -       /etc/inittab.)
      +       the standard error output device in  the  /etc/ttys  file.
      +       (On Linux and System-V-like UNIXes, getty does this job by
      +       setting TERM  according  to  the  type  passed  to  it  by
      +       /etc/inittab.)
       
              4. The default terminal type, ``unknown''.
       
      @@ -53,7 +91,7 @@
              have  changed,  or  are  not  set to their default values,
              their values are displayed to the standard error output.
       
      -       When invoked as reset, tset sets cooked  and  echo  modes,
      +       When invoked as reset, tset sets cooked  and  echo  modes,
              turns  off cbreak and raw modes, turns on newline transla-
              tion and resets any  unset  special  characters  to  their
              default  values  before  doing the terminal initialization
      @@ -61,7 +99,7 @@
              leaving  a  terminal  in an abnormal state.  Note, you may
              have to type
       
      -           <LF>reset<LF>
      +           <LF>reset<LF>
       
              (the line-feed character is normally control-J) to get the
              terminal to work, as carriage-return may no longer work in
      @@ -74,7 +112,7 @@
                   put, and the terminal is not initialized in any  way.
                   The option `-' by itself is equivalent but archaic.
       
      -       -e   Set the erase character to ch.
      +       -e   Set the erase character to ch.
       
              -I   Do  not  send  the  terminal  or  tab  initialization
                   strings to the terminal.
      @@ -82,12 +120,12 @@
              -Q   Don't display any values for the erase, interrupt and
                   line kill characters.
       
      -       -V   reports the version of ncurses which was used in this
      +       -V   reports the version of ncurses which was used in this
                   program, and exits.
       
      -       -i   Set the interrupt character to ch.
      +       -i   Set the interrupt character to ch.
       
      -       -k   Set the line kill character to ch.
      +       -k   Set the line kill character to ch.
       
              -m   Specify a mapping from a port  type  to  a  terminal.
                   See below for more information.
      @@ -95,7 +133,7 @@
              -r   Print the terminal type to the standard error output.
       
              -s   Print the sequence of shell  commands  to  initialize
      -            the environment variable TERM to the standard output.
      +            the environment variable TERM to the standard output.
                   See the section below on setting the environment  for
                   details.
       
      @@ -112,11 +150,11 @@
       
              When the -s option is specified, the commands to enter the
              information  into  the  shell's environment are written to
      -       the standard output.  If the SHELL environmental  variable
      -       ends in ``csh'', the commands are for csh, otherwise, they
      -       are for sh.  Note, the csh  commands  set  and  unset  the
      -       shell  variable  noglob,  leaving it unset.  The following
      -       line in the .login or .profile files will  initialize  the
      +       the standard output.  If the SHELL environmental  variable
      +       ends in ``csh'', the commands are for csh, otherwise, they
      +       are for sh.  Note, the csh  commands  set  and  unset  the
      +       shell  variable  noglob,  leaving it unset.  The following
      +       line in the .login or .profile files will  initialize  the
              environment correctly:
       
                  eval `tset -s options ... `
      @@ -127,14 +165,14 @@
       

      TERMINAL TYPE MAPPING

              When the terminal is not hardwired into the system (or the
              current system information is incorrect) the terminal type
      -       derived  from the /etc/ttys file or the TERM environmental
      -       variable is often something generic like network,  dialup,
      -       or  unknown.   When tset is used in a startup script it is
      +       derived  from the /etc/ttys file or the TERM environmental
      +       variable is often something generic like network,  dialup,
      +       or  unknown.   When tset is used in a startup script it is
              often desirable to provide information about the  type  of
              terminal used on such ports.
       
              The  purpose  of  the -m option is to map from some set of
      -       conditions to a terminal type, that is, to tell tset  ``If
      +       conditions to a terminal type, that is, to tell tset  ``If
              I'm  on this port at a particular speed, guess that I'm on
              that kind of terminal''.
       
      @@ -158,17 +196,17 @@
              ble mapping is used.
       
              For    example,    consider    the    following   mapping:
      -       dialup>9600:vt100.  The port type is dialup , the operator
      +       dialup>9600:vt100.  The port type is dialup , the operator
              is  >, the baud rate specification is 9600, and the termi-
              nal type is vt100.  The result of this mapping is to spec-
      -       ify that if the terminal type is dialup, and the baud rate
      -       is greater than 9600 baud, a terminal type of  vt100  will
      +       ify that if the terminal type is dialup, and the baud rate
      +       is greater than 9600 baud, a terminal type of  vt100  will
              be used.
       
              If no baud rate is specified, the terminal type will match
              any baud rate.  If no port type is specified, the terminal
      -       type   will   match   any  port  type.   For  example,  -m
      -       dialup:vt100  -m  :?xterm  will  cause  any  dialup  port,
      +       type   will   match   any  port  type.   For  example,  -m
      +       dialup:vt100  -m  :?xterm  will  cause  any  dialup  port,
              regardless of baud rate, to match the terminal type vt100,
              and any non-dialup port type to match  the  terminal  type
              ?xterm.   Note,  because of the leading question mark, the
      @@ -178,14 +216,14 @@
              No  whitespace  characters  are permitted in the -m option
              argument.  Also, to avoid problems  with  meta-characters,
              it  is  suggested  that  the  entire -m option argument be
      -       placed within single quote characters, and that csh  users
      +       placed within single quote characters, and that csh  users
              insert  a  backslash character (``\'') before any exclama-
              tion marks (``!'').
       
       
       

      HISTORY

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

      COMPATIBILITY

      -       The  tset  utility has been provided for backward-compati-
      +       The  tset  utility has been provided for backward-compati-
              bility with BSD environments (under  most  modern  UNIXes,
      -       /etc/inittab  and  getty(1) can set TERM appropriately for
      -       each dial-up line; this  obviates  what  was  tset's  most
      +       /etc/inittab  and  getty(1) can set TERM appropriately for
      +       each dial-up line; this  obviates  what  was  tset's  most
              important  use).   This implementation behaves like 4.4BSD
              tset, with a few exceptions specified here.
       
              The -S option of BSD tset no longer works;  it  prints  an
              error message to stderr and dies.  The -s option only sets
      -       TERM, not TERMCAP.  Both these  changes  are  because  the
      -       TERMCAP  variable  is  no longer supported under terminfo-
      -       based ncurses, which makes tset -S useless (we made it die
      +       TERM, not TERMCAP.  Both these  changes  are  because  the
      +       TERMCAP  variable  is  no longer supported under terminfo-
      +       based ncurses, which makes tset -S useless (we made it die
              noisily rather than silently induce lossage).
       
              There  was  an  undocumented  4.4BSD feature that invoking
      @@ -213,7 +251,7 @@
              upper-case only.  This feature has been omitted.
       
              The -A, -E, -h, -u and -v options were  deleted  from  the
      -       tset  utility  in  4.4BSD. None of them were documented in
      +       tset  utility  in  4.4BSD. None of them were documented in
              4.3BSD and all are of limited utility at best. The -a, -d,
              and -p options are similarly not documented or useful, but
              were retained as they appear to be in widespread use.   It
      @@ -227,16 +265,16 @@
              mended that such usage be fixed to explicitly specify  the
              character.
       
      -       As  of  4.4BSD,  executing tset as reset no longer implies
      +       As  of  4.4BSD,  executing tset as reset no longer implies
              the -Q option.  Also, the interaction between the - option
      -       and the terminal argument in some historic implementations
      -       of tset has been removed.
      +       and the terminal argument in some historic implementations
      +       of tset has been removed.
       
       
       
       

      ENVIRONMENT

      -       The tset command uses the SHELL and TERM environment vari-
      +       The tset command uses the SHELL and TERM environment vari-
              ables.
       
       
      @@ -252,8 +290,8 @@
       
       

      SEE ALSO

      -       csh(1), sh(1), stty(1), tty(4), termcap(5), ttys(5), envi-
      -       ron(7)
      +       csh(1), sh(1), stty(1), tty(4), termcap(5), ttys(5), envi-
      +       ron(7)
       
       
       
      diff --git a/doc/html/man/wresize.3x.html b/doc/html/man/wresize.3x.html
      index d2e2650b..cb402ad8 100644
      --- a/doc/html/man/wresize.3x.html
      +++ b/doc/html/man/wresize.3x.html
      @@ -1,33 +1,72 @@
      +
      +
       
      +
      +wresize 3x
      +
      +
      +
       
      +

      wresize 3x

      +
       
       
       

      NAME

      -       wresize - resize a curses window
      +       wresize - resize a curses window
       
       
       

      SYNOPSIS

      -       #include <curses.h>
      +       #include <curses.h>
       
      -       int wresize(WINDOW *win, int lines, int columns);
      +       int wresize(WINDOW *win, int lines, int columns);
       
       
       

      DESCRIPTION

      -       The  wresize  function  reallocates storage for an ncurses
      +       The  wresize  function  reallocates storage for an ncurses
              window to adjust its dimensions to the  specified  values.
              If either dimension is larger than the current values, the
              window's data is filled with blanks that have the  current
      -       background  rendition  (as  set  by wbkgndset) merged into
      +       background  rendition  (as  set  by wbkgndset) merged into
              them.
       
       
       

      RETURN VALUE

      -       The function returns the integer ERR upon failure  and  OK
      +       The function returns the integer ERR upon failure  and  OK
              on success.  It will fail if either of the dimensions less
              than or equal  to  zero,  or  if  an  error  occurs  while
              (re)allocating memory for the window.
      @@ -37,14 +76,14 @@
       

      NOTES

              The only restriction placed on the dimensions is that they
              be greater than zero.  The dimensions are not compared  to
      -       curses   screen   dimensions  to  simplify  the  logic  of
      -       resizeterm.  The caller  must  ensure  that  the  window's
      +       curses   screen   dimensions  to  simplify  the  logic  of
      +       resizeterm.  The caller  must  ensure  that  the  window's
              dimensions fit within the actual screen dimensions.
       
       
       

      SEE ALSO

      -       resizeterm(3x).
      +       resizeterm(3x).
       
       
       
      diff --git a/doc/html/ncurses-intro.html b/doc/html/ncurses-intro.html index 05c756e0..3500e7a6 100644 --- a/doc/html/ncurses-intro.html +++ b/doc/html/ncurses-intro.html @@ -1,6 +1,6 @@ @@ -221,13 +221,13 @@ maintainer of this package is <esr@snark.thyrsus.com> wrote many of the new features in versions after 1.8.1 and wrote most of this introduction. -Jürgen Pfeifer +Jürgen Pfeifer wrote all of the menu and forms code as well as the Ada95 binding. Ongoing work is being done by Thomas Dickey and -Jürgen Pfeifer. +Jürgen Pfeifer. Florian La Roche acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -704,7 +704,11 @@ restore the ncurses screen from before the escape. newterm() instead of initscr(). newterm() should be called once for each terminal. It returns a variable of type SCREEN * which should be saved as a reference to that -terminal. The arguments are the type of the terminal (a string) and +terminal. +(NOTE: a SCREEN variable is not a screen in the sense we +are describing in this introduction, but a collection of +parameters used to assist in optimizing the display.) +The arguments are the type of the terminal (a string) and FILE pointers for the output and input of the terminal. If type is NULL then the environment variable $TERM is used. endwin() should called once at wrapup time for each terminal diff --git a/doc/ncurses-intro.doc b/doc/ncurses-intro.doc index 669b0b39..750777ed 100644 --- a/doc/ncurses-intro.doc +++ b/doc/ncurses-intro.doc @@ -1,11 +1,11 @@ Writing Programs with NCURSES - + by Eric S. Raymond and Zeyd M. Ben-Halim updates since release 1.9.9e by Thomas Dickey - + Contents - + * Introduction + A Brief History of Curses + Scope of This Document @@ -96,192 +96,192 @@ o Order Functions For Custom Types o Avoiding Problems _________________________________________________________________ - + Introduction - + This document is an introduction to programming with curses. It is not - an exhaustive reference for the curses Application Programming - Interface (API); that role is filled by the curses manual pages. - Rather, it is intended to help C programmers ease into using the + an exhaustive reference for the curses Application Programming + Interface (API); that role is filled by the curses manual pages. + Rather, it is intended to help C programmers ease into using the package. - - This document is aimed at C applications programmers not yet - specifically familiar with ncurses. If you are already an experienced - curses programmer, you should nevertheless read the sections on Mouse - Interfacing, Debugging, Compatibility with Older Versions, and Hints, - Tips, and Tricks. These will bring you up to speed on the special - features and quirks of the ncurses implementation. If you are not so + + This document is aimed at C applications programmers not yet + specifically familiar with ncurses. If you are already an experienced + curses programmer, you should nevertheless read the sections on Mouse + Interfacing, Debugging, Compatibility with Older Versions, and Hints, + Tips, and Tricks. These will bring you up to speed on the special + features and quirks of the ncurses implementation. If you are not so experienced, keep reading. - - The curses package is a subroutine library for terminal-independent - screen-painting and input-event handling which presents a high level - screen model to the programmer, hiding differences between terminal - types and doing automatic optimization of output to change one screen - full of text into another. Curses uses terminfo, which is a database - format that can describe the capabilities of thousands of different + + The curses package is a subroutine library for terminal-independent + screen-painting and input-event handling which presents a high level + screen model to the programmer, hiding differences between terminal + types and doing automatic optimization of output to change one screen + full of text into another. Curses uses terminfo, which is a database + format that can describe the capabilities of thousands of different terminals. - - The curses API may seem something of an archaism on UNIX desktops - increasingly dominated by X, Motif, and Tcl/Tk. Nevertheless, UNIX - still supports tty lines and X supports xterm(1); the curses API has + + The curses API may seem something of an archaism on UNIX desktops + increasingly dominated by X, Motif, and Tcl/Tk. Nevertheless, UNIX + still supports tty lines and X supports xterm(1); the curses API has the advantage of (a) back-portability to character-cell terminals, and - (b) simplicity. For an application that does not require bit-mapped - graphics and multiple fonts, an interface implementation using curses - will typically be a great deal simpler and less expensive than one + (b) simplicity. For an application that does not require bit-mapped + graphics and multiple fonts, an interface implementation using curses + will typically be a great deal simpler and less expensive than one using an X toolkit. - + A Brief History of Curses Historically, the first ancestor of curses was the routines written to - provide screen-handling for the game rogue; these used the - already-existing termcap database facility for describing terminal + provide screen-handling for the game rogue; these used the + already-existing termcap database facility for describing terminal capabilities. These routines were abstracted into a documented library and first released with the early BSD UNIX versions. - - System III UNIX from Bell Labs featured a rewritten and much-improved - curses library. It introduced the terminfo format. Terminfo is based - on Berkeley's termcap database, but contains a number of improvements - and extensions. Parameterized capabilities strings were introduced, - making it possible to describe multiple video attributes, and colors - and to handle far more unusual terminals than possible with termcap. - In the later AT&T System V releases, curses evolved to use more + + System III UNIX from Bell Labs featured a rewritten and much-improved + curses library. It introduced the terminfo format. Terminfo is based + on Berkeley's termcap database, but contains a number of improvements + and extensions. Parameterized capabilities strings were introduced, + making it possible to describe multiple video attributes, and colors + and to handle far more unusual terminals than possible with termcap. + In the later AT&T System V releases, curses evolved to use more facilities and offer more capabilities, going far beyond BSD curses in power and flexibility. - + Scope of This Document This document describes ncurses, a free implementation of the System V - curses API with some clearly marked extensions. It includes the + curses API with some clearly marked extensions. It includes the following System V curses features: - * Support for multiple screen highlights (BSD curses could only + * Support for multiple screen highlights (BSD curses could only handle one `standout' highlight, usually reverse-video). * Support for line- and box-drawing using forms characters. * Recognition of function keys on input. * Color support. - * Support for pads (windows of larger than screen size on which the + * Support for pads (windows of larger than screen size on which the screen or a subwindow defines a viewport). - - Also, this package makes use of the insert and delete line and - character features of terminals so equipped, and determines how to - optimally use these features with no help from the programmer. It - allows arbitrary combinations of video attributes to be displayed, - even on terminals that leave ``magic cookies'' on the screen to mark + + Also, this package makes use of the insert and delete line and + character features of terminals so equipped, and determines how to + optimally use these features with no help from the programmer. It + allows arbitrary combinations of video attributes to be displayed, + even on terminals that leave ``magic cookies'' on the screen to mark changes in attributes. - - The ncurses package can also capture and use event reports from a + + The ncurses package can also capture and use event reports from a mouse in some environments (notably, xterm under the X window system). This document includes tips for using the mouse. - - The ncurses package was originated by Pavel Curtis. The original - maintainer of this package is Zeyd Ben-Halim . + + The ncurses package was originated by Pavel Curtis. The original + maintainer of this package is Zeyd Ben-Halim . Eric S. Raymond wrote many of the new features - in versions after 1.8.1 and wrote most of this introduction. Jürgen - Pfeifer wrote all of the menu and forms code as well as the Ada95 - binding. Ongoing work is being done by Thomas Dickey and Jürgen + in versions after 1.8.1 and wrote most of this introduction. Jürgen + Pfeifer wrote all of the menu and forms code as well as the Ada95 + binding. Ongoing work is being done by Thomas Dickey and Jürgen Pfeifer. Florian La Roche acts as the maintainer for the Free Software - Foundation, which holds the copyright on ncurses. Contact the current + Foundation, which holds the copyright on ncurses. Contact the current maintainers at bug-ncurses@gnu.org. - - This document also describes the panels extension library, similarly - modeled on the SVr4 panels facility. This library allows you to - associate backing store with each of a stack or deck of overlapping - windows, and provides operations for moving windows around in the + + This document also describes the panels extension library, similarly + modeled on the SVr4 panels facility. This library allows you to + associate backing store with each of a stack or deck of overlapping + windows, and provides operations for moving windows around in the stack that change their visibility in the natural way (handling window overlaps). - - Finally, this document describes in detail the menus and forms - extension libraries, also cloned from System V, which support easy + + Finally, this document describes in detail the menus and forms + extension libraries, also cloned from System V, which support easy construction and sequences of menus and fill-in forms. - + Terminology - In this document, the following terminology is used with reasonable + In this document, the following terminology is used with reasonable consistency: - + window - A data structure describing a sub-rectangle of the screen - (possibly the entire screen). You can write to a window as - though it were a miniature screen, scrolling independently of + A data structure describing a sub-rectangle of the screen + (possibly the entire screen). You can write to a window as + though it were a miniature screen, scrolling independently of other windows on the physical screen. - + screens - A subset of windows which are as large as the terminal screen, - i.e., they start at the upper left hand corner and encompass - the lower right hand corner. One of these, stdscr, is + A subset of windows which are as large as the terminal screen, + i.e., they start at the upper left hand corner and encompass + the lower right hand corner. One of these, stdscr, is automatically provided for the programmer. - + terminal screen The package's idea of what the terminal display currently looks like, i.e., what the user sees now. This is a special screen. - + The Curses Library - + An Overview of Curses Compiling Programs using Curses - + In order to use the library, it is necessary to have certain types and variables defined. Therefore, the programmer must have a line: #include at the top of the program source. The screen package uses the Standard - I/O library, so includes . also - includes , , or depending on your - system. It is redundant (but harmless) for the programmer to do these - includes, too. In linking with curses you need to have -lncurses in - your LDFLAGS or on the command line. There is no need for any other + I/O library, so includes . also + includes , , or depending on your + system. It is redundant (but harmless) for the programmer to do these + includes, too. In linking with curses you need to have -lncurses in + your LDFLAGS or on the command line. There is no need for any other libraries. - + Updating the Screen - - In order to update the screen optimally, it is necessary for the - routines to know what the screen currently looks like and what the - programmer wants it to look like next. For this purpose, a data type - (structure) named WINDOW is defined which describes a window image to - the routines, including its starting position on the screen (the (y, - x) coordinates of the upper left hand corner) and its size. One of - these (called curscr, for current screen) is a screen image of what - the terminal currently looks like. Another screen (called stdscr, for + + In order to update the screen optimally, it is necessary for the + routines to know what the screen currently looks like and what the + programmer wants it to look like next. For this purpose, a data type + (structure) named WINDOW is defined which describes a window image to + the routines, including its starting position on the screen (the (y, + x) coordinates of the upper left hand corner) and its size. One of + these (called curscr, for current screen) is a screen image of what + the terminal currently looks like. Another screen (called stdscr, for standard screen) is provided by default to make changes on. - - A window is a purely internal representation. It is used to build and - store a potential image of a portion of the terminal. It doesn't bear - any necessary relation to what is really on the terminal screen; it's + + A window is a purely internal representation. It is used to build and + store a potential image of a portion of the terminal. It doesn't bear + any necessary relation to what is really on the terminal screen; it's more like a scratchpad or write buffer. - - To make the section of physical screen corresponding to a window - reflect the contents of the window structure, the routine refresh() + + To make the section of physical screen corresponding to a window + reflect the contents of the window structure, the routine refresh() (or wrefresh() if the window is not stdscr) is called. - - A given physical screen section may be within the scope of any number - of overlapping windows. Also, changes can be made to windows in any - order, without regard to motion efficiency. Then, at will, the + + A given physical screen section may be within the scope of any number + of overlapping windows. Also, changes can be made to windows in any + order, without regard to motion efficiency. Then, at will, the programmer can effectively say ``make it look like this,'' and let the package implementation determine the most efficient way to repaint the screen. - + Standard Windows and Function Naming Conventions - - As hinted above, the routines can use several windows, but two are + + As hinted above, the routines can use several windows, but two are automatically given: curscr, which knows what the terminal looks like, - and stdscr, which is what the programmer wants the terminal to look - like next. The user should never actually access curscr directly. - Changes should be made to through the API, and then the routine + and stdscr, which is what the programmer wants the terminal to look + like next. The user should never actually access curscr directly. + Changes should be made to through the API, and then the routine refresh() (or wrefresh()) called. - - Many functions are defined to use stdscr as a default screen. For - example, to add a character to stdscr, one calls addch() with the + + Many functions are defined to use stdscr as a default screen. For + example, to add a character to stdscr, one calls addch() with the desired character as argument. To write to a different window. use the - routine waddch() (for `w'indow-specific addch()) is provided. This + routine waddch() (for `w'indow-specific addch()) is provided. This convention of prepending function names with a `w' when they are to be - applied to specific windows is consistent. The only routines which do + applied to specific windows is consistent. The only routines which do not follow it are those for which a window must always be specified. - - In order to move the current (y, x) coordinates from one point to - another, the routines move() and wmove() are provided. However, it is - often desirable to first move and then perform some I/O operation. In - order to avoid clumsiness, most I/O routines can be preceded by the - prefix 'mv' and the desired (y, x) coordinates prepended to the + + In order to move the current (y, x) coordinates from one point to + another, the routines move() and wmove() are provided. However, it is + often desirable to first move and then perform some I/O operation. In + order to avoid clumsiness, most I/O routines can be preceded by the + prefix 'mv' and the desired (y, x) coordinates prepended to the arguments to the function. For example, the calls move(y, x); addch(ch); @@ -296,44 +296,44 @@ An Overview of Curses can be replaced by mvwaddch(win, y, x, ch); - Note that the window description pointer (win) comes before the added - (y, x) coordinates. If a function requires a window pointer, it is + Note that the window description pointer (win) comes before the added + (y, x) coordinates. If a function requires a window pointer, it is always the first parameter passed. - + Variables - - The curses library sets some variables describing the terminal + + The curses library sets some variables describing the terminal capabilities. type name description ------------------------------------------------------------------ int LINES number of lines on the terminal int COLS number of columns on the terminal - The curses.h also introduces some #define constants and types of + The curses.h also introduces some #define constants and types of general usefulness: - + bool boolean type, actually a `char' (e.g., bool doneit;) - + TRUE boolean `true' flag (1). - + FALSE boolean `false' flag (0). - + ERR error flag returned by routines on a failure (-1). - + OK error flag returned by routines when things go right. - + Using the Library - Now we describe how to actually use the screen package. In it, we - assume all updating, reading, etc. is applied to stdscr. These - instructions will work on any window, providing you change the + Now we describe how to actually use the screen package. In it, we + assume all updating, reading, etc. is applied to stdscr. These + instructions will work on any window, providing you change the function names and parameters as mentioned above. - + Here is a sample program to motivate the discussion: #include #include @@ -396,397 +396,400 @@ static void finish(int sig) } Starting up - - In order to use the screen package, the routines must know about - terminal characteristics, and the space for curscr and stdscr must be - allocated. These function initscr() does both these things. Since it - must allocate space for the windows, it can overflow memory when - attempting to do so. On the rare occasions this happens, initscr() - will terminate the program with an error message. initscr() must - always be called before any of the routines which affect windows are - used. If it is not, the program will core dump as soon as either - curscr or stdscr are referenced. However, it is usually best to wait - to call it until after you are sure you will need it, like after - checking for startup errors. Terminal status changing routines like + + In order to use the screen package, the routines must know about + terminal characteristics, and the space for curscr and stdscr must be + allocated. These function initscr() does both these things. Since it + must allocate space for the windows, it can overflow memory when + attempting to do so. On the rare occasions this happens, initscr() + will terminate the program with an error message. initscr() must + always be called before any of the routines which affect windows are + used. If it is not, the program will core dump as soon as either + curscr or stdscr are referenced. However, it is usually best to wait + to call it until after you are sure you will need it, like after + checking for startup errors. Terminal status changing routines like nl() and cbreak() should be called after initscr(). - - Once the screen windows have been allocated, you can set them up for - your program. If you want to, say, allow a screen to scroll, use - scrollok(). If you want the cursor to be left in place after the last - change, use leaveok(). If this isn't done, refresh() will move the + + Once the screen windows have been allocated, you can set them up for + your program. If you want to, say, allow a screen to scroll, use + scrollok(). If you want the cursor to be left in place after the last + change, use leaveok(). If this isn't done, refresh() will move the cursor to the window's current (y, x) coordinates after updating it. - - You can create new windows of your own using the functions newwin(), + + You can create new windows of your own using the functions newwin(), derwin(), and subwin(). The routine delwin() will allow you to get rid - of old windows. All the options described above can be applied to any + of old windows. All the options described above can be applied to any window. - + Output - - Now that we have set things up, we will want to actually update the - terminal. The basic functions used to change what will go on a window + + Now that we have set things up, we will want to actually update the + terminal. The basic functions used to change what will go on a window are addch() and move(). addch() adds a character at the current (y, x) coordinates. move() changes the current (y, x) coordinates to whatever you want them to be. It returns ERR if you try to move off the window. - As mentioned above, you can combine the two into mvaddch() to do both + As mentioned above, you can combine the two into mvaddch() to do both things at once. - - The other output functions, such as addstr() and printw(), all call + + The other output functions, such as addstr() and printw(), all call addch() to add characters to the window. - - After you have put on the window what you want there, when you want - the portion of the terminal covered by the window to be made to look - like it, you must call refresh(). In order to optimize finding - changes, refresh() assumes that any part of the window not changed - since the last refresh() of that window has not been changed on the - terminal, i.e., that you have not refreshed a portion of the terminal - with an overlapping window. If this is not the case, the routine + + After you have put on the window what you want there, when you want + the portion of the terminal covered by the window to be made to look + like it, you must call refresh(). In order to optimize finding + changes, refresh() assumes that any part of the window not changed + since the last refresh() of that window has not been changed on the + terminal, i.e., that you have not refreshed a portion of the terminal + with an overlapping window. If this is not the case, the routine touchwin() is provided to make it look like the entire window has been - changed, thus making refresh() check the whole subsection of the + changed, thus making refresh() check the whole subsection of the terminal for changes. - - If you call wrefresh() with curscr as its argument, it will make the - screen look like curscr thinks it looks like. This is useful for - implementing a command which would redraw the screen in case it get + + If you call wrefresh() with curscr as its argument, it will make the + screen look like curscr thinks it looks like. This is useful for + implementing a command which would redraw the screen in case it get messed up. - + Input - - The complementary function to addch() is getch() which, if echo is + + The complementary function to addch() is getch() which, if echo is set, will call addch() to echo the character. Since the screen package - needs to know what is on the terminal at all times, if characters are - to be echoed, the tty must be in raw or cbreak mode. Since initially - the terminal has echoing enabled and is in ordinary ``cooked'' mode, + needs to know what is on the terminal at all times, if characters are + to be echoed, the tty must be in raw or cbreak mode. Since initially + the terminal has echoing enabled and is in ordinary ``cooked'' mode, one or the other has to changed before calling getch(); otherwise, the program's output will be unpredictable. - + When you need to accept line-oriented input in a window, the functions wgetstr() and friends are available. There is even a wscanw() function - that can do scanf()(3)-style multi-field parsing on window input. - These pseudo-line-oriented functions turn on echoing while they + that can do scanf()(3)-style multi-field parsing on window input. + These pseudo-line-oriented functions turn on echoing while they execute. - - The example code above uses the call keypad(stdscr, TRUE) to enable - support for function-key mapping. With this feature, the getch() code - watches the input stream for character sequences that correspond to - arrow and function keys. These sequences are returned as + + The example code above uses the call keypad(stdscr, TRUE) to enable + support for function-key mapping. With this feature, the getch() code + watches the input stream for character sequences that correspond to + arrow and function keys. These sequences are returned as pseudo-character values. The #define values returned are listed in the curses.h The mapping from sequences to #define values is determined by key_ capabilities in the terminal's terminfo entry. - + Using Forms Characters - - The addch() function (and some others, including box() and border()) + + The addch() function (and some others, including box() and border()) can accept some pseudo-character arguments which are specially defined - by ncurses. These are #define values set up in the curses.h header; + by ncurses. These are #define values set up in the curses.h header; see there for a complete list (look for the prefix ACS_). - - The most useful of the ACS defines are the forms-drawing characters. - You can use these to draw boxes and simple graphs on the screen. If - the terminal does not have such characters, curses.h will map them to + + The most useful of the ACS defines are the forms-drawing characters. + You can use these to draw boxes and simple graphs on the screen. If + the terminal does not have such characters, curses.h will map them to a recognizable (though ugly) set of ASCII defaults. - + Character Attributes and Color - - The ncurses package supports screen highlights including standout, - reverse-video, underline, and blink. It also supports color, which is + + The ncurses package supports screen highlights including standout, + reverse-video, underline, and blink. It also supports color, which is treated as another kind of highlight. - - Highlights are encoded, internally, as high bits of the - pseudo-character type (chtype) that curses.h uses to represent the + + Highlights are encoded, internally, as high bits of the + pseudo-character type (chtype) that curses.h uses to represent the contents of a screen cell. See the curses.h header file for a complete list of highlight mask values (look for the prefix A_). - - There are two ways to make highlights. One is to logical-or the value - of the highlights you want into the character argument of an addch() + + There are two ways to make highlights. One is to logical-or the value + of the highlights you want into the character argument of an addch() call, or any other output call that takes a chtype argument. - + The other is to set the current-highlight value. This is logical-or'ed - with any highlight you specify the first way. You do this with the + with any highlight you specify the first way. You do this with the functions attron(), attroff(), and attrset(); see the manual pages for - details. Color is a special kind of highlight. The package actually - thinks in terms of color pairs, combinations of foreground and - background colors. The sample code above sets up eight color pairs, - all of the guaranteed-available colors on black. Note that each color - pair is, in effect, given the name of its foreground color. Any other - range of eight non-conflicting values could have been used as the + details. Color is a special kind of highlight. The package actually + thinks in terms of color pairs, combinations of foreground and + background colors. The sample code above sets up eight color pairs, + all of the guaranteed-available colors on black. Note that each color + pair is, in effect, given the name of its foreground color. Any other + range of eight non-conflicting values could have been used as the first arguments of the init_pair() values. - + Once you've done an init_pair() that creates color-pair N, you can use - COLOR_PAIR(N) as a highlight that invokes that particular color - combination. Note that COLOR_PAIR(N), for constant N, is itself a + COLOR_PAIR(N) as a highlight that invokes that particular color + combination. Note that COLOR_PAIR(N), for constant N, is itself a compile-time constant and can be used in initializers. - + Mouse Interfacing - + The ncurses library also provides a mouse interface. - - NOTE: this facility is specific to ncurses, it is not part of - either the XSI Curses standard, nor of System V Release 4, nor BSD - curses. System V Release 4 curses contains code with similar - interface definitions, however it is not documented. Other than by - disassembling the library, we have no way to determine exactly how - that mouse code works. Thus, we recommend that you wrap - mouse-related code in an #ifdef using the feature macro - NCURSES_MOUSE_VERSION so it will not be compiled and linked on + + NOTE: this facility is specific to ncurses, it is not part of + either the XSI Curses standard, nor of System V Release 4, nor BSD + curses. System V Release 4 curses contains code with similar + interface definitions, however it is not documented. Other than by + disassembling the library, we have no way to determine exactly how + that mouse code works. Thus, we recommend that you wrap + mouse-related code in an #ifdef using the feature macro + NCURSES_MOUSE_VERSION so it will not be compiled and linked on non-ncurses systems. - + Presently, mouse event reporting works in the following environments: * xterm and similar programs such as rxvt. - * Linux console, when configured with gpm(1), Alessandro Rubini's + * Linux console, when configured with gpm(1), Alessandro Rubini's mouse server. * OS/2 EMX - - The mouse interface is very simple. To activate it, you use the - function mousemask(), passing it as first argument a bit-mask that - specifies what kinds of events you want your program to be able to - see. It will return the bit-mask of events that actually become + + The mouse interface is very simple. To activate it, you use the + function mousemask(), passing it as first argument a bit-mask that + specifies what kinds of events you want your program to be able to + see. It will return the bit-mask of events that actually become visible, which may differ from the argument if the mouse device is not capable of reporting some of the event types you specify. - + Once the mouse is active, your application's command loop should watch - for a return value of KEY_MOUSE from wgetch(). When you see this, a - mouse event report has been queued. To pick it off the queue, use the - function getmouse() (you must do this before the next wgetch(), - otherwise another mouse event might come in and make the first one + for a return value of KEY_MOUSE from wgetch(). When you see this, a + mouse event report has been queued. To pick it off the queue, use the + function getmouse() (you must do this before the next wgetch(), + otherwise another mouse event might come in and make the first one inaccessible). - + Each call to getmouse() fills a structure (the address of which you'll - pass it) with mouse event data. The event data includes zero-origin, - screen-relative character-cell coordinates of the mouse pointer. It - also includes an event mask. Bits in this mask will be set, + pass it) with mouse event data. The event data includes zero-origin, + screen-relative character-cell coordinates of the mouse pointer. It + also includes an event mask. Bits in this mask will be set, corresponding to the event type being reported. - - The mouse structure contains two additional fields which may be - significant in the future as ncurses interfaces to new kinds of - pointing device. In addition to x and y coordinates, there is a slot - for a z coordinate; this might be useful with touch-screens that can - return a pressure or duration parameter. There is also a device ID - field, which could be used to distinguish between multiple pointing + + The mouse structure contains two additional fields which may be + significant in the future as ncurses interfaces to new kinds of + pointing device. In addition to x and y coordinates, there is a slot + for a z coordinate; this might be useful with touch-screens that can + return a pressure or duration parameter. There is also a device ID + field, which could be used to distinguish between multiple pointing devices. - - The class of visible events may be changed at any time via - mousemask(). Events that can be reported include presses, releases, - single-, double- and triple-clicks (you can set the maximum - button-down time for clicks). If you don't make clicks visible, they - will be reported as press-release pairs. In some environments, the - event mask may include bits reporting the state of shift, alt, and + + The class of visible events may be changed at any time via + mousemask(). Events that can be reported include presses, releases, + single-, double- and triple-clicks (you can set the maximum + button-down time for clicks). If you don't make clicks visible, they + will be reported as press-release pairs. In some environments, the + event mask may include bits reporting the state of shift, alt, and ctrl keys on the keyboard during the event. - - A function to check whether a mouse event fell within a given window - is also supplied. You can use this to see whether a given window + + A function to check whether a mouse event fell within a given window + is also supplied. You can use this to see whether a given window should consider a mouse event relevant to it. - - Because mouse event reporting will not be available in all - environments, it would be unwise to build ncurses applications that - require the use of a mouse. Rather, you should use the mouse as a - shortcut for point-and-shoot commands your application would normally - accept from the keyboard. Two of the test games in the ncurses - distribution (bs and knight) contain code that illustrates how this + + Because mouse event reporting will not be available in all + environments, it would be unwise to build ncurses applications that + require the use of a mouse. Rather, you should use the mouse as a + shortcut for point-and-shoot commands your application would normally + accept from the keyboard. Two of the test games in the ncurses + distribution (bs and knight) contain code that illustrates how this can be done. - - See the manual page curs_mouse(3X) for full details of the + + See the manual page curs_mouse(3X) for full details of the mouse-interface functions. - + Finishing Up - - In order to clean up after the ncurses routines, the routine endwin() - is provided. It restores tty modes to what they were when initscr() - was first called, and moves the cursor down to the lower-left corner. - Thus, anytime after the call to initscr, endwin() should be called + + In order to clean up after the ncurses routines, the routine endwin() + is provided. It restores tty modes to what they were when initscr() + was first called, and moves the cursor down to the lower-left corner. + Thus, anytime after the call to initscr, endwin() should be called before exiting. - + Function Descriptions - We describe the detailed behavior of some important curses functions + We describe the detailed behavior of some important curses functions here, as a supplement to the manual page descriptions. - + Initialization and Wrapup - + initscr() - The first function called should almost always be initscr(). - This will determine the terminal type and initialize curses + The first function called should almost always be initscr(). + This will determine the terminal type and initialize curses data structures. initscr() also arranges that the first call to - refresh() will clear the screen. If an error occurs a message - is written to standard error and the program exits. Otherwise - it returns a pointer to stdscr. A few functions may be called + refresh() will clear the screen. If an error occurs a message + is written to standard error and the program exits. Otherwise + it returns a pointer to stdscr. A few functions may be called before initscr (slk_init(), filter(), ripofflines(), use_env(), and, if you are using multiple terminals, newterm().) - + endwin() - Your program should always call endwin() before exiting or - shelling out of the program. This function will restore tty - modes, move the cursor to the lower left corner of the screen, - reset the terminal into the proper non-visual mode. Calling - refresh() or doupdate() after a temporary escape from the + Your program should always call endwin() before exiting or + shelling out of the program. This function will restore tty + modes, move the cursor to the lower left corner of the screen, + reset the terminal into the proper non-visual mode. Calling + refresh() or doupdate() after a temporary escape from the program will restore the ncurses screen from before the escape. - + newterm(type, ofp, ifp) - A program which outputs to more than one terminal should use + A program which outputs to more than one terminal should use newterm() instead of initscr(). newterm() should be called once for each terminal. It returns a variable of type SCREEN * which - should be saved as a reference to that terminal. The arguments - are the type of the terminal (a string) and FILE pointers for - the output and input of the terminal. If type is NULL then the - environment variable $TERM is used. endwin() should called once - at wrapup time for each terminal opened using this function. - + should be saved as a reference to that terminal. (NOTE: a + SCREEN variable is not a screen in the sense we are describing + in this introduction, but a collection of parameters used to + assist in optimizing the display.) The arguments are the type + of the terminal (a string) and FILE pointers for the output and + input of the terminal. If type is NULL then the environment + variable $TERM is used. endwin() should called once at wrapup + time for each terminal opened using this function. + set_term(new) - This function is used to switch to a different terminal - previously opened by newterm(). The screen reference for the - new terminal is passed as the parameter. The previous terminal - is returned by the function. All other calls affect only the + This function is used to switch to a different terminal + previously opened by newterm(). The screen reference for the + new terminal is passed as the parameter. The previous terminal + is returned by the function. All other calls affect only the current terminal. - + delscreen(sp) - The inverse of newterm(); deallocates the data structures + The inverse of newterm(); deallocates the data structures associated with a given SCREEN reference. - + Causing Output to the Terminal - + refresh() and wrefresh(win) - These functions must be called to actually get any output on - the terminal, as other routines merely manipulate data - structures. wrefresh() copies the named window to the physical - terminal screen, taking into account what is already there in - order to do optimizations. refresh() does a refresh of - stdscr(). Unless leaveok() has been enabled, the physical - cursor of the terminal is left at the location of the window's + These functions must be called to actually get any output on + the terminal, as other routines merely manipulate data + structures. wrefresh() copies the named window to the physical + terminal screen, taking into account what is already there in + order to do optimizations. refresh() does a refresh of + stdscr(). Unless leaveok() has been enabled, the physical + cursor of the terminal is left at the location of the window's cursor. - + doupdate() and wnoutrefresh(win) These two functions allow multiple updates with more efficiency - than wrefresh. To use them, it is important to understand how - curses works. In addition to all the window structures, curses - keeps two data structures representing the terminal screen: a + than wrefresh. To use them, it is important to understand how + curses works. In addition to all the window structures, curses + keeps two data structures representing the terminal screen: a physical screen, describing what is actually on the screen, and - a virtual screen, describing what the programmer wants to have + a virtual screen, describing what the programmer wants to have on the screen. wrefresh works by first copying the named window - to the virtual screen (wnoutrefresh()), and then calling the - routine to update the screen (doupdate()). If the programmer - wishes to output several windows at once, a series of calls to + to the virtual screen (wnoutrefresh()), and then calling the + routine to update the screen (doupdate()). If the programmer + wishes to output several windows at once, a series of calls to wrefresh will result in alternating calls to wnoutrefresh() and - doupdate(), causing several bursts of output to the screen. By - calling wnoutrefresh() for each window, it is then possible to - call doupdate() once, resulting in only one burst of output, - with fewer total characters transmitted (this also avoids a + doupdate(), causing several bursts of output to the screen. By + calling wnoutrefresh() for each window, it is then possible to + call doupdate() once, resulting in only one burst of output, + with fewer total characters transmitted (this also avoids a visually annoying flicker at each update). - + Low-Level Capability Access - + setupterm(term, filenum, errret) - This routine is called to initialize a terminal's description, + This routine is called to initialize a terminal's description, without setting up the curses screen structures or changing the tty-driver mode bits. term is the character string representing - the name of the terminal being used. filenum is the UNIX file - descriptor of the terminal to be used for output. errret is a + the name of the terminal being used. filenum is the UNIX file + descriptor of the terminal to be used for output. errret is a pointer to an integer, in which a success or failure indication - is returned. The values returned can be 1 (all is well), 0 (no - such terminal), or -1 (some problem locating the terminfo + is returned. The values returned can be 1 (all is well), 0 (no + such terminal), or -1 (some problem locating the terminfo database). - - The value of term can be given as NULL, which will cause the + + The value of term can be given as NULL, which will cause the value of TERM in the environment to be used. The errret pointer - can also be given as NULL, meaning no error code is wanted. If + can also be given as NULL, meaning no error code is wanted. If errret is defaulted, and something goes wrong, setupterm() will - print an appropriate error message and exit, rather than - returning. Thus, a simple program can call setupterm(0, 1, 0) + print an appropriate error message and exit, rather than + returning. Thus, a simple program can call setupterm(0, 1, 0) and not worry about initialization errors. - - After the call to setupterm(), the global variable cur_term is + + After the call to setupterm(), the global variable cur_term is set to point to the current structure of terminal capabilities. - By calling setupterm() for each terminal, and saving and - restoring cur_term, it is possible for a program to use two or - more terminals at once. Setupterm() also stores the names - section of the terminal description in the global character + By calling setupterm() for each terminal, and saving and + restoring cur_term, it is possible for a program to use two or + more terminals at once. Setupterm() also stores the names + section of the terminal description in the global character array ttytype[]. Subsequent calls to setupterm() will overwrite this array, so you'll have to save it yourself if need be. - + Debugging - + NOTE: These functions are not part of the standard curses API! - + trace() - This function can be used to explicitly set a trace level. If - the trace level is nonzero, execution of your program will + This function can be used to explicitly set a trace level. If + the trace level is nonzero, execution of your program will generate a file called `trace' in the current working directory - containing a report on the library's actions. Higher trace - levels enable more detailed (and verbose) reporting -- see - comments attached to TRACE_ defines in the curses.h file for + containing a report on the library's actions. Higher trace + levels enable more detailed (and verbose) reporting -- see + comments attached to TRACE_ defines in the curses.h file for details. (It is also possible to set a trace level by assigning a trace level value to the environment variable NCURSES_TRACE). - + _tracef() - This function can be used to output your own debugging - information. It is only available only if you link with - -lncurses_g. It can be used the same way as printf(), only it - outputs a newline after the end of arguments. The output goes + This function can be used to output your own debugging + information. It is only available only if you link with + -lncurses_g. It can be used the same way as printf(), only it + outputs a newline after the end of arguments. The output goes to a file called trace in the current directory. - - Trace logs can be difficult to interpret due to the sheer volume of + + Trace logs can be difficult to interpret due to the sheer volume of data dumped in them. There is a script called tracemunch included with - the ncurses distribution that can alleviate this problem somewhat; it - compacts long sequences of similar operations into more succinct - single-line pseudo-operations. These pseudo-ops can be distinguished + the ncurses distribution that can alleviate this problem somewhat; it + compacts long sequences of similar operations into more succinct + single-line pseudo-operations. These pseudo-ops can be distinguished by the fact that they are named in capital letters. - + Hints, Tips, and Tricks The ncurses manual pages are a complete reference for this library. In the remainder of this document, we discuss various useful methods that may not be obvious from the manual page descriptions. - + Some Notes of Caution - - If you find yourself thinking you need to use noraw() or nocbreak(), - think again and move carefully. It's probably better design to use - getstr() or one of its relatives to simulate cooked mode. The noraw() - and nocbreak() functions try to restore cooked mode, but they may end - up clobbering some control bits set before you started your - application. Also, they have always been poorly documented, and are - likely to hurt your application's usability with other curses + + If you find yourself thinking you need to use noraw() or nocbreak(), + think again and move carefully. It's probably better design to use + getstr() or one of its relatives to simulate cooked mode. The noraw() + and nocbreak() functions try to restore cooked mode, but they may end + up clobbering some control bits set before you started your + application. Also, they have always been poorly documented, and are + likely to hurt your application's usability with other curses libraries. - - Bear in mind that refresh() is a synonym for wrefresh(stdscr). Don't - try to mix use of stdscr with use of windows declared by newwin(); a - refresh() call will blow them off the screen. The right way to handle - this is to use subwin(), or not touch stdscr at all and tile your - screen with declared windows which you then wnoutrefresh() somewhere - in your program event loop, with a single doupdate() call to trigger + + Bear in mind that refresh() is a synonym for wrefresh(stdscr). Don't + try to mix use of stdscr with use of windows declared by newwin(); a + refresh() call will blow them off the screen. The right way to handle + this is to use subwin(), or not touch stdscr at all and tile your + screen with declared windows which you then wnoutrefresh() somewhere + in your program event loop, with a single doupdate() call to trigger actual repainting. - - You are much less likely to run into problems if you design your - screen layouts to use tiled rather than overlapping windows. - Historically, curses support for overlapping windows has been weak, - fragile, and poorly documented. The ncurses library is not yet an + + You are much less likely to run into problems if you design your + screen layouts to use tiled rather than overlapping windows. + Historically, curses support for overlapping windows has been weak, + fragile, and poorly documented. The ncurses library is not yet an exception to this rule. - - There is a panels library included in the ncurses distribution that - does a pretty good job of strengthening the overlapping-windows + + There is a panels library included in the ncurses distribution that + does a pretty good job of strengthening the overlapping-windows facilities. - + Try to avoid using the global variables LINES and COLS. Use getmaxyx() - on the stdscr context instead. Reason: your code may be ported to run - in an environment with window resizes, in which case several screens + on the stdscr context instead. Reason: your code may be ported to run + in an environment with window resizes, in which case several screens could be open with different sizes. - + Temporarily Leaving NCURSES Mode - - Sometimes you will want to write a program that spends most of its - time in screen mode, but occasionally returns to ordinary `cooked' - mode. A common reason for this is to support shell-out. This behavior + + Sometimes you will want to write a program that spends most of its + time in screen mode, but occasionally returns to ordinary `cooked' + mode. A common reason for this is to support shell-out. This behavior is simple to arrange in ncurses. - - To leave ncurses mode, call endwin() as you would if you were - intending to terminate the program. This will take the screen back to - cooked mode; you can do your shell-out. When you want to return to - ncurses mode, simply call refresh() or doupdate(). This will repaint + + To leave ncurses mode, call endwin() as you would if you were + intending to terminate the program. This will take the screen back to + cooked mode; you can do your shell-out. When you want to return to + ncurses mode, simply call refresh() or doupdate(). This will repaint the screen. - - There is a boolean function, isendwin(), which code can use to test + + There is a boolean function, isendwin(), which code can use to test whether ncurses screen mode is active. It returns TRUE in the interval between an endwin() call and the following refresh(), FALSE otherwise. - + Here is some sample code for shellout: addstr("Shelling out..."); def_prog_mode(); /* save current tty modes */ @@ -796,319 +799,319 @@ Hints, Tips, and Tricks refresh(); /* restore save modes, repaint screen */ Using NCURSES under XTERM - - A resize operation in X sends SIGWINCH to the application running - under xterm. The ncurses library provides an experimental signal - handler, but in general does not catch this signal, because it cannot - know how you want the screen re-painted. You will usually have to + + A resize operation in X sends SIGWINCH to the application running + under xterm. The ncurses library provides an experimental signal + handler, but in general does not catch this signal, because it cannot + know how you want the screen re-painted. You will usually have to write the SIGWINCH handler yourself. Ncurses can give you some help. - - The easiest way to code your SIGWINCH handler is to have it do an + + The easiest way to code your SIGWINCH handler is to have it do an endwin, followed by an refresh and a screen repaint you code yourself. - The refresh will pick up the new screen size from the xterm's + The refresh will pick up the new screen size from the xterm's environment. - - That is the standard way, of course (it even works with some vendor's - curses implementations). Its drawback is that it clears the screen to + + That is the standard way, of course (it even works with some vendor's + curses implementations). Its drawback is that it clears the screen to reinitialize the display, and does not resize subwindows which must be - shrunk. Ncurses provides an extension which works better, the - resizeterm function. That function ensures that all windows are - limited to the new screen dimensions, and pads stdscr with blanks if + shrunk. Ncurses provides an extension which works better, the + resizeterm function. That function ensures that all windows are + limited to the new screen dimensions, and pads stdscr with blanks if the screen is larger. - - Finally, ncurses can be configured to provide its own SIGWINCH + + Finally, ncurses can be configured to provide its own SIGWINCH handler, based on resizeterm. - + Handling Multiple Terminal Screens - + The initscr() function actually calls a function named newterm() to do - most of its work. If you are writing a program that opens multiple + most of its work. If you are writing a program that opens multiple terminals, use newterm() directly. - - For each call, you will have to specify a terminal type and a pair of - file pointers; each call will return a screen reference, and stdscr + + For each call, you will have to specify a terminal type and a pair of + file pointers; each call will return a screen reference, and stdscr will be set to the last one allocated. You will switch between screens - with the set_term call. Note that you will also have to call + with the set_term call. Note that you will also have to call def_shell_mode and def_prog_mode on each tty yourself. - + Testing for Terminal Capabilities - + Sometimes you may want to write programs that test for the presence of - various capabilities before deciding whether to go into ncurses mode. - An easy way to do this is to call setupterm(), then use the functions + various capabilities before deciding whether to go into ncurses mode. + An easy way to do this is to call setupterm(), then use the functions tigetflag(), tigetnum(), and tigetstr() to do your testing. - - A particularly useful case of this often comes up when you want to - test whether a given terminal type should be treated as `smart' + + A particularly useful case of this often comes up when you want to + test whether a given terminal type should be treated as `smart' (cursor-addressable) or `stupid'. The right way to test this is to see if the return value of tigetstr("cup") is non-NULL. Alternatively, you - can include the term.h file and test the value of the macro + can include the term.h file and test the value of the macro cursor_address. - + Tuning for Speed - - Use the addchstr() family of functions for fast screen-painting of - text when you know the text doesn't contain any control characters. - Try to make attribute changes infrequent on your screens. Don't use + + Use the addchstr() family of functions for fast screen-painting of + text when you know the text doesn't contain any control characters. + Try to make attribute changes infrequent on your screens. Don't use the immedok() option! - + Special Features of NCURSES - - The wresize() function allows you to resize a window in place. The - associated resizeterm() function simplifies the construction of + + The wresize() function allows you to resize a window in place. The + associated resizeterm() function simplifies the construction of SIGWINCH handlers, for resizing all windows. - + The define_key() function allows you to define at runtime function-key - control sequences which are not in the terminal description. The - keyok() function allows you to temporarily enable or disable + control sequences which are not in the terminal description. The + keyok() function allows you to temporarily enable or disable interpretation of any function-key control sequence. - + The use_default_colors() function allows you to construct applications - which can use the terminal's default foreground and background colors - as an additional "default" color. Several terminal emulators support + which can use the terminal's default foreground and background colors + as an additional "default" color. Several terminal emulators support this feature, which is based on ISO 6429. - - Ncurses supports up 16 colors, unlike SVr4 curses which defines only + + Ncurses supports up 16 colors, unlike SVr4 curses which defines only 8. While most terminals which provide color allow only 8 colors, about a quarter (including XFree86 xterm) support 16 colors. - + Compatibility with Older Versions - Despite our best efforts, there are some differences between ncurses - and the (undocumented!) behavior of older curses implementations. - These arise from ambiguities or omissions in the documentation of the + Despite our best efforts, there are some differences between ncurses + and the (undocumented!) behavior of older curses implementations. + These arise from ambiguities or omissions in the documentation of the API. - + Refresh of Overlapping Windows - - If you define two windows A and B that overlap, and then alternately - scribble on and refresh them, the changes made to the overlapping - region under historic curses versions were often not documented + + If you define two windows A and B that overlap, and then alternately + scribble on and refresh them, the changes made to the overlapping + region under historic curses versions were often not documented precisely. - - To understand why this is a problem, remember that screen updates are - calculated between two representations of the entire display. The - documentation says that when you refresh a window, it is first copied - to to the virtual screen, and then changes are calculated to update - the physical screen (and applied to the terminal). But "copied to" is - not very specific, and subtle differences in how copying works can - produce different behaviors in the case where two overlapping windows + + To understand why this is a problem, remember that screen updates are + calculated between two representations of the entire display. The + documentation says that when you refresh a window, it is first copied + to to the virtual screen, and then changes are calculated to update + the physical screen (and applied to the terminal). But "copied to" is + not very specific, and subtle differences in how copying works can + produce different behaviors in the case where two overlapping windows are each being refreshed at unpredictable intervals. - - What happens to the overlapping region depends on what wnoutrefresh() - does with its argument -- what portions of the argument window it - copies to the virtual screen. Some implementations do "change copy", - copying down only locations in the window that have changed (or been - marked changed with wtouchln() and friends). Some implementations do - "entire copy", copying all window locations to the virtual screen + + What happens to the overlapping region depends on what wnoutrefresh() + does with its argument -- what portions of the argument window it + copies to the virtual screen. Some implementations do "change copy", + copying down only locations in the window that have changed (or been + marked changed with wtouchln() and friends). Some implementations do + "entire copy", copying all window locations to the virtual screen whether or not they have changed. - - The ncurses library itself has not always been consistent on this - score. Due to a bug, versions 1.8.7 to 1.9.8a did entire copy. - Versions 1.8.6 and older, and versions 1.9.9 and newer, do change + + The ncurses library itself has not always been consistent on this + score. Due to a bug, versions 1.8.7 to 1.9.8a did entire copy. + Versions 1.8.6 and older, and versions 1.9.9 and newer, do change copy. - - For most commercial curses implementations, it is not documented and - not known for sure (at least not to the ncurses maintainers) whether - they do change copy or entire copy. We know that System V release 3 - curses has logic in it that looks like an attempt to do change copy, - but the surrounding logic and data representations are sufficiently - complex, and our knowledge sufficiently indirect, that it's hard to - know whether this is reliable. It is not clear what the SVr4 - documentation and XSI standard intend. The XSI Curses standard barely - mentions wnoutrefresh(); the SVr4 documents seem to be describing + + For most commercial curses implementations, it is not documented and + not known for sure (at least not to the ncurses maintainers) whether + they do change copy or entire copy. We know that System V release 3 + curses has logic in it that looks like an attempt to do change copy, + but the surrounding logic and data representations are sufficiently + complex, and our knowledge sufficiently indirect, that it's hard to + know whether this is reliable. It is not clear what the SVr4 + documentation and XSI standard intend. The XSI Curses standard barely + mentions wnoutrefresh(); the SVr4 documents seem to be describing entire-copy, but it is possible with some effort and straining to read them the other way. - - It might therefore be unwise to rely on either behavior in programs - that might have to be linked with other curses implementations. - Instead, you can do an explicit touchwin() before the wnoutrefresh() + + It might therefore be unwise to rely on either behavior in programs + that might have to be linked with other curses implementations. + Instead, you can do an explicit touchwin() before the wnoutrefresh() call to guarantee an entire-contents copy anywhere. - - The really clean way to handle this is to use the panels library. If, - when you want a screen update, you do update_panels(), it will do all - the necessary wnoutrfresh() calls for whatever panel stacking order - you have defined. Then you can do one doupdate() and there will be a + + The really clean way to handle this is to use the panels library. If, + when you want a screen update, you do update_panels(), it will do all + the necessary wnoutrfresh() calls for whatever panel stacking order + you have defined. Then you can do one doupdate() and there will be a single burst of physical I/O that will do all your updates. - + Background Erase - + If you have been using a very old versions of ncurses (1.8.7 or older) - you may be surprised by the behavior of the erase functions. In older - versions, erased areas of a window were filled with a blank modified - by the window's current attribute (as set by wattrset(), wattron(), + you may be surprised by the behavior of the erase functions. In older + versions, erased areas of a window were filled with a blank modified + by the window's current attribute (as set by wattrset(), wattron(), wattroff() and friends). - - In newer versions, this is not so. Instead, the attribute of erased - blanks is normal unless and until it is modified by the functions + + In newer versions, this is not so. Instead, the attribute of erased + blanks is normal unless and until it is modified by the functions bkgdset() or wbkgdset(). - + This change in behavior conforms ncurses to System V Release 4 and the XSI Curses standard. - + XSI Curses Conformance - The ncurses library is intended to be base-level conformant with the - XSI Curses standard from X/Open. Many extended-level features (in - fact, almost all features not directly concerned with wide characters + The ncurses library is intended to be base-level conformant with the + XSI Curses standard from X/Open. Many extended-level features (in + fact, almost all features not directly concerned with wide characters and internationalization) are also supported. - - One effect of XSI conformance is the change in behavior described + + One effect of XSI conformance is the change in behavior described under "Background Erase -- Compatibility with Old Versions". - - Also, ncurses meets the XSI requirement that every macro entry point - have a corresponding function which may be linked (and will be + + Also, ncurses 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. - + The Panels Library - - The ncurses library by itself provides good support for screen + + The ncurses library by itself provides good support for screen displays in which the windows are tiled (non-overlapping). In the more - general case that windows may overlap, you have to use a series of - wnoutrefresh() calls followed by a doupdate(), and be careful about + general case that windows may overlap, you have to use a series of + wnoutrefresh() calls followed by a doupdate(), and be careful about the order you do the window refreshes in. It has to be bottom-upwards, otherwise parts of windows that should be obscured will show through. - - When your interface design is such that windows may dive deeper into - the visibility stack or pop to the top at runtime, the resulting - book-keeping can be tedious and difficult to get right. Hence the + + When your interface design is such that windows may dive deeper into + the visibility stack or pop to the top at runtime, the resulting + book-keeping can be tedious and difficult to get right. Hence the panels library. - - The panel library first appeared in AT&T System V. The version + + The panel library first appeared in AT&T System V. The version documented here is the panel code distributed with ncurses. - + Compiling With the Panels Library - Your panels-using modules must import the panels library declarations + Your panels-using modules must import the panels library declarations with #include and must be linked explicitly with the panels library using an -lpanel - argument. Note that they must also link the ncurses library with + argument. Note that they must also link the ncurses library with -lncurses. Many linkers are two-pass and will accept either order, but it is still good practice to put -lpanel first and -lncurses second. - + Overview of Panels - A panel object is a window that is implicitly treated as part of a - deck including all other panel objects. The deck has an implicit - bottom-to-top visibility order. The panels library includes an update + A panel object is a window that is implicitly treated as part of a + deck including all other panel objects. The deck has an implicit + bottom-to-top visibility order. The panels library includes an update function (analogous to refresh()) that displays all panels in the deck - in the proper order to resolve overlaps. The standard window, stdscr, + in the proper order to resolve overlaps. The standard window, stdscr, is considered below all panels. - - Details on the panels functions are available in the man pages. We'll + + Details on the panels functions are available in the man pages. We'll just hit the highlights here. - - You create a panel from a window by calling new_panel() on a window - pointer. It then becomes the top of the deck. The panel's window is + + You create a panel from a window by calling new_panel() on a window + pointer. It then becomes the top of the deck. The panel's window is available as the value of panel_window() called with the panel pointer as argument. - - You can delete a panel (removing it from the deck) with del_panel. - This will not deallocate the associated window; you have to do that - yourself. You can replace a panel's window with a different window by - calling replace_window. The new window may be of different size; the + + You can delete a panel (removing it from the deck) with del_panel. + This will not deallocate the associated window; you have to do that + yourself. You can replace a panel's window with a different window by + calling replace_window. The new window may be of different size; the panel code will re-compute all overlaps. This operation doesn't change the panel's position in the deck. - - To move a panel's window, use move_panel(). The mvwin() function on - the panel's window isn't sufficient because it doesn't update the - panels library's representation of where the windows are. This + + To move a panel's window, use move_panel(). The mvwin() function on + the panel's window isn't sufficient because it doesn't update the + panels library's representation of where the windows are. This operation leaves the panel's depth, contents, and size unchanged. - - Two functions (top_panel(), bottom_panel()) are provided for + + Two functions (top_panel(), bottom_panel()) are provided for rearranging the deck. The first pops its argument window to the top of - the deck; the second sends it to the bottom. Either operation leaves + the deck; the second sends it to the bottom. Either operation leaves the panel's screen location, contents, and size unchanged. - - The function update_panels() does all the wnoutrefresh() calls needed + + The function update_panels() does all the wnoutrefresh() calls needed to prepare for doupdate() (which you must call yourself, afterwards). - - Typically, you will want to call update_panels() and doupdate() just + + Typically, you will want to call update_panels() and doupdate() just before accepting command input, once in each cycle of interaction with - the user. If you call update_panels() after each and every panel - write, you'll generate a lot of unnecessary refresh activity and + the user. If you call update_panels() after each and every panel + write, you'll generate a lot of unnecessary refresh activity and screen flicker. - + Panels, Input, and the Standard Screen - You shouldn't mix wnoutrefresh() or wrefresh() operations with panels - code; this will work only if the argument window is either in the top + You shouldn't mix wnoutrefresh() or wrefresh() operations with panels + code; this will work only if the argument window is either in the top panel or unobscured by any other panels. - - The stsdcr window is a special case. It is considered below all + + The stsdcr window is a special case. It is considered below all panels. Because changes to panels may obscure parts of stdscr, though, - you should call update_panels() before doupdate() even when you only + you should call update_panels() before doupdate() even when you only change stdscr. - - Note that wgetch automatically calls wrefresh. Therefore, before - requesting input from a panel window, you need to be sure that the + + Note that wgetch automatically calls wrefresh. Therefore, before + requesting input from a panel window, you need to be sure that the panel is totally unobscured. - - There is presently no way to display changes to one obscured panel + + There is presently no way to display changes to one obscured panel without repainting all panels. - + Hiding Panels - It's possible to remove a panel from the deck temporarily; use - hide_panel for this. Use show_panel() to render it visible again. The - predicate function panel_hidden tests whether or not a panel is + It's possible to remove a panel from the deck temporarily; use + hide_panel for this. Use show_panel() to render it visible again. The + predicate function panel_hidden tests whether or not a panel is hidden. - + The panel_update code ignores hidden panels. You cannot do top_panel() - or bottom_panel on a hidden panel(). Other panels operations are + or bottom_panel on a hidden panel(). Other panels operations are applicable. - + Miscellaneous Other Facilities - It's possible to navigate the deck using the functions panel_above() - and panel_below. Handed a panel pointer, they return the panel above - or below that panel. Handed NULL, they return the bottom-most or + It's possible to navigate the deck using the functions panel_above() + and panel_below. Handed a panel pointer, they return the panel above + or below that panel. Handed NULL, they return the bottom-most or top-most panel. - - Every panel has an associated user pointer, not used by the panel - code, to which you can attach application data. See the man page + + Every panel has an associated user pointer, not used by the panel + code, to which you can attach application data. See the man page documentation of set_panel_userptr() and panel_userptr for details. - + The Menu Library - + A menu is a screen display that assists the user to choose some subset - of a given set of items. The menu library is a curses extension that - supports easy programming of menu hierarchies with a uniform but + of a given set of items. The menu library is a curses extension that + supports easy programming of menu hierarchies with a uniform but flexible interface. - - The menu library first appeared in AT&T System V. The version + + The menu library first appeared in AT&T System V. The version documented here is the menu code distributed with ncurses. - + Compiling With the menu Library Your menu-using modules must import the menu library declarations with #include - and must be linked explicitly with the menus library using an -lmenu - argument. Note that they must also link the ncurses library with + and must be linked explicitly with the menus library using an -lmenu + argument. Note that they must also link the ncurses library with -lncurses. Many linkers are two-pass and will accept either order, but it is still good practice to put -lmenu first and -lncurses second. - + Overview of Menus - The menus created by this library consist of collections of items - including a name string part and a description string part. To make - menus, you create groups of these items and connect them with menu + The menus created by this library consist of collections of items + including a name string part and a description string part. To make + menus, you create groups of these items and connect them with menu frame objects. - - The menu can then by posted, that is written to an associated window. + + The menu can then by posted, that is written to an associated window. Actually, each menu has two associated windows; a containing window in - which the programmer can scribble titles or borders, and a subwindow + which the programmer can scribble titles or borders, and a subwindow in which the menu items proper are displayed. If this subwindow is too - small to display all the items, it will be a scrollable viewport on + small to display all the items, it will be a scrollable viewport on the collection of items. - - A menu may also be unposted (that is, undisplayed), and finally freed - to make the storage associated with it and its items available for + + A menu may also be unposted (that is, undisplayed), and finally freed + to make the storage associated with it and its items available for re-use. - + The general flow of control of a menu program looks like this: 1. Initialize curses. 2. Create the menu items, using new_item(). @@ -1120,195 +1123,195 @@ Overview of Menus 8. Free the menu, using free_menu(). 9. Free the items using free_item(). 10. Terminate curses. - + Selecting items - Menus may be multi-valued or (the default) single-valued (see the - manual page menu_opts(3x) to see how to change the default). Both + Menus may be multi-valued or (the default) single-valued (see the + manual page menu_opts(3x) to see how to change the default). Both types always have a current item. - - From a single-valued menu you can read the selected value simply by - looking at the current item. From a multi-valued menu, you get the - selected set by looping through the items applying the item_value() - predicate function. Your menu-processing code can use the function + + From a single-valued menu you can read the selected value simply by + looking at the current item. From a multi-valued menu, you get the + selected set by looping through the items applying the item_value() + predicate function. Your menu-processing code can use the function set_item_value() to flag the items in the select set. - - Menu items can be made unselectable using set_item_opts() or - item_opts_off() with the O_SELECTABLE argument. This is the only - option so far defined for menus, but it is good practice to code as + + Menu items can be made unselectable using set_item_opts() or + item_opts_off() with the O_SELECTABLE argument. This is the only + option so far defined for menus, but it is good practice to code as though other option bits might be on. - + Menu Display - The menu library calculates a minimum display size for your window, + The menu library calculates a minimum display size for your window, based on the following variables: * The number and maximum length of the menu items * Whether the O_ROWMAJOR option is enabled * Whether display of descriptions is enabled * Whatever menu format may have been set by the programmer - * The length of the menu mark string used for highlighting selected + * The length of the menu mark string used for highlighting selected items - - The function set_menu_format() allows you to set the maximum size of + + The function set_menu_format() allows you to set the maximum size of the viewport or menu page that will be used to display menu items. You can retrieve any format associated with a menu with menu_format(). The default format is rows=16, columns=1. - + The actual menu page may be smaller than the format size. This depends - on the item number and size and whether O_ROWMAJOR is on. This option - (on by default) causes menu items to be displayed in a `raster-scan' + on the item number and size and whether O_ROWMAJOR is on. This option + (on by default) causes menu items to be displayed in a `raster-scan' pattern, so that if more than one item will fit horizontally the first - couple of items are side-by-side in the top row. The alternative is - column-major display, which tries to put the first several items in + couple of items are side-by-side in the top row. The alternative is + column-major display, which tries to put the first several items in the first column. - - As mentioned above, a menu format not large enough to allow all items - to fit on-screen will result in a menu display that is vertically + + As mentioned above, a menu format not large enough to allow all items + to fit on-screen will result in a menu display that is vertically scrollable. - - You can scroll it with requests to the menu driver, which will be + + You can scroll it with requests to the menu driver, which will be described in the section on menu input handling. - - Each menu has a mark string used to visually tag selected items; see + + Each menu has a mark string used to visually tag selected items; see the menu_mark(3x) manual page for details. The mark string length also influences the menu page size. - - The function scale_menu() returns the minimum display size that the - menu code computes from all these factors. There are other menu - display attributes including a select attribute, an attribute for - selectable items, an attribute for unselectable items, and a pad + + The function scale_menu() returns the minimum display size that the + menu code computes from all these factors. There are other menu + display attributes including a select attribute, an attribute for + selectable items, an attribute for unselectable items, and a pad character used to separate item name text from description text. These - have reasonable defaults which the library allows you to change (see + have reasonable defaults which the library allows you to change (see the menu_attribs(3x) manual page. - + Menu Windows - Each menu has, as mentioned previously, a pair of associated windows. + Each menu has, as mentioned previously, a pair of associated windows. Both these windows are painted when the menu is posted and erased when the menu is unposted. - - The outer or frame window is not otherwise touched by the menu + + The outer or frame window is not otherwise touched by the menu routines. It exists so the programmer can associate a title, a border, - or perhaps help text with the menu and have it properly refreshed or + or perhaps help text with the menu and have it properly refreshed or erased at post/unpost time. The inner window or subwindow is where the current menu page is displayed. - - By default, both windows are stdscr. You can set them with the + + By default, both windows are stdscr. You can set them with the functions in menu_win(3x). - - When you call menu_post(), you write the menu to its subwindow. When - you call menu_unpost(), you erase the subwindow, However, neither of - these actually modifies the screen. To do that, call wrefresh() or + + When you call menu_post(), you write the menu to its subwindow. When + you call menu_unpost(), you erase the subwindow, However, neither of + these actually modifies the screen. To do that, call wrefresh() or some equivalent. - + Processing Menu Input - The main loop of your menu-processing code should call menu_driver() - repeatedly. The first argument of this routine is a menu pointer; the - second is a menu command code. You should write an input-fetching + The main loop of your menu-processing code should call menu_driver() + repeatedly. The first argument of this routine is a menu pointer; the + second is a menu command code. You should write an input-fetching routine that maps input characters to menu command codes, and pass its - output to menu_driver(). The menu command codes are fully documented + output to menu_driver(). The menu command codes are fully documented in menu_driver(3x). - - The simplest group of command codes is REQ_NEXT_ITEM, REQ_PREV_ITEM, - REQ_FIRST_ITEM, REQ_LAST_ITEM, REQ_UP_ITEM, REQ_DOWN_ITEM, - REQ_LEFT_ITEM, REQ_RIGHT_ITEM. These change the currently selected - item. These requests may cause scrolling of the menu page if it only + + The simplest group of command codes is REQ_NEXT_ITEM, REQ_PREV_ITEM, + REQ_FIRST_ITEM, REQ_LAST_ITEM, REQ_UP_ITEM, REQ_DOWN_ITEM, + REQ_LEFT_ITEM, REQ_RIGHT_ITEM. These change the currently selected + item. These requests may cause scrolling of the menu page if it only partially displayed. - - There are explicit requests for scrolling which also change the - current item (because the select location does not change, but the - item there does). These are REQ_SCR_DLINE, REQ_SCR_ULINE, + + There are explicit requests for scrolling which also change the + current item (because the select location does not change, but the + item there does). These are REQ_SCR_DLINE, REQ_SCR_ULINE, REQ_SCR_DPAGE, and REQ_SCR_UPAGE. - - The REQ_TOGGLE_ITEM selects or deselects the current item. It is for - use in multi-valued menus; if you use it with O_ONEVALUE on, you'll + + The REQ_TOGGLE_ITEM selects or deselects the current item. It is for + use in multi-valued menus; if you use it with O_ONEVALUE on, you'll get an error return (E_REQUEST_DENIED). - - Each menu has an associated pattern buffer. The menu_driver() logic - tries to accumulate printable ASCII characters passed in in that - buffer; when it matches a prefix of an item name, that item (or the - next matching item) is selected. If appending a character yields no - new match, that character is deleted from the pattern buffer, and + + Each menu has an associated pattern buffer. The menu_driver() logic + tries to accumulate printable ASCII characters passed in in that + buffer; when it matches a prefix of an item name, that item (or the + next matching item) is selected. If appending a character yields no + new match, that character is deleted from the pattern buffer, and menu_driver() returns E_NO_MATCH. - - Some requests change the pattern buffer directly: REQ_CLEAR_PATTERN, - REQ_BACK_PATTERN, REQ_NEXT_MATCH, REQ_PREV_MATCH. The latter two are - useful when pattern buffer input matches more than one item in a + + Some requests change the pattern buffer directly: REQ_CLEAR_PATTERN, + REQ_BACK_PATTERN, REQ_NEXT_MATCH, REQ_PREV_MATCH. The latter two are + useful when pattern buffer input matches more than one item in a multi-valued menu. - - Each successful scroll or item navigation request clears the pattern - buffer. It is also possible to set the pattern buffer explicitly with + + Each successful scroll or item navigation request clears the pattern + buffer. It is also possible to set the pattern buffer explicitly with set_menu_pattern(). - - Finally, menu driver requests above the constant MAX_COMMAND are - considered application-specific commands. The menu_driver() code + + Finally, menu driver requests above the constant MAX_COMMAND are + considered application-specific commands. The menu_driver() code ignores them and returns E_UNKNOWN_COMMAND. - + Miscellaneous Other Features - Various menu options can affect the processing and visual appearance + Various menu options can affect the processing and visual appearance and input processing of menus. See menu_opts(3x) for details. - - It is possible to change the current item from application code; this - is useful if you want to write your own navigation requests. It is - also possible to explicitly set the top row of the menu display. See - mitem_current(3x). If your application needs to change the menu - subwindow cursor for any reason, pos_menu_cursor() will restore it to + + It is possible to change the current item from application code; this + is useful if you want to write your own navigation requests. It is + also possible to explicitly set the top row of the menu display. See + mitem_current(3x). If your application needs to change the menu + subwindow cursor for any reason, pos_menu_cursor() will restore it to the correct location for continuing menu driver processing. - - It is possible to set hooks to be called at menu initialization and - wrapup time, and whenever the selected item changes. See + + It is possible to set hooks to be called at menu initialization and + wrapup time, and whenever the selected item changes. See menu_hook(3x). - - Each item, and each menu, has an associated user pointer on which you + + Each item, and each menu, has an associated user pointer on which you can hang application data. See mitem_userptr(3x) and menu_userptr(3x). - + The Forms Library - - The form library is a curses extension that supports easy programming + + The form library is a curses extension that supports easy programming of on-screen forms for data entry and program control. - - The form library first appeared in AT&T System V. The version + + The form library first appeared in AT&T System V. The version documented here is the form code distributed with ncurses. - + Compiling With the form Library Your form-using modules must import the form library declarations with #include - and must be linked explicitly with the forms library using an -lform - argument. Note that they must also link the ncurses library with + and must be linked explicitly with the forms library using an -lform + argument. Note that they must also link the ncurses library with -lncurses. Many linkers are two-pass and will accept either order, but it is still good practice to put -lform first and -lncurses second. - + Overview of Forms - A form is a collection of fields; each field may be either a label - (explanatory text) or a data-entry location. Long forms may be + A form is a collection of fields; each field may be either a label + (explanatory text) or a data-entry location. Long forms may be segmented into pages; each entry to a new page clears the screen. - - To make forms, you create groups of fields and connect them with form + + To make forms, you create groups of fields and connect them with form frame objects; the form library makes this relatively simple. - - Once defined, a form can be posted, that is written to an associated - window. Actually, each form has two associated windows; a containing - window in which the programmer can scribble titles or borders, and a + + Once defined, a form can be posted, that is written to an associated + window. Actually, each form has two associated windows; a containing + window in which the programmer can scribble titles or borders, and a subwindow in which the form fields proper are displayed. - - As the form user fills out the posted form, navigation and editing - keys support movement between fields, editing keys support modifying - field, and plain text adds to or changes data in a current field. The - form library allows you (the forms designer) to bind each navigation - and editing key to any keystroke accepted by curses Fields may have - validation conditions on them, so that they check input data for type - and value. The form library supplies a rich set of pre-defined field + + As the form user fills out the posted form, navigation and editing + keys support movement between fields, editing keys support modifying + field, and plain text adds to or changes data in a current field. The + form library allows you (the forms designer) to bind each navigation + and editing key to any keystroke accepted by curses Fields may have + validation conditions on them, so that they check input data for type + and value. The form library supplies a rich set of pre-defined field types, and makes it relatively easy to define new ones. - + Once its transaction is completed (or aborted), a form may be unposted - (that is, undisplayed), and finally freed to make the storage + (that is, undisplayed), and finally freed to make the storage associated with it and its items available for re-use. - + The general flow of control of a form program looks like this: 1. Initialize curses. 2. Create the form fields, using new_field(). @@ -1320,17 +1323,17 @@ Overview of Forms 8. Free the form, using free_form(). 9. Free the fields using free_field(). 10. Terminate curses. - - Note that this looks much like a menu program; the form library - handles tasks which are in many ways similar, and its interface was - obviously designed to resemble that of the menu library wherever + + Note that this looks much like a menu program; the form library + handles tasks which are in many ways similar, and its interface was + obviously designed to resemble that of the menu library wherever possible. - - In forms programs, however, the `process user requests' is somewhat - more complicated than for menus. Besides menu-like navigation + + In forms programs, however, the `process user requests' is somewhat + more complicated than for menus. Besides menu-like navigation operations, the menu driver loop has to support field editing and data validation. - + Creating and Freeing Fields and Forms The basic function for creating fields is new_field(): @@ -1339,91 +1342,91 @@ FIELD *new_field(int height, int width, /* new field size */ int offscreen, /* number of offscreen rows */ int nbuf); /* number of working buffers */ - Menu items always occupy a single row, but forms fields may have - multiple rows. So new_field() requires you to specify a width and - height (the first two arguments, which mist both be greater than + Menu items always occupy a single row, but forms fields may have + multiple rows. So new_field() requires you to specify a width and + height (the first two arguments, which mist both be greater than zero). - + You must also specify the location of the field's upper left corner on - the screen (the third and fourth arguments, which must be zero or - greater). Note that these coordinates are relative to the form - subwindow, which will coincide with stdscr by default but need not be + the screen (the third and fourth arguments, which must be zero or + greater). Note that these coordinates are relative to the form + subwindow, which will coincide with stdscr by default but need not be stdscr if you've done an explicit set_form_window() call. - - The fifth argument allows you to specify a number of off-screen rows. - If this is zero, the entire field will always be displayed. If it is - nonzero, the form will be scrollable, with only one screen-full - (initially the top part) displayed at any given time. If you make a - field dynamic and grow it so it will no longer fit on the screen, the - form will become scrollable even if the offscreen argument was + + The fifth argument allows you to specify a number of off-screen rows. + If this is zero, the entire field will always be displayed. If it is + nonzero, the form will be scrollable, with only one screen-full + (initially the top part) displayed at any given time. If you make a + field dynamic and grow it so it will no longer fit on the screen, the + form will become scrollable even if the offscreen argument was initially zero. - - The forms library allocates one working buffer per field; the size of + + The forms library allocates one working buffer per field; the size of each buffer is ((height + offscreen)*width + 1, one character for each position in the field plus a NUL terminator. The sixth argument is the - number of additional data buffers to allocate for the field; your + number of additional data buffers to allocate for the field; your application can use them for its own purposes. FIELD *dup_field(FIELD *field, /* field to copy */ int top, int left); /* location of new copy */ - The function dup_field() duplicates an existing field at a new - location. Size and buffering information are copied; some attribute - flags and status bits are not (see the form_field_new(3X) for + The function dup_field() duplicates an existing field at a new + location. Size and buffering information are copied; some attribute + flags and status bits are not (see the form_field_new(3X) for details). FIELD *link_field(FIELD *field, /* field to copy */ int top, int left); /* location of new copy */ - The function link_field() also duplicates an existing field at a new - location. The difference from dup_field() is that it arranges for the + The function link_field() also duplicates an existing field at a new + location. The difference from dup_field() is that it arranges for the new field's buffer to be shared with the old one. - - Besides the obvious use in making a field editable from two different + + Besides the obvious use in making a field editable from two different form pages, linked fields give you a way to hack in dynamic labels. If - you declare several fields linked to an original, and then make them - inactive, changes from the original will still be propagated to the + you declare several fields linked to an original, and then make them + inactive, changes from the original will still be propagated to the linked fields. - - As with duplicated fields, linked fields have attribute bits separate + + As with duplicated fields, linked fields have attribute bits separate from the original. - - As you might guess, all these field-allocations return NULL if the - field allocation is not possible due to an out-of-memory error or + + As you might guess, all these field-allocations return NULL if the + field allocation is not possible due to an out-of-memory error or out-of-bounds arguments. - + To connect fields to a form, use FORM *new_form(FIELD **fields); - This function expects to see a NULL-terminated array of field - pointers. Said fields are connected to a newly-allocated form object; + This function expects to see a NULL-terminated array of field + pointers. Said fields are connected to a newly-allocated form object; its address is returned (or else NULL if the allocation fails). - - Note that new_field() does not copy the pointer array into private - storage; if you modify the contents of the pointer array during forms - processing, all manner of bizarre things might happen. Also note that + + Note that new_field() does not copy the pointer array into private + storage; if you modify the contents of the pointer array during forms + processing, all manner of bizarre things might happen. Also note that any given field may only be connected to one form. - - The functions free_field() and free_form are available to free field - and form objects. It is an error to attempt to free a field connected + + The functions free_field() and free_form are available to free field + and form objects. It is an error to attempt to free a field connected to a form, but not vice-versa; thus, you will generally free your form objects first. - + Fetching and Changing Field Attributes - Each form field has a number of location and size attributes - associated with it. There are other field attributes used to control + Each form field has a number of location and size attributes + associated with it. There are other field attributes used to control display and editing of the field. Some (for example, the O_STATIC bit) - involve sufficient complications to be covered in sections of their + involve sufficient complications to be covered in sections of their own later on. We cover the functions used to get and set several basic attributes here. - + When a field is created, the attributes not specified by the new_field - function are copied from an invisible system default field. In - attribute-setting and -fetching functions, the argument NULL is taken + function are copied from an invisible system default field. In + attribute-setting and -fetching functions, the argument NULL is taken to mean this field. Changes to it persist as defaults until your forms application terminates. - + Fetching Size and Location Data - + You can retrieve field sizes and locations through: int field_info(FIELD *field, /* field from which to fetch */ int *height, *int width, /* field size */ @@ -1431,40 +1434,40 @@ int field_info(FIELD *field, /* field from which to fetch */ int *offscreen, /* number of offscreen rows */ int *nbuf); /* number of working buffers */ - This function is a sort of inverse of new_field(); instead of setting - size and location attributes of a new field, it fetches them from an + This function is a sort of inverse of new_field(); instead of setting + size and location attributes of a new field, it fetches them from an existing one. - + Changing the Field Location - + It is possible to move a field's location on the screen: int move_field(FIELD *field, /* field to alter */ int top, int left); /* new upper-left corner */ You can, of course. query the current location through field_info(). - + The Justification Attribute - - One-line fields may be unjustified, justified right, justified left, + + One-line fields may be unjustified, justified right, justified left, or centered. Here is how you manipulate this attribute: int set_field_just(FIELD *field, /* field to alter */ int justmode); /* mode to set */ int field_just(FIELD *field); /* fetch mode of field */ - The mode values accepted and returned by this functions are - preprocessor macros NO_JUSTIFICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or + The mode values accepted and returned by this functions are + preprocessor macros NO_JUSTIFICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER. - + Field Display Attributes - - For each field, you can set a foreground attribute for entered - characters, a background attribute for the entire field, and a pad - character for the unfilled portion of the field. You can also control + + For each field, you can set a foreground attribute for entered + characters, a background attribute for the entire field, and a pad + character for the unfilled portion of the field. You can also control pagination of the form. - - This group of four field attributes controls the visual appearance of - the field on the screen, without affecting in any way the data in the + + This group of four field attributes controls the visual appearance of + the field on the screen, without affecting in any way the data in the field buffer. int set_field_fore(FIELD *field, /* field to alter */ chtype attr); /* attribute to set */ @@ -1487,14 +1490,14 @@ int set_new_page(FIELD *field, /* field to alter */ chtype new_page(FIELD *field); /* field to query */ The attributes set and returned by the first four functions are normal - curses(3x) display attribute values (A_STANDOUT, A_BOLD, A_REVERSE - etc). The page bit of a field controls whether it is displayed at the + curses(3x) display attribute values (A_STANDOUT, A_BOLD, A_REVERSE + etc). The page bit of a field controls whether it is displayed at the start of a new form screen. - + Field Option Bits - - There is also a large collection of field option bits you can set to - control various aspects of forms processing. You can manipulate them + + There is also a large collection of field option bits you can set to + control various aspects of forms processing. You can manipulate them with these functions: int set_field_opts(FIELD *field, /* field to alter */ int attr); /* attribute to set */ @@ -1508,171 +1511,171 @@ int field_opts_off(FIELD *field, /* field to alter */ int field_opts(FIELD *field); /* field to query */ By default, all options are on. Here are the available option bits: - + O_VISIBLE - Controls whether the field is visible on the screen. Can be - used during form processing to hide or pop up fields depending + Controls whether the field is visible on the screen. Can be + used during form processing to hide or pop up fields depending on the value of parent fields. - + O_ACTIVE - Controls whether the field is active during forms processing - (i.e. visited by form navigation keys). Can be used to make - labels or derived fields with buffer values alterable by the + Controls whether the field is active during forms processing + (i.e. visited by form navigation keys). Can be used to make + labels or derived fields with buffer values alterable by the forms application, not the user. - + O_PUBLIC - Controls whether data is displayed during field entry. If this - option is turned off on a field, the library will accept and - edit data in that field, but it will not be displayed and the - visible field cursor will not move. You can turn off the + Controls whether data is displayed during field entry. If this + option is turned off on a field, the library will accept and + edit data in that field, but it will not be displayed and the + visible field cursor will not move. You can turn off the O_PUBLIC bit to define password fields. - + O_EDIT - Controls whether the field's data can be modified. When this - option is off, all editing requests except REQ_PREV_CHOICE and - REQ_NEXT_CHOICE will fail. Such read-only fields may be useful + Controls whether the field's data can be modified. When this + option is off, all editing requests except REQ_PREV_CHOICE and + REQ_NEXT_CHOICE will fail. Such read-only fields may be useful for help messages. - + O_WRAP Controls word-wrapping in multi-line fields. Normally, when any - character of a (blank-separated) word reaches the end of the - current line, the entire word is wrapped to the next line + character of a (blank-separated) word reaches the end of the + current line, the entire word is wrapped to the next line (assuming there is one). When this option is off, the word will be split across the line break. - + O_BLANK - Controls field blanking. When this option is on, entering a - character at the first field position erases the entire field + Controls field blanking. When this option is on, entering a + character at the first field position erases the entire field (except for the just-entered character). - + O_AUTOSKIP - Controls automatic skip to next field when this one fills. - Normally, when the forms user tries to type more data into a - field than will fit, the editing location jumps to next field. + Controls automatic skip to next field when this one fills. + Normally, when the forms user tries to type more data into a + field than will fit, the editing location jumps to next field. When this option is off, the user's cursor will hang at the end - of the field. This option is ignored in dynamic fields that + of the field. This option is ignored in dynamic fields that have not reached their size limit. - + O_NULLOK - Controls whether validation is applied to blank fields. - Normally, it is not; the user can leave a field blank without - invoking the usual validation check on exit. If this option is + Controls whether validation is applied to blank fields. + Normally, it is not; the user can leave a field blank without + invoking the usual validation check on exit. If this option is off on a field, exit from it will invoke a validation check. - + O_PASSOK Controls whether validation occurs on every exit, or only after - the field is modified. Normally the latter is true. Setting - O_PASSOK may be useful if your field's validation function may + the field is modified. Normally the latter is true. Setting + O_PASSOK may be useful if your field's validation function may change during forms processing. - + O_STATIC - Controls whether the field is fixed to its initial dimensions. - If you turn this off, the field becomes dynamic and will + Controls whether the field is fixed to its initial dimensions. + If you turn this off, the field becomes dynamic and will stretch to fit entered data. - - A field's options cannot be changed while the field is currently - selected. However, options may be changed on posted fields that are + + A field's options cannot be changed while the field is currently + selected. However, options may be changed on posted fields that are not current. - + The option values are bit-masks and can be composed with logical-or in the obvious way. - + Field Status Every field has a status flag, which is set to FALSE when the field is - created and TRUE when the value in field buffer 0 changes. This flag + created and TRUE when the value in field buffer 0 changes. This flag can be queried and set directly: int set_field_status(FIELD *field, /* field to alter */ int status); /* mode to set */ int field_status(FIELD *field); /* fetch mode of field */ - Setting this flag under program control can be useful if you use the + Setting this flag under program control can be useful if you use the same form repeatedly, looking for modified fields each time. - - Calling field_status() on a field not currently selected for input + + Calling field_status() on a field not currently selected for input will return a correct value. Calling field_status() on a field that is - currently selected for input may not necessarily give a correct field - status value, because entered data isn't necessarily copied to buffer - zero before the exit validation check. To guarantee that the returned - status value reflects reality, call field_status() either (1) in the - field's exit validation check routine, (2) from the field's or form's - initialization or termination hooks, or (3) just after a + currently selected for input may not necessarily give a correct field + status value, because entered data isn't necessarily copied to buffer + zero before the exit validation check. To guarantee that the returned + status value reflects reality, call field_status() either (1) in the + field's exit validation check routine, (2) from the field's or form's + initialization or termination hooks, or (3) just after a REQ_VALIDATION request has been processed by the forms driver. - + Field User Pointer - Each field structure contains one character pointer slot that is not - used by the forms library. It is intended to be used by applications + Each field structure contains one character pointer slot that is not + used by the forms library. It is intended to be used by applications to store private per-field data. You can manipulate it with: int set_field_userptr(FIELD *field, /* field to alter */ char *userptr); /* mode to set */ char *field_userptr(FIELD *field); /* fetch mode of field */ - (Properly, this user pointer field ought to have (void *) type. The + (Properly, this user pointer field ought to have (void *) type. The (char *) type is retained for System V compatibility.) - - It is valid to set the user pointer of the default field (with a - set_field_userptr() call passed a NULL field pointer.) When a new - field is created, the default-field user pointer is copied to + + It is valid to set the user pointer of the default field (with a + set_field_userptr() call passed a NULL field pointer.) When a new + field is created, the default-field user pointer is copied to initialize the new field's user pointer. - + Variable-Sized Fields - Normally, a field is fixed at the size specified for it at creation - time. If, however, you turn off its O_STATIC bit, it becomes dynamic - and will automatically resize itself to accommodate data as it is - entered. If the field has extra buffers associated with it, they will + Normally, a field is fixed at the size specified for it at creation + time. If, however, you turn off its O_STATIC bit, it becomes dynamic + and will automatically resize itself to accommodate data as it is + entered. If the field has extra buffers associated with it, they will grow right along with the main input buffer. - - A one-line dynamic field will have a fixed height (1) but variable + + A one-line dynamic field will have a fixed height (1) but variable width, scrolling horizontally to display data within the field area as - originally dimensioned and located. A multi-line dynamic field will - have a fixed width, but variable height (number of rows), scrolling - vertically to display data within the field area as originally + originally dimensioned and located. A multi-line dynamic field will + have a fixed width, but variable height (number of rows), scrolling + vertically to display data within the field area as originally dimensioned and located. - - Normally, a dynamic field is allowed to grow without limit. But it is - possible to set an upper limit on the size of a dynamic field. You do + + Normally, a dynamic field is allowed to grow without limit. But it is + possible to set an upper limit on the size of a dynamic field. You do it with this function: int set_max_field(FIELD *field, /* field to alter (may not be NULL) */ int max_size); /* upper limit on field size */ If the field is one-line, max_size is taken to be a column size limit; - if it is multi-line, it is taken to be a line size limit. To disable - any limit, use an argument of zero. The growth limit can be changed + if it is multi-line, it is taken to be a line size limit. To disable + any limit, use an argument of zero. The growth limit can be changed whether or not the O_STATIC bit is on, but has no effect until it is. - + The following properties of a field change when it becomes dynamic: - * If there is no growth limit, there is no final position of the + * If there is no growth limit, there is no final position of the field; therefore O_AUTOSKIP and O_NL_OVERLOAD are ignored. * Field justification will be ignored (though whatever justification is set up will be retained internally and can be queried). - * The dup_field() and link_field() calls copy dynamic-buffer sizes. - If the O_STATIC option is set on one of a collection of links, - buffer resizing will occur only when the field is edited through + * The dup_field() and link_field() calls copy dynamic-buffer sizes. + If the O_STATIC option is set on one of a collection of links, + buffer resizing will occur only when the field is edited through that link. - * The call field_info() will retrieve the original static size of - the field; use dynamic_field_info() to get the actual dynamic + * The call field_info() will retrieve the original static size of + the field; use dynamic_field_info() to get the actual dynamic size. - + Field Validation - By default, a field will accept any data that will fit in its input - buffer. However, it is possible to attach a validation type to a - field. If you do this, any attempt to leave the field while it - contains data that doesn't match the validation type will fail. Some - validation types also have a character-validity check for each time a + By default, a field will accept any data that will fit in its input + buffer. However, it is possible to attach a validation type to a + field. If you do this, any attempt to leave the field while it + contains data that doesn't match the validation type will fail. Some + validation types also have a character-validity check for each time a character is entered in the field. - - A field's validation check (if any) is not called when - set_field_buffer() modifies the input buffer, nor when that buffer is + + A field's validation check (if any) is not called when + set_field_buffer() modifies the input buffer, nor when that buffer is changed through a linked field. - - The form library provides a rich set of pre-defined validation types, - and gives you the capability to define custom ones of your own. You - can examine and change field validation attributes with the following + + The form library provides a rich set of pre-defined validation types, + and gives you the capability to define custom ones of your own. You + can examine and change field validation attributes with the following functions: int set_field_type(FIELD *field, /* field to alter */ FIELDTYPE *ftype, /* type to associate */ @@ -1680,45 +1683,45 @@ int set_field_type(FIELD *field, /* field to alter */ FIELDTYPE *field_type(FIELD *field); /* field to query */ - The validation type of a field is considered an attribute of the - field. As with other field attributes, Also, doing set_field_type() - with a NULL field default will change the system default for + The validation type of a field is considered an attribute of the + field. As with other field attributes, Also, doing set_field_type() + with a NULL field default will change the system default for validation of newly-created fields. - + Here are the pre-defined validation types: - + TYPE_ALPHA - - This field type accepts alphabetic data; no blanks, no digits, no - special characters (this is checked at character-entry time). It is + + This field type accepts alphabetic data; no blanks, no digits, no + special characters (this is checked at character-entry time). It is set up with: int set_field_type(FIELD *field, /* field to alter */ TYPE_ALPHA, /* type to associate */ int width); /* maximum width of field */ The width argument sets a minimum width of data. Typically you'll want - to set this to the field width; if it's greater than the field width, - the validation check will always fail. A minimum width of zero makes + to set this to the field width; if it's greater than the field width, + the validation check will always fail. A minimum width of zero makes field completion optional. - + TYPE_ALNUM - - This field type accepts alphabetic data and digits; no blanks, no - special characters (this is checked at character-entry time). It is + + This field type accepts alphabetic data and digits; no blanks, no + special characters (this is checked at character-entry time). It is set up with: int set_field_type(FIELD *field, /* field to alter */ TYPE_ALNUM, /* type to associate */ int width); /* maximum width of field */ - The width argument sets a minimum width of data. As with TYPE_ALPHA, - typically you'll want to set this to the field width; if it's greater + The width argument sets a minimum width of data. As with TYPE_ALPHA, + typically you'll want to set this to the field width; if it's greater than the field width, the validation check will always fail. A minimum width of zero makes field completion optional. - + TYPE_ENUM - - This type allows you to restrict a field's values to be among a - specified set of string values (for example, the two-letter postal + + This type allows you to restrict a field's values to be among a + specified set of string values (for example, the two-letter postal codes for U.S. states). It is set up with: int set_field_type(FIELD *field, /* field to alter */ TYPE_ENUM, /* type to associate */ @@ -1726,110 +1729,110 @@ int set_field_type(FIELD *field, /* field to alter */ int checkcase; /* case-sensitive? */ int checkunique); /* must specify uniquely? */ - The valuelist parameter must point at a NULL-terminated list of valid - strings. The checkcase argument, if true, makes comparison with the + The valuelist parameter must point at a NULL-terminated list of valid + strings. The checkcase argument, if true, makes comparison with the string case-sensitive. - - When the user exits a TYPE_ENUM field, the validation procedure tries - to complete the data in the buffer to a valid entry. If a complete - choice string has been entered, it is of course valid. But it is also + + When the user exits a TYPE_ENUM field, the validation procedure tries + to complete the data in the buffer to a valid entry. If a complete + choice string has been entered, it is of course valid. But it is also possible to enter a prefix of a valid string and have it completed for you. - - By default, if you enter such a prefix and it matches more than one - value in the string list, the prefix will be completed to the first + + By default, if you enter such a prefix and it matches more than one + value in the string list, the prefix will be completed to the first matching value. But the checkunique argument, if true, requires prefix matches to be unique in order to be valid. - - The REQ_NEXT_CHOICE and REQ_PREV_CHOICE input requests can be + + The REQ_NEXT_CHOICE and REQ_PREV_CHOICE input requests can be particularly useful with these fields. - + TYPE_INTEGER - + This field type accepts an integer. It is set up as follows: int set_field_type(FIELD *field, /* field to alter */ TYPE_INTEGER, /* type to associate */ int padding, /* # places to zero-pad to */ int vmin, int vmax); /* valid range */ - Valid characters consist of an optional leading minus and digits. The + Valid characters consist of an optional leading minus and digits. The range check is performed on exit. If the range maximum is less than or equal to the minimum, the range is ignored. - + If the value passes its range check, it is padded with as many leading zero digits as necessary to meet the padding argument. - + A TYPE_INTEGER value buffer can conveniently be interpreted with the C library function atoi(3). - + TYPE_NUMERIC - + This field type accepts a decimal number. It is set up as follows: int set_field_type(FIELD *field, /* field to alter */ TYPE_NUMERIC, /* type to associate */ int padding, /* # places of precision */ double vmin, double vmax); /* valid range */ - Valid characters consist of an optional leading minus and digits. - possibly including a decimal point. If your system supports locale's, - the decimal point character used must be the one defined by your - locale. The range check is performed on exit. If the range maximum is + Valid characters consist of an optional leading minus and digits. + possibly including a decimal point. If your system supports locale's, + the decimal point character used must be the one defined by your + locale. The range check is performed on exit. If the range maximum is less than or equal to the minimum, the range is ignored. - - If the value passes its range check, it is padded with as many + + If the value passes its range check, it is padded with as many trailing zero digits as necessary to meet the padding argument. - + A TYPE_NUMERIC value buffer can conveniently be interpreted with the C library function atof(3). - + TYPE_REGEXP - - This field type accepts data matching a regular expression. It is set + + This field type accepts data matching a regular expression. It is set up as follows: int set_field_type(FIELD *field, /* field to alter */ TYPE_REGEXP, /* type to associate */ char *regexp); /* expression to match */ - The syntax for regular expressions is that of regcomp(3). The check + The syntax for regular expressions is that of regcomp(3). The check for regular-expression match is performed on exit. - + Direct Field Buffer Manipulation The chief attribute of a field is its buffer contents. When a form has - been completed, your application usually needs to know the state of + been completed, your application usually needs to know the state of each field buffer. You can find this out with: char *field_buffer(FIELD *field, /* field to query */ int bufindex); /* number of buffer to query */ - Normally, the state of the zero-numbered buffer for each field is set - by the user's editing actions on that field. It's sometimes useful to - be able to set the value of the zero-numbered (or some other) buffer + Normally, the state of the zero-numbered buffer for each field is set + by the user's editing actions on that field. It's sometimes useful to + be able to set the value of the zero-numbered (or some other) buffer from your application: int set_field_buffer(FIELD *field, /* field to alter */ int bufindex, /* number of buffer to alter */ char *value); /* string value to set */ - If the field is not large enough and cannot be resized to a + If the field is not large enough and cannot be resized to a sufficiently large size to contain the specified value, the value will be truncated to fit. - - Calling field_buffer() with a null field pointer will raise an error. - Calling field_buffer() on a field not currently selected for input + + Calling field_buffer() with a null field pointer will raise an error. + Calling field_buffer() on a field not currently selected for input will return a correct value. Calling field_buffer() on a field that is - currently selected for input may not necessarily give a correct field - buffer value, because entered data isn't necessarily copied to buffer - zero before the exit validation check. To guarantee that the returned - buffer value reflects on-screen reality, call field_buffer() either + currently selected for input may not necessarily give a correct field + buffer value, because entered data isn't necessarily copied to buffer + zero before the exit validation check. To guarantee that the returned + buffer value reflects on-screen reality, call field_buffer() either (1) in the field's exit validation check routine, (2) from the field's - or form's initialization or termination hooks, or (3) just after a + or form's initialization or termination hooks, or (3) just after a REQ_VALIDATION request has been processed by the forms driver. - + Attributes of Forms - As with field attributes, form attributes inherit a default from a + As with field attributes, form attributes inherit a default from a system default form structure. These defaults can be queried or set by of these functions using a form-pointer argument of NULL. - + The principal attribute of a form is its field list. You can query and change this list with: int set_form_fields(FORM *form, /* form to alter */ @@ -1839,53 +1842,53 @@ char *form_fields(FORM *form); /* fetch fields of form */ int field_count(FORM *form); /* count connect fields */ - The second argument of set_form_fields() may be a NULL-terminated + The second argument of set_form_fields() may be a NULL-terminated field pointer array like the one required by new_form(). In that case, - the old fields of the form are disconnected but not freed (and - eligible to be connected to other forms), then the new fields are + the old fields of the form are disconnected but not freed (and + eligible to be connected to other forms), then the new fields are connected. - - It may also be null, in which case the old fields are disconnected + + It may also be null, in which case the old fields are disconnected (and not freed) but no new ones are connected. - - The field_count() function simply counts the number of fields - connected to a given from. It returns -1 if the form-pointer argument + + The field_count() function simply counts the number of fields + connected to a given from. It returns -1 if the form-pointer argument is NULL. - + Control of Form Display - In the overview section, you saw that to display a form you normally - start by defining its size (and fields), posting it, and refreshing - the screen. There is an hidden step before posting, which is the - association of the form with a frame window (actually, a pair of - windows) within which it will be displayed. By default, the forms + In the overview section, you saw that to display a form you normally + start by defining its size (and fields), posting it, and refreshing + the screen. There is an hidden step before posting, which is the + association of the form with a frame window (actually, a pair of + windows) within which it will be displayed. By default, the forms library associates every form with the full-screen window stdscr. - + By making this step explicit, you can associate a form with a declared frame window on your screen display. This can be useful if you want to - adapt the form display to different screen sizes, dynamically tile - forms on the screen, or use a form as part of an interface layout + adapt the form display to different screen sizes, dynamically tile + forms on the screen, or use a form as part of an interface layout managed by panels. - - The two windows associated with each form have the same functions as - their analogues in the menu library. Both these windows are painted + + The two windows associated with each form have the same functions as + their analogues in the menu library. Both these windows are painted when the form is posted and erased when the form is unposted. - - The outer or frame window is not otherwise touched by the form + + The outer or frame window is not otherwise touched by the form routines. It exists so the programmer can associate a title, a border, - or perhaps help text with the form and have it properly refreshed or + or perhaps help text with the form and have it properly refreshed or erased at post/unpost time. The inner window or subwindow is where the current form page is actually displayed. - - In order to declare your own frame window for a form, you'll need to - know the size of the form's bounding rectangle. You can get this + + In order to declare your own frame window for a form, you'll need to + know the size of the form's bounding rectangle. You can get this information with: int scale_form(FORM *form, /* form to query */ int *rows, /* form rows */ int *cols); /* form cols */ The form dimensions are passed back in the locations pointed to by the - arguments. Once you have this information, you can use it to declare + arguments. Once you have this information, you can use it to declare of windows, then use one of these functions: int set_form_win(FORM *form, /* form to alter */ WINDOW *win); /* frame window to connect */ @@ -1897,31 +1900,31 @@ int set_form_sub(FORM *form, /* form to alter */ WINDOW *form_sub(FORM *form); /* fetch form subwindow of form */ - Note that curses operations, including refresh(), on the form, should + Note that curses operations, including refresh(), on the form, should be done on the frame window, not the form subwindow. - - It is possible to check from your application whether all of a - scrollable field is actually displayed within the menu subwindow. Use + + It is possible to check from your application whether all of a + scrollable field is actually displayed within the menu subwindow. Use these functions: int data_ahead(FORM *form); /* form to be queried */ int data_behind(FORM *form); /* form to be queried */ - The function data_ahead() returns TRUE if (a) the current field is - one-line and has undisplayed data off to the right, (b) the current + The function data_ahead() returns TRUE if (a) the current field is + one-line and has undisplayed data off to the right, (b) the current field is multi-line and there is data off-screen below it. - + The function data_behind() returns TRUE if the first (upper left hand) character position is off-screen (not being displayed). - - Finally, there is a function to restore the form window's cursor to + + Finally, there is a function to restore the form window's cursor to the value expected by the forms driver: int pos_form_cursor(FORM *) /* form to be queried */ If your application changes the form window cursor, call this function - before handing control back to the forms driver in order to + before handing control back to the forms driver in order to re-synchronize it. - + Input Processing in the Forms Driver The function form_driver() handles virtualized input requests for form @@ -1930,311 +1933,311 @@ Input Processing in the Forms Driver int form_driver(FORM *form, /* form to pass input to */ int request); /* form request code */ - Your input virtualization function needs to take input and then - convert it to either an alphanumeric character (which is treated as - data to be entered in the currently-selected field), or a forms + Your input virtualization function needs to take input and then + convert it to either an alphanumeric character (which is treated as + data to be entered in the currently-selected field), or a forms processing request. - - The forms driver provides hooks (through input-validation and - field-termination functions) with which your application code can + + The forms driver provides hooks (through input-validation and + field-termination functions) with which your application code can check that the input taken by the driver matched what was expected. - + Page Navigation Requests - - These requests cause page-level moves through the form, triggering + + These requests cause page-level moves through the form, triggering display of a new form screen. - + REQ_NEXT_PAGE Move to the next form page. - + REQ_PREV_PAGE Move to the previous form page. - + REQ_FIRST_PAGE Move to the first form page. - + REQ_LAST_PAGE Move to the last form page. - - These requests treat the list as cyclic; that is, REQ_NEXT_PAGE from + + These requests treat the list as cyclic; that is, REQ_NEXT_PAGE from the last page goes to the first, and REQ_PREV_PAGE from the first page goes to the last. - + Inter-Field Navigation Requests - + These requests handle navigation between fields on the same page. - + REQ_NEXT_FIELD Move to next field. - + REQ_PREV_FIELD Move to previous field. - + REQ_FIRST_FIELD Move to the first field. - + REQ_LAST_FIELD Move to the last field. - + REQ_SNEXT_FIELD Move to sorted next field. - + REQ_SPREV_FIELD Move to sorted previous field. - + REQ_SFIRST_FIELD Move to the sorted first field. - + REQ_SLAST_FIELD Move to the sorted last field. - + REQ_LEFT_FIELD Move left to field. - + REQ_RIGHT_FIELD Move right to field. - + REQ_UP_FIELD Move up to field. - + REQ_DOWN_FIELD Move down to field. - - These requests treat the list of fields on a page as cyclic; that is, - REQ_NEXT_FIELD from the last field goes to the first, and + + These requests treat the list of fields on a page as cyclic; that is, + REQ_NEXT_FIELD from the last field goes to the first, and REQ_PREV_FIELD from the first field goes to the last. The order of the fields for these (and the REQ_FIRST_FIELD and REQ_LAST_FIELD requests) is simply the order of the field pointers in the form array (as set up by new_form() or set_form_fields() - - It is also possible to traverse the fields as if they had been sorted - in screen-position order, so the sequence goes left-to-right and - top-to-bottom. To do this, use the second group of four + + It is also possible to traverse the fields as if they had been sorted + in screen-position order, so the sequence goes left-to-right and + top-to-bottom. To do this, use the second group of four sorted-movement requests. - + Finally, it is possible to move between fields using visual directions - up, down, right, and left. To accomplish this, use the third group of + up, down, right, and left. To accomplish this, use the third group of four requests. Note, however, that the position of a form for purposes of these requests is its upper-left corner. - - For example, suppose you have a multi-line field B, and two + + For example, suppose you have a multi-line field B, and two single-line fields A and C on the same line with B, with A to the left - of B and C to the right of B. A REQ_MOVE_RIGHT from A will go to B - only if A, B, and C all share the same first line; otherwise it will + of B and C to the right of B. A REQ_MOVE_RIGHT from A will go to B + only if A, B, and C all share the same first line; otherwise it will skip over B to C. - + Intra-Field Navigation Requests - - These requests drive movement of the edit cursor within the currently + + These requests drive movement of the edit cursor within the currently selected field. - + REQ_NEXT_CHAR Move to next character. - + REQ_PREV_CHAR Move to previous character. - + REQ_NEXT_LINE Move to next line. - + REQ_PREV_LINE Move to previous line. - + REQ_NEXT_WORD Move to next word. - + REQ_PREV_WORD Move to previous word. - + REQ_BEG_FIELD Move to beginning of field. - + REQ_END_FIELD Move to end of field. - + REQ_BEG_LINE Move to beginning of line. - + REQ_END_LINE Move to end of line. - + REQ_LEFT_CHAR Move left in field. - + REQ_RIGHT_CHAR Move right in field. - + REQ_UP_CHAR Move up in field. - + REQ_DOWN_CHAR Move down in field. - - Each word is separated from the previous and next characters by + + Each word is separated from the previous and next characters by whitespace. The commands to move to beginning and end of line or field look for the first or last non-pad character in their ranges. - + Scrolling Requests - - Fields that are dynamic and have grown and fields explicitly created - with offscreen rows are scrollable. One-line fields scroll - horizontally; multi-line fields scroll vertically. Most scrolling is + + Fields that are dynamic and have grown and fields explicitly created + with offscreen rows are scrollable. One-line fields scroll + horizontally; multi-line fields scroll vertically. Most scrolling is triggered by editing and intra-field movement (the library scrolls the - field to keep the cursor visible). It is possible to explicitly + field to keep the cursor visible). It is possible to explicitly request scrolling with the following requests: - + REQ_SCR_FLINE Scroll vertically forward a line. - + REQ_SCR_BLINE Scroll vertically backward a line. - + REQ_SCR_FPAGE Scroll vertically forward a page. - + REQ_SCR_BPAGE Scroll vertically backward a page. - + REQ_SCR_FHPAGE Scroll vertically forward half a page. - + REQ_SCR_BHPAGE Scroll vertically backward half a page. - + REQ_SCR_FCHAR Scroll horizontally forward a character. - + REQ_SCR_BCHAR Scroll horizontally backward a character. - + REQ_SCR_HFLINE Scroll horizontally one field width forward. - + REQ_SCR_HBLINE Scroll horizontally one field width backward. - + REQ_SCR_HFHALF Scroll horizontally one half field width forward. - + REQ_SCR_HBHALF Scroll horizontally one half field width backward. - + For scrolling purposes, a page of a field is the height of its visible part. - + Editing Requests - - When you pass the forms driver an ASCII character, it is treated as a - request to add the character to the field's data buffer. Whether this - is an insertion or a replacement depends on the field's edit mode + + When you pass the forms driver an ASCII character, it is treated as a + request to add the character to the field's data buffer. Whether this + is an insertion or a replacement depends on the field's edit mode (insertion is the default. - + The following requests support editing the field and changing the edit mode: - + REQ_INS_MODE Set insertion mode. - + REQ_OVL_MODE Set overlay mode. - + REQ_NEW_LINE New line request (see below for explanation). - + REQ_INS_CHAR Insert space at character location. - + REQ_INS_LINE Insert blank line at character location. - + REQ_DEL_CHAR Delete character at cursor. - + REQ_DEL_PREV Delete previous word at cursor. - + REQ_DEL_LINE Delete line at cursor. - + REQ_DEL_WORD Delete word at cursor. - + REQ_CLR_EOL Clear to end of line. - + REQ_CLR_EOF Clear to end of field. - + REQ_CLEAR_FIELD Clear entire field. - - The behavior of the REQ_NEW_LINE and REQ_DEL_PREV requests is - complicated and partly controlled by a pair of forms options. The - special cases are triggered when the cursor is at the beginning of a + + The behavior of the REQ_NEW_LINE and REQ_DEL_PREV requests is + complicated and partly controlled by a pair of forms options. The + special cases are triggered when the cursor is at the beginning of a field, or on the last line of the field. - + First, we consider REQ_NEW_LINE: - - The normal behavior of REQ_NEW_LINE in insert mode is to break the + + The normal behavior of REQ_NEW_LINE in insert mode is to break the current line at the position of the edit cursor, inserting the portion - of the current line after the cursor as a new line following the - current and moving the cursor to the beginning of that new line (you + of the current line after the cursor as a new line following the + current and moving the cursor to the beginning of that new line (you may think of this as inserting a newline in the field buffer). - - The normal behavior of REQ_NEW_LINE in overlay mode is to clear the - current line from the position of the edit cursor to end of line. The + + The normal behavior of REQ_NEW_LINE in overlay mode is to clear the + current line from the position of the edit cursor to end of line. The cursor is then moved to the beginning of the next line. - + However, REQ_NEW_LINE at the beginning of a field, or on the last line - of a field, instead does a REQ_NEXT_FIELD. O_NL_OVERLOAD option is + of a field, instead does a REQ_NEXT_FIELD. O_NL_OVERLOAD option is off, this special action is disabled. - + Now, let us consider REQ_DEL_PREV: - - The normal behavior of REQ_DEL_PREV is to delete the previous - character. If insert mode is on, and the cursor is at the start of a - line, and the text on that line will fit on the previous one, it - instead appends the contents of the current line to the previous one - and deletes the current line (you may think of this as deleting a + + The normal behavior of REQ_DEL_PREV is to delete the previous + character. If insert mode is on, and the cursor is at the start of a + line, and the text on that line will fit on the previous one, it + instead appends the contents of the current line to the previous one + and deletes the current line (you may think of this as deleting a newline from the field buffer). - - However, REQ_DEL_PREV at the beginning of a field is instead treated + + However, REQ_DEL_PREV at the beginning of a field is instead treated as a REQ_PREV_FIELD. - - If the O_BS_OVERLOAD option is off, this special action is disabled + + If the O_BS_OVERLOAD option is off, this special action is disabled and the forms driver just returns E_REQUEST_DENIED. - - See Form Options for discussion of how to set and clear the overload + + See Form Options for discussion of how to set and clear the overload options. - + Order Requests - + If the type of your field is ordered, and has associated functions for - getting the next and previous values of the type from a given value, + getting the next and previous values of the type from a given value, there are requests that can fetch that value into the field buffer: - + REQ_NEXT_CHOICE Place the successor value of the current value in the buffer. - + REQ_PREV_CHOICE Place the predecessor value of the current value in the buffer. - + Of the built-in field types, only TYPE_ENUM has built-in successor and - predecessor functions. When you define a field type of your own (see - Custom Validation Types), you can associate our own ordering + predecessor functions. When you define a field type of your own (see + Custom Validation Types), you can associate our own ordering functions. - + Application Commands - - Form requests are represented as integers above the curses value - greater than KEY_MAX and less than or equal to the constant - MAX_COMMAND. If your input-virtualization routine returns a value + + Form requests are represented as integers above the curses value + greater than KEY_MAX and less than or equal to the constant + MAX_COMMAND. If your input-virtualization routine returns a value above MAX_COMMAND, the forms driver will ignore it. - + Field Change Hooks - It is possible to set function hooks to be executed whenever the - current field or form changes. Here are the functions that support + It is possible to set function hooks to be executed whenever the + current field or form changes. Here are the functions that support this: typedef void (*HOOK)(); /* pointer to function returning void */ @@ -2259,46 +2262,46 @@ int set_field_term(FORM *form, /* form to alter */ HOOK field_term(FORM *form); /* form to query */ These functions allow you to either set or query four different hooks. - In each of the set functions, the second argument should be the - address of a hook function. These functions differ only in the timing + In each of the set functions, the second argument should be the + address of a hook function. These functions differ only in the timing of the hook call. - + form_init - This hook is called when the form is posted; also, just after + This hook is called when the form is posted; also, just after each page change operation. - + field_init - This hook is called when the form is posted; also, just after + This hook is called when the form is posted; also, just after each field change - + field_term - This hook is called just after field validation; that is, just + This hook is called just after field validation; that is, just before the field is altered. It is also called when the form is unposted. - + form_term - This hook is called when the form is unposted; also, just + This hook is called when the form is unposted; also, just before each page change operation. - + Calls to these hooks may be triggered 1. When user editing requests are processed by the forms driver 2. When the current page is changed by set_current_field() call 3. When the current field is changed by a set_form_page() call - + See Field Change Commands for discussion of the latter two cases. - - You can set a default hook for all fields by passing one of the set + + You can set a default hook for all fields by passing one of the set functions a NULL first argument. - - You can disable any of these hooks by (re)setting them to NULL, the + + You can disable any of these hooks by (re)setting them to NULL, the default value. - + Field Change Commands - Normally, navigation through the form will be driven by the user's - input requests. But sometimes it is useful to be able to move the - focus for editing and viewing under control of your application, or - ask which field it currently is in. The following functions help you + Normally, navigation through the form will be driven by the user's + input requests. But sometimes it is useful to be able to move the + focus for editing and viewing under control of your application, or + ask which field it currently is in. The following functions help you accomplish this: int set_current_field(FORM *form, /* form to alter */ FIELD *field); /* field to shift to */ @@ -2309,24 +2312,24 @@ int field_index(FORM *form, /* form to query */ FIELD *field); /* field to get index of */ The function field_index() returns the index of the given field in the - given form's field array (the array passed to new_form() or + given form's field array (the array passed to new_form() or set_form_fields()). - - The initial current field of a form is the first active field on the + + The initial current field of a form is the first active field on the first page. The function set_form_fields() resets this. - + It is also possible to move around by pages. int set_form_page(FORM *form, /* form to alter */ int page); /* page to go to (0-origin) */ int form_page(FORM *form); /* return form's current page */ - The initial page of a newly-created form is 0. The function + The initial page of a newly-created form is 0. The function set_form_fields() resets this. - + Form Options - Like fields, forms may have control option bits. They can be changed + Like fields, forms may have control option bits. They can be changed or queried with these functions: int set_form_opts(FORM *form, /* form to alter */ int attr); /* attribute to set */ @@ -2340,55 +2343,55 @@ int form_opts_off(FORM *form, /* form to alter */ int form_opts(FORM *form); /* form to query */ By default, all options are on. Here are the available option bits: - + O_NL_OVERLOAD - Enable overloading of REQ_NEW_LINE as described in Editing + Enable overloading of REQ_NEW_LINE as described in Editing Requests. The value of this option is ignored on dynamic fields - that have not reached their size limit; these have no last - line, so the circumstances for triggering a REQ_NEXT_FIELD + that have not reached their size limit; these have no last + line, so the circumstances for triggering a REQ_NEXT_FIELD never arise. - + O_BS_OVERLOAD - Enable overloading of REQ_DEL_PREV as described in Editing + Enable overloading of REQ_DEL_PREV as described in Editing Requests. - + The option values are bit-masks and can be composed with logical-or in the obvious way. - + Custom Validation Types - The form library gives you the capability to define custom validation - types of your own. Further, the optional additional arguments of + The form library gives you the capability to define custom validation + types of your own. Further, the optional additional arguments of set_field_type effectively allow you to parameterize validation types. - Most of the complications in the validation-type interface have to do + Most of the complications in the validation-type interface have to do with the handling of the additional arguments within custom validation functions. - + Union Types - - The simplest way to create a custom data type is to compose it from + + The simplest way to create a custom data type is to compose it from two preexisting ones: FIELD *link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2); - This function creates a field type that will accept any of the values - legal for either of its argument field types (which may be either - predefined or programmer-defined). If a set_field_type() call later - requires arguments, the new composite type expects all arguments for - the first type, than all arguments for the second. Order functions - (see Order Requests) associated with the component types will work on - the composite; what it does is check the validation function for the - first type, then for the second, to figure what type the buffer + This function creates a field type that will accept any of the values + legal for either of its argument field types (which may be either + predefined or programmer-defined). If a set_field_type() call later + requires arguments, the new composite type expects all arguments for + the first type, than all arguments for the second. Order functions + (see Order Requests) associated with the component types will work on + the composite; what it does is check the validation function for the + first type, then for the second, to figure what type the buffer contents should be treated as. - + New Field Types - - To create a field type from scratch, you need to specify one or both + + To create a field type from scratch, you need to specify one or both of the following things: - * A character-validation function, to check each character as it is + * A character-validation function, to check each character as it is entered. * A field-validation function to be applied on exit from the field. - + Here's how you do that: typedef int (*HOOK)(); /* pointer to function returning int */ @@ -2399,37 +2402,37 @@ FIELDTYPE *new_fieldtype(HOOK f_validate, /* field validator */ int free_fieldtype(FIELDTYPE *ftype); /* type to free */ At least one of the arguments of new_fieldtype() must be non-NULL. The - forms driver will automatically call the new type's validation + forms driver will automatically call the new type's validation functions at appropriate points in processing a field of the new type. - - The function free_fieldtype() deallocates the argument fieldtype, + + The function free_fieldtype() deallocates the argument fieldtype, freeing all storage associated with it. - - Normally, a field validator is called when the user attempts to leave - the field. Its first argument is a field pointer, from which it can - get to field buffer 0 and test it. If the function returns TRUE, the - operation succeeds; if it returns FALSE, the edit cursor stays in the + + Normally, a field validator is called when the user attempts to leave + the field. Its first argument is a field pointer, from which it can + get to field buffer 0 and test it. If the function returns TRUE, the + operation succeeds; if it returns FALSE, the edit cursor stays in the field. - - A character validator gets the character passed in as a first - argument. It too should return TRUE if the character is valid, FALSE + + A character validator gets the character passed in as a first + argument. It too should return TRUE if the character is valid, FALSE otherwise. - + Validation Function Arguments - - Your field- and character- validation functions will be passed a - second argument as well. This second argument is the address of a - structure (which we'll call a pile) built from any of the - field-type-specific arguments passed to set_field_type(). If no such - arguments are defined for the field type, this pile pointer argument + + Your field- and character- validation functions will be passed a + second argument as well. This second argument is the address of a + structure (which we'll call a pile) built from any of the + field-type-specific arguments passed to set_field_type(). If no such + arguments are defined for the field type, this pile pointer argument will be NULL. - + In order to arrange for such arguments to be passed to your validation - functions, you must associate a small set of storage-management + functions, you must associate a small set of storage-management functions with the type. The forms driver will use these to synthesize - a pile from the trailing arguments of each set_field_type() argument, + a pile from the trailing arguments of each set_field_type() argument, and a pointer to the pile will be passed to the validation functions. - + Here is how you make the association: typedef char *(*PTRHOOK)(); /* pointer to function returning (char *) */ typedef void (*VOIDHOOK)(); /* pointer to function returning void */ @@ -2440,34 +2443,34 @@ int set_fieldtype_arg(FIELDTYPE *type, /* type to alter */ VOIDHOOK free_str); /* free structure storage */ Here is how the storage-management hooks are used: - + make_str - This function is called by set_field_type(). It gets one - argument, a va_list of the type-specific arguments passed to - set_field_type(). It is expected to return a pile pointer to a + This function is called by set_field_type(). It gets one + argument, a va_list of the type-specific arguments passed to + set_field_type(). It is expected to return a pile pointer to a data structure that encapsulates those arguments. - + copy_str This function is called by form library functions that allocate - new field instances. It is expected to take a pile pointer, - copy the pile to allocated storage, and return the address of + new field instances. It is expected to take a pile pointer, + copy the pile to allocated storage, and return the address of the pile copy. - + free_str - This function is called by field- and type-deallocation - routines in the library. It takes a pile pointer argument, and + This function is called by field- and type-deallocation + routines in the library. It takes a pile pointer argument, and is expected to free the storage of that pile. - - The make_str and copy_str functions may return NULL to signal - allocation failure. The library routines will that call them will - return error indication when this happens. Thus, your validation - functions should never see a NULL file pointer and need not check + + The make_str and copy_str functions may return NULL to signal + allocation failure. The library routines will that call them will + return error indication when this happens. Thus, your validation + functions should never see a NULL file pointer and need not check specially for it. - + Order Functions For Custom Types - - Some custom field types are simply ordered in the same well-defined - way that TYPE_ENUM is. For such types, it is possible to define + + Some custom field types are simply ordered in the same well-defined + way that TYPE_ENUM is. For such types, it is possible to define successor and predecessor functions to support the REQ_NEXT_CHOICE and REQ_PREV_CHOICE requests. Here's how: typedef int (*INTHOOK)(); /* pointer to function returning int */ @@ -2476,27 +2479,27 @@ int set_fieldtype_arg(FIELDTYPE *type, /* type to alter */ INTHOOK succ, /* get successor value */ INTHOOK pred); /* get predecessor value */ - The successor and predecessor arguments will each be passed two - arguments; a field pointer, and a pile pointer (as for the validation - functions). They are expected to use the function field_buffer() to - read the current value, and set_field_buffer() on buffer 0 to set the - next or previous value. Either hook may return TRUE to indicate - success (a legal next or previous value was set) or FALSE to indicate + The successor and predecessor arguments will each be passed two + arguments; a field pointer, and a pile pointer (as for the validation + functions). They are expected to use the function field_buffer() to + read the current value, and set_field_buffer() on buffer 0 to set the + next or previous value. Either hook may return TRUE to indicate + success (a legal next or previous value was set) or FALSE to indicate failure. - + Avoiding Problems - - The interface for defining custom types is complicated and tricky. - Rather than attempting to create a custom type entirely from scratch, - you should start by studying the library source code for whichever of + + The interface for defining custom types is complicated and tricky. + Rather than attempting to create a custom type entirely from scratch, + you should start by studying the library source code for whichever of the pre-defined types seems to be closest to what you want. - - Use that code as a model, and evolve it towards what you really want. - You will avoid many problems and annoyances that way. The code in the - ncurses library has been specifically exempted from the package + + Use that code as a model, and evolve it towards what you really want. + You will avoid many problems and annoyances that way. The code in the + ncurses library has been specifically exempted from the package copyright to support this. - - If your custom type defines order functions, have do something - intuitive with a blank field. A useful convention is to make the - successor of a blank field the types minimum value, and its + + If your custom type defines order functions, have do something + intuitive with a blank field. A useful convention is to make the + successor of a blank field the types minimum value, and its predecessor the maximum. diff --git a/form/Makefile.in b/form/Makefile.in index 7d9f20fd..e55afcb5 100644 --- a/form/Makefile.in +++ b/form/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.31 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +# $Id: Makefile.in,v 1.36 2002/01/20 01:49:17 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ @@ -57,6 +58,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -85,7 +87,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -97,6 +99,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -113,8 +117,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources : $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make copies to simplify include-paths while still keeping form's include # file in this directory. @@ -136,7 +141,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/form/READ.ME b/form/READ.ME index dd91693f..11c81460 100644 --- a/form/READ.ME +++ b/form/READ.ME @@ -11,5 +11,6 @@ directory. Juergen Pfeifer -eMail: juergen.pfeifer@gmx.net +Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en + diff --git a/form/fld_arg.c b/form/fld_arg.c index bc816e9e..7e4eaaf7 100644 --- a/form/fld_arg.c +++ b/form/fld_arg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") +MODULE_ID("$Id: fld_arg.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -60,10 +61,12 @@ MODULE_ID("$Id: fld_arg.c,v 1.4 1999/05/16 17:16:04 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int set_fieldtype_arg(FIELDTYPE * typ, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)) +NCURSES_EXPORT(int) +set_fieldtype_arg + (FIELDTYPE * typ, + void * (* const make_arg)(va_list *), + void * (* const copy_arg)(const void *), + void (* const free_arg)(void *)) { if ( !typ || !make_arg ) RETURN(E_BAD_ARGUMENT); @@ -83,7 +86,8 @@ int set_fieldtype_arg(FIELDTYPE * typ, | | Return Values : Pointer to structure or NULL if none is defined. +--------------------------------------------------------------------------*/ -void *field_arg(const FIELD * field) +NCURSES_EXPORT(void *) +field_arg (const FIELD * field) { return Normalize_Field(field)->arg; } diff --git a/form/fld_attr.c b/form/fld_attr.c index 3c7d8e35..6ce192e0 100644 --- a/form/fld_attr.c +++ b/form/fld_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,18 +27,19 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_attr.c,v 1.4 1999/05/16 17:16:30 juergen Exp $") +MODULE_ID("$Id: fld_attr.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*---------------------------------------------------------------------------- Field-Attribute manipulation routines --------------------------------------------------------------------------*/ /* "Template" macro to generate a function to set a fields attribute */ #define GEN_FIELD_ATTR_SET_FCT( name ) \ -int set_field_ ## name (FIELD * field, chtype attr)\ +NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\ {\ int res = E_BAD_ARGUMENT;\ if ( attr==A_NORMAL || ((attr & A_ATTRIBUTES)==attr) )\ @@ -57,7 +58,7 @@ int set_field_ ## name (FIELD * field, chtype attr)\ /* "Template" macro to generate a function to get a fields attribute */ #define GEN_FIELD_ATTR_GET_FCT( name ) \ -chtype field_ ## name (const FIELD * field)\ +NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\ {\ return ( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\ } diff --git a/form/fld_current.c b/form/fld_current.c index 2bf8163a..02192c28 100644 --- a/form/fld_current.c +++ b/form/fld_current.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_current.c,v 1.4 1999/05/16 17:16:46 juergen Exp $") +MODULE_ID("$Id: fld_current.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +47,8 @@ MODULE_ID("$Id: fld_current.c,v 1.4 1999/05/16 17:16:46 juergen Exp $") | E_INVALID_FIELD - current field can't be left | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_current_field(FORM * form, FIELD * field) +NCURSES_EXPORT(int) +set_current_field (FORM * form, FIELD * field) { int err = E_OK; @@ -101,7 +103,8 @@ int set_current_field(FORM * form, FIELD * field) | | Return Values : Pointer to the current field. +--------------------------------------------------------------------------*/ -FIELD *current_field(const FORM * form) +NCURSES_EXPORT(FIELD *) +current_field (const FORM * form) { return Normalize_Form(form)->current; } @@ -116,7 +119,8 @@ FIELD *current_field(const FORM * form) | Return Values : >= 0 : field index | -1 : fieldpointer invalid or field not connected +--------------------------------------------------------------------------*/ -int field_index(const FIELD * field) +NCURSES_EXPORT(int) +field_index (const FIELD * field) { return ( (field && field->form) ? field->index : -1 ); } diff --git a/form/fld_def.c b/form/fld_def.c index dd3de804..73e2e4cf 100644 --- a/form/fld_def.c +++ b/form/fld_def.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_def.c,v 1.12 1999/05/16 17:37:48 juergen Exp $") +MODULE_ID("$Id: fld_def.c,v 1.14 2002/07/06 15:33:27 juergen Exp $") /* this can't be readonly */ static FIELD default_field = { @@ -63,7 +64,7 @@ static FIELD default_field = { (char *)0 /* usrptr */ }; -FIELD *_nc_Default_Field = &default_field; +NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field; /*--------------------------------------------------------------------------- | Facility : libnform @@ -79,8 +80,9 @@ FIELD *_nc_Default_Field = &default_field; | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an errorcounter is increased. +--------------------------------------------------------------------------*/ -TypeArgument* -_nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) +NCURSES_EXPORT(TypeArgument*) +_nc_Make_Argument +(const FIELDTYPE *typ, va_list *ap, int *err) { TypeArgument *res = (TypeArgument *)0; TypeArgument *p; @@ -121,9 +123,10 @@ _nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err) | Return Values : Pointer to argument structure. Maybe NULL. | In case of an error in *err an errorcounter is increased. +--------------------------------------------------------------------------*/ -TypeArgument* -_nc_Copy_Argument(const FIELDTYPE *typ, - const TypeArgument *argp, int *err) +NCURSES_EXPORT(TypeArgument*) +_nc_Copy_Argument + (const FIELDTYPE *typ, + const TypeArgument *argp, int *err) { TypeArgument *res = (TypeArgument *)0; TypeArgument *p; @@ -166,8 +169,9 @@ _nc_Copy_Argument(const FIELDTYPE *typ, | | Return Values : - +--------------------------------------------------------------------------*/ -void -_nc_Free_Argument(const FIELDTYPE * typ, TypeArgument * argp) +NCURSES_EXPORT(void) +_nc_Free_Argument +(const FIELDTYPE * typ, TypeArgument * argp) { if (!typ || !(typ->status & _HAS_ARGS)) return; @@ -195,8 +199,9 @@ _nc_Free_Argument(const FIELDTYPE * typ, TypeArgument * argp) | Return Values : TRUE - copy worked | FALSE - error occured +--------------------------------------------------------------------------*/ -bool -_nc_Copy_Type(FIELD *dst, FIELD const *src) +NCURSES_EXPORT(bool) +_nc_Copy_Type +(FIELD *dst, FIELD const *src) { int err = 0; @@ -228,8 +233,8 @@ _nc_Copy_Type(FIELD *dst, FIELD const *src) | | Return Values : - +--------------------------------------------------------------------------*/ -void -_nc_Free_Type(FIELD *field) +NCURSES_EXPORT(void) +_nc_Free_Type (FIELD *field) { assert(field); if (field->type) @@ -253,7 +258,9 @@ _nc_Free_Type(FIELD *field) | | Return Values : Pointer to the new field or NULL if failure. +--------------------------------------------------------------------------*/ -FIELD *new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) +NCURSES_EXPORT(FIELD *) +new_field +(int rows, int cols, int frow, int fcol, int nrow, int nbuf) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; @@ -317,7 +324,8 @@ FIELD *new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf) | E_BAD_ARGUMENT - invalid field pointer | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int free_field(FIELD * field) +NCURSES_EXPORT(int) +free_field (FIELD * field) { if (!field) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_dup.c b/form/fld_dup.c index d265f958..31671791 100644 --- a/form/fld_dup.c +++ b/form/fld_dup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_dup.c,v 1.4 1999/05/16 17:17:08 juergen Exp $") +MODULE_ID("$Id: fld_dup.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -47,7 +48,8 @@ MODULE_ID("$Id: fld_dup.c,v 1.4 1999/05/16 17:17:08 juergen Exp $") | | Return Values : Pointer to the new field or NULL if failure +--------------------------------------------------------------------------*/ -FIELD *dup_field(FIELD * field, int frow, int fcol) +NCURSES_EXPORT(FIELD *) +dup_field (FIELD * field, int frow, int fcol) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; diff --git a/form/fld_ftchoice.c b/form/fld_ftchoice.c index 8e7d2a96..faaa4f45 100644 --- a/form/fld_ftchoice.c +++ b/form/fld_ftchoice.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_ftchoice.c,v 1.4 1999/05/16 17:17:21 juergen Exp $") +MODULE_ID("$Id: fld_ftchoice.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,9 +47,11 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.4 1999/05/16 17:17:21 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid arguments +--------------------------------------------------------------------------*/ -int set_fieldtype_choice(FIELDTYPE * typ, - bool (* const next_choice) (FIELD *,const void *), - bool (* const prev_choice) (FIELD *,const void *)) +NCURSES_EXPORT(int) +set_fieldtype_choice + (FIELDTYPE * typ, + bool (* const next_choice) (FIELD *,const void *), + bool (* const prev_choice) (FIELD *,const void *)) { if ( !typ || !next_choice || !prev_choice ) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_ftlink.c b/form/fld_ftlink.c index 1c30cab2..9535817b 100644 --- a/form/fld_ftlink.c +++ b/form/fld_ftlink.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_ftlink.c,v 1.4 1999/05/16 17:17:33 juergen Exp $") +MODULE_ID("$Id: fld_ftlink.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -48,7 +49,9 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.4 1999/05/16 17:17:33 juergen Exp $") | | Return Values : Fieldtype pointer or NULL if error occured. +--------------------------------------------------------------------------*/ -FIELDTYPE *link_fieldtype(FIELDTYPE * type1, FIELDTYPE * type2) +NCURSES_EXPORT(FIELDTYPE *) +link_fieldtype +(FIELDTYPE * type1, FIELDTYPE * type2) { FIELDTYPE *nftyp = (FIELDTYPE *)0; diff --git a/form/fld_info.c b/form/fld_info.c index 98100a4f..c3826abd 100644 --- a/form/fld_info.c +++ b/form/fld_info.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_info.c,v 1.4 1999/05/16 17:17:52 juergen Exp $") +MODULE_ID("$Id: fld_info.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,10 +47,12 @@ MODULE_ID("$Id: fld_info.c,v 1.4 1999/05/16 17:17:52 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid field pointer +--------------------------------------------------------------------------*/ -int field_info(const FIELD *field, - int *rows, int *cols, - int *frow, int *fcol, - int *nrow, int *nbuf) +NCURSES_EXPORT(int) +field_info + (const FIELD *field, + int *rows, int *cols, + int *frow, int *fcol, + int *nrow, int *nbuf) { if (!field) RETURN(E_BAD_ARGUMENT); @@ -75,8 +78,9 @@ int field_info(const FIELD *field, | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int dynamic_field_info(const FIELD *field, - int *drows, int *dcols, int *maxgrow) +NCURSES_EXPORT(int) +dynamic_field_info +(const FIELD *field, int *drows, int *dcols, int *maxgrow) { if (!field) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_just.c b/form/fld_just.c index 2a6dd38e..31bf0fd0 100644 --- a/form/fld_just.c +++ b/form/fld_just.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_just.c,v 1.5 1999/05/16 17:18:06 juergen Exp $") +MODULE_ID("$Id: fld_just.c,v 1.7 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: fld_just.c,v 1.5 1999/05/16 17:18:06 juergen Exp $") | E_BAD_ARGUMENT - one of the arguments was incorrect | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_just(FIELD * field, int just) +NCURSES_EXPORT(int) +set_field_just (FIELD * field, int just) { int res = E_BAD_ARGUMENT; @@ -73,7 +75,8 @@ int set_field_just(FIELD * field, int just) | | Return Values : The justification type. +--------------------------------------------------------------------------*/ -int field_just(const FIELD * field) +NCURSES_EXPORT(int) +field_just (const FIELD * field) { return Normalize_Field( field )->just; } diff --git a/form/fld_link.c b/form/fld_link.c index 4352d6ab..ea7df28a 100644 --- a/form/fld_link.c +++ b/form/fld_link.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_link.c,v 1.4 1999/05/16 17:18:18 juergen Exp $") +MODULE_ID("$Id: fld_link.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -48,7 +49,8 @@ MODULE_ID("$Id: fld_link.c,v 1.4 1999/05/16 17:18:18 juergen Exp $") | | Return Values : Pointer to the new field or NULL if failure +--------------------------------------------------------------------------*/ -FIELD *link_field(FIELD * field, int frow, int fcol) +NCURSES_EXPORT(FIELD *) +link_field (FIELD * field, int frow, int fcol) { FIELD *New_Field = (FIELD *)0; int err = E_BAD_ARGUMENT; diff --git a/form/fld_max.c b/form/fld_max.c index f17bcec5..1ed58176 100644 --- a/form/fld_max.c +++ b/form/fld_max.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_max.c,v 1.4 1999/05/16 17:18:34 juergen Exp $") +MODULE_ID("$Id: fld_max.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: fld_max.c,v 1.4 1999/05/16 17:18:34 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid argument +--------------------------------------------------------------------------*/ -int set_max_field(FIELD *field, int maxgrow) +NCURSES_EXPORT(int) +set_max_field (FIELD *field, int maxgrow) { if (!field || (maxgrow<0)) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_move.c b/form/fld_move.c index 7965d5af..6bd355f9 100644 --- a/form/fld_move.c +++ b/form/fld_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_move.c,v 1.4 1999/05/16 17:38:51 juergen Exp $") +MODULE_ID("$Id: fld_move.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -45,7 +46,8 @@ MODULE_ID("$Id: fld_move.c,v 1.4 1999/05/16 17:38:51 juergen Exp $") | E_BAD_ARGUMENT - invalid argument passed | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int move_field(FIELD *field, int frow, int fcol) +NCURSES_EXPORT(int) +move_field (FIELD *field, int frow, int fcol) { if ( !field || (frow<0) || (fcol<0) ) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_newftyp.c b/form/fld_newftyp.c index 68b1692a..bc80e329 100644 --- a/form/fld_newftyp.c +++ b/form/fld_newftyp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_newftyp.c,v 1.5 1999/05/16 17:18:54 juergen Exp $") +MODULE_ID("$Id: fld_newftyp.c,v 1.7 2002/07/06 15:33:27 juergen Exp $") static FIELDTYPE const default_fieldtype = { 0, /* status */ @@ -48,7 +49,7 @@ static FIELDTYPE const default_fieldtype = { NULL /* enumerate previous function */ }; -const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; +NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype; /*--------------------------------------------------------------------------- | Facility : libnform @@ -65,7 +66,8 @@ const FIELDTYPE* _nc_Default_FieldType = &default_fieldtype; | | Return Values : Fieldtype pointer or NULL if error occured +--------------------------------------------------------------------------*/ -FIELDTYPE *new_fieldtype( +NCURSES_EXPORT(FIELDTYPE *) +new_fieldtype ( bool (* const field_check)(FIELD *,const void *), bool (* const char_check) (int,const void *) ) { @@ -102,7 +104,8 @@ FIELDTYPE *new_fieldtype( | E_CONNECTED - there are fields referencing the type | E_BAD_ARGUMENT - invalid fieldtype pointer +--------------------------------------------------------------------------*/ -int free_fieldtype(FIELDTYPE *typ) +NCURSES_EXPORT(int) +free_fieldtype (FIELDTYPE *typ) { if (!typ) RETURN(E_BAD_ARGUMENT); diff --git a/form/fld_opts.c b/form/fld_opts.c index e5cd996d..585c391c 100644 --- a/form/fld_opts.c +++ b/form/fld_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_opts.c,v 1.6 1999/05/16 17:19:06 juergen Exp $") +MODULE_ID("$Id: fld_opts.c,v 1.8 2002/07/06 15:33:27 juergen Exp $") /*---------------------------------------------------------------------------- Field-Options manipulation routines @@ -49,7 +50,8 @@ MODULE_ID("$Id: fld_opts.c,v 1.6 1999/05/16 17:19:06 juergen Exp $") | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_opts(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +set_field_opts (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; opts &= ALL_FIELD_OPTS; @@ -66,7 +68,8 @@ int set_field_opts(FIELD * field, Field_Options opts) | | Return Values : The options. +--------------------------------------------------------------------------*/ -Field_Options field_opts(const FIELD * field) +NCURSES_EXPORT(Field_Options) +field_opts (const FIELD * field) { return ALL_FIELD_OPTS & Normalize_Field( field )->opts; } @@ -83,7 +86,8 @@ Field_Options field_opts(const FIELD * field) | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int field_opts_on(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +field_opts_on (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; @@ -108,7 +112,8 @@ int field_opts_on(FIELD * field, Field_Options opts) | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int field_opts_off(FIELD * field, Field_Options opts) +NCURSES_EXPORT(int) +field_opts_off (FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; diff --git a/form/fld_pad.c b/form/fld_pad.c index 527e1511..e635f488 100644 --- a/form/fld_pad.c +++ b/form/fld_pad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_pad.c,v 1.4 1999/05/16 17:38:58 juergen Exp $") +MODULE_ID("$Id: fld_pad.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: fld_pad.c,v 1.4 1999/05/16 17:38:58 juergen Exp $") | E_BAD_ARGUMENT - invalid field pointer or pad character | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_pad(FIELD * field, int ch) +NCURSES_EXPORT(int) +set_field_pad (FIELD * field, int ch) { int res = E_BAD_ARGUMENT; @@ -70,7 +72,8 @@ int set_field_pad(FIELD * field, int ch) | | Return Values : The pad character. +--------------------------------------------------------------------------*/ -int field_pad(const FIELD * field) +NCURSES_EXPORT(int) +field_pad (const FIELD * field) { return Normalize_Field( field )->pad; } diff --git a/form/fld_page.c b/form/fld_page.c index 452a507c..7012961f 100644 --- a/form/fld_page.c +++ b/form/fld_page.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_page.c,v 1.4 1999/05/16 17:19:37 juergen Exp $") +MODULE_ID("$Id: fld_page.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: fld_page.c,v 1.4 1999/05/16 17:19:37 juergen Exp $") | Return Values : E_OK - success | E_CONNECTED - field is connected +--------------------------------------------------------------------------*/ -int set_new_page(FIELD * field, bool new_page_flag) +NCURSES_EXPORT(int) +set_new_page (FIELD * field, bool new_page_flag) { Normalize_Field(field); if (field->form) @@ -68,7 +70,8 @@ int set_new_page(FIELD * field, bool new_page_flag) | Return Values : TRUE - field starts a new page | FALSE - field doesn't start a new page +--------------------------------------------------------------------------*/ -bool new_page(const FIELD * field) +NCURSES_EXPORT(bool) +new_page (const FIELD * field) { return (Normalize_Field(field)->status & _NEWPAGE) ? TRUE : FALSE; } diff --git a/form/fld_stat.c b/form/fld_stat.c index 98144bf2..0cd255a7 100644 --- a/form/fld_stat.c +++ b/form/fld_stat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_stat.c,v 1.6 1999/05/16 17:19:48 juergen Exp $") +MODULE_ID("$Id: fld_stat.c,v 1.8 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +44,8 @@ MODULE_ID("$Id: fld_stat.c,v 1.6 1999/05/16 17:19:48 juergen Exp $") | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_field_status(FIELD * field, bool status) +NCURSES_EXPORT(int) +set_field_status (FIELD * field, bool status) { Normalize_Field( field ); @@ -65,7 +67,8 @@ int set_field_status(FIELD * field, bool status) | Return Values : TRUE - buffer has been changed | FALSE - buffer has not been changed +--------------------------------------------------------------------------*/ -bool field_status(const FIELD * field) +NCURSES_EXPORT(bool) +field_status (const FIELD * field) { return ((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE); } diff --git a/form/fld_type.c b/form/fld_type.c index 238b5474..ee8731d1 100644 --- a/form/fld_type.c +++ b/form/fld_type.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_type.c,v 1.9 1999/05/16 17:19:59 juergen Exp $") +MODULE_ID("$Id: fld_type.c,v 1.11 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -45,7 +46,8 @@ MODULE_ID("$Id: fld_type.c,v 1.9 1999/05/16 17:19:59 juergen Exp $") | Return Values : E_OK - success | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_type(FIELD *field,FIELDTYPE *type, ...) +NCURSES_EXPORT(int) +set_field_type (FIELD *field,FIELDTYPE *type, ...) { va_list ap; int res = E_SYSTEM_ERROR; @@ -84,7 +86,8 @@ int set_field_type(FIELD *field,FIELDTYPE *type, ...) | | Return Values : Pointer to fieldtype of NULL if none is defined. +--------------------------------------------------------------------------*/ -FIELDTYPE *field_type(const FIELD * field) +NCURSES_EXPORT(FIELDTYPE *) +field_type (const FIELD * field) { return Normalize_Field(field)->type; } diff --git a/form/fld_user.c b/form/fld_user.c index cf5b4c29..a81484f5 100644 --- a/form/fld_user.c +++ b/form/fld_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fld_user.c,v 1.8 1999/05/16 17:20:09 juergen Exp $") +MODULE_ID("$Id: fld_user.c,v 1.10 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +44,8 @@ MODULE_ID("$Id: fld_user.c,v 1.8 1999/05/16 17:20:09 juergen Exp $") | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int set_field_userptr(FIELD * field, void *usrptr) +NCURSES_EXPORT(int) +set_field_userptr (FIELD * field, void *usrptr) { Normalize_Field( field )->usrptr = usrptr; RETURN(E_OK); @@ -59,7 +61,8 @@ int set_field_userptr(FIELD * field, void *usrptr) | Return Values : Value of pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -void *field_userptr(const FIELD *field) +NCURSES_EXPORT(void *) +field_userptr (const FIELD *field) { return Normalize_Field( field )->usrptr; } diff --git a/form/form.h b/form/form.h index 40ae0a35..57f63a30 100644 --- a/form/form.h +++ b/form/form.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #ifndef FORM_H @@ -246,140 +247,135 @@ typedef void (*Form_Hook)(FORM *); /************************* * standard field types * *************************/ -extern FIELDTYPE *TYPE_ALPHA, - *TYPE_ALNUM, - *TYPE_ENUM, - *TYPE_INTEGER, - *TYPE_NUMERIC, - *TYPE_REGEXP; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; /************************************ * built-in additional field types * * They are not defined in SVr4 * ************************************/ -extern FIELDTYPE *TYPE_IPV4; /* Internet IP Version 4 address */ +extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ /*********************** * Default objects * ***********************/ -extern FORM *_nc_Default_Form; -extern FIELD *_nc_Default_Field; +extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form; +extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field; /*********************** * FIELDTYPE routines * ***********************/ -extern FIELDTYPE - *new_fieldtype( +extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( bool (* const field_check)(FIELD *,const void *), bool (* const char_check)(int,const void *)), *link_fieldtype(FIELDTYPE *,FIELDTYPE *); -extern int free_fieldtype(FIELDTYPE *), - set_fieldtype_arg(FIELDTYPE *, +extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); +extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, void * (* const make_arg)(va_list *), void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)), - set_fieldtype_choice (FIELDTYPE *, + void (* const free_arg)(void *)); +extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, bool (* const next_choice)(FIELD *,const void *), bool (* const prev_choice)(FIELD *,const void *)); /******************* * FIELD routines * *******************/ -extern FIELD *new_field(int,int,int,int,int,int), - *dup_field(FIELD *,int,int), - *link_field(FIELD *,int,int); - -extern int free_field(FIELD *), - field_info(const FIELD *,int *,int *,int *,int *,int *,int *), - dynamic_field_info(const FIELD *,int *,int *,int *), - set_max_field( FIELD *,int), - move_field(FIELD *,int,int), - set_field_type(FIELD *,FIELDTYPE *,...), - set_new_page(FIELD *,bool), - set_field_just(FIELD *,int), - field_just(const FIELD *), - set_field_fore(FIELD *,chtype), - set_field_back(FIELD *,chtype), - set_field_pad(FIELD *,int), - field_pad(const FIELD *), - set_field_buffer(FIELD *,int,const char *), - set_field_status(FIELD *,bool), - set_field_userptr(FIELD *, void *), - set_field_opts(FIELD *,Field_Options), - field_opts_on(FIELD *,Field_Options), - field_opts_off(FIELD *,Field_Options); - -extern chtype field_fore(const FIELD *), - field_back(const FIELD *); - -extern bool new_page(const FIELD *), - field_status(const FIELD *); - -extern void *field_arg(const FIELD *); - -extern void *field_userptr(const FIELD *); - -extern FIELDTYPE - *field_type(const FIELD *); - -extern char* field_buffer(const FIELD *,int); - -extern Field_Options - field_opts(const FIELD *); +extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); +extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); +extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); + +extern NCURSES_EXPORT(int) free_field (FIELD *); +extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); +extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); +extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); +extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); +extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); +extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); +extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); +extern NCURSES_EXPORT(int) field_just (const FIELD *); +extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); +extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); +extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); +extern NCURSES_EXPORT(int) field_pad (const FIELD *); +extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); +extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); +extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); +extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); +extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); +extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); + +extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); +extern NCURSES_EXPORT(chtype) field_back (const FIELD *); + +extern NCURSES_EXPORT(bool) new_page (const FIELD *); +extern NCURSES_EXPORT(bool) field_status (const FIELD *); + +extern NCURSES_EXPORT(void *) field_arg (const FIELD *); + +extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); + +extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); + +extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); + +extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); /****************** * FORM routines * ******************/ -extern FORM *new_form(FIELD **); - -extern FIELD **form_fields(const FORM *), - *current_field(const FORM *); - -extern WINDOW *form_win(const FORM *), - *form_sub(const FORM *); - -extern Form_Hook - form_init(const FORM *), - form_term(const FORM *), - field_init(const FORM *), - field_term(const FORM *); - -extern int free_form(FORM *), - set_form_fields(FORM *,FIELD **), - field_count(const FORM *), - set_form_win(FORM *,WINDOW *), - set_form_sub(FORM *,WINDOW *), - set_current_field(FORM *,FIELD *), - field_index(const FIELD *), - set_form_page(FORM *,int), - form_page(const FORM *), - scale_form(const FORM *,int *,int *), - set_form_init(FORM *,Form_Hook), - set_form_term(FORM *,Form_Hook), - set_field_init(FORM *,Form_Hook), - set_field_term(FORM *,Form_Hook), - post_form(FORM *), - unpost_form(FORM *), - pos_form_cursor(FORM *), - form_driver(FORM *,int), - set_form_userptr(FORM *,void *), - set_form_opts(FORM *,Form_Options), - form_opts_on(FORM *,Form_Options), - form_opts_off(FORM *,Form_Options), - form_request_by_name(const char *); - -extern const char - *form_request_name(int); - -extern void *form_userptr(const FORM *); - -extern Form_Options - form_opts(const FORM *); - -extern bool data_ahead(const FORM *), - data_behind(const FORM *); + +extern NCURSES_EXPORT(FORM *) new_form (FIELD **); + +extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); +extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); + +extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); +extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); + +extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); +extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); +extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); +extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); + +extern NCURSES_EXPORT(int) free_form (FORM *); +extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); +extern NCURSES_EXPORT(int) field_count (const FORM *); +extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); +extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); +extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); +extern NCURSES_EXPORT(int) field_index (const FIELD *); +extern NCURSES_EXPORT(int) set_form_page (FORM *,int); +extern NCURSES_EXPORT(int) form_page (const FORM *); +extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); +extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); +extern NCURSES_EXPORT(int) post_form (FORM *); +extern NCURSES_EXPORT(int) unpost_form (FORM *); +extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); +extern NCURSES_EXPORT(int) form_driver (FORM *,int); +extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); +extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); +extern NCURSES_EXPORT(int) form_request_by_name (const char *); + +extern NCURSES_EXPORT(const char *) form_request_name (int); + +extern NCURSES_EXPORT(void *) form_userptr (const FORM *); + +extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); + +extern NCURSES_EXPORT(bool) data_ahead (const FORM *); +extern NCURSES_EXPORT(bool) data_behind (const FORM *); #ifdef __cplusplus } diff --git a/form/form.priv.h b/form/form.priv.h index 886121c9..c1ca8e19 100644 --- a/form/form.priv.h +++ b/form/form.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "mf_common.h" @@ -110,19 +111,19 @@ typedef struct typearg { #define C_BLANK ' ' #define is_blank(c) ((c)==C_BLANK) -extern const FIELDTYPE* _nc_Default_FieldType; - -extern TypeArgument* _nc_Make_Argument(const FIELDTYPE*,va_list*,int*); -extern TypeArgument *_nc_Copy_Argument(const FIELDTYPE*,const TypeArgument*, int*); -extern void _nc_Free_Argument(const FIELDTYPE*,TypeArgument*); -extern bool _nc_Copy_Type(FIELD*, FIELD const *); -extern void _nc_Free_Type(FIELD *); - -extern int _nc_Synchronize_Attributes(FIELD*); -extern int _nc_Synchronize_Options(FIELD*,Field_Options); -extern int _nc_Set_Form_Page(FORM*,int,FIELD*); -extern int _nc_Refresh_Current_Field(FORM*); -extern FIELD* _nc_First_Active_Field(FORM*); -extern bool _nc_Internal_Validation(FORM*); -extern int _nc_Set_Current_Field(FORM*,FIELD*); -extern int _nc_Position_Form_Cursor(FORM*); +extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType; + +extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*,va_list*,int*); +extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*,const TypeArgument*, int*); +extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*,TypeArgument*); +extern NCURSES_EXPORT(bool) _nc_Copy_Type (FIELD*, FIELD const *); +extern NCURSES_EXPORT(void) _nc_Free_Type (FIELD *); + +extern NCURSES_EXPORT(int) _nc_Synchronize_Attributes (FIELD*); +extern NCURSES_EXPORT(int) _nc_Synchronize_Options (FIELD*,Field_Options); +extern NCURSES_EXPORT(int) _nc_Set_Form_Page (FORM*,int,FIELD*); +extern NCURSES_EXPORT(int) _nc_Refresh_Current_Field (FORM*); +extern NCURSES_EXPORT(FIELD *) _nc_First_Active_Field (FORM*); +extern NCURSES_EXPORT(bool) _nc_Internal_Validation (FORM*); +extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*,FIELD*); +extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*); diff --git a/form/frm_cursor.c b/form/frm_cursor.c index 96ad2d60..8e28235f 100644 --- a/form/frm_cursor.c +++ b/form/frm_cursor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_cursor.c,v 1.4 1999/05/16 17:20:19 juergen Exp $") +MODULE_ID("$Id: frm_cursor.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -47,7 +48,8 @@ MODULE_ID("$Id: frm_cursor.c,v 1.4 1999/05/16 17:20:19 juergen Exp $") | E_BAD_ARGUMENT - Invalid form pointer | E_NOT_POSTED - Form is not posted +--------------------------------------------------------------------------*/ -int pos_form_cursor(FORM * form) +NCURSES_EXPORT(int) +pos_form_cursor (FORM * form) { int res; diff --git a/form/frm_data.c b/form/frm_data.c index e90f5a17..1026cf4f 100644 --- a/form/frm_data.c +++ b/form/frm_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_data.c,v 1.6 1999/05/16 17:20:29 juergen Exp $") +MODULE_ID("$Id: frm_data.c,v 1.8 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: frm_data.c,v 1.6 1999/05/16 17:20:29 juergen Exp $") | Return Values : TRUE - there are off-screen data behind | FALSE - there are no off-screen data behind +--------------------------------------------------------------------------*/ -bool data_behind(const FORM *form) +NCURSES_EXPORT(bool) +data_behind (const FORM *form) { bool result = FALSE; @@ -101,7 +103,8 @@ static char * After_Last_Non_Pad_Position(char *buffer, int len, int pad) | Return Values : TRUE - there are off-screen data ahead | FALSE - there are no off-screen data ahead +--------------------------------------------------------------------------*/ -bool data_ahead(const FORM *form) +NCURSES_EXPORT(bool) +data_ahead (const FORM *form) { bool result = FALSE; diff --git a/form/frm_def.c b/form/frm_def.c index 34be5fe7..ef6f9c92 100644 --- a/form/frm_def.c +++ b/form/frm_def.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_def.c,v 1.9 1999/05/16 17:20:43 juergen Exp $") +MODULE_ID("$Id: frm_def.c,v 1.11 2002/07/06 15:33:27 juergen Exp $") /* this can't be readonly */ static FORM default_form = { @@ -60,7 +61,7 @@ static FORM default_form = { NULL /* fieldterm */ }; -FORM *_nc_Default_Form = &default_form; +NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form; /*--------------------------------------------------------------------------- | Facility : libnform @@ -269,7 +270,8 @@ INLINE static int Associate_Fields(FORM *form, FIELD **fields) | | Return Values : Pointer to form. NULL if error occured. +--------------------------------------------------------------------------*/ -FORM *new_form(FIELD ** fields) +NCURSES_EXPORT(FORM *) +new_form (FIELD ** fields) { int err = E_SYSTEM_ERROR; @@ -301,7 +303,8 @@ FORM *new_form(FIELD ** fields) | E_BAD_ARGUMENT - invalid form pointer | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int free_form(FORM * form) +NCURSES_EXPORT(int) +free_form (FORM * form) { if ( !form ) RETURN(E_BAD_ARGUMENT); @@ -327,7 +330,8 @@ int free_form(FORM * form) | E_BAD_ARGUMENT - invalid form pointer | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_fields(FORM * form, FIELD ** fields) +NCURSES_EXPORT(int) +set_form_fields (FORM * form, FIELD ** fields) { FIELD **old; int res; @@ -355,7 +359,8 @@ int set_form_fields(FORM * form, FIELD ** fields) | | Return Values : Pointer to field array +--------------------------------------------------------------------------*/ -FIELD **form_fields(const FORM * form) +NCURSES_EXPORT(FIELD **) +form_fields (const FORM * form) { return (Normalize_Form( form )->field); } @@ -368,7 +373,8 @@ FIELD **form_fields(const FORM * form) | | Return Values : Number of fields, -1 if none are defined +--------------------------------------------------------------------------*/ -int field_count(const FORM * form) +NCURSES_EXPORT(int) +field_count (const FORM * form) { return (Normalize_Form( form )->maxfield); } diff --git a/form/frm_driver.c b/form/frm_driver.c index e609e191..c9275f7e 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.35 1999/05/16 17:20:52 juergen Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.39 2002/07/06 15:33:27 juergen Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -516,7 +517,8 @@ static bool Field_Grown(FIELD * field, int amount) return FALSE; } assert(form!=(FORM *)0); - delwin(form->w); + if (form->w) + delwin(form->w); form->w = new_window; Set_Field_Window_Attributes(field,form->w); werase(form->w); @@ -558,8 +560,8 @@ static bool Field_Grown(FIELD * field, int amount) | E_SYSTEM_ERROR - form has no current field or | field-window +--------------------------------------------------------------------------*/ -int -_nc_Position_Form_Cursor(FORM * form) +NCURSES_EXPORT(int) +_nc_Position_Form_Cursor (FORM * form) { FIELD *field; WINDOW *formwin; @@ -599,8 +601,8 @@ _nc_Position_Form_Cursor(FORM * form) | E_BAD_ARGUMENT - invalid form pointer | E_SYSTEM_ERROR - general error +--------------------------------------------------------------------------*/ -int -_nc_Refresh_Current_Field(FORM * form) +NCURSES_EXPORT(int) +_nc_Refresh_Current_Field (FORM * form) { WINDOW *formwin; FIELD *field; @@ -957,7 +959,8 @@ static int Synchronize_Linked_Fields(FIELD * field) | E_BAD_ARGUMENT - invalid field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int _nc_Synchronize_Attributes(FIELD * field) +NCURSES_EXPORT(int) +_nc_Synchronize_Attributes (FIELD * field) { FORM *form; int res = E_OK; @@ -1015,8 +1018,9 @@ int _nc_Synchronize_Attributes(FIELD * field) | E_BAD_ARGUMENT - invalid field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int -_nc_Synchronize_Options(FIELD *field, Field_Options newopts) +NCURSES_EXPORT(int) +_nc_Synchronize_Options +(FIELD *field, Field_Options newopts) { Field_Options oldopts; Field_Options changed_opts; @@ -1113,8 +1117,9 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) | E_BAD_ARGUMENT - invalid form or field pointer | E_SYSTEM_ERROR - some severe basic error +--------------------------------------------------------------------------*/ -int -_nc_Set_Current_Field(FORM *form, FIELD *newfield) +NCURSES_EXPORT(int) +_nc_Set_Current_Field +(FORM *form, FIELD *newfield) { FIELD *field; WINDOW *new_window; @@ -1159,6 +1164,7 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield) } } delwin(form->w); + form->w = (WINDOW *)0; } field = newfield; @@ -1173,7 +1179,11 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield) return(E_SYSTEM_ERROR); form->current = field; + + if (form->w) + delwin(form->w); form->w = new_window; + form->status &= ~_WINDOW_MODIFIED; Set_Field_Window_Attributes(field,form->w); @@ -2686,8 +2696,8 @@ static bool Check_Field(FIELDTYPE *typ, FIELD *field, TypeArgument *argp) | Return Values : TRUE - field is valid | FALSE - field is invalid +--------------------------------------------------------------------------*/ -bool -_nc_Internal_Validation(FORM *form) +NCURSES_EXPORT(bool) +_nc_Internal_Validation (FORM *form) { FIELD *field; @@ -2776,8 +2786,8 @@ INLINE static FIELD *Next_Field_On_Page(FIELD * field) | | Return Values : Pointer to calculated field. +--------------------------------------------------------------------------*/ -FIELD* -_nc_First_Active_Field(FORM * form) +NCURSES_EXPORT(FIELD*) +_nc_First_Active_Field (FORM * form) { FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; FIELD *proposed = Next_Field_On_Page(*last_on_page); @@ -3283,8 +3293,9 @@ static int FN_Down_Field(FORM * form) | Return Values : E_OK - success | != E_OK - error from subordinate call +--------------------------------------------------------------------------*/ -int -_nc_Set_Form_Page(FORM * form, int page, FIELD * field) +NCURSES_EXPORT(int) +_nc_Set_Form_Page +(FORM * form, int page, FIELD * field) { int res = E_OK; @@ -3637,7 +3648,8 @@ static const Binding_Info bindings[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = | E_REQUEST_DENIED - request failed | E_UNKNOWN_COMMAND - command not known +--------------------------------------------------------------------------*/ -int form_driver(FORM * form, int c) +NCURSES_EXPORT(int) +form_driver (FORM * form, int c) { const Binding_Info* BI = (Binding_Info *)0; int res = E_UNKNOWN_COMMAND; @@ -3736,7 +3748,9 @@ int form_driver(FORM * form, int c) | E_BAD_ARGUMENT - invalid argument | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_field_buffer(FIELD * field, int buffer, const char * value) +NCURSES_EXPORT(int) +set_field_buffer +(FIELD * field, int buffer, const char * value) { char *s, *p; int res = E_OK; @@ -3778,7 +3792,7 @@ int set_field_buffer(FIELD * field, int buffer, const char * value) unsigned int i; for(i=len; i= 0) && (buffer <= field->nbuf)) return Address_Of_Nth_Buffer(field,buffer); diff --git a/form/frm_hook.c b/form/frm_hook.c index 5a5ec293..1af3d084 100644 --- a/form/frm_hook.c +++ b/form/frm_hook.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,16 +27,17 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_hook.c,v 1.8 1999/05/16 17:21:04 juergen Exp $") +MODULE_ID("$Id: frm_hook.c,v 1.10 2002/07/06 15:33:27 juergen Exp $") /* "Template" macro to generate function to set application specific hook */ #define GEN_HOOK_SET_FUNCTION( typ, name ) \ -int set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ +NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ {\ (Normalize_Form( form ) -> typ ## name) = func ;\ RETURN(E_OK);\ @@ -44,7 +45,7 @@ int set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\ /* "Template" macro to generate function to get application specific hook */ #define GEN_HOOK_GET_FUNCTION( typ, name ) \ -Form_Hook typ ## _ ## name ( const FORM *form )\ +NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\ {\ return ( Normalize_Form( form ) -> typ ## name );\ } diff --git a/form/frm_opts.c b/form/frm_opts.c index 009c1897..22ca3a1e 100644 --- a/form/frm_opts.c +++ b/form/frm_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $") +MODULE_ID("$Id: frm_opts.c,v 1.10 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: frm_opts.c,v 1.8 1999/05/16 17:38:05 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int set_form_opts(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +set_form_opts (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) @@ -64,7 +66,8 @@ int set_form_opts(FORM * form, Form_Options opts) | | Return Values : The option flags. +--------------------------------------------------------------------------*/ -Form_Options form_opts(const FORM * form) +NCURSES_EXPORT(Form_Options) +form_opts (const FORM * form) { return (Normalize_Form(form)->opts & ALL_FORM_OPTS); } @@ -79,7 +82,8 @@ Form_Options form_opts(const FORM * form) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int form_opts_on(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +form_opts_on (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) @@ -101,7 +105,8 @@ int form_opts_on(FORM * form, Form_Options opts) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int form_opts_off(FORM * form, Form_Options opts) +NCURSES_EXPORT(int) +form_opts_off (FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) diff --git a/form/frm_page.c b/form/frm_page.c index 5136542e..b1a958e1 100644 --- a/form/frm_page.c +++ b/form/frm_page.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_page.c,v 1.5 1999/05/16 17:21:26 juergen Exp $") +MODULE_ID("$Id: frm_page.c,v 1.7 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +47,8 @@ MODULE_ID("$Id: frm_page.c,v 1.5 1999/05/16 17:21:26 juergen Exp $") | E_INVALID_FIELD - current field can't be left | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int set_form_page(FORM * form, int page) +NCURSES_EXPORT(int) +set_form_page (FORM * form, int page) { int err = E_OK; @@ -92,7 +94,8 @@ int set_form_page(FORM * form, int page) | Return Values : >= 0 : current page number | -1 : invalid form pointer +--------------------------------------------------------------------------*/ -int form_page(const FORM * form) +NCURSES_EXPORT(int) +form_page (const FORM * form) { return Normalize_Form(form)->curpage; } diff --git a/form/frm_post.c b/form/frm_post.c index 3fdb57a0..ac1aa1c2 100644 --- a/form/frm_post.c +++ b/form/frm_post.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_post.c,v 1.4 1999/05/16 17:21:39 juergen Exp $") +MODULE_ID("$Id: frm_post.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -46,7 +47,8 @@ MODULE_ID("$Id: frm_post.c,v 1.4 1999/05/16 17:21:39 juergen Exp $") | E_NO_ROOM - form doesn't fit into subwindow | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ -int post_form(FORM * form) +NCURSES_EXPORT(int) +post_form (FORM * form) { WINDOW *formwin; int err; @@ -93,7 +95,8 @@ int post_form(FORM * form) | E_NOT_POSTED - form isn't posted | E_BAD_STATE - called from a hook routine +--------------------------------------------------------------------------*/ -int unpost_form(FORM * form) +NCURSES_EXPORT(int) +unpost_form (FORM * form) { if (!form) RETURN(E_BAD_ARGUMENT); diff --git a/form/frm_req_name.c b/form/frm_req_name.c index 63006517..e7d5aa4a 100644 --- a/form/frm_req_name.c +++ b/form/frm_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_req_name.c,v 1.7 1999/05/16 17:21:53 juergen Exp $") +MODULE_ID("$Id: frm_req_name.c,v 1.9 2002/07/06 15:33:27 juergen Exp $") static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = { "NEXT_PAGE" , @@ -113,7 +114,8 @@ static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = { | Return Values : Pointer to name - on success | NULL - on invalid request code +--------------------------------------------------------------------------*/ -const char *form_request_name( int request ) +NCURSES_EXPORT(const char *) +form_request_name ( int request ) { if ( (request < MIN_FORM_COMMAND) || (request > MAX_FORM_COMMAND) ) { @@ -134,7 +136,8 @@ const char *form_request_name( int request ) | Return Values : Request Id - on success | E_NO_MATCH - request not found +--------------------------------------------------------------------------*/ -int form_request_by_name( const char *str ) +NCURSES_EXPORT(int) +form_request_by_name ( const char *str ) { /* because the table is so small, it doesn't really hurt to run sequentially through it. diff --git a/form/frm_scale.c b/form/frm_scale.c index bb197177..e86df103 100644 --- a/form/frm_scale.c +++ b/form/frm_scale.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_scale.c,v 1.4 1999/05/16 17:22:02 juergen Exp $") +MODULE_ID("$Id: frm_scale.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -44,7 +45,8 @@ MODULE_ID("$Id: frm_scale.c,v 1.4 1999/05/16 17:22:02 juergen Exp $") | E_BAD_ARGUMENT - invalid form pointer | E_NOT_CONNECTED - no fields connected to form +--------------------------------------------------------------------------*/ -int scale_form(const FORM * form, int * rows, int * cols) +NCURSES_EXPORT(int) +scale_form (const FORM * form, int * rows, int * cols) { if ( !form ) RETURN(E_BAD_ARGUMENT); diff --git a/form/frm_sub.c b/form/frm_sub.c index 849f9cb0..1c33930e 100644 --- a/form/frm_sub.c +++ b/form/frm_sub.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_sub.c,v 1.4 1999/05/16 17:22:11 juergen Exp $") +MODULE_ID("$Id: frm_sub.c,v 1.6 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +44,8 @@ MODULE_ID("$Id: frm_sub.c,v 1.4 1999/05/16 17:22:11 juergen Exp $") | Return Values : E_OK - success | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_sub(FORM * form, WINDOW * win) +NCURSES_EXPORT(int) +set_form_sub (FORM * form, WINDOW * win) { if (form && (form->status & _POSTED)) RETURN(E_POSTED); @@ -60,7 +62,8 @@ int set_form_sub(FORM * form, WINDOW * win) | | Return Values : The pointer to the Subwindow. +--------------------------------------------------------------------------*/ -WINDOW *form_sub(const FORM * form) +NCURSES_EXPORT(WINDOW *) +form_sub (const FORM * form) { const FORM* f = Normalize_Form( form ); return Get_Form_Window(f); diff --git a/form/frm_user.c b/form/frm_user.c index 853904f0..a9b6b397 100644 --- a/form/frm_user.c +++ b/form/frm_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_user.c,v 1.8 1999/05/16 17:22:21 juergen Exp $") +MODULE_ID("$Id: frm_user.c,v 1.10 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +44,8 @@ MODULE_ID("$Id: frm_user.c,v 1.8 1999/05/16 17:22:21 juergen Exp $") | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int set_form_userptr(FORM * form, void *usrptr) +NCURSES_EXPORT(int) +set_form_userptr (FORM * form, void *usrptr) { Normalize_Form(form)->usrptr = usrptr; RETURN(E_OK); @@ -59,7 +61,8 @@ int set_form_userptr(FORM * form, void *usrptr) | Return Values : Value of pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -void *form_userptr(const FORM * form) +NCURSES_EXPORT(void *) +form_userptr (const FORM * form) { return Normalize_Form(form)->usrptr; } diff --git a/form/frm_win.c b/form/frm_win.c index b705d033..b765d33d 100644 --- a/form/frm_win.c +++ b/form/frm_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,12 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: frm_win.c,v 1.8 1999/05/16 17:22:32 juergen Exp $") +MODULE_ID("$Id: frm_win.c,v 1.10 2002/07/06 15:33:27 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -43,7 +44,8 @@ MODULE_ID("$Id: frm_win.c,v 1.8 1999/05/16 17:22:32 juergen Exp $") | Return Values : E_OK - success | E_POSTED - form is posted +--------------------------------------------------------------------------*/ -int set_form_win(FORM * form, WINDOW * win) +NCURSES_EXPORT(int) +set_form_win (FORM * form, WINDOW * win) { if (form && (form->status & _POSTED)) RETURN(E_POSTED); @@ -60,7 +62,8 @@ int set_form_win(FORM * form, WINDOW * win) | | Return Values : The pointer to the Window or stdscr if there is none. +--------------------------------------------------------------------------*/ -WINDOW *form_win(const FORM * form) +NCURSES_EXPORT(WINDOW *) +form_win (const FORM * form) { const FORM* f = Normalize_Form( form ); return (f->win ? f->win : stdscr); diff --git a/form/fty_alnum.c b/form/fty_alnum.c index cb3909d7..bf16c66d 100644 --- a/form/fty_alnum.c +++ b/form/fty_alnum.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_alnum.c,v 1.9 1999/05/16 17:22:49 juergen Exp $") +MODULE_ID("$Id: fty_alnum.c,v 1.11 2002/07/06 15:33:27 juergen Exp $") typedef struct { int width; @@ -132,6 +133,6 @@ static FIELDTYPE typeALNUM = { NULL }; -FIELDTYPE* TYPE_ALNUM = &typeALNUM; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM; /* fty_alnum.c ends here */ diff --git a/form/fty_alpha.c b/form/fty_alpha.c index 3dd8f2cb..aa5c7c7d 100644 --- a/form/fty_alpha.c +++ b/form/fty_alpha.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_alpha.c,v 1.9 1999/05/16 17:22:58 juergen Exp $") +MODULE_ID("$Id: fty_alpha.c,v 1.11 2002/07/06 15:33:27 juergen Exp $") typedef struct { int width; @@ -133,6 +134,6 @@ static FIELDTYPE typeALPHA = { NULL }; -FIELDTYPE* TYPE_ALPHA = &typeALPHA; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA; /* fty_alpha.c ends here */ diff --git a/form/fty_enum.c b/form/fty_enum.c index 4ad69fb5..ab256db1 100644 --- a/form/fty_enum.c +++ b/form/fty_enum.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_enum.c,v 1.14 2000/10/18 09:28:19 juergen Exp $") +MODULE_ID("$Id: fty_enum.c,v 1.16 2002/07/13 11:35:08 juergen Exp $") typedef struct { char **kwds; @@ -290,6 +291,6 @@ static FIELDTYPE typeENUM = { Previous_Enum }; -FIELDTYPE* TYPE_ENUM = &typeENUM; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM; /* fty_enum.c ends here */ diff --git a/form/fty_int.c b/form/fty_int.c index cb690bda..61ad9e42 100644 --- a/form/fty_int.c +++ b/form/fty_int.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_int.c,v 1.10 1999/05/16 17:23:22 juergen Exp $") +MODULE_ID("$Id: fty_int.c,v 1.12 2002/07/06 15:33:27 juergen Exp $") typedef struct { int precision; @@ -155,6 +156,6 @@ static FIELDTYPE typeINTEGER = { NULL }; -FIELDTYPE* TYPE_INTEGER = &typeINTEGER; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER; /* fty_int.c ends here */ diff --git a/form/fty_ipv4.c b/form/fty_ipv4.c index 064c02c8..f49dcdb1 100644 --- a/form/fty_ipv4.c +++ b/form/fty_ipv4.c @@ -13,7 +13,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fty_ipv4.c,v 1.2 1997/04/26 22:06:00 tom Exp $") +MODULE_ID("$Id: fty_ipv4.c,v 1.4 2000/12/09 23:46:12 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -32,13 +32,13 @@ static bool Check_IPV4_Field(FIELD * field, const void * argp GCC_UNUSED) int num = 0, len; unsigned int d1, d2, d3, d4; - if(isdigit(*bp)) /* Must start with digit */ + if(isdigit((unsigned char)*bp)) /* Must start with digit */ { num = sscanf(bp, "%u.%u.%u.%u%n", &d1, &d2, &d3, &d4, &len); if (num == 4) { bp += len; /* Make bp point to what sscanf() left */ - while (*bp && isspace(*bp)) + while (*bp && isspace((unsigned char)*bp)) bp++; /* Allow trailing whitespace */ } } @@ -76,6 +76,6 @@ static FIELDTYPE typeIPV4 = { NULL }; -FIELDTYPE* TYPE_IPV4 = &typeIPV4; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4; /* fty_ipv4.c ends here */ diff --git a/form/fty_num.c b/form/fty_num.c index ca0fbe01..db4d648c 100644 --- a/form/fty_num.c +++ b/form/fty_num.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_num.c,v 1.13 1999/05/16 17:23:30 juergen Exp $") +MODULE_ID("$Id: fty_num.c,v 1.15 2002/07/06 15:33:27 juergen Exp $") #if HAVE_LOCALE_H #include @@ -190,6 +191,6 @@ static FIELDTYPE typeNUMERIC = { NULL }; -FIELDTYPE* TYPE_NUMERIC = &typeNUMERIC; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC; /* fty_num.c ends here */ diff --git a/form/fty_regex.c b/form/fty_regex.c index 7a928125..6cb69d04 100644 --- a/form/fty_regex.c +++ b/form/fty_regex.c @@ -7,13 +7,14 @@ */ /*************************************************************************** * * -* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net * +* Author : Juergen Pfeifer * +* Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * * * ***************************************************************************/ #include "form.priv.h" -MODULE_ID("$Id: fty_regex.c,v 1.14 1999/05/16 17:23:38 juergen Exp $") +MODULE_ID("$Id: fty_regex.c,v 1.16 2002/07/06 15:33:27 juergen Exp $") #if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */ #include @@ -252,6 +253,6 @@ static FIELDTYPE typeREGEXP = { NULL }; -FIELDTYPE* TYPE_REGEXP = &typeREGEXP; +NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP; /* fty_regex.c ends here */ diff --git a/form/llib-lform b/form/llib-lform index ac2ba436..d66a9620 100644 --- a/form/llib-lform +++ b/form/llib-lform @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996,1997 * + * Author: Thomas E. Dickey 1996,1997,2002 * ****************************************************************************/ /* LINTLIBRARY */ @@ -119,10 +119,10 @@ void _nc_Free_Argument( { /* void */ } #undef _nc_Copy_Type -bool _nc_Copy_Type( +NCURSES_BOOL _nc_Copy_Type( FIELD *dst, FIELD const *src) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_Free_Type void _nc_Free_Type( @@ -158,10 +158,10 @@ FIELD *dup_field( #undef set_fieldtype_choice int set_fieldtype_choice( FIELDTYPE *typ, - bool (*const next_choice)( + NCURSES_BOOL (*const next_choice)( FIELD *p1, const void *p2), - bool (*const prev_choice)( + NCURSES_BOOL (*const prev_choice)( FIELD *p1, const void *p2)) { return(*(int *)0); } @@ -241,10 +241,10 @@ const FIELDTYPE *_nc_Default_FieldType = {0}; #undef new_fieldtype FIELDTYPE *new_fieldtype( - bool (*const field_check)( + NCURSES_BOOL (*const field_check)( FIELD *p1, const void *p2), - bool (*const char_check)( + NCURSES_BOOL (*const char_check)( int p1, const void *p2)) { return(*(FIELDTYPE **)0); } @@ -297,26 +297,26 @@ int field_pad( #undef set_new_page int set_new_page( FIELD *field, - bool new_page_flag) + NCURSES_BOOL new_page_flag) { return(*(int *)0); } #undef new_page -bool new_page( +NCURSES_BOOL new_page( const FIELD *field) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./fld_stat.c */ #undef set_field_status int set_field_status( FIELD *field, - bool status) + NCURSES_BOOL status) { return(*(int *)0); } #undef field_status -bool field_status( +NCURSES_BOOL field_status( const FIELD *field) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./fld_type.c */ @@ -355,14 +355,14 @@ int pos_form_cursor( /* ./frm_data.c */ #undef data_behind -bool data_behind( +NCURSES_BOOL data_behind( const FORM *form) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef data_ahead -bool data_ahead( +NCURSES_BOOL data_ahead( const FORM *form) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./frm_def.c */ @@ -425,9 +425,9 @@ int _nc_Set_Current_Field( { return(*(int *)0); } #undef _nc_Internal_Validation -bool _nc_Internal_Validation( +NCURSES_BOOL _nc_Internal_Validation( FORM *form) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_First_Active_Field FIELD *_nc_First_Active_Field( @@ -644,8 +644,8 @@ FIELDTYPE *TYPE_ALPHA; typedef struct { char **kwds; int count; - bool checkcase; - bool checkunique; + NCURSES_BOOL checkcase; + NCURSES_BOOL checkunique; } enumARG; #undef TYPE_ENUM diff --git a/form/llib-lformw b/form/llib-lformw new file mode 100644 index 00000000..f5720189 --- /dev/null +++ b/form/llib-lformw @@ -0,0 +1,692 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./fld_arg.c */ + +#include "form.priv.h" + +#undef set_fieldtype_arg +int set_fieldtype_arg( + FIELDTYPE *typ, + void *(*const make_arg)( + va_list *p1), + void *(*const copy_arg)( + const void *p1), + void (*const free_arg)( + void *p1)) + { return(*(int *)0); } + +#undef field_arg +void *field_arg( + const FIELD *field) + { return(*(void **)0); } + +/* ./fld_attr.c */ + +#undef set_field_fore +int set_field_fore( + FIELD *field, + chtype attr) + { return(*(int *)0); } + +#undef field_fore +chtype field_fore( + const FIELD *field) + { return(*(chtype *)0); } + +#undef set_field_back +int set_field_back( + FIELD *field, + chtype attr) + { return(*(int *)0); } + +#undef field_back +chtype field_back( + const FIELD *field) + { return(*(chtype *)0); } + +/* ./fld_current.c */ + +#undef set_current_field +int set_current_field( + FORM *form, + FIELD *field) + { return(*(int *)0); } + +#undef current_field +FIELD *current_field( + const FORM *form) + { return(*(FIELD **)0); } + +#undef field_index +int field_index( + const FIELD *field) + { return(*(int *)0); } + +/* ./fld_def.c */ + +#undef _nc_Default_Field +FIELD *_nc_Default_Field; + +#undef _nc_Make_Argument +TypeArgument *_nc_Make_Argument( + const FIELDTYPE *typ, + va_list *ap, + int *err) + { return(*(TypeArgument **)0); } + +#undef _nc_Copy_Argument +TypeArgument *_nc_Copy_Argument( + const FIELDTYPE *typ, + const TypeArgument *argp, + int *err) + { return(*(TypeArgument **)0); } + +#undef _nc_Free_Argument +void _nc_Free_Argument( + const FIELDTYPE *typ, + TypeArgument *argp) + { /* void */ } + +#undef _nc_Copy_Type +NCURSES_BOOL _nc_Copy_Type( + FIELD *dst, + FIELD const *src) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_Free_Type +void _nc_Free_Type( + FIELD *field) + { /* void */ } + +#undef new_field +FIELD *new_field( + int rows, + int cols, + int frow, + int fcol, + int nrow, + int nbuf) + { return(*(FIELD **)0); } + +#undef free_field +int free_field( + FIELD *field) + { return(*(int *)0); } + +/* ./fld_dup.c */ + +#undef dup_field +FIELD *dup_field( + FIELD *field, + int frow, + int fcol) + { return(*(FIELD **)0); } + +/* ./fld_ftchoice.c */ + +#undef set_fieldtype_choice +int set_fieldtype_choice( + FIELDTYPE *typ, + NCURSES_BOOL (*const next_choice)( + FIELD *p1, + const void *p2), + NCURSES_BOOL (*const prev_choice)( + FIELD *p1, + const void *p2)) + { return(*(int *)0); } + +/* ./fld_ftlink.c */ + +#undef link_fieldtype +FIELDTYPE *link_fieldtype( + FIELDTYPE *type1, + FIELDTYPE *type2) + { return(*(FIELDTYPE **)0); } + +/* ./fld_info.c */ + +#undef field_info +int field_info( + const FIELD *field, + int *rows, + int *cols, + int *frow, + int *fcol, + int *nrow, + int *nbuf) + { return(*(int *)0); } + +#undef dynamic_field_info +int dynamic_field_info( + const FIELD *field, + int *drows, + int *dcols, + int *maxgrow) + { return(*(int *)0); } + +/* ./fld_just.c */ + +#undef set_field_just +int set_field_just( + FIELD *field, + int just) + { return(*(int *)0); } + +#undef field_just +int field_just( + const FIELD *field) + { return(*(int *)0); } + +/* ./fld_link.c */ + +#undef link_field +FIELD *link_field( + FIELD *field, + int frow, + int fcol) + { return(*(FIELD **)0); } + +/* ./fld_max.c */ + +#undef set_max_field +int set_max_field( + FIELD *field, + int maxgrow) + { return(*(int *)0); } + +/* ./fld_move.c */ + +#undef move_field +int move_field( + FIELD *field, + int frow, + int fcol) + { return(*(int *)0); } + +/* ./fld_newftyp.c */ + +#undef _nc_Default_FieldType +const FIELDTYPE *_nc_Default_FieldType = {0}; + +#undef new_fieldtype +FIELDTYPE *new_fieldtype( + NCURSES_BOOL (*const field_check)( + FIELD *p1, + const void *p2), + NCURSES_BOOL (*const char_check)( + int p1, + const void *p2)) + { return(*(FIELDTYPE **)0); } + +#undef free_fieldtype +int free_fieldtype( + FIELDTYPE *typ) + { return(*(int *)0); } + +/* ./fld_opts.c */ + +#undef set_field_opts +int set_field_opts( + FIELD *field, + Field_Options opts) + { return(*(int *)0); } + +#undef field_opts +Field_Options field_opts( + const FIELD *field) + { return(*(Field_Options *)0); } + +#undef field_opts_on +int field_opts_on( + FIELD *field, + Field_Options opts) + { return(*(int *)0); } + +#undef field_opts_off +int field_opts_off( + FIELD *field, + Field_Options opts) + { return(*(int *)0); } + +/* ./fld_pad.c */ + +#undef set_field_pad +int set_field_pad( + FIELD *field, + int ch) + { return(*(int *)0); } + +#undef field_pad +int field_pad( + const FIELD *field) + { return(*(int *)0); } + +/* ./fld_page.c */ + +#undef set_new_page +int set_new_page( + FIELD *field, + NCURSES_BOOL new_page_flag) + { return(*(int *)0); } + +#undef new_page +NCURSES_BOOL new_page( + const FIELD *field) + { return(*(NCURSES_BOOL *)0); } + +/* ./fld_stat.c */ + +#undef set_field_status +int set_field_status( + FIELD *field, + NCURSES_BOOL status) + { return(*(int *)0); } + +#undef field_status +NCURSES_BOOL field_status( + const FIELD *field) + { return(*(NCURSES_BOOL *)0); } + +/* ./fld_type.c */ + +#undef set_field_type +int set_field_type( + FIELD *field, + FIELDTYPE *type, + ...) + { return(*(int *)0); } + +#undef field_type +FIELDTYPE *field_type( + const FIELD *field) + { return(*(FIELDTYPE **)0); } + +/* ./fld_user.c */ + +#undef set_field_userptr +int set_field_userptr( + FIELD *field, + void *usrptr) + { return(*(int *)0); } + +#undef field_userptr +void *field_userptr( + const FIELD *field) + { return(*(void **)0); } + +/* ./frm_cursor.c */ + +#undef pos_form_cursor +int pos_form_cursor( + FORM *form) + { return(*(int *)0); } + +/* ./frm_data.c */ + +#undef data_behind +NCURSES_BOOL data_behind( + const FORM *form) + { return(*(NCURSES_BOOL *)0); } + +#undef data_ahead +NCURSES_BOOL data_ahead( + const FORM *form) + { return(*(NCURSES_BOOL *)0); } + +/* ./frm_def.c */ + +#undef _nc_Default_Form +FORM *_nc_Default_Form; + +#undef new_form +FORM *new_form( + FIELD **fields) + { return(*(FORM **)0); } + +#undef free_form +int free_form( + FORM *form) + { return(*(int *)0); } + +#undef set_form_fields +int set_form_fields( + FORM *form, + FIELD **fields) + { return(*(int *)0); } + +#undef form_fields +FIELD **form_fields( + const FORM *form) + { return(*(FIELD ***)0); } + +#undef field_count +int field_count( + const FORM *form) + { return(*(int *)0); } + +/* ./frm_driver.c */ + +#undef _nc_Position_Form_Cursor +int _nc_Position_Form_Cursor( + FORM *form) + { return(*(int *)0); } + +#undef _nc_Refresh_Current_Field +int _nc_Refresh_Current_Field( + FORM *form) + { return(*(int *)0); } + +#undef _nc_Synchronize_Attributes +int _nc_Synchronize_Attributes( + FIELD *field) + { return(*(int *)0); } + +#undef _nc_Synchronize_Options +int _nc_Synchronize_Options( + FIELD *field, + Field_Options newopts) + { return(*(int *)0); } + +#undef _nc_Set_Current_Field +int _nc_Set_Current_Field( + FORM *form, + FIELD *newfield) + { return(*(int *)0); } + +#undef _nc_Internal_Validation +NCURSES_BOOL _nc_Internal_Validation( + FORM *form) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_First_Active_Field +FIELD *_nc_First_Active_Field( + FORM *form) + { return(*(FIELD **)0); } + +#undef _nc_Set_Form_Page +int _nc_Set_Form_Page( + FORM *form, + int page, + FIELD *field) + { return(*(int *)0); } + +typedef struct { + int keycode; + int (*cmd)(FORM *); +} Binding_Info; + +#undef form_driver +int form_driver( + FORM *form, + int c) + { return(*(int *)0); } + +#undef set_field_buffer +int set_field_buffer( + FIELD *field, + int buffer, + const char *value) + { return(*(int *)0); } + +#undef field_buffer +char *field_buffer( + const FIELD *field, + int buffer) + { return(*(char **)0); } + +/* ./frm_hook.c */ + +#undef set_field_init +int set_field_init( + FORM *form, + Form_Hook func) + { return(*(int *)0); } + +#undef field_init +Form_Hook field_init( + const FORM *form) + { return(*(Form_Hook *)0); } + +#undef set_field_term +int set_field_term( + FORM *form, + Form_Hook func) + { return(*(int *)0); } + +#undef field_term +Form_Hook field_term( + const FORM *form) + { return(*(Form_Hook *)0); } + +#undef set_form_init +int set_form_init( + FORM *form, + Form_Hook func) + { return(*(int *)0); } + +#undef form_init +Form_Hook form_init( + const FORM *form) + { return(*(Form_Hook *)0); } + +#undef set_form_term +int set_form_term( + FORM *form, + Form_Hook func) + { return(*(int *)0); } + +#undef form_term +Form_Hook form_term( + const FORM *form) + { return(*(Form_Hook *)0); } + +/* ./frm_opts.c */ + +#undef set_form_opts +int set_form_opts( + FORM *form, + Form_Options opts) + { return(*(int *)0); } + +#undef form_opts +Form_Options form_opts( + const FORM *form) + { return(*(Form_Options *)0); } + +#undef form_opts_on +int form_opts_on( + FORM *form, + Form_Options opts) + { return(*(int *)0); } + +#undef form_opts_off +int form_opts_off( + FORM *form, + Form_Options opts) + { return(*(int *)0); } + +/* ./frm_page.c */ + +#undef set_form_page +int set_form_page( + FORM *form, + int page) + { return(*(int *)0); } + +#undef form_page +int form_page( + const FORM *form) + { return(*(int *)0); } + +/* ./frm_post.c */ + +#undef post_form +int post_form( + FORM *form) + { return(*(int *)0); } + +#undef unpost_form +int unpost_form( + FORM *form) + { return(*(int *)0); } + +/* ./frm_req_name.c */ + +#undef form_request_name +const char *form_request_name( + int request) + { return(*(const char **)0); } + +#undef form_request_by_name +int form_request_by_name( + const char *str) + { return(*(int *)0); } + +/* ./frm_scale.c */ + +#undef scale_form +int scale_form( + const FORM *form, + int *rows, + int *cols) + { return(*(int *)0); } + +/* ./frm_sub.c */ + +#undef set_form_sub +int set_form_sub( + FORM *form, + WINDOW *win) + { return(*(int *)0); } + +#undef form_sub +WINDOW *form_sub( + const FORM *form) + { return(*(WINDOW **)0); } + +/* ./frm_user.c */ + +#undef set_form_userptr +int set_form_userptr( + FORM *form, + void *usrptr) + { return(*(int *)0); } + +#undef form_userptr +void *form_userptr( + const FORM *form) + { return(*(void **)0); } + +/* ./frm_win.c */ + +#undef set_form_win +int set_form_win( + FORM *form, + WINDOW *win) + { return(*(int *)0); } + +#undef form_win +WINDOW *form_win( + const FORM *form) + { return(*(WINDOW **)0); } + +/* ./fty_alnum.c */ + +typedef struct { + int width; +} alnumARG; + +#undef TYPE_ALNUM +FIELDTYPE *TYPE_ALNUM; + +/* ./fty_alpha.c */ + +typedef struct { + int width; +} alphaARG; + +#undef TYPE_ALPHA +FIELDTYPE *TYPE_ALPHA; + +/* ./fty_enum.c */ + +typedef struct { + char **kwds; + int count; + NCURSES_BOOL checkcase; + NCURSES_BOOL checkunique; +} enumARG; + +#undef TYPE_ENUM +FIELDTYPE *TYPE_ENUM; + +/* ./fty_int.c */ + +typedef struct { + int precision; + long low; + long high; +} integerARG; + +#undef TYPE_INTEGER +FIELDTYPE *TYPE_INTEGER; + +/* ./fty_ipv4.c */ +#undef TYPE_IPV4 +FIELDTYPE *TYPE_IPV4; + +/* ./fty_num.c */ + +typedef struct { + int precision; + double low; + double high; + struct lconv* L; +} numericARG; + +#undef TYPE_NUMERIC +FIELDTYPE *TYPE_NUMERIC; + +/* ./fty_regex.c */ + +#include + +typedef struct +{ + regex_t *pRegExp; + unsigned long *refCount; +} RegExp_Arg; + +#undef TYPE_REGEXP +FIELDTYPE *TYPE_REGEXP; diff --git a/include/Caps b/include/Caps index b12370f0..795f9daa 100644 --- a/include/Caps +++ b/include/Caps @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -29,7 +29,7 @@ # Author: Zeyd M. Ben-Halim 1992,1995 # and: Eric S. Raymond # -# $Id: Caps,v 1.30 2000/10/14 17:36:14 tom Exp $ +# $Id: Caps,v 1.35 2002/04/20 15:43:34 tom Exp $ # # This is the master termcap/terminfo capability table. # @@ -49,11 +49,13 @@ # Column 2: terminfo capability name # Column 3: capability type (boolean, numeric, or string) # Column 4: termcap capability name -# Column 5: Lead with `Y' if capability should be emitted in termcap +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap # translations, `-' otherwise -# Column 6: capability description +# Column 8: capability description # -# The codes following [Y-] in column 5 describe the versions of termcap which +# The codes following [Y-] in column 7 describe the versions of termcap which # use the given capability. This information is not used by the curses library # proper; rather, it's there to help the terminfo maintainer avoid emitting # termcap entry translations that are more than 1023 bytes long (and tank a @@ -67,7 +69,7 @@ # translation if possible. The problem is that preserving all such caps may # lead to some termcap translations being too long. The termcap maintainer # has a bit of a juggling act to do...potential problem cases are marked with -# a * or **. +# an asterisk (*). # # The aliases section has the following format: # @@ -207,43 +209,43 @@ #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBBooleans name Code\fR -auto_left_margin bw bool bw YB-G- cub1 wraps from column 0 to last column -auto_right_margin am bool am YBCGE terminal has automatic margins -no_esc_ctlc xsb bool xb YBCG- beehive (f1=escape, f2=ctrl C) -ceol_standout_glitch xhp bool xs YBCGE standout not erased by overwriting (hp) -eat_newline_glitch xenl bool xn YBCGE newline ignored after 80 cols (concept) -erase_overstrike eo bool eo YBCG- can erase overstrikes with a blank -generic_type gn bool gn YB-G- generic line type -hard_copy hc bool hc YBCG- hardcopy terminal -has_meta_key km bool km YB-GE Has a meta key (i.e., sets 8th-bit) -has_status_line hs bool hs YB-G- has extra status line -insert_null_glitch in bool in YBCGE insert mode distinguishes nulls -memory_above da bool da YBCG- display may be retained above the screen -memory_below db bool db YB-GE display may be retained below the screen -move_insert_mode mir bool mi YBCGE safe to move while in insert mode -move_standout_mode msgr bool ms YBCGE safe to move while in standout mode -over_strike os bool os YBCG- terminal can overstrike -status_line_esc_ok eslok bool es YB-G- escape can be used on the status line -dest_tabs_magic_smso xt bool xt YBCGE tabs destructive, magic so char (t1061) -tilde_glitch hz bool hz YB-GE can't print ~'s (hazeltine) -transparent_underline ul bool ul YBCGE underline character overstrikes -xon_xoff xon bool xo YB--- terminal uses xon/xoff handshaking -needs_xon_xoff nxon bool nx ----- padding won't work, xon/xoff required -prtr_silent mc5i bool 5i ----- printer won't echo on screen -hard_cursor chts bool HC ----- cursor is hard to see -non_rev_rmcup nrrmc bool NR ----- smcup does not reverse rmcup -no_pad_char npc bool NP ----- pad character does not exist -non_dest_scroll_region ndscr bool ND ----- scrolling region is non-destructive -can_change ccc bool cc ----- terminal can re-define existing colors -back_color_erase bce bool ut ----- screen erased with background color -hue_lightness_saturation hls bool hl ----- terminal uses only HLS color notation (Tektronix) -col_addr_glitch xhpa bool YA ----- only positive motion for hpa/mhpa caps -cr_cancels_micro_mode crxm bool YB ----- using cr turns off micro mode -has_print_wheel daisy bool YC ----- printer needs operator to change character set -row_addr_glitch xvpa bool YD ----- only positive motion for vpa/mvpa caps -semi_auto_right_margin sam bool YE ----- printing in last column causes cr -cpi_changes_res cpix bool YF ----- changing character pitch changes resolution -lpi_changes_res lpix bool YG ----- changing line pitch changes resolution +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution #%.TE #%.ad #% @@ -257,23 +259,23 @@ lpi_changes_res lpix bool YG ----- changing line pitch changes resolution #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBNumeric name Code\fR -columns cols num co YBCGE number of columns in a line -init_tabs it num it YB-G- tabs initially every # spaces -lines lines num li YBCGE number of lines on screen or page -lines_of_memory lm num lm YB-G- lines of memory if > line. 0 means varies -magic_cookie_glitch xmc num sg YBCGE number of blank characters left by smso or rmso -padding_baud_rate pb num pb YB-GE lowest baud rate where padding needed -virtual_terminal vt num vt YB--- virtual terminal number (CB/unix) -width_status_line wsl num ws YB-G- number of columns in status line -num_labels nlab num Nl ----- number of labels on screen -label_height lh num lh ----- rows in each label -label_width lw num lw ----- columns in each label -max_attributes ma num ma YBC-- maximum combined attributes terminal can handle -maximum_windows wnum num MW ----- maximum number of defineable windows +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows # These came in with SVr4's color support -max_colors colors num Co ----- maximum number of colors on screen -max_pairs pairs num pa ----- maximum number of color-pairs on the screen -no_color_video ncv num NC ----- video attributes that can't be used with colors +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that cannot be used with colors #%.TE #%.ad #% @@ -289,23 +291,23 @@ no_color_video ncv num NC ----- video attributes that can't be used with color #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBNumeric name Code\fR -buffer_capacity bufsz num Ya ----- numbers of bytes buffered before printing -dot_vert_spacing spinv num Yb ----- spacing of pins vertically in pins per inch -dot_horz_spacing spinh num Yc ----- spacing of dots horizontally in dots per inch -max_micro_address maddr num Yd ----- maximum value in micro_..._address -max_micro_jump mjump num Ye ----- maximum value in parm_..._micro -micro_col_size mcs num Yf ----- character step size when in micro mode -micro_line_size mls num Yg ----- line step size when in micro mode -number_of_pins npins num Yh ----- numbers of pins in print-head -output_res_char orc num Yi ----- horizontal resolution in units per line -output_res_line orl num Yj ----- vertical resolution in units per line -output_res_horz_inch orhi num Yk ----- horizontal resolution in units per inch -output_res_vert_inch orvi num Yl ----- vertical resolution in units per inch -print_rate cps num Ym ----- print rate in characters per second -wide_char_size widcs num Yn ----- character step size when in double wide mode -buttons btns num BT ----- number of buttons on mouse -bit_image_entwining bitwin num Yo ----- number of passes for each bit-image row -bit_image_type bitype num Yp ----- type of bit-image device +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device #%.TE #%.ad #% @@ -319,370 +321,370 @@ bit_image_type bitype num Yp ----- type of bit-image device #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBString name Code\fR -back_tab cbt str bt YBCGE back tab (P) -bell bel str bl YB-GE audible signal (bell) (P) -carriage_return cr str cr YBCGE carriage return (P*) (P*) -change_scroll_region csr str cs YBCGE change region to line #1 to line #2 (P) -clear_all_tabs tbc str ct YB-G- clear all tab stops (P) -clear_screen clear str cl YBCGE clear screen and home cursor (P*) -clr_eol el str ce YBCGE clear to end of line (P) -clr_eos ed str cd YBCGE clear to end of screen (P*) -column_address hpa str ch -B-GE** horizontal position #1, absolute (P) -command_character cmdch str CC YB-G- terminal settable cmd character in prototype !? -cursor_address cup str cm YBCGE move to row #1 columns #2 -cursor_down cud1 str do YBCGE down one line -cursor_home home str ho YBCGE home cursor (if no cup) -cursor_invisible civis str vi YB-G- make cursor invisible -cursor_left cub1 str le YBCGE move left one space -cursor_mem_address mrcup str CM YB-G- memory relative cursor addressing, move to row #1 columns #2 -cursor_normal cnorm str ve YBCGE make cursor appear normal (undo civis/cvvis) -cursor_right cuf1 str nd YBCGE non-destructive space (move right one space) -cursor_to_ll ll str ll YBCGE last line, first column (if no cup) -cursor_up cuu1 str up YBCGE up one line -cursor_visible cvvis str vs YBCGE make cursor very visible -delete_character dch1 str dc YBCGE delete character (P*) -delete_line dl1 str dl YBCGE delete line (P*) -dis_status_line dsl str ds YB-G- disable status line -down_half_line hd str hd YB-G- half a line down -enter_alt_charset_mode smacs str as YB-G- start alternate character set (P) -enter_blink_mode blink str mb YB-G- turn on blinking -enter_bold_mode bold str md YB-G- turn on bold (extra bright) mode -enter_ca_mode smcup str ti YBCGE string to start programs using cup -enter_delete_mode smdc str dm YBCGE enter delete mode -enter_dim_mode dim str mh YB-G- turn on half-bright mode -enter_insert_mode smir str im YBCGE enter insert mode -enter_secure_mode invis str mk -B-G-* turn on blank mode (characters invisible) -enter_protected_mode prot str mp -B-G-* turn on protected mode -enter_reverse_mode rev str mr YB-G- turn on reverse video mode -enter_standout_mode smso str so YBCGE begin standout mode -enter_underline_mode smul str us YBCGE begin underline mode -erase_chars ech str ec YB-G- erase #1 characters (P) -exit_alt_charset_mode rmacs str ae YB-G- end alternate character set (P) -exit_attribute_mode sgr0 str me YB-GE turn off all attributes -exit_ca_mode rmcup str te YBCGE strings to end programs using cup -exit_delete_mode rmdc str ed YBCGE end delete mode -exit_insert_mode rmir str ei YBCGE exit insert mode -exit_standout_mode rmso str se YBCGE exit standout mode -exit_underline_mode rmul str ue YBCGE exit underline mode -flash_screen flash str vb YBCGE visible bell (may not move cursor) -form_feed ff str ff YB-G- hardcopy terminal page eject (P*) -from_status_line fsl str fs YB-G- return from status line -init_1string is1 str i1 YB-G- initialization string -init_2string is2 str is YB-G- initialization string -init_3string is3 str i3 YB-G- initialization string -init_file if str if YB-G- name of initialization file -insert_character ich1 str ic YBCGE insert character (P) -insert_line il1 str al YBCGE insert line (P*) -insert_padding ip str ip YBCGE insert padding after inserted character -key_backspace kbs str kb YB-G- backspace key -key_catab ktbc str ka -B-G-* clear-all-tabs key -key_clear kclr str kC -B-G-* clear-screen or erase key -key_ctab kctab str kt -B-G-* clear-tab key -key_dc kdch1 str kD YB-G- delete-character key -key_dl kdl1 str kL -B-G-* delete-line key -key_down kcud1 str kd YBCGE down-arrow key -key_eic krmir str kM -B-G-* sent by rmir or smir in insert mode -key_eol kel str kE -B-G-* clear-to-end-of-line key -key_eos ked str kS -B-G-* clear-to-end-of-screen key -key_f0 kf0 str k0 YBCGE F0 function key -key_f1 kf1 str k1 YBCGE F1 function key -key_f10 kf10 str k; ----E F10 function key -key_f2 kf2 str k2 YBCGE F2 function key -key_f3 kf3 str k3 YBCGE F3 function key -key_f4 kf4 str k4 YBCGE F4 function key -key_f5 kf5 str k5 YBCGE F5 function key -key_f6 kf6 str k6 YBCGE F6 function key -key_f7 kf7 str k7 YBCGE F7 function key -key_f8 kf8 str k8 YBCGE F8 function key -key_f9 kf9 str k9 YBCGE F9 function key -key_home khome str kh YBCGE home key -key_ic kich1 str kI YB-GE insert-character key -key_il kil1 str kA -B-G-* insert-line key -key_left kcub1 str kl YBCGE left-arrow key -key_ll kll str kH YB-G- lower-left key (home down) -key_npage knp str kN YB-GE next-page key -key_ppage kpp str kP YB-GE previous-page key -key_right kcuf1 str kr YBCGE right-arrow key -key_sf kind str kF -B-G-* scroll-forward key -key_sr kri str kR -B-G-* scroll-backward key -key_stab khts str kT -B-G-* set-tab key -key_up kcuu1 str ku YBCGE up-arrow key -keypad_local rmkx str ke YBCGE leave 'keyboard_transmit' mode -keypad_xmit smkx str ks YBCGE enter 'keyboard_transmit' mode -lab_f0 lf0 str l0 -B-G-* label on function key f0 if not f0 -lab_f1 lf1 str l1 -B-G-* label on function key f1 if not f1 -lab_f10 lf10 str la ----- label on function key f10 if not f10 -lab_f2 lf2 str l2 -B-G-* label on function key f2 if not f2 -lab_f3 lf3 str l3 -B-G-* label on function key f3 if not f3 -lab_f4 lf4 str l4 -B-G-* label on function key f4 if not f4 -lab_f5 lf5 str l5 -B-G-* label on function key f5 if not f5 -lab_f6 lf6 str l6 -B-G-* label on function key f6 if not f6 -lab_f7 lf7 str l7 -B-G-* label on function key f7 if not f7 -lab_f8 lf8 str l8 -B-G-* label on function key f8 if not f8 -lab_f9 lf9 str l9 -B-G-* label on function key f9 if not f9 -meta_off rmm str mo YB-G-* turn off meta mode -meta_on smm str mm YB-G-* turn on meta mode (8th-bit on) -newline nel str nw YB-G-* newline (behave like cr followed by lf) -pad_char pad str pc YBCGE padding char (instead of null) -parm_dch dch str DC YB-GE delete #1 characters (P*) -parm_delete_line dl str DL YBCGE delete #1 lines (P*) -parm_down_cursor cud str DO YBCGE down #1 lines (P*) -parm_ich ich str IC YB-GE insert #1 characters (P*) -parm_index indn str SF YBCG- scroll forward #1 lines (P) -parm_insert_line il str AL YBCGE insert #1 lines (P*) -parm_left_cursor cub str LE YBCGE move #1 characters to the left (P) -parm_right_cursor cuf str RI YBCGE move #1 characters to the right (P*) -parm_rindex rin str SR YBCG- scroll back #1 lines (P) -parm_up_cursor cuu str UP YBCGE up #1 lines (P*) -pkey_key pfkey str pk -B--- program function key #1 to type string #2 -pkey_local pfloc str pl -B--- program function key #1 to execute string #2 -pkey_xmit pfx str px -B--- program function key #1 to transmit string #2 -print_screen mc0 str ps -B-G-* print contents of screen -prtr_off mc4 str pf -B-G-* turn off printer -prtr_on mc5 str po -B-G-* turn on printer -repeat_char rep str rp YB-GE repeat char #1 #2 times (P*) -reset_1string rs1 str r1 -B--- reset string -reset_2string rs2 str r2 -B--- reset string -reset_3string rs3 str r3 -B--- reset string -reset_file rf str rf -B--- name of reset file -restore_cursor rc str rc YBCG- restore cursor to position of last save_cursor -row_address vpa str cv -B-GE** vertical position #1 absolute (P) -save_cursor sc str sc YBCG- save current cursor position (P) -scroll_forward ind str sf YBCGE scroll text up (P) -scroll_reverse ri str sr YBCGE scroll text down (P) -set_attributes sgr str sa YB-G- define video attributes #1-#9 (PG9) -set_tab hts str st YB-G- set a tab in every row, current columns -set_window wind str wi -B-GE current window is lines #1-#2 cols #3-#4 -tab ht str ta YBCGE tab to next 8-space hardware tab stop -to_status_line tsl str ts YB-G- move to status line, column #1 -underline_char uc str uc YBCG- underline char and move past it -up_half_line hu str hu YB-G- half a line up -init_prog iprog str iP -B--- path name of program for initialization -key_a1 ka1 str K1 YB-GE upper left of keypad -key_a3 ka3 str K3 YB-GE upper right of keypad -key_b2 kb2 str K2 YB-GE center of keypad -key_c1 kc1 str K4 YB-GE lower left of keypad -key_c3 kc3 str K5 YB-GE lower right of keypad -prtr_non mc5p str pO -B-G-* turn on printer for #1 bytes +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes # # SVr1 capabilities stop here. IBM's version of terminfo is the same as # SVr4 up to this point, but has a different set afterwards. # -char_padding rmp str rP ----- like ip but when in insert mode -acs_chars acsc str ac ----- graphics charset pairs, based on vt100 -plab_norm pln str pn ----- program label #1 to show string #2 -key_btab kcbt str kB ----- back-tab key -enter_xon_mode smxon str SX ----- turn on xon/xoff handshaking -exit_xon_mode rmxon str RX ----- turn off xon/xoff handshaking -enter_am_mode smam str SA ----- turn on automatic margins -exit_am_mode rmam str RA ----- turn off automatic margins -xon_character xonc str XN ----- XON character -xoff_character xoffc str XF ----- XOFF character -ena_acs enacs str eA ----- enable alternate char set -label_on smln str LO ----- turn on soft labels -label_off rmln str LF ----- turn off soft labels -key_beg kbeg str @1 ----- begin key -key_cancel kcan str @2 ----- cancel key -key_close kclo str @3 ----- close key -key_command kcmd str @4 ----- command key -key_copy kcpy str @5 ----- copy key -key_create kcrt str @6 ----- create key -key_end kend str @7 ----- end key -key_enter kent str @8 ----- enter/send key -key_exit kext str @9 ----- exit key -key_find kfnd str @0 ----- find key -key_help khlp str %1 ----- help key -key_mark kmrk str %2 ----- mark key -key_message kmsg str %3 ----- message key -key_move kmov str %4 ----- move key -key_next knxt str %5 ----- next key -key_open kopn str %6 ----- open key -key_options kopt str %7 ----- options key -key_previous kprv str %8 ----- previous key -key_print kprt str %9 ----- print key -key_redo krdo str %0 ----- redo key -key_reference kref str &1 ----- reference key -key_refresh krfr str &2 ----- refresh key -key_replace krpl str &3 ----- replace key -key_restart krst str &4 ----- restart key -key_resume kres str &5 ----- resume key -key_save ksav str &6 ----- save key -key_suspend kspd str &7 ----- suspend key -key_undo kund str &8 ----- undo key -key_sbeg kBEG str &9 ----- shifted begin key -key_scancel kCAN str &0 ----- shifted cancel key -key_scommand kCMD str *1 ----- shifted command key -key_scopy kCPY str *2 ----- shifted copy key -key_screate kCRT str *3 ----- shifted create key -key_sdc kDC str *4 ----- shifted delete-character key -key_sdl kDL str *5 ----- shifted delete-line key -key_select kslt str *6 ----- select key -key_send kEND str *7 ----- shifted end key -key_seol kEOL str *8 ----- shifted clear-to-end-of-line key -key_sexit kEXT str *9 ----- shifted exit key -key_sfind kFND str *0 ----- shifted find key -key_shelp kHLP str #1 ----- shifted help key -key_shome kHOM str #2 ----- shifted home key -key_sic kIC str #3 ----- shifted insert-character key -key_sleft kLFT str #4 ----- shifted left-arrow key -key_smessage kMSG str %a ----- shifted message key -key_smove kMOV str %b ----- shifted move key -key_snext kNXT str %c ----- shifted next key -key_soptions kOPT str %d ----- shifted options key -key_sprevious kPRV str %e ----- shifted previous key -key_sprint kPRT str %f ----- shifted print key -key_sredo kRDO str %g ----- shifted redo key -key_sreplace kRPL str %h ----- shifted replace key -key_sright kRIT str %i ----- shifted right-arrow key -key_srsume kRES str %j ----- shifted resume key -key_ssave kSAV str !1 ----- shifted save key -key_ssuspend kSPD str !2 ----- shifted suspend key -key_sundo kUND str !3 ----- shifted undo key -req_for_input rfi str RF ----- send next input char (for ptys) -key_f11 kf11 str F1 ----E F11 function key -key_f12 kf12 str F2 ----E F12 function key -key_f13 kf13 str F3 ----E F13 function key -key_f14 kf14 str F4 ----E F14 function key -key_f15 kf15 str F5 ----E F15 function key -key_f16 kf16 str F6 ----E F16 function key -key_f17 kf17 str F7 ----E F17 function key -key_f18 kf18 str F8 ----E F18 function key -key_f19 kf19 str F9 ----E F19 function key -key_f20 kf20 str FA ----E F20 function key -key_f21 kf21 str FB ----E F21 function key -key_f22 kf22 str FC ----E F22 function key -key_f23 kf23 str FD ----E F23 function key -key_f24 kf24 str FE ----E F24 function key -key_f25 kf25 str FF ----E F25 function key -key_f26 kf26 str FG ----E F26 function key -key_f27 kf27 str FH ----E F27 function key -key_f28 kf28 str FI ----E F28 function key -key_f29 kf29 str FJ ----E F29 function key -key_f30 kf30 str FK ----E F30 function key -key_f31 kf31 str FL ----E F31 function key -key_f32 kf32 str FM ----E F32 function key -key_f33 kf33 str FN ----E F33 function key -key_f34 kf34 str FO ----E F34 function key -key_f35 kf35 str FP ----E F35 function key -key_f36 kf36 str FQ ----E F36 function key -key_f37 kf37 str FR ----E F37 function key -key_f38 kf38 str FS ----E F38 function key -key_f39 kf39 str FT ----E F39 function key -key_f40 kf40 str FU ----E F40 function key -key_f41 kf41 str FV ----E F41 function key -key_f42 kf42 str FW ----E F42 function key -key_f43 kf43 str FX ----E F43 function key -key_f44 kf44 str FY ----E F44 function key -key_f45 kf45 str FZ ----E F45 function key -key_f46 kf46 str Fa ----E F46 function key -key_f47 kf47 str Fb ----E F47 function key -key_f48 kf48 str Fc ----E F48 function key -key_f49 kf49 str Fd ----E F49 function key -key_f50 kf50 str Fe ----E F50 function key -key_f51 kf51 str Ff ----E F51 function key -key_f52 kf52 str Fg ----E F52 function key -key_f53 kf53 str Fh ----E F53 function key -key_f54 kf54 str Fi ----E F54 function key -key_f55 kf55 str Fj ----E F55 function key -key_f56 kf56 str Fk ----E F56 function key -key_f57 kf57 str Fl ----E F57 function key -key_f58 kf58 str Fm ----E F58 function key -key_f59 kf59 str Fn ----E F59 function key -key_f60 kf60 str Fo ----E F60 function key -key_f61 kf61 str Fp ----E F61 function key -key_f62 kf62 str Fq ----E F62 function key -key_f63 kf63 str Fr ----E F63 function key -clr_bol el1 str cb ----- Clear to beginning of line -clear_margins mgc str MC ----- clear right and left soft margins -set_left_margin smgl str ML ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). -set_right_margin smgr str MR ----- set right soft margin at current column -label_format fln str Lf ----- label format -set_clock sclk str SC ----- set clock, #1 hrs #2 mins #3 secs -display_clock dclk str DK ----- display clock -remove_clock rmclk str RC ----- remove clock -create_window cwin str CW ----- define a window #1 from #2,#3 to #4,#5 -goto_window wingo str WG ----- go to window #1 -hangup hup str HU ----- hang-up phone -dial_phone dial str DI ----- dial number #1 -quick_dial qdial str QD ----- dial number #1 without checking -tone tone str TO ----- select touch tone dialing -pulse pulse str PU ----- select pulse dialing -flash_hook hook str fh ----- flash switch hook -fixed_pause pause str PA ----- pause for 2-3 seconds -wait_tone wait str WA ----- wait for dial-tone -user0 u0 str u0 ----- User string #0 -user1 u1 str u1 ----- User string #1 -user2 u2 str u2 ----- User string #2 -user3 u3 str u3 ----- User string #3 -user4 u4 str u4 ----- User string #4 -user5 u5 str u5 ----- User string #5 -user6 u6 str u6 ----- User string #6 -user7 u7 str u7 ----- User string #7 -user8 u8 str u8 ----- User string #8 -user9 u9 str u9 ----- User string #9 +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +clr_bol el1 str cb - - ----- Clear to beginning of line +clear_margins mgc str MC - - ----- clear right and left soft margins +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +label_format fln str Lf - - ----- label format +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +display_clock dclk str DK - - ----- display clock +remove_clock rmclk str RC - - ----- remove clock +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 # # SVr4 added these capabilities to support color # -orig_pair op str op ----- Set default pair to its original value -orig_colors oc str oc ----- Set all color pairs to the original ones -initialize_color initc str Ic ----- initialize color #1 to (#2,#3,#4) -initialize_pair initp str Ip ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) -set_color_pair scp str sp ----- Set current color pair to #1 -set_foreground setf str Sf ----- Set foreground color #1 -set_background setb str Sb ----- Set background color #1 +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_background setb str Sb - - ----- Set background color #1 # # SVr4 added these capabilities to support printers # -change_char_pitch cpi str ZA ----- Change number of characters per inch to #1 -change_line_pitch lpi str ZB ----- Change number of lines per inch to #1 -change_res_horz chr str ZC ----- Change horizontal resolution to #1 -change_res_vert cvr str ZD ----- Change vertical resolution to #1 -define_char defc str ZE ----- Define a character #1, #2 dots wide, descender #3 -enter_doublewide_mode swidm str ZF ----- Enter double-wide mode -enter_draft_quality sdrfq str ZG ----- Enter draft-quality mode -enter_italics_mode sitm str ZH ----- Enter italic mode -enter_leftward_mode slm str ZI ----- Start leftward carriage motion -enter_micro_mode smicm str ZJ ----- Start micro-motion mode -enter_near_letter_quality snlq str ZK ----- Enter NLQ mode -enter_normal_quality snrmq str ZL ----- Enter normal-quality mode -enter_shadow_mode sshm str ZM ----- Enter shadow-print mode -enter_subscript_mode ssubm str ZN ----- Enter subscript mode -enter_superscript_mode ssupm str ZO ----- Enter superscript mode -enter_upward_mode sum str ZP ----- Start upward carriage motion -exit_doublewide_mode rwidm str ZQ ----- End double-wide mode -exit_italics_mode ritm str ZR ----- End italic mode -exit_leftward_mode rlm str ZS ----- End left-motion mode -exit_micro_mode rmicm str ZT ----- End micro-motion mode -exit_shadow_mode rshm str ZU ----- End shadow-print mode -exit_subscript_mode rsubm str ZV ----- End subscript mode -exit_superscript_mode rsupm str ZW ----- End superscript mode -exit_upward_mode rum str ZX ----- End reverse character motion -micro_column_address mhpa str ZY ----- Like column_address in micro mode -micro_down mcud1 str ZZ ----- Like cursor_down in micro mode -micro_left mcub1 str Za ----- Like cursor_left in micro mode -micro_right mcuf1 str Zb ----- Like cursor_right in micro mode -micro_row_address mvpa str Zc ----- Like row_address #1 in micro mode -micro_up mcuu1 str Zd ----- Like cursor_up in micro mode -order_of_pins porder str Ze ----- Match software bits to print-head pins -parm_down_micro mcud str Zf ----- Like parm_down_cursor in micro mode -parm_left_micro mcub str Zg ----- Like parm_left_cursor in micro mode -parm_right_micro mcuf str Zh ----- Like parm_right_cursor in micro mode -parm_up_micro mcuu str Zi ----- Like parm_up_cursor in micro mode -select_char_set scs str Zj ----- Select character set, #1 -set_bottom_margin smgb str Zk ----- Set bottom margin at current line -set_bottom_margin_parm smgbp str Zl ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom -set_left_margin_parm smglp str Zm ----- Set left (right) margin at column #1 -set_right_margin_parm smgrp str Zn ----- Set right margin at column #1 -set_top_margin smgt str Zo ----- Set top margin at current line -set_top_margin_parm smgtp str Zp ----- Set top (bottom) margin at row #1 -start_bit_image sbim str Zq ----- Start printing bit image graphics -start_char_set_def scsd str Zr ----- Start character set definition #1, with #2 characters in the set -stop_bit_image rbim str Zs ----- Stop printing bit image graphics -stop_char_set_def rcsd str Zt ----- End definition of character set #1 -subscript_characters subcs str Zu ----- List of subscriptable characters -superscript_characters supcs str Zv ----- List of superscriptable characters -these_cause_cr docr str Zw ----- Printing any of these characters causes CR -zero_motion zerom str Zx ----- No motion for subsequent character +change_char_pitch cpi str ZA - - ----- Change number of characters per inch to #1 +change_line_pitch lpi str ZB - - ----- Change number of lines per inch to #1 +change_res_horz chr str ZC - - ----- Change horizontal resolution to #1 +change_res_vert cvr str ZD - - ----- Change vertical resolution to #1 +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode +enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode +enter_italics_mode sitm str ZH - - ----- Enter italic mode +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +micro_column_address mhpa str ZY - - ----- Like column_address in micro mode +micro_down mcud1 str ZZ - - ----- Like cursor_down in micro mode +micro_left mcub1 str Za - - ----- Like cursor_left in micro mode +micro_right mcuf1 str Zb - - ----- Like cursor_right in micro mode +micro_row_address mvpa str Zc - - ----- Like row_address #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +parm_down_micro mcud str Zf - - ----- Like parm_down_cursor in micro mode +parm_left_micro mcub str Zg - - ----- Like parm_left_cursor in micro mode +parm_right_micro mcuf str Zh - - ----- Like parm_right_cursor in micro mode +parm_up_micro mcuu str Zi - - ----- Like parm_up_cursor in micro mode +select_char_set scs str Zj - - ----- Select character set, #1 +set_bottom_margin smgb str Zk - - ----- Set bottom margin at current line +set_bottom_margin_parm smgbp str Zl - - ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_top_margin smgt str Zo - - ----- Set top margin at current line +set_top_margin_parm smgtp str Zp - - ----- Set top (bottom) margin at row #1 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +start_char_set_def scsd str Zr - - ----- Start character set definition #1, with #2 characters in the set +stop_bit_image rbim str Zs - - ----- Stop printing bit image graphics +stop_char_set_def rcsd str Zt - - ----- End definition of character set #1 +subscript_characters subcs str Zu - - ----- List of subscriptable characters +superscript_characters supcs str Zv - - ----- List of superscriptable characters +these_cause_cr docr str Zw - - ----- Printing any of these characters causes CR +zero_motion zerom str Zx - - ----- No motion for subsequent character #%.TE #%.ad #% @@ -697,41 +699,41 @@ zero_motion zerom str Zx ----- No motion for subsequent character #%lw25 lw6 lw2 lw18. #%\fBVariable Cap- TCap Description\fR #%\fBString name Code\fR -char_set_names csnm str Zy ----- Produce #1'th item from list of character set names -key_mouse kmous str Km ----- Mouse event has occurred -mouse_info minfo str Mi ----- Mouse status information -req_mouse_pos reqmp str RQ ----- Request mouse position -get_mouse getm str Gm ----- Curses should get button events, parameter #1 not documented. -set_a_foreground setaf str AF ----- Set foreground color to #1, using ANSI escape -set_a_background setab str AB ----- Set background color to #1, using ANSI escape -pkey_plab pfxl str xl ----- Program function key #1 to type string #2 and show string #3 -device_type devt str dv ----- Indicate language/codeset support -code_set_init csin str ci ----- Init sequence for multiple codesets -set0_des_seq s0ds str s0 ----- Shift to code set 0 (EUC set 0, ASCII) -set1_des_seq s1ds str s1 ----- Shift to code set 1 -set2_des_seq s2ds str s2 ----- Shift to code set 2 -set3_des_seq s3ds str s3 ----- Shift to code set 3 -set_lr_margin smglr str ML ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). -set_tb_margin smgtb str MT ----- Sets both top and bottom margins to #1, #2 -bit_image_repeat birep str Xy ----- Repeat bit image cell #1 #2 times -bit_image_newline binel str Zz ----- Move to next row of the bit image -bit_image_carriage_return bicr str Yv ----- Move to beginning of same row -color_names colornm str Yw ----- Give name for color #1 -define_bit_image_region defbi str Yx ----- Define rectangualar bit image region -end_bit_image_region endbi str Yy ----- End a bit-image region -set_color_band setcolor str Yz ----- Change to ribbon color #1 -set_page_length slines str YZ ----- Set page length to #1 lines +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +mouse_info minfo str Mi - - ----- Mouse status information +req_mouse_pos reqmp str RQ - - ----- Request mouse position +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +bit_image_repeat birep str Xy - - ----- Repeat bit image cell #1 #2 times +bit_image_newline binel str Zz - - ----- Move to next row of the bit image +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_page_length slines str YZ - - ----- Set page length to #1 lines # # SVr4 added these capabilities for direct PC-clone support # -display_pc_char dispc str S1 ----- Display PC character #1 -enter_pc_charset_mode smpch str S2 ----- Enter PC character display mode -exit_pc_charset_mode rmpch str S3 ----- Exit PC character display mode -enter_scancode_mode smsc str S4 ----- Enter PC scancode mode -exit_scancode_mode rmsc str S5 ----- Exit PC scancode mode -pc_term_options pctrm str S6 ----- PC terminal options -scancode_escape scesc str S7 ----- Escape for scancode emulation -alt_scancode_esc scesa str S8 ----- Alternate escape for scancode emulation +display_pc_char dispc str S1 - - ----- Display PC character #1 +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation #%.TE #%.ad #% @@ -751,14 +753,14 @@ alt_scancode_esc scesa str S8 ----- Alternate escape for scancode emulation #%lw25 lw6 lw2 lw20. #%\fBVariable Cap- TCap Description\fR #%\fBString name Code\fR -enter_horizontal_hl_mode ehhlm str Xh ----- Enter horizontal highlight mode -enter_left_hl_mode elhlm str Xl ----- Enter left highlight mode -enter_low_hl_mode elohlm str Xo ----- Enter low highlight mode -enter_right_hl_mode erhlm str Xr ----- Enter right highlight mode -enter_top_hl_mode ethlm str Xt ----- Enter top highlight mode -enter_vertical_hl_mode evhlm str Xv ----- Enter vertical highlight mode -set_a_attributes sgr1 str sA ----- Define second set of video attributes #1-#6 -set_pglen_inch slength str sL ----- YI Set page length to #1 hundredth of an inch +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch #%.TE #%.ad # @@ -795,34 +797,34 @@ set_pglen_inch slength str sL ----- YI Set page length to #1 hundredth of an i # The ug capability is thrown away, but assumed to be whatever sg is if the # latter is nonzero and we're dumping in termcap format. # -termcap_init2 OTi2 str i2 YB--- secondary initialization string -termcap_reset OTrs str rs YB-G- terminal reset string -magic_cookie_glitch_ul OTug num ug YBCGE number of blanks left by ul +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul # # Obsolete termcap capabilities. Some are used for termcap translation. The # code uses the 'OT' prefix we put on obsolete capabilities to suppress # printing them in terminfo source dumps of compiled entries. # -backspaces_with_bs OTbs bool bs YBCGE uses ^H to move left -crt_no_scrolling OTns bool ns YBCG- crt cannot scroll -no_correctly_working_cr OTnc bool nc YBCG- no way to go to start of line -carriage_return_delay OTdC num dC YB-G- pad needed for CR -new_line_delay OTdN num dN YB-G- pad needed for LF -linefeed_if_not_lf OTnl str nl YBCGE use to move down -backspace_if_not_bs OTbc str bc YBCGE move left, if not ^H +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H # # GNU termcap library extensions. The GNU termcap file distributed with # Emacs no longer uses these, but MT showed up in pre-9.0 versions of the # BSD termcap file. The name clash with terminfo MT is resolved by type # info; MT is converted to km. # -gnu_has_meta_key OTMT bool MT ----E has meta key -# gnu_tab_width OTtw num tw ----E tab width in spaces +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces # # GNU termcap *does* include the following extended capability, Only the # now-obsolete Ann Arbor terminals used it. # -# gnu_change_scroll_region OTcS str cS ---GE alternate set scrolling region +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region # # The following comments describe capnames so ancient that I believe no # software uses them any longer. Some of these have to go because they @@ -855,50 +857,50 @@ gnu_has_meta_key OTMT bool MT ----E has meta key # Applications that use terminfo are supposed to behave as though xr is # always true. # -linefeed_is_newline OTNL bool NL YB--- move down with \n -# even_parity OTEP bool EP -B--- terminal requires even parity -# odd_parity OTOP bool OP -B--- terminal requires odd parity -# half_duplex OTHD bool HD -B--- terminal is half-duplex -# lower_case_only OTLC bool LC -B--- terminal has only lower case -# upper_case_only OTUC bool UC -B--- terminal has only upper case -backspace_delay OTdB num dB YB-G- padding required for ^H -# form_feed_delay OTdF num dF -B-G- padding required for ^L -horizontal_tab_delay OTdT num dT YB-G- padding required for ^I -# vertical_tab_delay OTdV num dV -B--- padding required for ^V -number_of_function_keys OTkn num kn -B-G- count of function keys -other_non_function_keys OTko str ko -B-G- list of self-mapped keycaps -arrow_key_map OTma str ma YBC-- map arrow keys rogue(1) motion keys -# memory_lock_above OTml str ml -B--- lock visible screen memory above the current line -# memory_unlock OTmu str mu -B--- unlock visible screen memory above the current line -has_hardware_tabs OTpt bool pt YB--- has 8-char tabs invoked with ^I -return_does_clr_eol OTxr bool xr YB--- return clears the line -# tek_4025_insert_line OTxx bool xx -BC-- Tektronix 4025 insert-line glitch +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch # # mytinfo described this as a termcap capability, but it's not listed in the # 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses # package, like System V, behaves as though it is always true. # -# rind_only_at_top OTxq bool xq ----- reverse index only works from top line +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line # # University of Waterloo termcap extensions (as described in mytinfo). # The `xl' termcap file clashes with a terminfo name; this ambiguity cannot # be resolved by a type check. The descriptions are guesses from what was # in the mytinfo tables. # -# key_interrupt_char OTki str ki ----- string set by interrupt key (?) -# key_kill_char OTkk str kk ----- string set by kill key (?) -# key_suspend_char OTkz str kz ----- string set by suspend key (?) -# initialization_messy OTxc bool xc ----- initialization leaves garbage on the screen (?) -# ind_at_bottom_does_cr OTxl bool xl ----- index does a carriage return +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return # # Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. # SR clashes with a terminfo name; this ambiguity cannot be resolved by a type # check. # -# scroll_left OTsl1 str Sl ----- scroll screen leftward -# scroll_right OTsr1 str Sr ----- scroll screen rightward -# parm_scroll_left OTsl str SL ----- scroll screen leftward #1 characters -# parm_scroll_right OTsr str SR ----- scroll screen rightward #1 characters +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters # # The mytinfo capabilities end here. # @@ -938,17 +940,17 @@ return_does_clr_eol OTxr bool xr YB--- return clears the line # that detects the acs_ prefix and uses it to suppress pad translation. # These terminfo names are invented. # -acs_ulcorner OTG2 str G2 ----- single upper left -acs_llcorner OTG3 str G3 ----- single lower left -acs_urcorner OTG1 str G1 ----- single upper right -acs_lrcorner OTG4 str G4 ----- single lower right -acs_ltee OTGR str GR ----- tee pointing right -acs_rtee OTGL str GL ----- tee pointing left -acs_btee OTGU str GU ----- tee pointing up -acs_ttee OTGD str GD ----- tee pointing down -acs_hline OTGH str GH ----- single horizontal line -acs_vline OTGV str GV ----- single vertical line -acs_plus OTGC str GC ----- single intersection +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection # ############################################################################# # @@ -965,64 +967,64 @@ acs_plus OTGC str GC ----- single intersection # functionally identical to SVr4 extensions, but they make the binary format # different. Grrr.... # -memory_lock meml str ml ----K memory lock above -memory_unlock memu str mu ----K memory unlock -#plab_norm pln str pn ----- program label #1 to show string #2 -#label_on smln str LO ----- turn on soft labels -#label_off rmln str LF ----- turn off soft labels -#key_f11 kf11 str F1 ----- F11 function key -#key_f12 kf12 str F2 ----- F12 function key -#key_f13 kf13 str F3 ----- F13 function key -#key_f14 kf14 str F4 ----- F14 function key -#key_f15 kf15 str F5 ----- F15 function key -#key_f16 kf16 str F6 ----- F16 function key -#key_f17 kf17 str F7 ----- F17 function key -#key_f18 kf18 str F8 ----- F18 function key -#key_f19 kf19 str F9 ----- F19 function key -#key_f20 kf20 str FA ----- F20 function key -#key_f21 kf21 str FB ----- F21 function key -#key_f22 kf22 str FC ----- F22 function key -#key_f23 kf23 str FD ----- F23 function key -#key_f24 kf24 str FE ----- F24 function key -#key_f25 kf25 str FF ----- F25 function key -#key_f26 kf26 str FG ----- F26 function key -#key_f27 kf27 str FH ----- F27 function key -#key_f28 kf28 str FI ----- F28 function key -#key_f29 kf29 str FJ ----- F29 function key -#key_f30 kf30 str FK ----- F30 function key -#key_f31 kf31 str FL ----- F31 function key -#key_f32 kf32 str FM ----- F32 function key -#key_f33 kf33 str FN ----- F33 function key -#key_f34 kf34 str FO ----- F34 function key -#key_f35 kf35 str FP ----- F35 function key -#key_f36 kf36 str FQ ----- F36 function key -#key_f37 kf37 str FR ----- F37 function key -#key_f38 kf38 str FS ----- F38 function key -#key_f39 kf39 str FT ----- F39 function key -#key_f40 kf40 str FU ----- F40 function key -#key_f41 kf41 str FV ----- F41 function key -#key_f42 kf42 str FW ----- F42 function key -#key_f43 kf43 str FX ----- F43 function key -#key_f44 kf44 str FY ----- F44 function key -#key_f45 kf45 str FZ ----- F45 function key -#key_f46 kf46 str Fa ----- F46 function key -#key_f47 kf47 str Fb ----- F47 function key -#key_f48 kf48 str Fc ----- F48 function key -#key_f49 kf49 str Fd ----- F49 function key -#key_f50 kf50 str Fe ----- F50 function key -#key_f51 kf51 str Ff ----- F51 function key -#key_f52 kf52 str Fg ----- F52 function key -#key_f53 kf53 str Fh ----- F53 function key -#key_f54 kf54 str Fi ----- F54 function key -#key_f55 kf55 str Fj ----- F55 function key -#key_f56 kf56 str Fk ----- F56 function key -#key_f57 kf57 str Fl ----- F57 function key -#key_f58 kf58 str Fm ----- F58 function key -#key_f59 kf59 str Fn ----- F59 function key -#key_f60 kf60 str Fo ----- F60 function key -#key_f61 kf61 str Fp ----- F61 function key -#key_f62 kf62 str Fq ----- F62 function key -#key_f63 kf63 str Fr ----- F63 function key +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key # # IBM extensions # @@ -1046,146 +1048,94 @@ memory_unlock memu str mu ----K memory unlock # # The box2 characters are the double-line versions of these forms graphics. # -box_chars_1 box1 str bx ----K box characters primary set -#box_chars_2 box2 str by ----K box characters secondary set -#box_attr_1 batt1 str Bx ----K attributes for box1 -#box_attr_2 batt2 str By ----K attributes for box2 -#color_bg_0 colb0 str d0 ----K background color 0 -#color_bg_1 colb1 str d1 ----K background color 1 -#color_bg_2 colb2 str d2 ----K background color 2 -#color_bg_3 colb3 str d3 ----K background color 3 -#color_bg_4 colb4 str d4 ----K background color 4 -#color_bg_5 colb5 str d5 ----K background color 5 -#color_bg_6 colb6 str d6 ----K background color 6 -#color_bg_7 colb7 str d7 ----K background color 7 -#color_fg_0 colf0 str c0 ----K foreground color 0 -#color_fg_1 colf1 str c1 ----K foreground color 1 -#color_fg_2 colf2 str c2 ----K foreground color 2 -#color_fg_3 colf3 str c3 ----K foreground color 3 -#color_fg_4 colf4 str c4 ----K foreground color 4 -#color_fg_5 colf5 str c5 ----K foreground color 5 -#color_fg_6 colf6 str c6 ----K foreground color 6 -#color_fg_7 colf7 str c7 ----K foreground color 7 -#font_0 font0 str f0 ----- select font 0 -#font_1 font1 str f1 ----- select font 1 -#font_2 font2 str f2 ----- select font 2 -#font_3 font3 str f3 ----- select font 3 -#font_4 font4 str f4 ----K select font 4 -#font_5 font5 str f5 ----K select font 5 -#font_6 font6 str f6 ----K select font 6 -#font_7 font7 str f7 ----K select font 7 -#key_back_tab kbtab str k0 ----- backtab key -#key_do kdo str ki ----K do request key -#key_command kcmd str kd ----K command-request key -#key_command_pane kcpn str kW ----K command-pane key -#key_end kend str kw ----- end key -#key_help khlp str kq ----- help key -#key_newline knl str nl ----K newline key -#key_next_pane knpn str kv ----K next-pane key -#key_prev_cmd kppn str kp ----K previous-command key -#key_prev_pane kppn str kV ----K previous-pane key -#key_quit kquit str kQ ----K quit key -#key_select ksel str kU ----- select key -#key_scroll_left kscl str kz ----K scroll left -#key_scroll_right kscr str kZ ----K scroll right -#key_tab ktab str ko ----K tab key -#key_smap_in1 kmpf1 str Kv ----K special mapped key 1 input -#key_smap_out1 kmpt1 str KV ----K special mapped key 1 output -#key_smap_in2 kmpf2 str Kw ----K special mapped key 2 input -#key_smap_out2 kmpt2 str KW ----K special mapped key 2 output -#key_smap_in3 kmpf3 str Kx ----K special mapped key 3 input -#key_smap_out3 kmpt3 str KX ----K special mapped key 3 output -#key_smap_in4 kmpf4 str Ky ----K special mapped key 4 input -#key_smap_out4 kmpt4 str KY ----K special mapped key 4 output -#key_smap_in5 kmpf5 str Kz ----K special mapped key 5 input -#key_smap_out5 kmpt5 str KZ ----K special mapped key 5 output -#appl_defined_str apstr str za ----K application-defined string +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string # The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in # the IBM manual pages, so the cap name strings are guesses. The terminfo # names are almost certainly right, the termcap ones almost certainly wrong. -#key_smap_in6 kmpf6 str k! ----K special mapped key 6 input -#key_smap_out6 kmpt6 str K@ ----K special mapped key 6 output -#key_smap_in7 kmpf7 str k# ----K special mapped key 7 input -#key_smap_out7 kmpt7 str K$ ----K special mapped key 7 output -#key_smap_in8 kmpf8 str k% ----K special mapped key 8 input -#key_smap_out8 kmpt8 str K^ ----K special mapped key 8 output -#key_smap_in9 kmpf9 str k& ----K special mapped key 9 input -#key_smap_out9 kmpt9 str K* ----K special mapped key 9 output +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output # Undocumented capabilities end here -#key_sf1 ksf1 str S1 ----K special function key 1 -#key_sf2 ksf2 str S2 ----K special function key 2 -#key_sf3 ksf3 str S3 ----K special function key 3 -#key_sf4 ksf4 str S4 ----K special function key 4 -#key_sf5 ksf5 str S5 ----K special function key 5 -#key_sf6 ksf6 str S6 ----K special function key 6 -#key_sf7 ksf7 str S7 ----K special function key 7 -#key_sf8 ksf8 str S8 ----K special function key 8 -#key_sf9 ksf9 str S9 ----K special function key 9 -#key_sf10 ksf10 str SA ----K special function key 10 -#key_f11 kf11 str k< ----- function key 11 -#key_f12 kf12 str k> ----- function key 12 -# The key_f13 through key_f64 capabilities aren't described in -# the IBM manual pages, so the cap name strings are guesses. The terminfo -# names are almost certainly right, the termcap ones certainly wrong. -#key_f13 kf13 str k+ ----- function key 13 -#key_f14 kf14 str k+ ----- function key 14 -#key_f15 kf15 str k+ ----- function key 15 -#key_f16 kf16 str k+ ----- function key 16 -#key_f17 kf17 str k+ ----- function key 17 -#key_f18 kf18 str k+ ----- function key 18 -#key_f19 kf19 str k+ ----- function key 19 -#key_f20 kf20 str k+ ----- function key 20 -#key_f21 kf21 str k+ ----- function key 21 -#key_f22 kf22 str k+ ----- function key 22 -#key_f23 kf23 str k+ ----- function key 23 -#key_f24 kf24 str k+ ----- function key 24 -#key_f25 kf25 str k+ ----- function key 25 -#key_f26 kf26 str k+ ----- function key 26 -#key_f27 kf26 str k+ ----- function key 26 -#key_f28 kf28 str k+ ----- function key 28 -#key_f29 kf29 str k+ ----- function key 29 -#key_f30 kf30 str k+ ----- function key 30 -#key_f31 kf31 str k+ ----- function key 31 -#key_f32 kf31 str k+ ----- function key 32 -#key_f33 kf33 str k+ ----- function key 33 -#key_f34 kf34 str k+ ----- function key 34 -#key_f35 kf35 str k+ ----- function key 35 -#key_f36 kf36 str k+ ----- function key 36 -#key_f37 kf37 str k+ ----- function key 37 -#key_f38 kf38 str k+ ----- function key 38 -#key_f39 kf39 str k+ ----- function key 39 -#key_f40 kf40 str k+ ----- function key 40 -#key_f41 kf41 str k+ ----- function key 41 -#key_f42 kf42 str k+ ----- function key 42 -#key_f43 kf43 str k+ ----- function key 43 -#key_f44 kf44 str k+ ----- function key 44 -#key_f45 kf45 str k+ ----- function key 45 -#key_f46 kf46 str k+ ----- function key 46 -#key_f47 kf47 str k+ ----- function key 47 -#key_f48 kf48 str k+ ----- function key 48 -#key_f49 kf49 str k+ ----- function key 49 -#key_f50 kf50 str k+ ----- function key 50 -#key_f51 kf51 str k+ ----- function key 51 -#key_f52 kf52 str k+ ----- function key 52 -#key_f53 kf53 str k+ ----- function key 53 -#key_f54 kf54 str k+ ----- function key 54 -#key_f55 kf55 str k+ ----- function key 55 -#key_f56 kf56 str k+ ----- function key 56 -#key_f57 kf57 str k+ ----- function key 57 -#key_f58 kf58 str k+ ----- function key 58 -#key_f59 kf59 str k+ ----- function key 59 -#key_f60 kf60 str k+ ----- function key 60 -#key_f61 kf61 str k+ ----- function key 61 -#key_f62 kf62 str k+ ----- function key 62 -#key_f63 kf63 str k+ ----- function key 63 +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 # Undocumented capabilities end here. -#key_action kact str kJ ----K sent by action key +#key_action kact str kJ - - ----K sent by action key # The IBM docs say these capabilities are for table-drawing, and are # valid only for aixterm descriptions. -#enter_topline_mode topl str tp ----K start top-line mode -#enter_bottom_mode btml str bm ----K start bottom-line mode -#enter_rvert_mode rvert str rv ----K start right-vertical mode -#enter_lvert_mode lvert str lv ----K start left-vertical mode +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode # ############################################################################# # diff --git a/include/Caps.aix4 b/include/Caps.aix4 new file mode 100644 index 00000000..3f946284 --- /dev/null +++ b/include/Caps.aix4 @@ -0,0 +1,1255 @@ +############################################################################## +# Copyright (c) 2001 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Thomas Dickey +# +# $Id: Caps.aix4,v 1.6 2002/07/07 00:00:32 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with AIX 4.x's terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that cannot be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +box_chars_2 box2 str by - - ----K box characters secondary set +box_attr_1 batt1 str Bx - - ----K attributes for box1 +box_attr_2 batt2 str By - - ----K attributes for box2 +color_bg_0 colb0 str d0 - - ----K background color 0 +color_bg_1 colb1 str d1 - - ----K background color 1 +color_bg_2 colb2 str d2 - - ----K background color 2 +color_bg_3 colb3 str d3 - - ----K background color 3 +color_bg_4 colb4 str d4 - - ----K background color 4 +color_bg_5 colb5 str d5 - - ----K background color 5 +color_bg_6 colb6 str d6 - - ----K background color 6 +color_bg_7 colb7 str d7 - - ----K background color 7 +color_fg_0 colf0 str c0 - - ----K foreground color 0 +color_fg_1 colf1 str c1 - - ----K foreground color 1 +color_fg_2 colf2 str c2 - - ----K foreground color 2 +color_fg_3 colf3 str c3 - - ----K foreground color 3 +color_fg_4 colf4 str c4 - - ----K foreground color 4 +color_fg_5 colf5 str c5 - - ----K foreground color 5 +color_fg_6 colf6 str c6 - - ----K foreground color 6 +color_fg_7 colf7 str c7 - - ----K foreground color 7 +font_0 font0 str f0 - - ----K select font 0 +font_1 font1 str f1 - - ----K select font 1 +font_2 font2 str f2 - - ----K select font 2 +font_3 font3 str f3 - - ----K select font 3 +font_4 font4 str f4 - - ----K select font 4 +font_5 font5 str f5 - - ----K select font 5 +font_6 font6 str f6 - - ----K select font 6 +font_7 font7 str f7 - - ----K select font 7 +key_back_tab kbtab str k0 - - ----K backtab key +key_do kdo str ki - - ----K do request key +key_command kcmd str kd - - ----K command-request key +key_command_pane kcpn str kW - - ----K command-pane key +key_end kend str kw KEY_END 0550 ----- end key +key_help khlp str kq - - ----- help key +key_newline knl str nl - - ----K newline key +key_next_pane knpn str kv - - ----K next-pane key +key_prev_cmd kppn str kp - - ----K previous-command key +key_prev_pane kppn str kV - - ----K previous-pane key +key_quit kquit str kQ - - ----K quit key +key_select_aix ksel str kU - - ----- select key +key_scroll_left kscl str kz - - ----K scroll left +key_scroll_right kscr str kZ - - ----K scroll right +key_tab ktab str ko - - ----K tab key +key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +appl_defined_str apstr str za - - ----K application-defined string +key_smap_in6 kmpf6 str kr - - ----K special mapped key 6 input +key_smap_out6 kmpt6 str KR - - ----K special mapped key 6 output +key_smap_in7 kmpf7 str ks - - ----K special mapped key 7 input +key_smap_out7 kmpt7 str KS - - ----K special mapped key 7 output +key_smap_in8 kmpf8 str kt - - ----K special mapped key 8 input +key_smap_out8 kmpt8 str KT - - ----K special mapped key 8 output +key_smap_in9 kmpf9 str ku - - ----K special mapped key 9 input +key_smap_out9 kmpt9 str KU - - ----K special mapped key 9 output +key_sf1 ksf1 str S1 - - ----K special function key 1 +key_sf2 ksf2 str S2 - - ----K special function key 2 +key_sf3 ksf3 str S3 - - ----K special function key 3 +key_sf4 ksf4 str S4 - - ----K special function key 4 +key_sf5 ksf5 str S5 - - ----K special function key 5 +key_sf6 ksf6 str S6 - - ----K special function key 6 +key_sf7 ksf7 str S7 - - ----K special function key 7 +key_sf8 ksf8 str S8 - - ----K special function key 8 +key_sf9 ksf9 str S9 - - ----K special function key 9 +key_sf10 ksf10 str S0 - - ----K special function key 10 +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +key_action kact str kJ - - ----K sent by action key + +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +enter_topline_mode topl str tp - - ----K start top-line mode +enter_bottom_mode btml str bm - - ----K start bottom-line mode +enter_rvert_mode rvert str rv - - ----K start right-vertical mode +enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +# SVr4 capabilities resume here. Note that key_end is in the IBM-extensions. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +#key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +#key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +#key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +clr_bol el1 str cb - - ----- Clear to beginning of line +clear_margins mgc str MC - - ----- clear right and left soft margins +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +label_format fln str Lf - - ----- label format +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +display_clock dclk str DK - - ----- display clock +remove_clock rmclk str RC - - ----- remove clock +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +# +# SVr4 added these capabilities to support color +# +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_background setb str Sb - - ----- Set background color #1 +# +# SVr4 added these capabilities to support printers +# +change_char_pitch cpi str ZA - - ----- Change number of characters per inch to #1 +change_line_pitch lpi str ZB - - ----- Change number of lines per inch to #1 +change_res_horz chr str ZC - - ----- Change horizontal resolution to #1 +change_res_vert cvr str ZD - - ----- Change vertical resolution to #1 +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode +enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode +enter_italics_mode sitm str ZH - - ----- Enter italic mode +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +micro_column_address mhpa str ZY - - ----- Like column_address in micro mode +micro_down mcud1 str ZZ - - ----- Like cursor_down in micro mode +micro_left mcub1 str Za - - ----- Like cursor_left in micro mode +micro_right mcuf1 str Zb - - ----- Like cursor_right in micro mode +micro_row_address mvpa str Zc - - ----- Like row_address #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +parm_down_micro mcud str Zf - - ----- Like parm_down_cursor in micro mode +parm_left_micro mcub str Zg - - ----- Like parm_left_cursor in micro mode +parm_right_micro mcuf str Zh - - ----- Like parm_right_cursor in micro mode +parm_up_micro mcuu str Zi - - ----- Like parm_up_cursor in micro mode +select_char_set scs str Zj - - ----- Select character set, #1 +set_bottom_margin smgb str Zk - - ----- Set bottom margin at current line +set_bottom_margin_parm smgbp str Zl - - ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_top_margin smgt str Zo - - ----- Set top margin at current line +set_top_margin_parm smgtp str Zp - - ----- Set top (bottom) margin at row #1 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +start_char_set_def scsd str Zr - - ----- Start character set definition #1, with #2 characters in the set +stop_bit_image rbim str Zs - - ----- Stop printing bit image graphics +stop_char_set_def rcsd str Zt - - ----- End definition of character set #1 +subscript_characters subcs str Zu - - ----- List of subscriptable characters +superscript_characters supcs str Zv - - ----- List of superscriptable characters +these_cause_cr docr str Zw - - ----- Printing any of these characters causes CR +zero_motion zerom str Zx - - ----- No motion for subsequent character +#%.TE +#%.ad +#% +#%The following string capabilities are present in the SVr4.0 term structure, +#%but were originally not documented in the man page. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw18. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +mouse_info minfo str Mi - - ----- Mouse status information +req_mouse_pos reqmp str RQ - - ----- Request mouse position +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +bit_image_repeat birep str Xy - - ----- Repeat bit image cell #1 #2 times +bit_image_newline binel str Zz - - ----- Move to next row of the bit image +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_page_length slines str YZ - - ----- Set page length to #1 lines +# +# SVr4 added these capabilities for direct PC-clone support +# +display_pc_char dispc str S1 - - ----- Display PC character #1 +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +#%.TE +#%.ad +#% +#%.in .8i +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. +#%The \fBncurses\fR termcap names for them are invented; according to the +#%XSI Curses standard, they have no termcap names. If your compiled terminfo +#%entries use these, they may not be binary-compatible with System V terminfo +#%entries after SVr4.1; beware! +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +#%.TE +#%.ad +# +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/include/Caps.hpux11 b/include/Caps.hpux11 new file mode 100644 index 00000000..449ffe1d --- /dev/null +++ b/include/Caps.hpux11 @@ -0,0 +1,1275 @@ +############################################################################## +# Copyright (c) 2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Thomas Dickey +# +# $Id: Caps.hpux11,v 1.2 2002/07/07 00:11:56 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with AIX 4.x's terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that cannot be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +# HPUX defines these if __HP_CURSES_COMPAT is defined: +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +# +# +plab_norm pln str pn - - ----- program label #1 to show string #2 +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +clr_bol el1 str cb - - ----- Clear to beginning of line +clear_margins mgc str MC - - ----- clear right and left soft margins +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +label_format fln str Lf - - ----- label format +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +display_clock dclk str DK - - ----- display clock +remove_clock rmclk str RC - - ----- remove clock +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +# +# SVr4 added these capabilities to support color +# +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_background setb str Sb - - ----- Set background color #1 +# +# SVr4 added these capabilities to support printers +# +change_char_pitch cpi str ZA - - ----- Change number of characters per inch to #1 +change_line_pitch lpi str ZB - - ----- Change number of lines per inch to #1 +change_res_horz chr str ZC - - ----- Change horizontal resolution to #1 +change_res_vert cvr str ZD - - ----- Change vertical resolution to #1 +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode +enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode +enter_italics_mode sitm str ZH - - ----- Enter italic mode +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +micro_column_address mhpa str ZY - - ----- Like column_address in micro mode +micro_down mcud1 str ZZ - - ----- Like cursor_down in micro mode +micro_left mcub1 str Za - - ----- Like cursor_left in micro mode +micro_right mcuf1 str Zb - - ----- Like cursor_right in micro mode +micro_row_address mvpa str Zc - - ----- Like row_address #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +parm_down_micro mcud str Zf - - ----- Like parm_down_cursor in micro mode +parm_left_micro mcub str Zg - - ----- Like parm_left_cursor in micro mode +parm_right_micro mcuf str Zh - - ----- Like parm_right_cursor in micro mode +parm_up_micro mcuu str Zi - - ----- Like parm_up_cursor in micro mode +select_char_set scs str Zj - - ----- Select character set, #1 +set_bottom_margin smgb str Zk - - ----- Set bottom margin at current line +set_bottom_margin_parm smgbp str Zl - - ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_top_margin smgt str Zo - - ----- Set top margin at current line +set_top_margin_parm smgtp str Zp - - ----- Set top (bottom) margin at row #1 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +start_char_set_def scsd str Zr - - ----- Start character set definition #1, with #2 characters in the set +stop_bit_image rbim str Zs - - ----- Stop printing bit image graphics +stop_char_set_def rcsd str Zt - - ----- End definition of character set #1 +subscript_characters subcs str Zu - - ----- List of subscriptable characters +superscript_characters supcs str Zv - - ----- List of superscriptable characters +these_cause_cr docr str Zw - - ----- Printing any of these characters causes CR +zero_motion zerom str Zx - - ----- No motion for subsequent character +#%.TE +#%.ad +#% +#%The following string capabilities are present in the SVr4.0 term structure, +#%but were originally not documented in the man page. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw18. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +mouse_info minfo str Mi - - ----- Mouse status information +req_mouse_pos reqmp str RQ - - ----- Request mouse position +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +bit_image_repeat birep str Xy - - ----- Repeat bit image cell #1 #2 times +bit_image_newline binel str Zz - - ----- Move to next row of the bit image +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_page_length slines str YZ - - ----- Set page length to #1 lines +# +# SVr4 added these capabilities for direct PC-clone support +# +display_pc_char dispc str S1 - - ----- Display PC character #1 +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +#%.TE +#%.ad +#% +#%.in .8i +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. +#%The \fBncurses\fR termcap names for them are invented; according to the +#%XSI Curses standard, they have no termcap names. If your compiled terminfo +#%entries use these, they may not be binary-compatible with System V terminfo +#%entries after SVr4.1; beware! +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +exit_horizontal_hl_mode rhhlm str XH - - ----K Exit horizontal highlight mode +exit_left_hl_mode rlhlm str XL - - ----K Exit left highlight mode +exit_low_hl_mode rlohlm str XO - - ----K Exit low highlight mode +exit_right_hl_mode rrhlm str XR - - ----K Exit right highlight mode +exit_top_hl_mode rthlm str XT - - ----K Exit top highlight mode +exit_vertical_hl_mode rvhlm str XV - - ----K Exit vertical highlight mode +#%.TE +#%.ad +# +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +#memory_lock meml str ml - - ----K memory lock above +#memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/include/Caps.keys b/include/Caps.keys new file mode 100644 index 00000000..7ef7545f --- /dev/null +++ b/include/Caps.keys @@ -0,0 +1,1354 @@ +############################################################################## +# Copyright (c) 2001 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Thomas Dickey +# and: Ilya Zakharevich +# +# $Id: Caps.keys,v 1.2 2002/04/20 15:43:49 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is illustrates an experimental extension to describe alt-, shift- and +# control-modifiers applied to function and normal keys, as done on IBM pc's. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE can't print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding won't work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer won't echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +can_change ccc bool cc - - ----- terminal can re-define existing colors +back_color_erase bce bool ut - - ----- screen erased with background color +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that can't be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +number_of_pins npins num Yh - - ----- numbers of pins in print-head +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +buttons btns num BT - - ----- number of buttons on mouse +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +clr_bol el1 str cb - - ----- Clear to beginning of line +clear_margins mgc str MC - - ----- clear right and left soft margins +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +label_format fln str Lf - - ----- label format +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +display_clock dclk str DK - - ----- display clock +remove_clock rmclk str RC - - ----- remove clock +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +dial_phone dial str DI - - ----- dial number #1 +quick_dial qdial str QD - - ----- dial number #1 without checking +tone tone str TO - - ----- select touch tone dialing +pulse pulse str PU - - ----- select pulse dialing +flash_hook hook str fh - - ----- flash switch hook +fixed_pause pause str PA - - ----- pause for 2-3 seconds +wait_tone wait str WA - - ----- wait for dial-tone +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +# +# NCurses extensions for keys accessible on most PC consoles +# +key_sup kUP str !5 KEY_SUP + ----- shifted up-arrow key +key_sdown kDOWN str !6 KEY_SDOWN + ----- shifted down-arrow key +key_sbackspace kBS str !7 KEY_SBACKSPACE + ----- shifted backspace key +key_c_delete kcdelete str !8 KEY_C_DELETE + ----- control- delete-character key +key_c_end kcend str !9 KEY_C_END + ----- control- end key +key_c_home kchom str !0 KEY_C_HOME + ----- control- home key +key_c_insert kcinsert str !_ KEY_C_INSERT + ----- control- insert-character key +key_c_left kclft str %k KEY_C_LEFT + ----- control- left-arrow key +key_c_next kcnxt str %l KEY_C_NEXT + ----- control- next key +key_c_previous kcprv str %m KEY_C_PREVIOUS + ----- control- previous key +key_c_print kcprt str %n KEY_C_PRINT + ----- control- print key +key_c_right kcrit str %o KEY_C_RIGHT + ----- control- right-arrow key +key_c_backspace kcbs str %p KEY_C_BACKSPACE + ----- control- backspace key +key_c_up kcup str %q KEY_C_UP + ----- control- up-arrow key +key_c_down kcdown str %r KEY_C_DOWN + ----- control- down-arrow key +key_a_delete kadelete str %s KEY_A_DELETE + ----- alt- delete-character key +key_a_end kaend str %t KEY_A_END + ----- alt- end key +key_a_home kahom str %u KEY_A_HOME + ----- alt- home key +key_a_insert kainsert str %v KEY_A_INSERT + ----- alt- insert-character key +key_a_left kalft str %w KEY_A_LEFT + ----- alt- left-arrow key +key_a_next kanxt str %x KEY_A_NEXT + ----- alt- next key +key_a_previous kaprv str %y KEY_A_PREVIOUS + ----- alt- previous key +key_a_print kaprt str %z KEY_A_PRINT + ----- alt- print key +key_a_right karit str %! KEY_A_RIGHT + ----- alt- right-arrow key +key_a_backspace kabs str %@ KEY_A_BACKSPACE + ----- alt- backspace key +key_a_up kaup str %# KEY_A_UP + ----- alt- up-arrow key +key_a_down kadown str %$ KEY_A_DOWN + ----- alt- down-arrow key +key_a_a kaa str $a KEY_A_A + ----- alt- a key +key_a_b kab str $b KEY_A_B + ----- alt- b key +key_a_c kac str $c KEY_A_C + ----- alt- c key +key_a_d kad str $d KEY_A_D + ----- alt- d key +key_a_e kae str $e KEY_A_E + ----- alt- e key +key_a_f kaf str $f KEY_A_F + ----- alt- f key +key_a_g kag str $g KEY_A_G + ----- alt- g key +key_a_h kah str $h KEY_A_H + ----- alt- h key +key_a_i kai str $i KEY_A_I + ----- alt- i key +key_a_j kaj str $j KEY_A_J + ----- alt- j key +key_a_k kak str $k KEY_A_K + ----- alt- k key +key_a_l kal str $l KEY_A_L + ----- alt- l key +key_a_m kam str $m KEY_A_M + ----- alt- m key +key_a_n kan str $n KEY_A_N + ----- alt- n key +key_a_o kao str $o KEY_A_O + ----- alt- o key +key_a_p kap str $p KEY_A_P + ----- alt- p key +key_a_q kaq str $q KEY_A_Q + ----- alt- q key +key_a_r kar str $r KEY_A_R + ----- alt- r key +key_a_s kas str $s KEY_A_S + ----- alt- s key +key_a_t kat str $t KEY_A_T + ----- alt- t key +key_a_u kau str $u KEY_A_U + ----- alt- u key +key_a_v kav str $v KEY_A_V + ----- alt- v key +key_a_w kaw str $w KEY_A_W + ----- alt- w key +key_a_x kax str $x KEY_A_X + ----- alt- x key +key_a_y kay str $y KEY_A_Y + ----- alt- y key +key_a_z kaz str $z KEY_A_Z + ----- alt- z key +key_a_0 ka_0 str $0 KEY_A_0 + ----- alt- 0 key +key_a_1 ka_1 str $1 KEY_A_1 + ----- alt- 1 key +key_a_2 ka_2 str $2 KEY_A_2 + ----- alt- 2 key +key_a_3 ka_3 str $3 KEY_A_3 + ----- alt- 3 key +key_a_4 ka_4 str $4 KEY_A_4 + ----- alt- 4 key +key_a_5 ka_5 str $5 KEY_A_5 + ----- alt- 5 key +key_a_6 ka_6 str $6 KEY_A_6 + ----- alt- 6 key +key_a_7 ka_7 str $7 KEY_A_7 + ----- alt- 7 key +key_a_8 ka_8 str $8 KEY_A_8 + ----- alt- 8 key +key_a_9 ka_9 str $9 KEY_A_9 + ----- alt- 9 key +key_a_backtick ka_bt str $` KEY_A_BACKTICK + ----- alt- ` key +key_a_under ka_und str $_ KEY_A_UNDER + ----- alt- _ key +key_a_equals ka_eq str $= KEY_A_EQUALS + ----- alt- = key +key_a_bar ka_bsl str $| KEY_A_BAR + ----- alt- | key +key_a_lbracker ka_lbr str $[ KEY_A_LBRACKER + ----- alt- [ key +key_a_rbracker ka_rbr str $] KEY_A_RBRACKER + ----- alt- ] key +key_a_semi ka_semi str $; KEY_A_SEMI + ----- alt- ; key +key_a_tick ka_tick str $' KEY_A_TICK + ----- alt- ' key +key_a_comma ka_com str $, KEY_A_COMMA + ----- alt- , key +key_a_dot ka_dot str $. KEY_A_DOT + ----- alt- . key +key_a_question ka_sla str $? KEY_A_QUESTION + ----- alt- ? key +key_a_divide ka_div str $/ KEY_A_DIVIDE + ----- alt- keypad / key +key_a_multiply ka_mul str $* KEY_A_MULTIPLY + ----- alt- keypad * key +key_a_add ka_add str $+ KEY_A_ADD + ----- alt- keypad + key +key_a_subtract ka_sub str $- KEY_A_SUBTRACT + ----- alt- keypad - key +key_a_kenter ka_kent str $< KEY_A_KENTER + ----- alt- keypad enter key +key_a_enter ka_ent str $> KEY_A_ENTER + ----- alt- enter key +key_c_at kcat str %% KEY_C_AT + ----- control- @ key +key_c_divide kcdiv str %/ KEY_C_DIVIDE + ----- control- keypad / key +key_c_multiply kcmul str %* KEY_C_MULTIPLY + ----- control- keypad * key +key_c_add kcadd str %+ KEY_C_ADD + ----- control- keypad + key +key_c_subtract kcsub str %- KEY_C_SUBTRACT + ----- control- keypad - key +# +# SVr4 added these capabilities to support color +# +orig_pair op str op - - ----- Set default pair to its original value +orig_colors oc str oc - - ----- Set all color pairs to the original ones +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_background setb str Sb - - ----- Set background color #1 +# +# SVr4 added these capabilities to support printers +# +change_char_pitch cpi str ZA - - ----- Change number of characters per inch to #1 +change_line_pitch lpi str ZB - - ----- Change number of lines per inch to #1 +change_res_horz chr str ZC - - ----- Change horizontal resolution to #1 +change_res_vert cvr str ZD - - ----- Change vertical resolution to #1 +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode +enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode +enter_italics_mode sitm str ZH - - ----- Enter italic mode +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +micro_column_address mhpa str ZY - - ----- Like column_address in micro mode +micro_down mcud1 str ZZ - - ----- Like cursor_down in micro mode +micro_left mcub1 str Za - - ----- Like cursor_left in micro mode +micro_right mcuf1 str Zb - - ----- Like cursor_right in micro mode +micro_row_address mvpa str Zc - - ----- Like row_address #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +parm_down_micro mcud str Zf - - ----- Like parm_down_cursor in micro mode +parm_left_micro mcub str Zg - - ----- Like parm_left_cursor in micro mode +parm_right_micro mcuf str Zh - - ----- Like parm_right_cursor in micro mode +parm_up_micro mcuu str Zi - - ----- Like parm_up_cursor in micro mode +select_char_set scs str Zj - - ----- Select character set, #1 +set_bottom_margin smgb str Zk - - ----- Set bottom margin at current line +set_bottom_margin_parm smgbp str Zl - - ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_top_margin smgt str Zo - - ----- Set top margin at current line +set_top_margin_parm smgtp str Zp - - ----- Set top (bottom) margin at row #1 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +start_char_set_def scsd str Zr - - ----- Start character set definition #1, with #2 characters in the set +stop_bit_image rbim str Zs - - ----- Stop printing bit image graphics +stop_char_set_def rcsd str Zt - - ----- End definition of character set #1 +subscript_characters subcs str Zu - - ----- List of subscriptable characters +superscript_characters supcs str Zv - - ----- List of superscriptable characters +these_cause_cr docr str Zw - - ----- Printing any of these characters causes CR +zero_motion zerom str Zx - - ----- No motion for subsequent character +#%.TE +#%.ad +#% +#%The following string capabilities are present in the SVr4.0 term structure, +#%but were originally not documented in the man page. +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw18. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +mouse_info minfo str Mi - - ----- Mouse status information +req_mouse_pos reqmp str RQ - - ----- Request mouse position +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +bit_image_repeat birep str Xy - - ----- Repeat bit image cell #1 #2 times +bit_image_newline binel str Zz - - ----- Move to next row of the bit image +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +color_names colornm str Yw - - ----- Give name for color #1 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +end_bit_image_region endbi str Yy - - ----- End a bit-image region +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_page_length slines str YZ - - ----- Set page length to #1 lines +# +# SVr4 added these capabilities for direct PC-clone support +# +display_pc_char dispc str S1 - - ----- Display PC character #1 +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +pc_term_options pctrm str S6 - - ----- PC terminal options +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +#%.TE +#%.ad +#% +#%.in .8i +#%The XSI Curses standard added these. They are some post-4.1 +#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. +#%The \fBncurses\fR termcap names for them are invented; according to the +#%XSI Curses standard, they have no termcap names. If your compiled terminfo +#%entries use these, they may not be binary-compatible with System V terminfo +#%entries after SVr4.1; beware! +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +#%.TE +#%.ad +# +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/include/Caps.osf1r5 b/include/Caps.osf1r5 new file mode 100644 index 00000000..958461ae --- /dev/null +++ b/include/Caps.osf1r5 @@ -0,0 +1,1274 @@ +############################################################################## +# Copyright (c) 2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Thomas Dickey +# +# $Id: Caps.osf1r5,v 1.3 2002/07/07 00:02:52 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with OSF/1 version 5 (Tru64) terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +back_color_erase bce bool ut - - ----- screen erased with background color +can_change ccc bool cc - - ----- terminal can re-define existing colors +col_addr_glitch xhpa bool YA - - ----- only positive motion for hpa/mhpa caps +cpi_changes_res cpix bool YF - - ----- changing character pitch changes resolution +cr_cancels_micro_mode crxm bool YB - - ----- using cr turns off micro mode +hard_cursor chts bool HC - - ----- cursor is hard to see +has_print_wheel daisy bool YC - - ----- printer needs operator to change character set +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +lpi_changes_res lpix bool YG - - ----- changing line pitch changes resolution +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +row_addr_glitch xvpa bool YD - - ----- only positive motion for vpa/mvpa caps +semi_auto_right_margin sam bool YE - - ----- printing in last column causes cr +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +bit_image_entwining bitwin num Yo - - ----- number of passes for each bit-image row +bit_image_type bitype num Yp - - ----- type of bit-image device +buffer_capacity bufsz num Ya - - ----- numbers of bytes buffered before printing +buttons btns num BT - - ----- number of buttons on mouse +dot_vert_spacing spinv num Yb - - ----- spacing of pins vertically in pins per inch +dot_horz_spacing spinh num Yc - - ----- spacing of dots horizontally in dots per inch +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +max_colors colors num Co - - ----- maximum number of colors on screen +max_micro_address maddr num Yd - - ----- maximum value in micro_..._address +max_micro_jump mjump num Ye - - ----- maximum value in parm_..._micro +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +maximum_windows wnum num MW - - ----- maximum number of defineable windows +micro_col_size mcs num Yf - - ----- character step size when in micro mode +micro_line_size mls num Yg - - ----- line step size when in micro mode +no_color_video ncv num NC - - ----- video attributes that can not be used with colors +number_of_pins npins num Yh - - ----- numbers of pins in print-head +num_labels nlab num Nl - - ----- number of labels on screen +output_res_char orc num Yi - - ----- horizontal resolution in units per line +output_res_line orl num Yj - - ----- vertical resolution in units per line +output_res_horz_inch orhi num Yk - - ----- horizontal resolution in units per inch +output_res_vert_inch orvi num Yl - - ----- vertical resolution in units per inch +print_rate cps num Ym - - ----- print rate in characters per second +wide_char_size widcs num Yn - - ----- character step size when in double wide mode +#%.TE +#%.ad +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +# OSF1 differences start here, based on IBM version: +# +box_chars_1 box1 str bx - - ----K box characters primary set +box_chars_2 box2 str by - - ----K box characters secondary set +box_attr_1 batt1 str Bx - - ----K attributes for box1 +box_attr_2 batt2 str By - - ----K attributes for box2 +color_bg_0 colb0 str d0 - - ----K background color 0 +color_bg_1 colb1 str d1 - - ----K background color 1 +color_bg_2 colb2 str d2 - - ----K background color 2 +color_bg_3 colb3 str d3 - - ----K background color 3 +color_bg_4 colb4 str d4 - - ----K background color 4 +color_bg_5 colb5 str d5 - - ----K background color 5 +color_bg_6 colb6 str d6 - - ----K background color 6 +color_bg_7 colb7 str d7 - - ----K background color 7 +color_fg_0 colf0 str c0 - - ----K foreground color 0 +color_fg_1 colf1 str c1 - - ----K foreground color 1 +color_fg_2 colf2 str c2 - - ----K foreground color 2 +color_fg_3 colf3 str c3 - - ----K foreground color 3 +color_fg_4 colf4 str c4 - - ----K foreground color 4 +color_fg_5 colf5 str c5 - - ----K foreground color 5 +color_fg_6 colf6 str c6 - - ----K foreground color 6 +color_fg_7 colf7 str c7 - - ----K foreground color 7 +font_0 font0 str f0 - - ----- select font 0 +font_1 font1 str f1 - - ----- select font 1 +font_2 font2 str f2 - - ----- select font 2 +font_3 font3 str f3 - - ----- select font 3 +font_4 font4 str f4 - - ----K select font 4 +font_5 font5 str f5 - - ----K select font 5 +font_6 font6 str f6 - - ----K select font 6 +font_7 font7 str f7 - - ----K select font 7 +key_back_tab kbtab str k0 - - ----- backtab key +key_do kdo str ki - - ----K do request key +key_command kcmd str kc KEY_COMMAND 0545 ----- command key +key_command_pane kcpn str kW - - ----K command-pane key +key_end kend str @7 KEY_END 0550 ----- end key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_newline knl str nl - - ----K newline key +key_next_pane knpn str kv - - ----K next-pane key +key_prev_cmd kppn str kp - - ----K previous-command key +key_prev_pane kppn str kV - - ----K previous-pane key +key_quit kquit str kQ - - ----K quit key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_scroll_left kscl str kz - - ----K scroll left +key_scroll_right kscr str kZ - - ----K scroll right +key_tab ktab str ko - - ----K tab key +key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities are described in +# the Tru64 manual pages. +key_smap_in6 kmpf6 str Kr - - ----K special mapped key 6 input +key_smap_out6 kmpt6 str KR - - ----K special mapped key 6 output +key_smap_in7 kmpf7 str Ks - - ----K special mapped key 7 input +key_smap_out7 kmpt7 str KS - - ----K special mapped key 7 output +key_smap_in8 kmpf8 str Kt - - ----K special mapped key 8 input +key_smap_out8 kmpt8 str KT - - ----K special mapped key 8 output +key_smap_in9 kmpf9 str Ku - - ----K special mapped key 9 input +key_smap_out9 kmpt9 str KU - - ----K special mapped key 9 output +key_sf1 ksf1 str S1 - - ----K special function key 1 +key_sf2 ksf2 str S2 - - ----K special function key 2 +key_sf3 ksf3 str S3 - - ----K special function key 3 +key_sf4 ksf4 str S4 - - ----K special function key 4 +key_sf5 ksf5 str S5 - - ----K special function key 5 +key_sf6 ksf6 str S6 - - ----K special function key 6 +key_sf7 ksf7 str S7 - - ----K special function key 7 +key_sf8 ksf8 str S8 - - ----K special function key 8 +key_sf9 ksf9 str S9 - - ----K special function key 9 +key_sf10 ksf10 str SA - - ----K special function key 10 +# +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_action kact str kJ KEY_ACTION 0541 ----K sent by action key +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulation +bit_image_repeat birep str Xy - - ----- Repeat bit image cell #1 #2 times +bit_image_newline binel str Zz - - ----- Move to next row of the bit image +bit_image_carriage_return bicr str Yv - - ----- Move to beginning of same row +change_char_pitch cpi str ZA - - ----- Change number of characters per inch to #1 +change_line_pitch lpi str ZB - - ----- Change number of lines per inch to #1 +change_res_horz chr str ZC - - ----- Change horizontal resolution to #1 +change_res_vert cvr str ZD - - ----- Change vertical resolution to #1 +char_padding rmp str rP - - ----- like ip but when in insert mode +char_set_names csnm str Zy - - ----- Produce #1'th item from list of character set names +clear_margins mgc str MC - - ----- clear right and left soft margins +clr_bol el1 str cb - - ----- Clear to beginning of line +code_set_init csin str ci - - ----- Init sequence for multiple codesets +color_names colornm str Yw - - ----- Give name for color #1 +create_window cwin str CW - - ----- define a window #1 from #2,#3 to #4,#5 +define_bit_image_region defbi str Yx - - ----- Define rectangualar bit image region +define_char defc str ZE - - ----- Define a character #1, #2 dots wide, descender #3 +device_type devt str dv - - ----- Indicate language/codeset support +dial_phone dial str DI - - ----- dial number #1 +display_clock dclk str DK - - ----- display clock +display_pc_char dispc str S1 - - ----- Display PC character #1 +ena_acs enacs str eA - - ----- enable alternate char set +end_bit_image_region endbi str Yy - - ----- End a bit-image region +enter_am_mode smam str SA - - ----- turn on automatic margins +enter_doublewide_mode swidm str ZF - - ----- Enter double-wide mode +enter_draft_quality sdrfq str ZG - - ----- Enter draft-quality mode +enter_italics_mode sitm str ZH - - ----- Enter italic mode +enter_leftward_mode slm str ZI - - ----- Start leftward carriage motion +enter_micro_mode smicm str ZJ - - ----- Start micro-motion mode +enter_near_letter_quality snlq str ZK - - ----- Enter NLQ mode +enter_normal_quality snrmq str ZL - - ----- Enter normal-quality mode +enter_pc_charset_mode smpch str S2 - - ----- Enter PC character display mode +enter_scancode_mode smsc str S4 - - ----- Enter PC scancode mode +enter_shadow_mode sshm str ZM - - ----- Enter shadow-print mode +enter_subscript_mode ssubm str ZN - - ----- Enter subscript mode +enter_superscript_mode ssupm str ZO - - ----- Enter superscript mode +enter_upward_mode sum str ZP - - ----- Start upward carriage motion +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_am_mode rmam str RA - - ----- turn off automatic margins +exit_doublewide_mode rwidm str ZQ - - ----- End double-wide mode +exit_italics_mode ritm str ZR - - ----- End italic mode +exit_leftward_mode rlm str ZS - - ----- End left-motion mode +exit_micro_mode rmicm str ZT - - ----- End micro-motion mode +exit_pc_charset_mode rmpch str S3 - - ----- Exit PC character display mode +exit_scancode_mode rmsc str S5 - - ----- Exit PC scancode mode +exit_shadow_mode rshm str ZU - - ----- End shadow-print mode +exit_subscript_mode rsubm str ZV - - ----- End subscript mode +exit_superscript_mode rsupm str ZW - - ----- End superscript mode +exit_upward_mode rum str ZX - - ----- End reverse character motion +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +fixed_pause pause str PA - - ----- pause for 2-3 seconds +flash_hook hook str fh - - ----- flash switch hook +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +goto_window wingo str WG - - ----- go to window #1 +hangup hup str HU - - ----- hang-up phone +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_btab kcbt str kB KEY_BTAB 0632 ----- back-tab key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +label_format fln str Lf - - ----- label format +label_off rmln str LF - - ----- turn off soft labels +label_on smln str LO - - ----- turn on soft labels +micro_column_address mhpa str ZY - - ----- Like column_address in micro mode +micro_down mcud1 str ZZ - - ----- Like cursor_down in micro mode +micro_left mcub1 str Za - - ----- Like cursor_left in micro mode +micro_right mcuf1 str Zb - - ----- Like cursor_right in micro mode +micro_row_address mvpa str Zc - - ----- Like row_address #1 in micro mode +micro_up mcuu1 str Zd - - ----- Like cursor_up in micro mode +mouse_info minfo str Mi - - ----- Mouse status information +order_of_pins porder str Ze - - ----- Match software bits to print-head pins +orig_colors oc str oc - - ----- Set all color pairs to the original ones +orig_pair op str op - - ----- Set default pair to its original value +parm_down_micro mcud str Zf - - ----- Like parm_down_cursor in micro mode +parm_left_micro mcub str Zg - - ----- Like parm_left_cursor in micro mode +parm_right_micro mcuf str Zh - - ----- Like parm_right_cursor in micro mode +parm_up_micro mcuu str Zi - - ----- Like parm_up_cursor in micro mode +pc_term_options pctrm str S6 - - ----- PC terminal options +pkey_plab pfxl str xl - - ----- Program function key #1 to type string #2 and show string #3 +plab_norm pln str pn - - ----- program label #1 to show string #2 +pulse pulse str PU - - ----- select pulse dialing +quick_dial qdial str QD - - ----- dial number #1 without checking +req_for_input rfi str RF - - ----- send next input char (for ptys) +req_mouse_pos reqmp str RQ - - ----- Request mouse position +remove_clock rmclk str RC - - ----- remove clock +scancode_escape scesc str S7 - - ----- Escape for scancode emulation +select_char_set scs str Zj - - ----- Select character set, #1 +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_background setb str Sb - - ----- Set background color #1 +set_bottom_margin smgb str Zk - - ----- Set bottom margin at current line +set_bottom_margin_parm smgbp str Zl - - ----- Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom +set_clock sclk str SC - - ----- set clock, #1 hrs #2 mins #3 secs +set_color_band setcolor str Yz - - ----- Change to ribbon color #1 +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_left_margin_parm smglp str Zm - - ----- Set left (right) margin at column #1 +set_lr_margin smglr str ML - - ----- Set both left and right margins to #1, #2. (ML is not in BSD termcap). +set_page_length slines str YZ - - ----- Set page length to #1 lines +set_right_margin smgr str MR - - ----- set right soft margin at current column +set_right_margin_parm smgrp str Zn - - ----- Set right margin at column #1 +set_tb_margin smgtb str MT - - ----- Sets both top and bottom margins to #1, #2 +set_top_margin smgt str Zo - - ----- Set top margin at current line +set_top_margin_parm smgtp str Zp - - ----- Set top (bottom) margin at row #1 +start_bit_image sbim str Zq - - ----- Start printing bit image graphics +start_char_set_def scsd str Zr - - ----- Start character set definition #1, with #2 characters in the set +stop_bit_image rbim str Zs - - ----- Stop printing bit image graphics +stop_char_set_def rcsd str Zt - - ----- End definition of character set #1 +subscript_characters subcs str Zu - - ----- List of subscriptable characters +superscript_characters supcs str Zv - - ----- List of superscriptable characters +these_cause_cr docr str Zw - - ----- Printing any of these characters causes CR +tone tone str TO - - ----- select touch tone dialing +user0 u0 str u0 - - ----- User string #0 +user1 u1 str u1 - - ----- User string #1 +user2 u2 str u2 - - ----- User string #2 +user3 u3 str u3 - - ----- User string #3 +user4 u4 str u4 - - ----- User string #4 +user5 u5 str u5 - - ----- User string #5 +user6 u6 str u6 - - ----- User string #6 +user7 u7 str u7 - - ----- User string #7 +user8 u8 str u8 - - ----- User string #8 +user9 u9 str u9 - - ----- User string #9 +wait_tone wait str WA - - ----- wait for dial-tone +xoff_character xoffc str XF - - ----- XOFF character +xon_character xonc str XN - - ----- XON character +zero_motion zerom str Zx - - ----- No motion for subsequent character +set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch +enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode +enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode +enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode +enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode +enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode +enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode +set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6 +# +# +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +#box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/include/Caps.uwin b/include/Caps.uwin new file mode 100644 index 00000000..6efa208f --- /dev/null +++ b/include/Caps.uwin @@ -0,0 +1,1090 @@ +############################################################################## +# Copyright (c) 2001 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# Author: Thomas Dickey +# +# $Id: Caps.uwin,v 1.3 2002/07/07 00:05:00 tom Exp $ +# +# This is an adaptation of ncurses' termcap/terminfo capability table, which +# is designed to align with U/Win's terminfo. +# +# This table is used to generate initializers for tables that drive tic, +# infocmp, and the library compilation code used to support the termcap +# compatibility hack. It is also used to generate the tabular portion of the +# terminfo(5) man page; lines beginning with `#%' are passed through to become +# the terminfo table. +# +# This file has three major sections; a standard-capabilities table, two +# extension-capability tables, and a section of aliases declarations. +# The first two have the same format, as follows: +# +# FILE FORMAT +# +# Column 1: terminfo variable name +# Column 2: terminfo capability name +# Column 3: capability type (boolean, numeric, or string) +# Column 4: termcap capability name +# Column 5: KEY_xxx name, if any, `-' otherwise +# Column 6: value for KEY_xxx name, if any, `-' otherwise +# Column 7: Lead with `Y' if capability should be emitted in termcap +# translations, `-' otherwise +# Column 8: capability description +# +# The codes following [Y-] in column 7 describe the versions of termcap which +# use the given capability. This information is not used by the curses library +# proper; rather, it's there to help the terminfo maintainer avoid emitting +# termcap entry translations that are more than 1023 bytes long (and tank a +# lot of old termcap-using programs). The codes read as follows: +# B = mentioned in the BSD man page for 4.4BSD curses +# C = used by the 4.4BSD curses library +# G = mentioned in the documentation for GNU termcap +# E = used by GNU Emacs +# K = remove this terminfo capability when translating to standard format +# The important codes are C and E. A cap with C or E should be preserved in +# translation if possible. The problem is that preserving all such caps may +# lead to some termcap translations being too long. The termcap maintainer +# has a bit of a juggling act to do...potential problem cases are marked with +# an asterisk (*). +# +# The aliases section has the following format: +# +# Column 1: either `capalias' or `infoalias' +# Column 2: name to be aliased +# Column 3: what name it should translate to. The name IGNORE means it +# should be discarded with a warning message. +# Column 4: name of the extension set (used for compiler warning messages) +# Column 5: capability description (usually an associated terminfo variable) +# +# HANDLING TERMCAP AND TERMINFO EXTENSIONS +# +# There are basically five different ways to handle termcap and terminfo +# extensions: +# +# 1. Don't list the capname here, or list it but comment it out (the latter +# is preferable; someone might want to handle it in the future). If you do +# this, the capability will be treated as unknown and raise a warning from +# the compiler. +# +# 2. Alias it. This is appropriate if the capability has the same meaning +# as an already-supported one. The compiler will handle aliasing, emitting +# an appropriate informational message whenever an alias fires. +# +# 3. List it in the standard table. You almost certainly do *not* want +# to do this -- the capabilities in that one, and their order, have been +# carefully chosen to be SVr4-binary-compatible when they're written out +# as a terminfo object, and breaking this would be bad. It's up the ncurses +# library what to do with the terminfo data after it's read in. +# +# 4. List it in the aliases table with an IGNORE target field. If you +# do this, the capability will be ignored on input (though the user will +# get a warning message about it). +# +# 5. List it in the extensions table. If you do this, the compiler will +# silently accept the capability, but the curses library proper will never +# see it (because it won't be written out as part of the terminfo object +# format). It's up to you what you have the compiler do with it. +# +# There are two opposite reasons to choose option 5. One is when you want +# to eat the capability silently and discard it when doing translations +# to terminfo with tic -I. Some very old obsolete BSD caps like :kn: are +# in this class. Nothing will ever use them again. +# +# More usually, you want the compiler to try to deduce something from the +# capability value that it can use to translate it into your output format. +# You'll need to write custom code, probably in postprocess_termcap() or +# postprocess_terminfo(), to handle the translation. +# +# CONTROLLING ENTRY LENGTH +# +# Notes on specific elisions made to fit translations within 1023 bytes: +# +# Machines with IBM PC-like keyboards want to be able to define the following +# keys: key_npage, key_ppage, key_home, key_ll (which is used for in termcap- +# only environments for End or Home-Down), key_dc, and key_ic. This is also +# the set of keys the `joe' editor will be upset if it can't see. So don't +# trim those out of the set to be translated to termcap, or various users of +# the termcap file will become irate. +# +# It might look tempting to leave those long init strings out of translations. +# We can't do it (yet); 4.4BSD tput and tset use them. +# +# We retain the sgr capability in translation in spite of the fact that neither +# 4.4BSD nor GNU Emacs uses it, because (a) some entry naming distinctions are +# hard to understand without it, and (b) the entries in which it is long tend +# to be older types that don't use up a lot of string space on function keys. +# The tic(1) translation code will complain and elide it if it makes a critical +# difference (there is special code in tic to recognize this situation). +# +# Yes, BSD tset(1) uses hpa. We elide hpa/vpa anyway because the motion +# optimizer in BSD curses didn't use them. This omission seems to be the +# single most effective one, it shortened the resolved length of all thirteen +# problem entries in the 9.9.0 version of the terminfo master below critical. +# +# It would be nice to keep f11 and f12 for Emacs use, but a couple of termcap +# translations go back over critical if we do this. As 4.4BSD curses fades +# into history and GNU termcap's application base shrinks towards being GNU +# Emacs only, we'll probably elide out some BSD-only capabilities in order +# to buy space for non-essentials Emacs is still using. Capabilities high +# on that hit list: rc, sc, uc. +# +############################################################################# +# +# STANDARD CAPABILITIES +# +#%The following is a complete table of the capabilities included in a +#%terminfo description block and available to terminfo-using code. In each +#%line of the table, +#% +#%The \fBvariable\fR is the name by which the programmer (at the terminfo level) +#%accesses the capability. +#% +#%The \fBcapname\fR is the short name used in the text of the database, +#%and is used by a person updating the database. +#%Whenever possible, capnames are chosen to be the same as or similar to +#%the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses +#%identical or very similar names). Semantics are also intended to match +#%those of the specification. +#% +#%The termcap code is the old +#%.B termcap +#%capability name (some capabilities are new, and have names which termcap +#%did not originate). +#%.P +#%Capability names have no hard length limit, but an informal limit of 5 +#%characters has been adopted to keep them short and to allow the tabs in +#%the source file +#%.B Caps +#%to line up nicely. +#% +#%Finally, the description field attempts to convey the semantics of the +#%capability. You may find some codes in the description field: +#%.TP +#%(P) +#%indicates that padding may be specified +#%.TP +#%#[1-9] +#%in the description field indicates that the string is passed through tparm with +#%parms as given (#\fIi\fP). +#%.TP +#%(P*) +#%indicates that padding may vary in proportion to the number of +#%lines affected +#%.TP +#%(#\d\fIi\fP\u) +#%indicates the \fIi\fP\uth\d parameter. +#% +#%.PP +#% These are the boolean capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBBooleans name Code\fR +auto_left_margin bw bool bw - - YB-G- cub1 wraps from column 0 to last column +auto_right_margin am bool am - - YBCGE terminal has automatic margins +no_esc_ctlc xsb bool xb - - YBCG- beehive (f1=escape, f2=ctrl C) +ceol_standout_glitch xhp bool xs - - YBCGE standout not erased by overwriting (hp) +eat_newline_glitch xenl bool xn - - YBCGE newline ignored after 80 cols (concept) +erase_overstrike eo bool eo - - YBCG- can erase overstrikes with a blank +generic_type gn bool gn - - YB-G- generic line type +hard_copy hc bool hc - - YBCG- hardcopy terminal +has_meta_key km bool km - - YB-GE Has a meta key (i.e., sets 8th-bit) +has_status_line hs bool hs - - YB-G- has extra status line +insert_null_glitch in bool in - - YBCGE insert mode distinguishes nulls +memory_above da bool da - - YBCG- display may be retained above the screen +memory_below db bool db - - YB-GE display may be retained below the screen +move_insert_mode mir bool mi - - YBCGE safe to move while in insert mode +move_standout_mode msgr bool ms - - YBCGE safe to move while in standout mode +over_strike os bool os - - YBCG- terminal can overstrike +status_line_esc_ok eslok bool es - - YB-G- escape can be used on the status line +dest_tabs_magic_smso xt bool xt - - YBCGE tabs destructive, magic so char (t1061) +tilde_glitch hz bool hz - - YB-GE cannot print ~'s (hazeltine) +transparent_underline ul bool ul - - YBCGE underline character overstrikes +xon_xoff xon bool xo - - YB--- terminal uses xon/xoff handshaking +needs_xon_xoff nxon bool nx - - ----- padding will not work, xon/xoff required +prtr_silent mc5i bool 5i - - ----- printer will not echo on screen +hard_cursor chts bool HC - - ----- cursor is hard to see +non_rev_rmcup nrrmc bool NR - - ----- smcup does not reverse rmcup +no_pad_char npc bool NP - - ----- pad character does not exist +non_dest_scroll_region ndscr bool ND - - ----- scrolling region is non-destructive +back_color_erase bce bool ut - - ----- screen erased with background color +can_change ccc bool cc - - ----- terminal can re-define existing colors +hue_lightness_saturation hls bool hl - - ----- terminal uses only HLS color notation (Tektronix) +#%.TE +#%.ad +#% +#%These are the numeric capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBNumeric name Code\fR +columns cols num co - - YBCGE number of columns in a line +init_tabs it num it - - YB-G- tabs initially every # spaces +lines lines num li - - YBCGE number of lines on screen or page +lines_of_memory lm num lm - - YB-G- lines of memory if > line. 0 means varies +magic_cookie_glitch xmc num sg - - YBCGE number of blank characters left by smso or rmso +padding_baud_rate pb num pb - - YB-GE lowest baud rate where padding needed +virtual_terminal vt num vt - - YB--- virtual terminal number (CB/unix) +width_status_line wsl num ws - - YB-G- number of columns in status line +num_labels nlab num Nl - - ----- number of labels on screen +label_height lh num lh - - ----- rows in each label +label_width lw num lw - - ----- columns in each label +buttons btns num BT - - ----- number of buttons on mouse +#max_attributes ma num ma - - YBC-- maximum combined attributes terminal can handle +#maximum_windows wnum num MW - - ----- maximum number of defineable windows +# These came in with SVr4's color support +max_colors colors num Co - - ----- maximum number of colors on screen +max_pairs pairs num pa - - ----- maximum number of color-pairs on the screen +no_color_video ncv num NC - - ----- video attributes that cannot be used with colors +#%.TE +#%.ad +#% +#%The following numeric capabilities are present in the SVr4.0 term structure, +#%but are not yet documented in the man page. They came in with SVr4's +#%printer support. +#% +#%.na +#% +#%These are the string capabilities: +#% +#%.na +#%.TS H +#%center expand; +#%c l l c +#%c l l c +#%lw25 lw6 lw2 lw20. +#%\fBVariable Cap- TCap Description\fR +#%\fBString name Code\fR +back_tab cbt str bt - - YBCGE back tab (P) +bell bel str bl - - YB-GE audible signal (bell) (P) +carriage_return cr str cr - - YBCGE carriage return (P*) (P*) +change_scroll_region csr str cs - - YBCGE change region to line #1 to line #2 (P) +clear_all_tabs tbc str ct - - YB-G- clear all tab stops (P) +clear_screen clear str cl - - YBCGE clear screen and home cursor (P*) +clr_eol el str ce - - YBCGE clear to end of line (P) +clr_eos ed str cd - - YBCGE clear to end of screen (P*) +column_address hpa str ch - - -B-GE* horizontal position #1, absolute (P) +command_character cmdch str CC - - YB-G- terminal settable cmd character in prototype !? +cursor_address cup str cm - - YBCGE move to row #1 columns #2 +cursor_down cud1 str do - - YBCGE down one line +cursor_home home str ho - - YBCGE home cursor (if no cup) +cursor_invisible civis str vi - - YB-G- make cursor invisible +cursor_left cub1 str le - - YBCGE move left one space +cursor_mem_address mrcup str CM - - YB-G- memory relative cursor addressing, move to row #1 columns #2 +cursor_normal cnorm str ve - - YBCGE make cursor appear normal (undo civis/cvvis) +cursor_right cuf1 str nd - - YBCGE non-destructive space (move right one space) +cursor_to_ll ll str ll - - YBCGE last line, first column (if no cup) +cursor_up cuu1 str up - - YBCGE up one line +cursor_visible cvvis str vs - - YBCGE make cursor very visible +delete_character dch1 str dc - - YBCGE delete character (P*) +delete_line dl1 str dl - - YBCGE delete line (P*) +dis_status_line dsl str ds - - YB-G- disable status line +down_half_line hd str hd - - YB-G- half a line down +enter_alt_charset_mode smacs str as - - YB-G- start alternate character set (P) +enter_blink_mode blink str mb - - YB-G- turn on blinking +enter_bold_mode bold str md - - YB-G- turn on bold (extra bright) mode +enter_ca_mode smcup str ti - - YBCGE string to start programs using cup +enter_delete_mode smdc str dm - - YBCGE enter delete mode +enter_dim_mode dim str mh - - YB-G- turn on half-bright mode +enter_insert_mode smir str im - - YBCGE enter insert mode +enter_secure_mode invis str mk - - -B-G-* turn on blank mode (characters invisible) +enter_protected_mode prot str mp - - -B-G-* turn on protected mode +enter_reverse_mode rev str mr - - YB-G- turn on reverse video mode +enter_standout_mode smso str so - - YBCGE begin standout mode +enter_underline_mode smul str us - - YBCGE begin underline mode +erase_chars ech str ec - - YB-G- erase #1 characters (P) +exit_alt_charset_mode rmacs str ae - - YB-G- end alternate character set (P) +exit_attribute_mode sgr0 str me - - YB-GE turn off all attributes +exit_ca_mode rmcup str te - - YBCGE strings to end programs using cup +exit_delete_mode rmdc str ed - - YBCGE end delete mode +exit_insert_mode rmir str ei - - YBCGE exit insert mode +exit_standout_mode rmso str se - - YBCGE exit standout mode +exit_underline_mode rmul str ue - - YBCGE exit underline mode +flash_screen flash str vb - - YBCGE visible bell (may not move cursor) +form_feed ff str ff - - YB-G- hardcopy terminal page eject (P*) +from_status_line fsl str fs - - YB-G- return from status line +init_1string is1 str i1 - - YB-G- initialization string +init_2string is2 str is - - YB-G- initialization string +init_3string is3 str i3 - - YB-G- initialization string +init_file if str if - - YB-G- name of initialization file +insert_character ich1 str ic - - YBCGE insert character (P) +insert_line il1 str al - - YBCGE insert line (P*) +insert_padding ip str ip - - YBCGE insert padding after inserted character +key_backspace kbs str kb KEY_BACKSPACE 0407 YB-G- backspace key +key_catab ktbc str ka KEY_CATAB 0526 -B-G-* clear-all-tabs key +key_clear kclr str kC KEY_CLEAR 0515 -B-G-* clear-screen or erase key +key_ctab kctab str kt KEY_CTAB 0525 -B-G-* clear-tab key +key_dc kdch1 str kD KEY_DC 0512 YB-G- delete-character key +key_dl kdl1 str kL KEY_DL 0510 -B-G-* delete-line key +key_down kcud1 str kd KEY_DOWN 0402 YBCGE down-arrow key +key_eic krmir str kM KEY_EIC 0514 -B-G-* sent by rmir or smir in insert mode +key_eol kel str kE KEY_EOL 0517 -B-G-* clear-to-end-of-line key +key_eos ked str kS KEY_EOS 0516 -B-G-* clear-to-end-of-screen key +key_f0 kf0 str k0 KEY_F(0) 0410 YBCGE F0 function key +key_f1 kf1 str k1 KEY_F(1) - YBCGE F1 function key +key_f10 kf10 str k; KEY_F(10) - ----E F10 function key +key_f2 kf2 str k2 KEY_F(2) - YBCGE F2 function key +key_f3 kf3 str k3 KEY_F(3) - YBCGE F3 function key +key_f4 kf4 str k4 KEY_F(4) - YBCGE F4 function key +key_f5 kf5 str k5 KEY_F(5) - YBCGE F5 function key +key_f6 kf6 str k6 KEY_F(6) - YBCGE F6 function key +key_f7 kf7 str k7 KEY_F(7) - YBCGE F7 function key +key_f8 kf8 str k8 KEY_F(8) - YBCGE F8 function key +key_f9 kf9 str k9 KEY_F(9) - YBCGE F9 function key +key_home khome str kh KEY_HOME 0406 YBCGE home key +key_ic kich1 str kI KEY_IC 0513 YB-GE insert-character key +key_il kil1 str kA KEY_IL 0511 -B-G-* insert-line key +key_left kcub1 str kl KEY_LEFT 0404 YBCGE left-arrow key +key_ll kll str kH KEY_LL 0533 YB-G- lower-left key (home down) +key_npage knp str kN KEY_NPAGE 0522 YB-GE next-page key +key_ppage kpp str kP KEY_PPAGE 0523 YB-GE previous-page key +key_right kcuf1 str kr KEY_RIGHT 0405 YBCGE right-arrow key +key_sf kind str kF KEY_SF 0520 -B-G-* scroll-forward key +key_sr kri str kR KEY_SR 0521 -B-G-* scroll-backward key +key_stab khts str kT KEY_STAB 0524 -B-G-* set-tab key +key_up kcuu1 str ku KEY_UP 0403 YBCGE up-arrow key +keypad_local rmkx str ke - - YBCGE leave 'keyboard_transmit' mode +keypad_xmit smkx str ks - - YBCGE enter 'keyboard_transmit' mode +lab_f0 lf0 str l0 - - -B-G-* label on function key f0 if not f0 +lab_f1 lf1 str l1 - - -B-G-* label on function key f1 if not f1 +lab_f10 lf10 str la - - ----- label on function key f10 if not f10 +lab_f2 lf2 str l2 - - -B-G-* label on function key f2 if not f2 +lab_f3 lf3 str l3 - - -B-G-* label on function key f3 if not f3 +lab_f4 lf4 str l4 - - -B-G-* label on function key f4 if not f4 +lab_f5 lf5 str l5 - - -B-G-* label on function key f5 if not f5 +lab_f6 lf6 str l6 - - -B-G-* label on function key f6 if not f6 +lab_f7 lf7 str l7 - - -B-G-* label on function key f7 if not f7 +lab_f8 lf8 str l8 - - -B-G-* label on function key f8 if not f8 +lab_f9 lf9 str l9 - - -B-G-* label on function key f9 if not f9 +meta_off rmm str mo - - YB-G-* turn off meta mode +meta_on smm str mm - - YB-G-* turn on meta mode (8th-bit on) +newline nel str nw - - YB-G-* newline (behave like cr followed by lf) +pad_char pad str pc - - YBCGE padding char (instead of null) +parm_dch dch str DC - - YB-GE delete #1 characters (P*) +parm_delete_line dl str DL - - YBCGE delete #1 lines (P*) +parm_down_cursor cud str DO - - YBCGE down #1 lines (P*) +parm_ich ich str IC - - YB-GE insert #1 characters (P*) +parm_index indn str SF - - YBCG- scroll forward #1 lines (P) +parm_insert_line il str AL - - YBCGE insert #1 lines (P*) +parm_left_cursor cub str LE - - YBCGE move #1 characters to the left (P) +parm_right_cursor cuf str RI - - YBCGE move #1 characters to the right (P*) +parm_rindex rin str SR - - YBCG- scroll back #1 lines (P) +parm_up_cursor cuu str UP - - YBCGE up #1 lines (P*) +pkey_key pfkey str pk - - -B--- program function key #1 to type string #2 +pkey_local pfloc str pl - - -B--- program function key #1 to execute string #2 +pkey_xmit pfx str px - - -B--- program function key #1 to transmit string #2 +print_screen mc0 str ps - - -B-G-* print contents of screen +prtr_off mc4 str pf - - -B-G-* turn off printer +prtr_on mc5 str po - - -B-G-* turn on printer +repeat_char rep str rp - - YB-GE repeat char #1 #2 times (P*) +reset_1string rs1 str r1 - - -B--- reset string +reset_2string rs2 str r2 - - -B--- reset string +reset_3string rs3 str r3 - - -B--- reset string +reset_file rf str rf - - -B--- name of reset file +restore_cursor rc str rc - - YBCG- restore cursor to position of last save_cursor +row_address vpa str cv - - -B-GE* vertical position #1 absolute (P) +save_cursor sc str sc - - YBCG- save current cursor position (P) +scroll_forward ind str sf - - YBCGE scroll text up (P) +scroll_reverse ri str sr - - YBCGE scroll text down (P) +set_attributes sgr str sa - - YB-G- define video attributes #1-#9 (PG9) +set_tab hts str st - - YB-G- set a tab in every row, current columns +set_window wind str wi - - -B-GE current window is lines #1-#2 cols #3-#4 +tab ht str ta - - YBCGE tab to next 8-space hardware tab stop +to_status_line tsl str ts - - YB-G- move to status line, column #1 +underline_char uc str uc - - YBCG- underline char and move past it +up_half_line hu str hu - - YB-G- half a line up +init_prog iprog str iP - - -B--- path name of program for initialization +key_a1 ka1 str K1 KEY_A1 0534 YB-GE upper left of keypad +key_a3 ka3 str K3 KEY_A3 0535 YB-GE upper right of keypad +key_b2 kb2 str K2 KEY_B2 0536 YB-GE center of keypad +key_c1 kc1 str K4 KEY_C1 0537 YB-GE lower left of keypad +key_c3 kc3 str K5 KEY_C3 0540 YB-GE lower right of keypad +prtr_non mc5p str pO - - -B-G-* turn on printer for #1 bytes +# +# SVr1 capabilities stop here. IBM's version of terminfo is the same as +# SVr4 up to this point, but has a different set afterwards. +# +char_padding rmp str rP - - ----- like ip but when in insert mode +acs_chars acsc str ac - - ----- graphics charset pairs, based on vt100 +plab_norm pln str pn - - ----- program label #1 to show string #2 +key_btab kcbt str kB KEY_BTAB 0541 ----- back-tab key +enter_xon_mode smxon str SX - - ----- turn on xon/xoff handshaking +exit_xon_mode rmxon str RX - - ----- turn off xon/xoff handshaking +enter_am_mode smam str SA - - ----- turn on automatic margins +exit_am_mode rmam str RA - - ----- turn off automatic margins +xon_character xonc str XN - - ----- XON character +xoff_character xoffc str XF - - ----- XOFF character +ena_acs enacs str eA - - ----- enable alternate char set +label_on smln str LO - - ----- turn on soft labels +label_off rmln str LF - - ----- turn off soft labels +key_beg kbeg str @1 KEY_BEG 0542 ----- begin key +key_cancel kcan str @2 KEY_CANCEL 0543 ----- cancel key +key_close kclo str @3 KEY_CLOSE 0544 ----- close key +key_command kcmd str @4 KEY_COMMAND 0545 ----- command key +key_copy kcpy str @5 KEY_COPY 0546 ----- copy key +key_create kcrt str @6 KEY_CREATE 0547 ----- create key +key_end kend str @7 KEY_END 0550 ----- end key +key_enter kent str @8 KEY_ENTER 0527 ----- enter/send key +key_exit kext str @9 KEY_EXIT 0551 ----- exit key +key_find kfnd str @0 KEY_FIND 0552 ----- find key +key_help khlp str %1 KEY_HELP 0553 ----- help key +key_mark kmrk str %2 KEY_MARK 0554 ----- mark key +key_message kmsg str %3 KEY_MESSAGE 0555 ----- message key +key_move kmov str %4 KEY_MOVE 0556 ----- move key +key_next knxt str %5 KEY_NEXT 0557 ----- next key +key_open kopn str %6 KEY_OPEN 0560 ----- open key +key_options kopt str %7 KEY_OPTIONS 0561 ----- options key +key_previous kprv str %8 KEY_PREVIOUS 0562 ----- previous key +key_print kprt str %9 KEY_PRINT 0532 ----- print key +key_redo krdo str %0 KEY_REDO 0563 ----- redo key +key_reference kref str &1 KEY_REFERENCE 0564 ----- reference key +key_refresh krfr str &2 KEY_REFRESH 0565 ----- refresh key +key_replace krpl str &3 KEY_REPLACE 0566 ----- replace key +key_restart krst str &4 KEY_RESTART 0567 ----- restart key +key_resume kres str &5 KEY_RESUME 0570 ----- resume key +key_save ksav str &6 KEY_SAVE 0571 ----- save key +key_suspend kspd str &7 KEY_SUSPEND 0627 ----- suspend key +key_undo kund str &8 KEY_UNDO 0630 ----- undo key +key_sbeg kBEG str &9 KEY_SBEG 0572 ----- shifted begin key +key_scancel kCAN str &0 KEY_SCANCEL 0573 ----- shifted cancel key +key_scommand kCMD str *1 KEY_SCOMMAND 0574 ----- shifted command key +key_scopy kCPY str *2 KEY_SCOPY 0575 ----- shifted copy key +key_screate kCRT str *3 KEY_SCREATE 0576 ----- shifted create key +key_sdc kDC str *4 KEY_SDC 0577 ----- shifted delete-character key +key_sdl kDL str *5 KEY_SDL 0600 ----- shifted delete-line key +key_select kslt str *6 KEY_SELECT 0601 ----- select key +key_send kEND str *7 KEY_SEND 0602 ----- shifted end key +key_seol kEOL str *8 KEY_SEOL 0603 ----- shifted clear-to-end-of-line key +key_sexit kEXT str *9 KEY_SEXIT 0604 ----- shifted exit key +key_sfind kFND str *0 KEY_SFIND 0605 ----- shifted find key +key_shelp kHLP str #1 KEY_SHELP 0606 ----- shifted help key +key_shome kHOM str #2 KEY_SHOME 0607 ----- shifted home key +key_sic kIC str #3 KEY_SIC 0610 ----- shifted insert-character key +key_sleft kLFT str #4 KEY_SLEFT 0611 ----- shifted left-arrow key +key_smessage kMSG str %a KEY_SMESSAGE 0612 ----- shifted message key +key_smove kMOV str %b KEY_SMOVE 0613 ----- shifted move key +key_snext kNXT str %c KEY_SNEXT 0614 ----- shifted next key +key_soptions kOPT str %d KEY_SOPTIONS 0615 ----- shifted options key +key_sprevious kPRV str %e KEY_SPREVIOUS 0616 ----- shifted previous key +key_sprint kPRT str %f KEY_SPRINT 0617 ----- shifted print key +key_sredo kRDO str %g KEY_SREDO 0620 ----- shifted redo key +key_sreplace kRPL str %h KEY_SREPLACE 0621 ----- shifted replace key +key_sright kRIT str %i KEY_SRIGHT 0622 ----- shifted right-arrow key +key_srsume kRES str %j KEY_SRSUME 0623 ----- shifted resume key +key_ssave kSAV str !1 KEY_SSAVE 0624 ----- shifted save key +key_ssuspend kSPD str !2 KEY_SSUSPEND 0625 ----- shifted suspend key +key_sundo kUND str !3 KEY_SUNDO 0626 ----- shifted undo key +req_for_input rfi str RF - - ----- send next input char (for ptys) +key_f11 kf11 str F1 KEY_F(11) - ----E F11 function key +key_f12 kf12 str F2 KEY_F(12) - ----E F12 function key +key_f13 kf13 str F3 KEY_F(13) - ----E F13 function key +key_f14 kf14 str F4 KEY_F(14) - ----E F14 function key +key_f15 kf15 str F5 KEY_F(15) - ----E F15 function key +key_f16 kf16 str F6 KEY_F(16) - ----E F16 function key +key_f17 kf17 str F7 KEY_F(17) - ----E F17 function key +key_f18 kf18 str F8 KEY_F(18) - ----E F18 function key +key_f19 kf19 str F9 KEY_F(19) - ----E F19 function key +key_f20 kf20 str FA KEY_F(20) - ----E F20 function key +key_f21 kf21 str FB KEY_F(21) - ----E F21 function key +key_f22 kf22 str FC KEY_F(22) - ----E F22 function key +key_f23 kf23 str FD KEY_F(23) - ----E F23 function key +key_f24 kf24 str FE KEY_F(24) - ----E F24 function key +key_f25 kf25 str FF KEY_F(25) - ----E F25 function key +key_f26 kf26 str FG KEY_F(26) - ----E F26 function key +key_f27 kf27 str FH KEY_F(27) - ----E F27 function key +key_f28 kf28 str FI KEY_F(28) - ----E F28 function key +key_f29 kf29 str FJ KEY_F(29) - ----E F29 function key +key_f30 kf30 str FK KEY_F(30) - ----E F30 function key +key_f31 kf31 str FL KEY_F(31) - ----E F31 function key +key_f32 kf32 str FM KEY_F(32) - ----E F32 function key +key_f33 kf33 str FN KEY_F(33) - ----E F33 function key +key_f34 kf34 str FO KEY_F(34) - ----E F34 function key +key_f35 kf35 str FP KEY_F(35) - ----E F35 function key +key_f36 kf36 str FQ KEY_F(36) - ----E F36 function key +key_f37 kf37 str FR KEY_F(37) - ----E F37 function key +key_f38 kf38 str FS KEY_F(38) - ----E F38 function key +key_f39 kf39 str FT KEY_F(39) - ----E F39 function key +key_f40 kf40 str FU KEY_F(40) - ----E F40 function key +key_f41 kf41 str FV KEY_F(41) - ----E F41 function key +key_f42 kf42 str FW KEY_F(42) - ----E F42 function key +key_f43 kf43 str FX KEY_F(43) - ----E F43 function key +key_f44 kf44 str FY KEY_F(44) - ----E F44 function key +key_f45 kf45 str FZ KEY_F(45) - ----E F45 function key +key_f46 kf46 str Fa KEY_F(46) - ----E F46 function key +key_f47 kf47 str Fb KEY_F(47) - ----E F47 function key +key_f48 kf48 str Fc KEY_F(48) - ----E F48 function key +key_f49 kf49 str Fd KEY_F(49) - ----E F49 function key +key_f50 kf50 str Fe KEY_F(50) - ----E F50 function key +key_f51 kf51 str Ff KEY_F(51) - ----E F51 function key +key_f52 kf52 str Fg KEY_F(52) - ----E F52 function key +key_f53 kf53 str Fh KEY_F(53) - ----E F53 function key +key_f54 kf54 str Fi KEY_F(54) - ----E F54 function key +key_f55 kf55 str Fj KEY_F(55) - ----E F55 function key +key_f56 kf56 str Fk KEY_F(56) - ----E F56 function key +key_f57 kf57 str Fl KEY_F(57) - ----E F57 function key +key_f58 kf58 str Fm KEY_F(58) - ----E F58 function key +key_f59 kf59 str Fn KEY_F(59) - ----E F59 function key +key_f60 kf60 str Fo KEY_F(60) - ----E F60 function key +key_f61 kf61 str Fp KEY_F(61) - ----E F61 function key +key_f62 kf62 str Fq KEY_F(62) - ----E F62 function key +key_f63 kf63 str Fr KEY_F(63) - ----E F63 function key +clr_bol el1 str cb - - ----- Clear to beginning of line +clear_margins mgc str MC - - ----- clear right and left soft margins +set_left_margin smgl str ML - - ----- set left soft margin at current column. See smgl. (ML is not in BSD termcap). +set_right_margin smgr str MR - - ----- set right soft margin at current column +device_type devt str dv - - ----- Indicate language/codeset support +code_set_init csin str ci - - ----- Init sequence for multiple codesets +set0_des_seq s0ds str s0 - - ----- Shift to codeset 0 (EUC set 0, ASCII) +set1_des_seq s1ds str s1 - - ----- Shift to codeset 1 +set2_des_seq s2ds str s2 - - ----- Shift to codeset 2 +set3_des_seq s3ds str s3 - - ----- Shift to codeset 3 +key_mouse kmous str Km KEY_MOUSE 0631 ----- Mouse event has occurred +mouse_info minfo str Mi - - ----- Mouse status information +req_mouse_pos reqmp str RQ - - ----- Request mouse position +get_mouse getm str Gm - - ----- Curses should get button events, parameter #1 not documented. +release_mouse relm str Rm - - ----- Curses should release the mouse */ +color_names colornm str Yw - - ----- Give name for color #1 +initialize_color initc str Ic - - ----- initialize color #1 to (#2,#3,#4) +initialize_pair initp str Ip - - ----- Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) +orig_colors oc str oc - - ----- Set all color pairs to the original ones +orig_pair op str op - - ----- Set default pair to its original value +set_a_background setab str AB - - ----- Set background color to #1, using ANSI escape +set_a_foreground setaf str AF - - ----- Set foreground color to #1, using ANSI escape +set_background setb str Sb - - ----- Set background color #1 +set_color_pair scp str sp - - ----- Set current color pair to #1 +set_foreground setf str Sf - - ----- Set foreground color #1 +#%.TE +#%.ad +#% +# The magic token below tells the tic compiler-generator code that all the caps +# past it should be ignored (not written out) when dumping terminfo objects. It +# also tells the man page table generator not to pass through following lines +# This means we can have obsolete capabilities and pseudo-capabilities that are +# recognized for termcap or terminfo compilation, but not output. +# +# %%-STOP-HERE-%% +# +# Don't move this casually! In fact, don't move it at all unless you're +# either doing it to add System V or XPG4 extensions, or have decided you +# don't care about SVr4 binary compatibility. +# +############################################################################# +# +# TERMCAP EXTENSION CAPABILITIES +# +# The capabilities below are either obsolete or extensions on certain systems. +# They are not used by SVR4 terminfo. Some are used by captoinfo to translate +# termcap sources; the rest are listed for completeness, and in case somebody +# cares about them enough to hack in code that will translate them into +# terminfo capabilities. +# +# The first part of the list is from Ross Ridge's `mytinfo' package +# (comp.sources.unix, volume 26); the variable names and terminfo names (as +# well as the termcap codes) match his list. +# +# This group of codes is not marked obsolete in 4.4BSD, but have no direct +# terminfo equivalents. The rs capability is specially translated to terminfo +# r2, and vice versa, if an entry does not already have an r2. Similarly, +# i2 is translated to r3 if there is no r3 (because SV terminfo maps is to i2). +# The ug capability is thrown away, but assumed to be whatever sg is if the +# latter is nonzero and we're dumping in termcap format. +# +termcap_init2 OTi2 str i2 - - YB--- secondary initialization string +termcap_reset OTrs str rs - - YB-G- terminal reset string +magic_cookie_glitch_ul OTug num ug - - YBCGE number of blanks left by ul +# +# Obsolete termcap capabilities. Some are used for termcap translation. The +# code uses the 'OT' prefix we put on obsolete capabilities to suppress +# printing them in terminfo source dumps of compiled entries. +# +backspaces_with_bs OTbs bool bs - - YBCGE uses ^H to move left +crt_no_scrolling OTns bool ns - - YBCG- crt cannot scroll +no_correctly_working_cr OTnc bool nc - - YBCG- no way to go to start of line +carriage_return_delay OTdC num dC - - YB-G- pad needed for CR +new_line_delay OTdN num dN - - YB-G- pad needed for LF +linefeed_if_not_lf OTnl str nl - - YBCGE use to move down +backspace_if_not_bs OTbc str bc - - YBCGE move left, if not ^H +# +# GNU termcap library extensions. The GNU termcap file distributed with +# Emacs no longer uses these, but MT showed up in pre-9.0 versions of the +# BSD termcap file. The name clash with terminfo MT is resolved by type +# info; MT is converted to km. +# +gnu_has_meta_key OTMT bool MT - - ----E has meta key +# gnu_tab_width OTtw num tw - - ----E tab width in spaces +# +# GNU termcap *does* include the following extended capability, Only the +# now-obsolete Ann Arbor terminals used it. +# +# gnu_change_scroll_region OTcS str cS - - ---GE alternate set scrolling region +# +# The following comments describe capnames so ancient that I believe no +# software uses them any longer. Some of these have to go because they +# clash with terminfo names in ways that cannot be resolved by type +# information. +# +# These mytinfo codes are not used in the 4.4BSD curses code. They are +# marked obsolete in the 4.4BSD manual pages. +# +# There is one conflict with terminfo; ma is in both. This conflict is +# resolved by type information. +# +# The `ko' capability is translated by special code. It should contain a +# comma-separated list of capabilities for which there are corresponding keys. +# The `kn' code is accepted but ignored. +# +# The `ma' capability seems to have been designed to map between the rogue(2) +# motion keys (including jkhl) and characters emitted by arrow keys on some +# primitive pre-ANSI terminals. It's so obsolete it's fossilized... +# +# Here is a description of memory_lock_above and memory_unlock: +# "You can 'freeze' data on the screen by turning on Memory Lock in a line of +# text. All lines above the cursor's current line become locked in place on +# the screen. Then enter data normally. When the screen fills up, any +# further data entered forces the first line of unfrozen line text to scroll +# under the frozen data. Lines scrolled off the screen are inserted into +# memory immediately preceding the first frozen line." (from the HP 700/96 +# User's manual). VT100/ANSI memory lock set is \E[>2h, reset is \E[>2l. +# +# Applications that use terminfo are supposed to behave as though xr is +# always true. +# +linefeed_is_newline OTNL bool NL - - YB--- move down with \n +# even_parity OTEP bool EP - - -B--- terminal requires even parity +# odd_parity OTOP bool OP - - -B--- terminal requires odd parity +# half_duplex OTHD bool HD - - -B--- terminal is half-duplex +# lower_case_only OTLC bool LC - - -B--- terminal has only lower case +# upper_case_only OTUC bool UC - - -B--- terminal has only upper case +backspace_delay OTdB num dB - - YB-G- padding required for ^H +# form_feed_delay OTdF num dF - - -B-G- padding required for ^L +horizontal_tab_delay OTdT num dT - - YB-G- padding required for ^I +# vertical_tab_delay OTdV num dV - - -B--- padding required for ^V +number_of_function_keys OTkn num kn - - -B-G- count of function keys +other_non_function_keys OTko str ko - - -B-G- list of self-mapped keycaps +arrow_key_map OTma str ma - - YBC-- map arrow keys rogue(1) motion keys +# memory_lock_above OTml str ml - - -B--- lock visible screen memory above the current line +# memory_unlock OTmu str mu - - -B--- unlock visible screen memory above the current line +has_hardware_tabs OTpt bool pt - - YB--- has 8-char tabs invoked with ^I +return_does_clr_eol OTxr bool xr - - YB--- return clears the line +# tek_4025_insert_line OTxx bool xx - - -BC-- Tektronix 4025 insert-line glitch +# +# mytinfo described this as a termcap capability, but it's not listed in the +# 4.4BSD man pages, and not found in the 4.4BSD termcap file. The ncurses +# package, like System V, behaves as though it is always true. +# +# rind_only_at_top OTxq bool xq - - ----- reverse index only works from top line +# +# University of Waterloo termcap extensions (as described in mytinfo). +# The `xl' termcap file clashes with a terminfo name; this ambiguity cannot +# be resolved by a type check. The descriptions are guesses from what was +# in the mytinfo tables. +# +# key_interrupt_char OTki str ki - - ----- string set by interrupt key (?) +# key_kill_char OTkk str kk - - ----- string set by kill key (?) +# key_suspend_char OTkz str kz - - ----- string set by suspend key (?) +# initialization_messy OTxc bool xc - - ----- initialization leaves garbage on the screen (?) +# ind_at_bottom_does_cr OTxl bool xl - - ----- index does a carriage return +# +# Nonstandard capabilities unique to Ross Ridge's `mytinfo' package. +# SR clashes with a terminfo name; this ambiguity cannot be resolved by a type +# check. +# +# scroll_left OTsl1 str Sl - - ----- scroll screen leftward +# scroll_right OTsr1 str Sr - - ----- scroll screen rightward +# parm_scroll_left OTsl str SL - - ----- scroll screen leftward #1 characters +# parm_scroll_right OTsr str SR - - ----- scroll screen rightward #1 characters +# +# The mytinfo capabilities end here. +# +# XENIX extensions: +# +# Xenix defined its own set of forms-drawing capabilities: +# +# cap IBM ASCII description ACS ASCII +# --- ----------- -------------------- ------------- ------ +# G1 191 \277 M-? single upper right ACS_URCORNER +# G2 218 \332 M-Z single upper left ACS_ULCORNER +# G3 192 \300 M-@ single lower left ACS_LLCORNER +# G4 217 \331 M-Y single lower right ACS_LRCORNER +# G5 187 \273 M-; double upper right +# G6 201 \311 M-I double upper left +# G7 200 \310 M-H double lower left +# G8 188 \274 M-< double lower right +# GC 197 \305 M-E single intersection ACS_PLUS _ _ +# GD 194 \302 M-B single down-tick ACS_TTEE | +# GH 196 \304 M-D single horizontal line ACS_HLINE +# GL 180 \264 M-4 single left tick ACS_RTEE -| +# GR 195 \303 M-C single right tick ACS_LTEE |- +# GU 193 \301 M-A single up tick ACS_BTEE _|_ +# GV 179 \263 M-3 single vertical line ACS_VLINE +# Gc 206 \316 M-N double intersection +# Gd 203 \313 M-K double down tick +# Gh 205 \315 M-M double horizontal line +# Gl 204 \204 M-L double left tick +# Gr 185 \271 M-9 double right tick +# Gu 202 \312 M-J double up tick +# Gv 186 \272 M-: double vertical line +# +# The compiler will translate the single-line caps and discard the others +# (via IGNORE aliases further down). We don't want to do normal pad +# translation on these, they're often single-character printable ASCII +# strings that happen to be numerics. There's awk code in parametrized.sh +# that detects the acs_ prefix and uses it to suppress pad translation. +# These terminfo names are invented. +# +acs_ulcorner OTG2 str G2 - - ----- single upper left +acs_llcorner OTG3 str G3 - - ----- single lower left +acs_urcorner OTG1 str G1 - - ----- single upper right +acs_lrcorner OTG4 str G4 - - ----- single lower right +acs_ltee OTGR str GR - - ----- tee pointing right +acs_rtee OTGL str GL - - ----- tee pointing left +acs_btee OTGU str GU - - ----- tee pointing up +acs_ttee OTGD str GD - - ----- tee pointing down +acs_hline OTGH str GH - - ----- single horizontal line +acs_vline OTGV str GV - - ----- single vertical line +acs_plus OTGC str GC - - ----- single intersection +# +############################################################################# +# +# TERMINFO EXTENSION CAPABILITIES +# +# This section is almost all comments. What it's mainly for is to describe +# what capabilities need to be squeezed out to get down to the XSI Curses +# standard set. They are flagged with K. +# +# HP extensions +# +# These extensions follow ptr_non (replacing everything after it) in HP +# terminfo files. Except for memory_lock and memory_unlock, they are +# functionally identical to SVr4 extensions, but they make the binary format +# different. Grrr.... +# +memory_lock meml str ml - - ----K memory lock above +memory_unlock memu str mu - - ----K memory unlock +#plab_norm pln str pn - - ----- program label #1 to show string #2 +#label_on smln str LO - - ----- turn on soft labels +#label_off rmln str LF - - ----- turn off soft labels +#key_f11 kf11 str F1 - - ----- F11 function key +#key_f12 kf12 str F2 - - ----- F12 function key +#key_f13 kf13 str F3 - - ----- F13 function key +#key_f14 kf14 str F4 - - ----- F14 function key +#key_f15 kf15 str F5 - - ----- F15 function key +#key_f16 kf16 str F6 - - ----- F16 function key +#key_f17 kf17 str F7 - - ----- F17 function key +#key_f18 kf18 str F8 - - ----- F18 function key +#key_f19 kf19 str F9 - - ----- F19 function key +#key_f20 kf20 str FA - - ----- F20 function key +#key_f21 kf21 str FB - - ----- F21 function key +#key_f22 kf22 str FC - - ----- F22 function key +#key_f23 kf23 str FD - - ----- F23 function key +#key_f24 kf24 str FE - - ----- F24 function key +#key_f25 kf25 str FF - - ----- F25 function key +#key_f26 kf26 str FG - - ----- F26 function key +#key_f27 kf27 str FH - - ----- F27 function key +#key_f28 kf28 str FI - - ----- F28 function key +#key_f29 kf29 str FJ - - ----- F29 function key +#key_f30 kf30 str FK - - ----- F30 function key +#key_f31 kf31 str FL - - ----- F31 function key +#key_f32 kf32 str FM - - ----- F32 function key +#key_f33 kf33 str FN - - ----- F33 function key +#key_f34 kf34 str FO - - ----- F34 function key +#key_f35 kf35 str FP - - ----- F35 function key +#key_f36 kf36 str FQ - - ----- F36 function key +#key_f37 kf37 str FR - - ----- F37 function key +#key_f38 kf38 str FS - - ----- F38 function key +#key_f39 kf39 str FT - - ----- F39 function key +#key_f40 kf40 str FU - - ----- F40 function key +#key_f41 kf41 str FV - - ----- F41 function key +#key_f42 kf42 str FW - - ----- F42 function key +#key_f43 kf43 str FX - - ----- F43 function key +#key_f44 kf44 str FY - - ----- F44 function key +#key_f45 kf45 str FZ - - ----- F45 function key +#key_f46 kf46 str Fa - - ----- F46 function key +#key_f47 kf47 str Fb - - ----- F47 function key +#key_f48 kf48 str Fc - - ----- F48 function key +#key_f49 kf49 str Fd - - ----- F49 function key +#key_f50 kf50 str Fe - - ----- F50 function key +#key_f51 kf51 str Ff - - ----- F51 function key +#key_f52 kf52 str Fg - - ----- F52 function key +#key_f53 kf53 str Fh - - ----- F53 function key +#key_f54 kf54 str Fi - - ----- F54 function key +#key_f55 kf55 str Fj - - ----- F55 function key +#key_f56 kf56 str Fk - - ----- F56 function key +#key_f57 kf57 str Fl - - ----- F57 function key +#key_f58 kf58 str Fm - - ----- F58 function key +#key_f59 kf59 str Fn - - ----- F59 function key +#key_f60 kf60 str Fo - - ----- F60 function key +#key_f61 kf61 str Fp - - ----- F61 function key +#key_f62 kf62 str Fq - - ----- F62 function key +#key_f63 kf63 str Fr - - ----- F63 function key +# +# IBM extensions +# +# These extensions follow ptr_non (replacing everything after it) in IBM +# terminfo files. +# +# The places in the box[12] capabilities correspond to acsc characters, here is +# the mapping: +# +# box1[0] = ACS_ULCORNER +# box1[1] = ACS_HLINE +# box1[2] = ACS_URCORNER +# box1[3] = ACS_VLINE +# box1[4] = ACS_LRCORNER +# box1[5] = ACS_LLCORNER +# box1[6] = ACS_TTEE +# box1[7] = ACS_RTEE +# box1[8] = ACS_BTEE +# box1[9] = ACS_LTEE +# box1[10] = ACS_PLUS +# +# The box2 characters are the double-line versions of these forms graphics. +# +box_chars_1 box1 str bx - - ----K box characters primary set +#box_chars_2 box2 str by - - ----K box characters secondary set +#box_attr_1 batt1 str Bx - - ----K attributes for box1 +#box_attr_2 batt2 str By - - ----K attributes for box2 +#color_bg_0 colb0 str d0 - - ----K background color 0 +#color_bg_1 colb1 str d1 - - ----K background color 1 +#color_bg_2 colb2 str d2 - - ----K background color 2 +#color_bg_3 colb3 str d3 - - ----K background color 3 +#color_bg_4 colb4 str d4 - - ----K background color 4 +#color_bg_5 colb5 str d5 - - ----K background color 5 +#color_bg_6 colb6 str d6 - - ----K background color 6 +#color_bg_7 colb7 str d7 - - ----K background color 7 +#color_fg_0 colf0 str c0 - - ----K foreground color 0 +#color_fg_1 colf1 str c1 - - ----K foreground color 1 +#color_fg_2 colf2 str c2 - - ----K foreground color 2 +#color_fg_3 colf3 str c3 - - ----K foreground color 3 +#color_fg_4 colf4 str c4 - - ----K foreground color 4 +#color_fg_5 colf5 str c5 - - ----K foreground color 5 +#color_fg_6 colf6 str c6 - - ----K foreground color 6 +#color_fg_7 colf7 str c7 - - ----K foreground color 7 +#font_0 font0 str f0 - - ----- select font 0 +#font_1 font1 str f1 - - ----- select font 1 +#font_2 font2 str f2 - - ----- select font 2 +#font_3 font3 str f3 - - ----- select font 3 +#font_4 font4 str f4 - - ----K select font 4 +#font_5 font5 str f5 - - ----K select font 5 +#font_6 font6 str f6 - - ----K select font 6 +#font_7 font7 str f7 - - ----K select font 7 +#key_back_tab kbtab str k0 - - ----- backtab key +#key_do kdo str ki - - ----K do request key +#key_command kcmd str kd - - ----K command-request key +#key_command_pane kcpn str kW - - ----K command-pane key +#key_end kend str kw - - ----- end key +#key_help khlp str kq - - ----- help key +#key_newline knl str nl - - ----K newline key +#key_next_pane knpn str kv - - ----K next-pane key +#key_prev_cmd kppn str kp - - ----K previous-command key +#key_prev_pane kppn str kV - - ----K previous-pane key +#key_quit kquit str kQ - - ----K quit key +#key_select ksel str kU - - ----- select key +#key_scroll_left kscl str kz - - ----K scroll left +#key_scroll_right kscr str kZ - - ----K scroll right +#key_tab ktab str ko - - ----K tab key +#key_smap_in1 kmpf1 str Kv - - ----K special mapped key 1 input +#key_smap_out1 kmpt1 str KV - - ----K special mapped key 1 output +#key_smap_in2 kmpf2 str Kw - - ----K special mapped key 2 input +#key_smap_out2 kmpt2 str KW - - ----K special mapped key 2 output +#key_smap_in3 kmpf3 str Kx - - ----K special mapped key 3 input +#key_smap_out3 kmpt3 str KX - - ----K special mapped key 3 output +#key_smap_in4 kmpf4 str Ky - - ----K special mapped key 4 input +#key_smap_out4 kmpt4 str KY - - ----K special mapped key 4 output +#key_smap_in5 kmpf5 str Kz - - ----K special mapped key 5 input +#key_smap_out5 kmpt5 str KZ - - ----K special mapped key 5 output +#appl_defined_str apstr str za - - ----K application-defined string +# The key_smap_in[6789] and key_smap_out[6789] capabilities aren't described in +# the IBM manual pages, so the cap name strings are guesses. The terminfo +# names are almost certainly right, the termcap ones almost certainly wrong. +#key_smap_in6 kmpf6 str k! - - ----K special mapped key 6 input +#key_smap_out6 kmpt6 str K@ - - ----K special mapped key 6 output +#key_smap_in7 kmpf7 str k# - - ----K special mapped key 7 input +#key_smap_out7 kmpt7 str K$ - - ----K special mapped key 7 output +#key_smap_in8 kmpf8 str k% - - ----K special mapped key 8 input +#key_smap_out8 kmpt8 str K^ - - ----K special mapped key 8 output +#key_smap_in9 kmpf9 str k& - - ----K special mapped key 9 input +#key_smap_out9 kmpt9 str K* - - ----K special mapped key 9 output +# Undocumented capabilities end here +#key_sf1 ksf1 str S1 - - ----K special function key 1 +#key_sf2 ksf2 str S2 - - ----K special function key 2 +#key_sf3 ksf3 str S3 - - ----K special function key 3 +#key_sf4 ksf4 str S4 - - ----K special function key 4 +#key_sf5 ksf5 str S5 - - ----K special function key 5 +#key_sf6 ksf6 str S6 - - ----K special function key 6 +#key_sf7 ksf7 str S7 - - ----K special function key 7 +#key_sf8 ksf8 str S8 - - ----K special function key 8 +#key_sf9 ksf9 str S9 - - ----K special function key 9 +#key_sf10 ksf10 str SA - - ----K special function key 10 +# AIX version 3 documents different codes for F11, F12 and does not mention +# F13-F64. AIX version 4 uses the same naming for F0-F63 as above. +#key_f11 kf11 str k< - - ----- function key 11 +#key_f12 kf12 str k> - - ----- function key 12 +# Undocumented capabilities end here. +#key_action kact str kJ - - ----K sent by action key +# The IBM docs say these capabilities are for table-drawing, and are +# valid only for aixterm descriptions. +#enter_topline_mode topl str tp - - ----K start top-line mode +#enter_bottom_mode btml str bm - - ----K start bottom-line mode +#enter_rvert_mode rvert str rv - - ----K start right-vertical mode +#enter_lvert_mode lvert str lv - - ----K start left-vertical mode +# +############################################################################# +# +# ALIAS DECLARATIONS +# +# Here we set up aliases for translating extensions into standard terminfo. +# +#---------------------------------- Termcap aliases ------------------------- +# +# BSD aliases: +# +# This is a common error in many termcap files. We'll get notified during +# translation when this (or any other alias) fires. +# +capalias sb sr BSD scroll text down +# +# AT&T extensions: +# +# The old AT&T 5410, 5420, 5425, pc6300plus, 610, and s4 entries used a set of +# nonstandard capabilities. Its signature is the KM capability, used to name +# some sort of keymap file. EE, BO, CI, CV, XS, DS, FL and FE are in this +# set. Comments in the original, and a little cross-checking with other AT&T +# documentation, seem to establish the following mappings: +# +capalias BO mr AT&T enter_reverse_mode +capalias CI vi AT&T cursor_invisible +capalias CV ve AT&T cursor_normal +capalias DS mh AT&T enter_dim_mode +#capalias EE me AT&T exit_attribute_mode +capalias FE LF AT&T label_on +capalias FL LO AT&T label_off +capalias XS mk AT&T enter_secure_mode +# +# We comment out EE because the conflicting XENIX EE is more common in +# old entries. +# +# XENIX extensions: +# +# These are the ones we know how to translate directly: +# +capalias EE mh XENIX exit_attribute_mode +capalias GE ae XENIX exit_alt_charset_mode +capalias GS as XENIX enter_alt_charset_mode +capalias CF vi XENIX cursor_invis +capalias CO ve XENIX cursor_normal +capalias EN @7 XENIX key_end +capalias HM kh XENIX key_home +capalias LD kL XENIX key_dl +capalias PD kN XENIX key_npage +capalias PN po XENIX prtr_off +capalias PS pf XENIX prtr_on +capalias PU kP XENIX key_ppage +capalias RT @8 XENIX kent +capalias UP ku XENIX kcuu1 +capalias G6 IGNORE XENIX double-ACS_ULCORNER +capalias G7 IGNORE XENIX double-ACS_LLCORNER +capalias G5 IGNORE XENIX double-ACS_URCORNER +capalias G8 IGNORE XENIX double-ACS_LRCORNER +capalias Gr IGNORE XENIX double-ACS_LTEE +capalias Gr IGNORE XENIX double-ACS_RTEE +capalias Gu IGNORE XENIX double-ACS_BTEE +capalias Gd IGNORE XENIX double ACS_TTEE +capalias Gh IGNORE XENIX double-ACS_HLINE +capalias Gv IGNORE XENIX double-ACS_VLINE +capalias Gc IGNORE XENIX double-ACS_PLUS +capalias GG IGNORE XENIX acs-glitch +# +# IBM extensions: +# +capalias kq %1 IBM key_help +# +# Iris extensions: +# +capalias HS mh IRIS enter_dim_mode +# +# Tektronix extensions: +# +capalias KA k; Tek key_f10 +capalias KB F1 Tek key_f11 +capalias KC F2 Tek key_f12 +capalias KD F3 Tek key_f13 +capalias KE F4 Tek key_f14 +capalias KF F5 Tek key_f15 +capalias BC Sb Tek set_background +capalias FC Sf Tek set_foreground +# +# There are also the following: +# +# XENIX XENIX variable name name clash with terminfo? +# ----- ------------------- ------------------------- +# CL key_char_left +# CR key_char_right +# CW key_change_window +# HP ?? +# LF key_linefeed label_off +# NU key_next_unlocked_cell +# PL ?? +# PR ?? +# RC key_recalc remove_clock +# RF key_toggle_ref req_for_input +# WL key_word_left +# WR key_word_right +# +# If you know what any of the question-marked ones mean, please tell us. +# +#--------------------------------- Terminfo aliases ------------------------ +# +# IBM extensions: +# +infoalias font0 s0ds IBM set0_des_seq +infoalias font1 s1ds IBM set1_des_seq +infoalias font2 s2ds IBM set2_des_seq +infoalias font3 s3ds IBM set3_des_seq +infoalias kbtab kcbt IBM key_backtab +infoalias ksel kslt IBM key_select +# +# Some others are identical to SVr4/XPG4 capabilities, in particular: +# kcmd, kend, khlp, and kf11...kf63. +# +############################################################################# +# +# The following sets edit modes for GNU EMACS +# Local Variables: +# case-fold-search:nil +# truncate-lines:t +# End: diff --git a/include/MKkey_defs.sh b/include/MKkey_defs.sh new file mode 100755 index 00000000..655078b9 --- /dev/null +++ b/include/MKkey_defs.sh @@ -0,0 +1,178 @@ +#! /bin/sh +# $Id: MKkey_defs.sh,v 1.10 2002/09/28 23:32:16 tom Exp $ +############################################################################## +# Copyright (c) 2001,2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# MKkey_defs.sh -- generate function-key definitions for curses.h +# +# Author: Thomas E. Dickey 2001 +# +# Extract function-key definitions from the Caps file +# +: ${AWK-awk} +DATA=${1-Caps} + +data=data$$ +pass1=pass1_$$ +pass2=pass2_$$ +pass3=pass3_$$ +pass4=pass4_$$ +trap 'rm -f $data pass[1234]_$$' 0 1 2 5 15 + +# change repeated tabs (used for readability) to single tabs (needed to make +# awk see the right field alignment of the corresponding columns): +if sort -k 6 $DATA >$data 2>/dev/null +then + # POSIX + sed -e 's/[ ]\+/ /g' < $DATA |sort -n -k 6 >$data +else + # SunOS (and SVr4, marked as obsolete but still recognized) + sed -e 's/[ ]\+/ /g' < $DATA |sort -n +5 >$data +fi + +# add keys that we generate automatically: +cat >>$data <$output <$data ' +function print_cols(text,cols) { + printf "%s", text + len = length(text); + while (len < cols) { + printf " " + len += 8; + } +} +function decode(keycode) { + result = 0; + if (substr(keycode, 1, 2) == "0x") { + digits="0123456789abcdef"; + } else if (substr(keycode, 1, 1) == "0") { + digits="01234567"; + } else { + digits="0123456789"; + } + while (length(keycode) != 0) { + digit=substr(keycode, 1, 1); + keycode=substr(keycode, 2); + result = result * length(digits) + index(digits, digit) - 1; + } + return result; +} + +BEGIN { + maxkey='$maxkey'; + pass='$pass'; + key_max=1; + bits=1; + while (key_max < maxkey) { + bits = bits + 1; + key_max = (key_max * 2) + 1; + } + octal_fmt = sprintf ("%%0%do", (bits + 2) / 3 + 1); +} + +/^$/ {next;} +/^#/ {next;} +/^capalias/ {next;} +/^infoalias/ {next;} + +$5 != "-" && $6 != "-" { + if ($6 == "+") { + if (pass == 1 || pass == 2) + next; + thiskey=maxkey + 1; + } else { + if (pass == 3) + next; + thiskey=decode($6); + } + if (thiskey > maxkey) + maxkey = thiskey; + if (pass == 2 || pass == 3) { + showkey=sprintf(octal_fmt, thiskey); + if ($5 == "KEY_F(0)" ) { + printf "#define " + print_cols("KEY_F0", 16); + print_cols(showkey, 16); + print "/* Function keys. Space for 64 */"; + printf "#define " + print_cols("KEY_F(n)", 16); + print_cols("(KEY_F0+(n))", 16); + print "/* Value of function key n */" + } else { + printf "#define " + print_cols($5, 16); + print_cols(showkey, 16); + printf "/*" + for (i = 8; i <= NF; i++) + printf " %s", $i + print " */" + } + } + } +END { + if (pass == 1) { + print maxkey; + } else if (pass == 4) { + print ""; + printf "#define "; + print_cols("KEY_MAX", 16); + result = sprintf (octal_fmt, key_max); + print_cols(result, 16); + printf "/* Maximum key value is "; + printf octal_fmt, maxkey; + print " */"; + } + } +' +if test $pass = 1 ; then + maxkey=`cat $pass1` +fi + +done + +cat $pass2 +cat $pass3 +cat $pass4 diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index e839cf4a..8243aea5 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -1,7 +1,6 @@ - BEGIN { print "/****************************************************************************" - print " * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *" + print " * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *" print " * *" print " * Permission is hereby granted, free of charge, to any person obtaining a *" print " * copy of this software and associated documentation files (the *" @@ -33,39 +32,34 @@ BEGIN { print "/* and: Eric S. Raymond */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.37 2000/03/12 02:40:07 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.41 2001/12/23 01:04:38 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" print "*/" print "" - print "#ifndef _NCU_TERM_H" - print "#define _NCU_TERM_H 1" + print "#ifndef NCURSES_TERM_H_incl" + print "#define NCURSES_TERM_H_incl 1" print "" print "#undef NCURSES_VERSION" print "#define NCURSES_VERSION \"@NCURSES_MAJOR@.@NCURSES_MINOR@\"" print "" + print "#include " + print "" print "#ifdef __cplusplus" print "extern \"C\" {" print "#endif" print "" print "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H" - print " * and BROKEN_LINKER definition (based on the system for which this was" - print " * configured)." + print " * definition (based on the system for which this was configured)." print " */" print "" print "#undef HAVE_TERMIOS_H" print "#define HAVE_TERMIOS_H 1/*default*/" print "" - print "#undef HAVE_TERMIO_H" - print "#define HAVE_TERMIO_H 0/*default*/" - print "" print "#undef HAVE_TCGETATTR" print "#define HAVE_TCGETATTR 1/*default*/" print "" - print "#undef BROKEN_LINKER" - print "#define BROKEN_LINKER 0/*default*/" - print "" print "#undef NCURSES_CONST" print "#define NCURSES_CONST @NCURSES_CONST@" print "" @@ -79,7 +73,7 @@ BEGIN { print "#undef SET_TTY" print "#undef GET_TTY" print "" - print "/* Assume Posix termio if we have the header and function */" + print "/* Assume POSIX termio if we have the header and function */" print "#if HAVE_TERMIOS_H && HAVE_TCGETATTR" print "" print "#undef TERMIOS" @@ -226,13 +220,13 @@ END { print "" print "typedef struct term { /* describe an actual terminal */" print " TERMTYPE type; /* terminal type description */" - print " short Filedes; /* file description being written to */" + print " short Filedes; /* file description being written to */" print " TTY Ottyb, /* original state of the terminal */" print " Nttyb; /* current state of the terminal */" print " int _baudrate; /* used to compute padding */" print "} TERMINAL;" print "" - print "extern TERMINAL *cur_term;" + print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;" print "" print "#if BROKEN_LINKER" print "#define boolnames _nc_boolnames()" @@ -245,71 +239,71 @@ END { print "#define strcodes _nc_strcodes()" print "#define strfnames _nc_strfnames()" print "" - print "extern NCURSES_CONST char * const *_nc_boolnames(void);" - print "extern NCURSES_CONST char * const *_nc_boolcodes(void);" - print "extern NCURSES_CONST char * const *_nc_boolfnames(void);" - print "extern NCURSES_CONST char * const *_nc_numnames(void);" - print "extern NCURSES_CONST char * const *_nc_numcodes(void);" - print "extern NCURSES_CONST char * const *_nc_numfnames(void);" - print "extern NCURSES_CONST char * const *_nc_strnames(void);" - print "extern NCURSES_CONST char * const *_nc_strcodes(void);" - print "extern NCURSES_CONST char * const *_nc_strfnames(void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolnames (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolcodes (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolfnames (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numnames (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numcodes (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numfnames (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strnames (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strcodes (void);" + print "extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strfnames (void);" print "" print "#else" print "" - print "extern NCURSES_CONST char *const boolnames[];" - print "extern NCURSES_CONST char *const boolcodes[];" - print "extern NCURSES_CONST char *const boolfnames[];" - print "extern NCURSES_CONST char *const numnames[];" - print "extern NCURSES_CONST char *const numcodes[];" - print "extern NCURSES_CONST char *const numfnames[];" - print "extern NCURSES_CONST char *const strnames[];" - print "extern NCURSES_CONST char *const strcodes[];" - print "extern NCURSES_CONST char *const strfnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];" + print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];" print "" print "#endif" print "" print "/* internals */" - print "extern int _nc_set_tty_mode(TTY *buf);" - print "extern int _nc_get_tty_mode(TTY *buf);" - print "extern int _nc_read_entry(const char * const, char * const, TERMTYPE *const);" - print "extern int _nc_read_file_entry(const char *const, TERMTYPE *);" - print "extern char *_nc_first_name(const char *const);" - print "extern int _nc_name_match(const char *const, const char *const, const char *const);" - print "extern int _nc_read_termcap_entry(const char *const, TERMTYPE *const);" - print "extern const TERMTYPE *_nc_fallback(const char *);" + print "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);" + print "extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf);" + print "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);" + print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);" + print "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);" + print "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);" + print "extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);" + print "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);" print "" print "/* entry points */" - print "extern TERMINAL *set_curterm(TERMINAL *);" - print "extern int del_curterm(TERMINAL *);" + print "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);" + print "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);" print "" print "/* miscellaneous entry points */" - print "extern int restartterm(NCURSES_CONST char *, int, int *);" - print "extern int setupterm(NCURSES_CONST char *,int,int *);" + print "extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);" + print "extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);" print "" print "/* terminfo entry points, also declared in curses.h */" print "#if !defined(__NCURSES_H)" - print "extern char *tigetstr(NCURSES_CONST char *);" - print "extern char *tparm(NCURSES_CONST char *, ...);" - print "extern char ttytype[];" - print "extern int putp(const char *);" - print "extern int tigetflag(NCURSES_CONST char *);" - print "extern int tigetnum(NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);" + print "extern NCURSES_EXPORT_VAR(char) ttytype[];" + print "extern NCURSES_EXPORT(int) putp (const char *);" + print "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);" print "#endif /* __NCURSES_H */" print "" print "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */" - print "#if !defined(_NCU_TERMCAP_H)" - print "extern char *tgetstr(NCURSES_CONST char *, char **);" - print "extern char *tgoto(const char *, int, int);" - print "extern int tgetent(char *, const char *);" - print "extern int tgetflag(NCURSES_CONST char *);" - print "extern int tgetnum(NCURSES_CONST char *);" - print "extern int tputs(const char *, int, int (*)(int));" - print "#endif /* _NCU_TERMCAP_H */" + print "#if !defined(NCURSES_TERMCAP_H_incl)" + print "extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);" + print "extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);" + print "extern NCURSES_EXPORT(int) tgetent (char *, const char *);" + print "extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);" + print "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));" + print "#endif /* NCURSES_TERMCAP_H_incl */" print "" print "#ifdef __cplusplus" print "}" print "#endif" print "" - print "#endif /* _NCU_TERM_H */" + print "#endif /* NCURSES_TERM_H_incl */" } diff --git a/include/Makefile.in b/include/Makefile.in index 49190916..1a48a170 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.26 2000/09/02 17:53:40 tom Exp $ +# $Id: Makefile.in,v 1.35 2001/12/08 18:50:06 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996-2001 # # Makefile for ncurses source code. # @@ -56,15 +56,20 @@ LN_S = @LN_S@ VERSION = @cf_cv_rel_version@ +# The "Caps" file specifies the terminfo database format, as well as the list +# of function keys. +TERMINFO_CAPS = $(srcdir)/@TERMINFO_CAPS@ + # These files are generated by the configure script CONFIG_SRC = \ MKterm.h.awk \ - curses.h \ + curses.head \ termcap.h \ unctrl.h # These files are generated by this makefile AUTO_SRC = \ + curses.h \ hashsize.h \ ncurses_def.h \ parametrized.h \ @@ -73,21 +78,31 @@ AUTO_SRC = \ ################################################################################ all \ libs \ +depend \ sources \ install :: $(AUTO_SRC) -term.h: $(srcdir)/Caps MKterm.h.awk - $(AWK) -f MKterm.h.awk $(srcdir)/Caps > $@ +curses.h : $(TERMINFO_CAPS) \ + curses.head \ + $(srcdir)/curses.tail \ + $(srcdir)/MKkey_defs.sh + cat curses.head >$@ + AWK=$(AWK) sh $(srcdir)/MKkey_defs.sh $(TERMINFO_CAPS) >>$@ + sh -c 'if test "@NCURSES_CH_T@" = "cchar_t" ; then cat $(srcdir)/curses.wide >>$@ ; fi' + cat $(srcdir)/curses.tail >>$@ + +term.h: $(TERMINFO_CAPS) MKterm.h.awk + $(AWK) -f MKterm.h.awk $(TERMINFO_CAPS) > $@ sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ -hashsize.h: $(srcdir)/Caps $(srcdir)/MKhashsize.sh - sh $(srcdir)/MKhashsize.sh $(srcdir)/Caps >$@ +hashsize.h: $(TERMINFO_CAPS) $(srcdir)/MKhashsize.sh + sh $(srcdir)/MKhashsize.sh $(TERMINFO_CAPS) >$@ ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh AWK=$(AWK) sh $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@ -parametrized.h: $(srcdir)/Caps $(srcdir)/MKparametrized.sh - AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(srcdir)/Caps >$@ +parametrized.h: $(TERMINFO_CAPS) $(srcdir)/MKparametrized.sh + AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(TERMINFO_CAPS) >$@ tags: ctags *.[ch] @@ -96,7 +111,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/include/curses.h.in b/include/curses.h.in index 5b9e19be..8b2b6223 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,9 +29,10 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.96 2000/09/16 16:11:01 tom Exp $ */ +/* $Id: curses.h.in,v 1.134 2002/09/28 15:08:06 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -40,7 +41,7 @@ #define CURSES_H 1 /* This should be defined for the enhanced functionality to be visible. - * However, none of the wide-character (enhanced) functionality is implemented. + * However, some of the wide-character (enhanced) functionality is missing. * So we do not define it (yet). #define _XOPEN_CURSES 1 */ @@ -54,6 +55,12 @@ #undef NCURSES_VERSION #define NCURSES_VERSION "@NCURSES_MAJOR@.@NCURSES_MINOR@" +#include + +/* + * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses + * configured using --disable-macros. + */ #ifdef NCURSES_NOMACROS #define NCURSES_ATTR_T attr_t #endif @@ -62,15 +69,33 @@ #define NCURSES_ATTR_T int #endif +/* + * Expands to 'const' if ncurses is configured using --enable-const. Note that + * doing so makes it incompatible with other implementations of X/Open Curses. + */ #undef NCURSES_CONST #define NCURSES_CONST @NCURSES_CONST@ +/* + * The internal type used for color values + */ #undef NCURSES_COLOR_T #define NCURSES_COLOR_T short +/* + * The internal type used for window dimensions. + */ #undef NCURSES_SIZE_T #define NCURSES_SIZE_T short +/* + * NCURSES_CH_T is used in building the library, but not used otherwise in + * this header file, since that would make the normal/wide-character versions + * of the header incompatible. + */ +#undef NCURSES_CH_T +#define NCURSES_CH_T @NCURSES_CH_T@ + typedef unsigned @cf_cv_typeof_chtype@ chtype; #include @@ -83,6 +108,13 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype; /* XSI and SVr4 specify that curses implements 'bool'. However, C++ may also * implement it. If so, we must use the C++ compiler's type to avoid conflict * with other interfaces. + * + * A further complication is that may declare 'bool' to be a + * different type, such as an enum which is not necessarily compatible with + * C++. If we have , make 'bool' a macro, so users may #undef it. + * Otherwise, let it remain a typedef to avoid conflicts with other #define's. + * In either case, make a typedef for NCURSES_BOOL which can be used if needed + * from either C or C++. */ #undef TRUE @@ -91,11 +123,24 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype; #undef FALSE #define FALSE 0 +typedef @cf_cv_type_of_bool@ NCURSES_BOOL; + #if (!defined(__cplusplus) || !@cf_cv_builtin_bool@) && (!@cf_cv_cc_bool_type@) + +#if @cf_cv_header_stdbool_h@ +#include +#endif + #undef bool + +#if @cf_cv_header_stdbool_h@ +#define bool NCURSES_BOOL +#else typedef @cf_cv_type_of_bool@ bool; #endif +#endif /* !__cplusplus, etc. */ + #ifdef __cplusplus extern "C" { #endif @@ -123,8 +168,8 @@ extern "C" { #define WA_VERTICAL A_VERTICAL /* colors */ -extern int COLORS; -extern int COLOR_PAIRS; +extern NCURSES_EXPORT_VAR(int) COLORS; +extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; #define COLOR_BLACK 0 #define COLOR_RED 1 @@ -137,7 +182,12 @@ extern int COLOR_PAIRS; /* line graphics */ -extern chtype acs_map[]; +#if @BROKEN_LINKER@ +extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void); +#define acs_map (_nc_acs_map()) +#else +extern NCURSES_EXPORT_VAR(chtype) acs_map[]; +#endif /* VT100 symbols begin here */ #define ACS_ULCORNER (acs_map['l']) /* upper left corner */ @@ -197,13 +247,11 @@ extern chtype acs_map[]; #define ACS_SBSB ACS_VLINE #define ACS_SSSS ACS_PLUS -#if !defined(ERR) || ((ERR) != -1) +#undef ERR #define ERR (-1) -#endif -#if !defined(OK) || ((OK) != 0) +#undef OK #define OK (0) -#endif /* values for the _flags member */ #define _SUBWIN 0x01 /* is this a sub-window? */ @@ -232,6 +280,20 @@ typedef struct _win_st WINDOW; typedef chtype attr_t; /* ...must be at least as wide as chtype */ #ifdef _XOPEN_SOURCE_EXTENDED + +#if @NCURSES_LIBUTF8@ +#ifdef mblen /* libutf8.h defines it w/o undefining first */ +#undef mblen +#endif +#include +#define _WCHAR_T +#define _WINT_T +#endif + +#if @NCURSES_MBSTATE_T@ +#include /* ...to get mbstate_t, etc. */ +#endif + #ifndef _WCHAR_T typedef unsigned long wchar_t; #endif /* _WCHAR_T */ @@ -246,15 +308,10 @@ typedef struct wchar_t chars[CCHARW_MAX]; } cchar_t; + #endif /* _XOPEN_SOURCE_EXTENDED */ -struct ldat -{ - chtype *text; /* text of the line */ - NCURSES_SIZE_T firstchar; /* first changed character in the line */ - NCURSES_SIZE_T lastchar; /* last changed character in the line */ - NCURSES_SIZE_T oldindex; /* index of the line at last update */ -}; +struct ldat; struct _win_st { @@ -272,14 +329,14 @@ struct _win_st /* option values set by user */ bool _notimeout; /* no time out on function-key entry? */ - bool _clear; /* consider all data in the window invalid? */ - bool _leaveok; /* OK to not reset cursor on exit? */ - bool _scroll; /* OK to scroll this window? */ - bool _idlok; /* OK to use insert/delete line? */ - bool _idcok; /* OK to use insert/delete char? */ + bool _clear; /* consider all data in the window invalid? */ + bool _leaveok; /* OK to not reset cursor on exit? */ + bool _scroll; /* OK to scroll this window? */ + bool _idlok; /* OK to use insert/delete line? */ + bool _idcok; /* OK to use insert/delete char? */ bool _immed; /* window in immed mode? (not yet used) */ bool _sync; /* window in sync mode? */ - bool _use_keypad; /* process function keys into KEY_ symbols? */ + bool _use_keypad; /* process function keys into KEY_ symbols? */ int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ struct ldat *_line; /* the actual line data */ @@ -302,35 +359,93 @@ struct _win_st } _pad; NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ + +#ifdef _XOPEN_SOURCE_EXTENDED + cchar_t _bkgrnd; /* current background char/attribute pair */ +#endif }; -extern WINDOW *stdscr; -extern WINDOW *curscr; -extern WINDOW *newscr; +extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; +extern NCURSES_EXPORT_VAR(WINDOW *) curscr; +extern NCURSES_EXPORT_VAR(WINDOW *) newscr; -extern int LINES; -extern int COLS; -extern int TABSIZE; +extern NCURSES_EXPORT_VAR(int) LINES; +extern NCURSES_EXPORT_VAR(int) COLS; +extern NCURSES_EXPORT_VAR(int) TABSIZE; /* * This global was an undocumented feature under AIX curses. */ -extern int ESCDELAY; /* ESC expire time in milliseconds */ +extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */ -extern char ttytype[]; /* needed for backward compatibility */ +extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */ /* * These functions are extensions - not in XSI Curses. */ -extern char *keybound (int, int); -extern const char *curses_version (void); -extern int assume_default_colors (int, int); -extern int define_key (char *, int); -extern int keyok (int, bool); -extern int resizeterm (int, int); -extern int use_default_colors (void); -extern int use_extended_names (bool); -extern int wresize (WINDOW *, int, int); +#if @NCURSES_EXT_FUNCS@ +extern NCURSES_EXPORT(bool) is_term_resized (int, int); +extern NCURSES_EXPORT(char *) keybound (int, int); +extern NCURSES_EXPORT(const char *) curses_version (void); +extern NCURSES_EXPORT(int) assume_default_colors (int, int); +extern NCURSES_EXPORT(int) define_key (char *, int); +extern NCURSES_EXPORT(int) keyok (int, bool); +extern NCURSES_EXPORT(int) resize_term (int, int); +extern NCURSES_EXPORT(int) resizeterm (int, int); +extern NCURSES_EXPORT(int) use_default_colors (void); +extern NCURSES_EXPORT(int) use_extended_names (bool); +extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); +#else +#define curses_version() NCURSES_VERSION +#endif + +/* + * This is an extension to support events... + */ +#if @NCURSES_EXT_FUNCS@ +#ifdef NCURSES_WGETCH_EVENTS +#if !defined(__BEOS__) /* Fix _nc_timed_wait() on BEOS... */ +# define NCURSES_EVENT_VERSION 1 +#endif /* !defined(__BEOS__) */ + +/* + * Bits to set in _nc_event.data.flags + */ +# define _NC_EVENT_TIMEOUT_MSEC 1 +# define _NC_EVENT_FILE 2 +# define _NC_EVENT_FILE_READABLE 2 +# if 0 /* Not supported yet... */ +# define _NC_EVENT_FILE_WRITABLE 4 +# define _NC_EVENT_FILE_EXCEPTION 8 +# endif + +typedef struct +{ + int type; + union + { + long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ + struct + { + unsigned int flags; + int fd; + unsigned int result; + } fev; /* _NC_EVENT_FILE */ + } data; +} _nc_event; + +typedef struct +{ + int count; + int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ + _nc_event *events[1]; +} _nc_eventlist; + +extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *); /* experimental */ +extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */ + +#endif /* NCURSES_WGETCH_EVENTS */ +#endif /* NCURSES_EXT_FUNCS */ /* * GCC (and some other compilers) define '__attribute__'; we're using this @@ -357,17 +472,21 @@ extern int wresize (WINDOW *, int, int); * We cannot define these in ncurses_cfg.h, since they require parameters to be * passed (that's non-portable). */ -#ifdef GCC_PRINTF +#ifndef GCC_PRINTFLIKE +#if defined(GCC_PRINTF) && !defined(printf) #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #else #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ #endif +#endif -#ifdef GCC_SCANF +#ifndef GCC_SCANFLIKE +#if defined(GCC_SCANF) && !defined(scanf) #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) #else #define GCC_SCANFLIKE(fmt,var) /*nothing*/ #endif +#endif #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ @@ -384,482 +503,295 @@ extern int wresize (WINDOW *, int, int); * requirements. */ -extern int addch(const chtype); /* generated */ -extern int addchnstr(const chtype *, int); /* generated */ -extern int addchstr(const chtype *); /* generated */ -extern int addnstr(const char *, int); /* generated */ -extern int addstr(const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int addnwstr(const wchar_t *, int); /* missing */ -extern int addwstr(const wchar_t *); /* missing */ -extern int add_wch(const cchar_t *); /* missing */ -extern int add_wchnstr(const cchar_t *, int); /* missing */ -extern int add_wchstr(const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int attroff(NCURSES_ATTR_T); /* generated */ -extern int attron(NCURSES_ATTR_T); /* generated */ -extern int attrset(NCURSES_ATTR_T); /* generated */ -extern int attr_get(attr_t *, short *, void *); /* generated */ -extern int attr_off(attr_t, void *); /* generated */ -extern int attr_on(attr_t, void *); /* generated */ -extern int attr_set(attr_t, short, void *); /* generated */ -extern int baudrate(void); /* implemented */ -extern int beep(void); /* implemented */ -extern int bkgd(chtype); /* generated */ -extern void bkgdset(chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern void bkgrndset(const cchar_t *); /* missing */ -extern int bkgrnd(const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int border(chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int border_set(const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int box(WINDOW *, chtype, chtype); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int box_set(WINDOW *, const cchar_t *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern bool can_change_color(void); /* implemented */ -extern int cbreak(void); /* implemented */ -extern int chgat(int, attr_t, short, const void *); /* generated */ -extern int clear(void); /* generated */ -extern int clearok(WINDOW *,bool); /* implemented */ -extern int clrtobot(void); /* generated */ -extern int clrtoeol(void); /* generated */ -extern int color_content(short,short*,short*,short*); /* implemented */ -extern int color_set(short,void*); /* generated */ -extern int COLOR_PAIR(int); /* generated */ -extern int copywin(const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */ -extern int curs_set(int); /* implemented */ -extern int def_prog_mode(void); /* implemented */ -extern int def_shell_mode(void); /* implemented */ -extern int delay_output(int); /* implemented */ -extern int delch(void); /* generated */ -extern void delscreen(SCREEN *); /* implemented */ -extern int delwin(WINDOW *); /* implemented */ -extern int deleteln(void); /* generated */ -extern WINDOW *derwin(WINDOW *,int,int,int,int); /* implemented */ -extern int doupdate(void); /* implemented */ -extern WINDOW *dupwin(WINDOW *); /* implemented */ -extern int echo(void); /* implemented */ -extern int echochar(const chtype); /* generated */ -extern int erase(void); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int echo_wchar(const cchar_t *); /* missing */ -extern int erasewchar(wchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int endwin(void); /* implemented */ -extern char erasechar(void); /* implemented */ -extern void filter(void); /* implemented */ -extern int flash(void); /* implemented */ -extern int flushinp(void); /* implemented */ -extern chtype getbkgd(WINDOW *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int getbkgrnd(cchar_t *); /* missing */ -extern int getcchar(const cchar_t *, wchar_t*, attr_t*, short*, void*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int getch(void); /* generated */ -extern int getnstr(char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int getn_wstr(wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int getstr(char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int get_wch(wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern WINDOW *getwin(FILE *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int get_wstr(wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int halfdelay(int); /* implemented */ -extern bool has_colors(void); /* implemented */ -extern bool has_ic(void); /* implemented */ -extern bool has_il(void); /* implemented */ -extern int hline(chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int hline_set(const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern void idcok(WINDOW *, bool); /* implemented */ -extern int idlok(WINDOW *, bool); /* implemented */ -extern void immedok(WINDOW *, bool); /* implemented */ -extern chtype inch(void); /* generated */ -extern int inchnstr(chtype *, int); /* generated */ -extern int inchstr(chtype *); /* generated */ -extern WINDOW *initscr(void); /* implemented */ -extern int init_color(short,short,short,short); /* implemented */ -extern int init_pair(short,short,short); /* implemented */ -extern int innstr(char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int innwstr(wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int insch(chtype); /* generated */ -extern int insdelln(int); /* generated */ -extern int insertln(void); /* generated */ -extern int insnstr(const char *, int); /* generated */ -extern int insstr(const char *); /* generated */ -extern int instr(char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int ins_nwstr(const wchar_t *, int); /* missing */ -extern int ins_wch(const cchar_t *); /* missing */ -extern int ins_wstr(const wchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int intrflush(WINDOW *,bool); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int inwstr(wchar_t *); /* missing */ -extern int in_wch(NCURSES_CONST cchar_t *); /* missing */ -extern int in_wchstr(NCURSES_CONST cchar_t *); /* missing */ -extern int in_wchnstr(NCURSES_CONST cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern bool isendwin(void); /* implemented */ -extern bool is_linetouched(WINDOW *,int); /* implemented */ -extern bool is_wintouched(WINDOW *); /* implemented */ -extern NCURSES_CONST char *keyname(int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern char *key_name(wchar_t); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int keypad(WINDOW *,bool); /* implemented */ -extern char killchar(void); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int killwchar(wchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int leaveok(WINDOW *,bool); /* implemented */ -extern char *longname(void); /* implemented */ -extern int meta(WINDOW *,bool); /* implemented */ -extern int move(int, int); /* generated */ -extern int mvaddch(int, int, const chtype); /* generated */ -extern int mvaddchnstr(int, int, const chtype *, int); /* generated */ -extern int mvaddchstr(int, int, const chtype *); /* generated */ -extern int mvaddnstr(int, int, const char *, int); /* generated */ -extern int mvaddstr(int, int, const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvaddnwstr(int, int, const wchar_t *, int); /* missing */ -extern int mvaddwstr(int, int, const wchar_t *); /* missing */ -extern int mvadd_wch(int, int, const cchar_t *); /* missing */ -extern int mvadd_wchnstr(int, int, const cchar_t *, int);/* missing */ -extern int mvadd_wchstr(int, int, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvchgat(int, int, int, attr_t, short, const void *); /* generated */ -extern int mvcur(int,int,int,int); /* implemented */ -extern int mvdelch(int, int); /* generated */ -extern int mvderwin(WINDOW *, int, int); /* implemented */ -extern int mvgetch(int, int); /* generated */ -extern int mvgetnstr(int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvgetn_wstr(int, int, wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvgetstr(int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvget_wch(int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvget_wstr(int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvhline(int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvhline_set(int, int, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern chtype mvinch(int, int); /* generated */ -extern int mvinchnstr(int, int, chtype *, int); /* generated */ -extern int mvinchstr(int, int, chtype *); /* generated */ -extern int mvinnstr(int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvinnwstr(int, int, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvinsch(int, int, chtype); /* generated */ -extern int mvinsnstr(int, int, const char *, int); /* generated */ -extern int mvinsstr(int, int, const char *); /* generated */ -extern int mvinstr(int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvins_nwstr(int, int, const wchar_t *, int); /* missing */ -extern int mvins_wch(int, int, const cchar_t *); /* missing */ -extern int mvins_wstr(int, int, const wchar_t *); /* missing */ -extern int mvinwstr(int, int, wchar_t *); /* missing */ -extern int mvin_wch(int, int, NCURSES_CONST cchar_t *); /* missing */ -extern int mvin_wchstr(int, int, NCURSES_CONST cchar_t *); /* missing */ -extern int mvin_wchnstr(int, int, NCURSES_CONST cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvprintw(int,int, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) addch (const chtype); /* generated */ +extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */ +extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */ +extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */ +extern NCURSES_EXPORT(int) addstr (const char *); /* generated */ +extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */ +extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */ +extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */ +extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */ +extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */ +extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */ +extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */ +extern NCURSES_EXPORT(int) baudrate (void); /* implemented */ +extern NCURSES_EXPORT(int) beep (void); /* implemented */ +extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */ +extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */ +extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ +extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */ +extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */ +extern NCURSES_EXPORT(int) cbreak (void); /* implemented */ +extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */ +extern NCURSES_EXPORT(int) clear (void); /* generated */ +extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(int) clrtobot (void); /* generated */ +extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */ +extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */ +extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */ +extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */ +extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) curs_set (int); /* implemented */ +extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */ +extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */ +extern NCURSES_EXPORT(int) delay_output (int); /* implemented */ +extern NCURSES_EXPORT(int) delch (void); /* generated */ +extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */ +extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) deleteln (void); /* generated */ +extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) doupdate (void); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) echo (void); /* implemented */ +extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */ +extern NCURSES_EXPORT(int) erase (void); /* generated */ +extern NCURSES_EXPORT(int) endwin (void); /* implemented */ +extern NCURSES_EXPORT(char) erasechar (void); /* implemented */ +extern NCURSES_EXPORT(void) filter (void); /* implemented */ +extern NCURSES_EXPORT(int) flash (void); /* implemented */ +extern NCURSES_EXPORT(int) flushinp (void); /* implemented */ +extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) getch (void); /* generated */ +extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */ +extern NCURSES_EXPORT(int) getstr (char *); /* generated */ +extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */ +extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */ +extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */ +extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */ +extern NCURSES_EXPORT(bool) has_il (void); /* implemented */ +extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */ +extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */ +extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */ +extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */ +extern NCURSES_EXPORT(chtype) inch (void); /* generated */ +extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */ +extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */ +extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */ +extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */ +extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */ +extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */ +extern NCURSES_EXPORT(int) insch (chtype); /* generated */ +extern NCURSES_EXPORT(int) insdelln (int); /* generated */ +extern NCURSES_EXPORT(int) insertln (void); /* generated */ +extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */ +extern NCURSES_EXPORT(int) insstr (const char *); /* generated */ +extern NCURSES_EXPORT(int) instr (char *); /* generated */ +extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */ +extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */ +extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */ +extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(char) killchar (void); /* implemented */ +extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(char *) longname (void); /* implemented */ +extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(int) move (int, int); /* generated */ +extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */ +extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */ +extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */ +extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */ +extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */ +extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */ +extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */ +extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */ +extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */ +extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */ +extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */ +extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */ +extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */ +extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */ +extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */ +extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */ +extern NCURSES_EXPORT(int) mvprintw (int,int, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(3,4); -extern int mvscanw(int,int, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(3,4); -extern int mvvline(int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvvline_set(int, int, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwaddch(WINDOW *, int, int, const chtype); /* generated */ -extern int mvwaddchnstr(WINDOW *, int, int, const chtype *, int);/* generated */ -extern int mvwaddchstr(WINDOW *, int, int, const chtype *); /* generated */ -extern int mvwaddnstr(WINDOW *, int, int, const char *, int); /* generated */ -extern int mvwaddstr(WINDOW *, int, int, const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);/* missing */ -extern int mvwaddwstr(WINDOW *, int, int, const wchar_t *); /* missing */ -extern int mvwadd_wch(WINDOW *, int, int, const cchar_t *); /* missing */ -extern int mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int); /* missing */ -extern int mvwadd_wchstr(WINDOW *, int, int, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ -extern int mvwdelch(WINDOW *, int, int); /* generated */ -extern int mvwgetch(WINDOW *, int, int); /* generated */ -extern int mvwgetnstr(WINDOW *, int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);/* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwgetstr(WINDOW *, int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwget_wch(WINDOW *, int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwget_wstr(WINDOW *, int, int, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwhline(WINDOW *, int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwhline_set(WINDOW *, int, int, const cchar_t *, int);/* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwin(WINDOW *,int,int); /* implemented */ -extern chtype mvwinch(WINDOW *, int, int); /* generated */ -extern int mvwinchnstr(WINDOW *, int, int, chtype *, int); /* generated */ -extern int mvwinchstr(WINDOW *, int, int, chtype *); /* generated */ -extern int mvwinnstr(WINDOW *, int, int, char *, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwinnwstr(WINDOW *, int, int, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwinsch(WINDOW *, int, int, chtype); /* generated */ -extern int mvwinsnstr(WINDOW *, int, int, const char *, int); /* generated */ -extern int mvwinsstr(WINDOW *, int, int, const char *); /* generated */ -extern int mvwinstr(WINDOW *, int, int, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwins_nwstr(WINDOW *, int,int, const wchar_t *,int); /* missing */ -extern int mvwins_wch(WINDOW *, int, int, const cchar_t *); /* missing */ -extern int mvwins_wstr(WINDOW *, int, int, const wchar_t *); /* missing */ -extern int mvwinwstr(WINDOW *, int, int, wchar_t *); /* missing */ -extern int mvwin_wch(WINDOW *, int, int, NCURSES_CONST cchar_t *); /* missing */ -extern int mvwin_wchnstr(WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* missing */ -extern int mvwin_wchstr(WINDOW *, int, int, NCURSES_CONST cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int mvwprintw(WINDOW*,int,int, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */ +extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */ +extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */ +extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */ +extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */ +extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ +extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */ +extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */ +extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */ +extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */ +extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */ +extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */ +extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */ +extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */ +extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ +extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ +extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ +extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ +extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(4,5); -extern int mvwscanw(WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(4,5); -extern int mvwvline(WINDOW *,int, int, chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int mvwvline_set(WINDOW *, int,int, const cchar_t *,int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int napms(int); /* implemented */ -extern WINDOW *newpad(int,int); /* implemented */ -extern SCREEN *newterm(NCURSES_CONST char *,FILE *,FILE *); /* implemented */ -extern WINDOW *newwin(int,int,int,int); /* implemented */ -extern int nl(void); /* implemented */ -extern int nocbreak(void); /* implemented */ -extern int nodelay(WINDOW *,bool); /* implemented */ -extern int noecho(void); /* implemented */ -extern int nonl(void); /* implemented */ -extern void noqiflush(void); /* implemented */ -extern int noraw(void); /* implemented */ -extern int notimeout(WINDOW *,bool); /* implemented */ -extern int overlay(const WINDOW*,WINDOW *); /* implemented */ -extern int overwrite(const WINDOW*,WINDOW *); /* implemented */ -extern int pair_content(short,short*,short*); /* implemented */ -extern int PAIR_NUMBER(int); /* generated */ -extern int pechochar(WINDOW *, const chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int pecho_wchar(WINDOW *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int pnoutrefresh(WINDOW*,int,int,int,int,int,int);/* implemented */ -extern int prefresh(WINDOW *,int,int,int,int,int,int); /* implemented */ -extern int printw(NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ +extern NCURSES_EXPORT(int) napms (int); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ +extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) nl (void); /* implemented */ +extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */ +extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(int) noecho (void); /* implemented */ +extern NCURSES_EXPORT(int) nonl (void); /* implemented */ +extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */ +extern NCURSES_EXPORT(int) noraw (void); /* implemented */ +extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */ +extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */ +extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */ +extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */ +extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) printw (NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(1,2); -extern int putp(const char *); /* implemented */ -extern int putwin(WINDOW *, FILE *); /* implemented */ -extern void qiflush(void); /* implemented */ -extern int raw(void); /* implemented */ -extern int redrawwin(WINDOW *); /* generated */ -extern int refresh(void); /* generated */ -extern int resetty(void); /* implemented */ -extern int reset_prog_mode(void); /* implemented */ -extern int reset_shell_mode(void); /* implemented */ -extern int ripoffline(int, int (*init)(WINDOW *, int)); /* implemented */ -extern int savetty(void); /* implemented */ -extern int scanw(NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) putp (const char *); /* implemented */ +extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */ +extern NCURSES_EXPORT(void) qiflush (void); /* implemented */ +extern NCURSES_EXPORT(int) raw (void); /* implemented */ +extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) refresh (void); /* generated */ +extern NCURSES_EXPORT(int) resetty (void); /* implemented */ +extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */ +extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */ +extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */ +extern NCURSES_EXPORT(int) savetty (void); /* implemented */ +extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(1,2); -extern int scr_dump(const char *); /* implemented */ -extern int scr_init(const char *); /* implemented */ -extern int scrl(int); /* generated */ -extern int scroll(WINDOW *); /* generated */ -extern int scrollok(WINDOW *,bool); /* implemented */ -extern int scr_restore(const char *); /* implemented */ -extern int scr_set(const char *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int setcchar(cchar_t *, const wchar_t *, const attr_t, short, const void *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int setscrreg(int,int); /* generated */ -extern SCREEN *set_term(SCREEN *); /* implemented */ -extern int slk_attroff(const chtype); /* implemented */ -extern int slk_attr_off(const attr_t, void *); /* generated:WIDEC */ -extern int slk_attron(const chtype); /* implemented */ -extern int slk_attr_on(attr_t,void*); /* generated:WIDEC */ -extern int slk_attrset(const chtype); /* implemented */ -extern attr_t slk_attr(void); /* implemented */ -extern int slk_attr_set(const attr_t,short,void*); /* implemented */ -extern int slk_clear(void); /* implemented */ -extern int slk_color(short); /* implemented */ -extern int slk_init(int); /* implemented */ -extern char *slk_label(int); /* implemented */ -extern int slk_noutrefresh(void); /* implemented */ -extern int slk_refresh(void); /* implemented */ -extern int slk_restore(void); /* implemented */ -extern int slk_set(int,const char *,int); /* implemented */ -extern int slk_touch(void); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int slk_wset(int, const wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int standout(void); /* generated */ -extern int standend(void); /* generated */ -extern int start_color(void); /* implemented */ -extern WINDOW *subpad(WINDOW *, int, int, int, int); /* implemented */ -extern WINDOW *subwin(WINDOW *,int,int,int,int); /* implemented */ -extern int syncok(WINDOW *, bool); /* implemented */ -extern chtype termattrs(void); /* implemented */ -extern attr_t term_attrs(void); /* missing */ -extern char *termname(void); /* implemented */ -extern int tigetflag(NCURSES_CONST char *); /* implemented */ -extern int tigetnum(NCURSES_CONST char *); /* implemented */ -extern char *tigetstr(NCURSES_CONST char *); /* implemented */ -extern void timeout(int); /* generated */ -extern int touchline(WINDOW *, int, int); /* generated */ -extern int touchwin(WINDOW *); /* generated */ -extern char *tparm(NCURSES_CONST char *, ...); /* implemented */ -extern int typeahead(int); /* implemented */ -extern int ungetch(int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int unget_wch(const wchar_t); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int untouchwin(WINDOW *); /* generated */ -extern void use_env(bool); /* implemented */ -extern int vidattr(chtype); /* implemented */ -extern int vid_attr(attr_t, short, void *); /* generated:WIDEC */ -extern int vidputs(chtype, int (*)(int)); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int vid_puts(attr_t, short, void *, int (*)(int)); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int vline(chtype, int); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int vline_set(const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int vwprintw(WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ -extern int vw_printw(WINDOW *, NCURSES_CONST char *,va_list); /* generated */ -extern int vwscanw(WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ -extern int vw_scanw(WINDOW *, NCURSES_CONST char *,va_list); /* generated */ -extern int waddch(WINDOW *, const chtype); /* implemented */ -extern int waddchnstr(WINDOW *,const chtype *const,int); /* implemented */ -extern int waddchstr(WINDOW *,const chtype *); /* generated */ -extern int waddnstr(WINDOW *,const char *const,int); /* implemented */ -extern int waddstr(WINDOW *,const char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int waddwstr(WINDOW *,const wchar_t *); /* missing */ -extern int waddnwstr(WINDOW *,const wchar_t *,int); /* missing */ -extern int wadd_wch(WINDOW *,const cchar_t *); /* missing */ -extern int wadd_wchnstr(WINDOW *,const cchar_t *,int); /* missing */ -extern int wadd_wchstr(WINDOW *,const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wattron(WINDOW *, int); /* generated */ -extern int wattroff(WINDOW *, int); /* generated */ -extern int wattrset(WINDOW *, int); /* generated */ -extern int wattr_get(WINDOW *, attr_t *, short *, void *); /* generated */ -extern int wattr_on(WINDOW *, NCURSES_CONST attr_t, void *); /* implemented */ -extern int wattr_off(WINDOW *, NCURSES_CONST attr_t, void *); /* implemented */ -extern int wattr_set(WINDOW *, attr_t, short, void *); /* generated */ -extern int wbkgd(WINDOW *,const chtype); /* implemented */ -extern void wbkgdset(WINDOW *,chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern void wbkgrndset(WINDOW *,const cchar_t *); /* missing */ -extern int wbkgrnd(WINDOW *,const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wborder(WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wborder_set(WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wchgat(WINDOW *, int, attr_t, short, const void *);/* implemented */ -extern int wclear(WINDOW *); /* implemented */ -extern int wclrtobot(WINDOW *); /* implemented */ -extern int wclrtoeol(WINDOW *); /* implemented */ -extern int wcolor_set(WINDOW*,short,void*); /* implemented */ -extern void wcursyncup(WINDOW *); /* implemented */ -extern int wdelch(WINDOW *); /* implemented */ -extern int wdeleteln(WINDOW *); /* generated */ -extern int wechochar(WINDOW *, const chtype); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wecho_wchar(WINDOW *, const cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int werase(WINDOW *); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wgetbkgrnd(WINDOW *, cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wgetch(WINDOW *); /* implemented */ -extern int wgetnstr(WINDOW *,char *,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wgetn_wstr(WINDOW *,wint_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wgetstr(WINDOW *, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wget_wch(WINDOW *, wint_t *); /* missing */ -extern int wget_wstr(WINDOW *, wint_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int whline(WINDOW *, chtype, int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int whline_set(WINDOW *, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern chtype winch(WINDOW *); /* implemented */ -extern int winchnstr(WINDOW *, chtype *, int); /* implemented */ -extern int winchstr(WINDOW *, chtype *); /* generated */ -extern int winnstr(WINDOW *, char *, int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int winnwstr(WINDOW *, wchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int winsch(WINDOW *, chtype); /* implemented */ -extern int winsdelln(WINDOW *,int); /* implemented */ -extern int winsertln(WINDOW *); /* generated */ -extern int winsnstr(WINDOW *, const char *,int); /* implemented */ -extern int winsstr(WINDOW *, const char *); /* generated */ -extern int winstr(WINDOW *, char *); /* generated */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wins_nwstr(WINDOW *, const wchar_t *, int); /* missing */ -extern int wins_wch(WINDOW *, const cchar_t *); /* missing */ -extern int wins_wstr(WINDOW *, const wchar_t *); /* missing */ -extern int winwstr(WINDOW *, wchar_t *); /* missing */ -extern int win_wch(WINDOW *, NCURSES_CONST cchar_t *); /* missing */ -extern int win_wchnstr(WINDOW *, NCURSES_CONST cchar_t *, int); /* missing */ -extern int win_wchstr(WINDOW *, NCURSES_CONST cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wmove(WINDOW *,int,int); /* implemented */ -extern int wnoutrefresh(WINDOW *); /* implemented */ -extern int wprintw(WINDOW *, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */ +extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */ +extern NCURSES_EXPORT(int) scrl (int); /* generated */ +extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */ +extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */ +extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */ +extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */ +extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */ +extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */ +extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */ +extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */ +extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */ +extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_color (short); /* implemented */ +extern NCURSES_EXPORT(int) slk_init (int); /* implemented */ +extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */ +extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ +extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ +extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ +extern NCURSES_EXPORT(int) standout (void); /* generated */ +extern NCURSES_EXPORT(int) standend (void); /* generated */ +extern NCURSES_EXPORT(int) start_color (void); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *,int,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */ +extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */ +extern NCURSES_EXPORT(char *) termname (void); /* implemented */ +extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ +extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */ +extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */ +extern NCURSES_EXPORT(void) timeout (int); /* generated */ +extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */ +extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */ +extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* implemented */ +extern NCURSES_EXPORT(int) typeahead (int); /* implemented */ +extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ +extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ +extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ +extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ +extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* implemented */ +extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ +extern NCURSES_EXPORT(int) vwprintw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ +extern NCURSES_EXPORT(int) vw_printw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ +extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ +extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ +extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */ +extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */ +extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ +extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int); /* implemented */ +extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */ +extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */ +extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */ +extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */ +extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */ +extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */ +extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */ +extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */ +extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */ +extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */ +extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ +extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */ +extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */ +extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */ +extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */ +extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */ +extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */ +extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */ +extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */ +extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */ +extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */ +extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */ +extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */ +extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */ +extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */ +extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */ +extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wprintw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ GCC_PRINTFLIKE(2,3); -extern int wredrawln(WINDOW *,int,int); /* implemented */ -extern int wrefresh(WINDOW *); /* implemented */ -extern int wscanw(WINDOW *, NCURSES_CONST char *,...) /* implemented */ +extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */ +extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ GCC_SCANFLIKE(2,3); -extern int wscrl(WINDOW *,int); /* implemented */ -extern int wsetscrreg(WINDOW *,int,int); /* implemented */ -extern int wstandout(WINDOW *); /* generated */ -extern int wstandend(WINDOW *); /* generated */ -extern void wsyncdown(WINDOW *); /* implemented */ -extern void wsyncup(WINDOW *); /* implemented */ -extern void wtimeout(WINDOW *,int); /* implemented */ -extern int wtouchln(WINDOW *,int,int,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern wchar_t *wunctrl(cchar_t *); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ -extern int wvline(WINDOW *,chtype,int); /* implemented */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern int wvline_set(WINDOW *, const cchar_t *, int); /* missing */ -#endif /* _XOPEN_SOURCE_EXTENDED */ +extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */ +extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */ +extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */ +extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */ +extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */ +extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ +extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */ +extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */ -extern bool mouse_trafo(int*, int*, bool); /* generated */ +/* + * vid_attr() was implemented originally based on the draft of XSI curses. + */ +#ifndef _XOPEN_SOURCE_EXTENDED +#define vid_attr(a,pair,opts) vidattr(a) +#endif /* attributes */ -#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + @cf_cv_widec_shift@)) +#define NCURSES_ATTR_SHIFT 8 +#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) #define A_NORMAL 0L #define A_ATTRIBUTES NCURSES_BITS(~(@cf_cv_1UL@ - @cf_cv_1UL@),0) @@ -873,11 +805,6 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ #define A_BOLD NCURSES_BITS(@cf_cv_1UL@,13) #define A_ALTCHARSET NCURSES_BITS(@cf_cv_1UL@,14) #define A_INVIS NCURSES_BITS(@cf_cv_1UL@,15) - -/* Tradeoff on 32-bit machines ('protect' vs widec). The others (e.g., left - * highlight are not implemented in any terminal descriptions, anyway. - */ -#if ((16 + @cf_cv_widec_shift@) < @cf_cv_shift_limit@) #define A_PROTECT NCURSES_BITS(@cf_cv_1UL@,16) #define A_HORIZONTAL NCURSES_BITS(@cf_cv_1UL@,17) #define A_LEFT NCURSES_BITS(@cf_cv_1UL@,18) @@ -885,18 +812,9 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ #define A_RIGHT NCURSES_BITS(@cf_cv_1UL@,20) #define A_TOP NCURSES_BITS(@cf_cv_1UL@,21) #define A_VERTICAL NCURSES_BITS(@cf_cv_1UL@,22) -#else -#define A_PROTECT 0L -#define A_HORIZONTAL 0L -#define A_LEFT 0L -#define A_LOW 0L -#define A_RIGHT 0L -#define A_TOP 0L -#define A_VERTICAL 0L -#endif #define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (((a) & A_COLOR) >> @cf_cv_widec_shift@) +#define PAIR_NUMBER(a) ((int)(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)) /* * pseudo functions @@ -939,9 +857,9 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ #define wstandend(win) (wattrset(win,A_NORMAL)) #define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK) -#define wattron(win,at) wattr_on(win, at, (void *)0) -#define wattroff(win,at) wattr_off(win, at, (void *)0) -#define wattrset(win,at) ((win)->_attrs = (at)) +#define wattron(win,at) wattr_on(win, (attr_t) at, (void *)0) +#define wattroff(win,at) wattr_off(win, (attr_t) at, (void *)0) +#define wattrset(win,at) ((win)->_attrs = (at)) #define scroll(win) wscrl(win,1) @@ -966,172 +884,108 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ * pseudo functions for standard screen */ -#define addch(ch) waddch(stdscr,ch) +#define addch(ch) waddch(stdscr,ch) #define addchnstr(str,n) waddchnstr(stdscr,str,n) #define addchstr(str) waddchstr(stdscr,str) #define addnstr(str,n) waddnstr(stdscr,str,n) -#define addstr(str) waddnstr(stdscr,str,-1) -#define attroff(at) wattroff(stdscr,at) -#define attron(at) wattron(stdscr,at) -#define attrset(at) wattrset(stdscr,at) +#define addstr(str) waddnstr(stdscr,str,-1) +#define attroff(at) wattroff(stdscr,at) +#define attron(at) wattron(stdscr,at) +#define attrset(at) wattrset(stdscr,at) +#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o) +#define attr_off(a,o) wattr_off(stdscr,a,o) +#define attr_on(a,o) wattr_on(stdscr,a,o) +#define attr_set(a,c,o) wattr_set(stdscr,a,c,o) #define bkgd(ch) wbkgd(stdscr,ch) #define bkgdset(ch) wbkgdset(stdscr,ch) -#define clear() wclear(stdscr) -#define clrtobot() wclrtobot(stdscr) -#define clrtoeol() wclrtoeol(stdscr) +#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) +#define clear() wclear(stdscr) +#define clrtobot() wclrtobot(stdscr) +#define clrtoeol() wclrtoeol(stdscr) #define color_set(c,o) wcolor_set(stdscr,c,o) -#define delch() wdelch(stdscr) -#define deleteln() winsdelln(stdscr,-1) +#define delch() wdelch(stdscr) +#define deleteln() winsdelln(stdscr,-1) #define echochar(c) wechochar(stdscr,c) -#define erase() werase(stdscr) -#define getch() wgetch(stdscr) -#define getstr(str) wgetstr(stdscr,str) -#define inch() winch(stdscr) +#define erase() werase(stdscr) +#define getch() wgetch(stdscr) +#define getstr(str) wgetstr(stdscr,str) +#define inch() winch(stdscr) #define inchnstr(s,n) winchnstr(stdscr,s,n) #define inchstr(s) winchstr(stdscr,s) #define innstr(s,n) winnstr(stdscr,s,n) -#define insch(c) winsch(stdscr,c) +#define insch(c) winsch(stdscr,c) #define insdelln(n) winsdelln(stdscr,n) -#define insertln() winsdelln(stdscr,1) +#define insertln() winsdelln(stdscr,1) #define insnstr(s,n) winsnstr(stdscr,s,n) #define insstr(s) winsstr(stdscr,s) #define instr(s) winstr(stdscr,s) -#define move(y,x) wmove(stdscr,y,x) -#define refresh() wrefresh(stdscr) +#define move(y,x) wmove(stdscr,y,x) +#define refresh() wrefresh(stdscr) #define scrl(n) wscrl(stdscr,n) -#define setscrreg(t,b) wsetscrreg(stdscr,t,b) -#define standend() wstandend(stdscr) -#define standout() wstandout(stdscr) +#define setscrreg(t,b) wsetscrreg(stdscr,t,b) +#define standend() wstandend(stdscr) +#define standout() wstandout(stdscr) #define timeout(delay) wtimeout(stdscr,delay) -#define wdeleteln(win) winsdelln(win,-1) -#define winsertln(win) winsdelln(win,1) +#define wdeleteln(win) winsdelln(win,-1) +#define winsertln(win) winsdelln(win,1) /* * mv functions */ -#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) +#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) #define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) -#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) +#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) #define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) -#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) -#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) -#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) -#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) -#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) -#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) -#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? (chtype)ERR : winch(win)) +#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) +#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) +#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) +#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) +#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) +#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) +#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) +#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? (chtype)ERR : winch(win)) #define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n)) #define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s)) #define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) -#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) +#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) #define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n)) #define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s)) #define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s)) -#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) +#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) -#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) +#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n) #define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str) #define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) -#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) -#define mvdelch(y,x) mvwdelch(stdscr,y,x) -#define mvgetch(y,x) mvwgetch(stdscr,y,x) +#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) +#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) +#define mvdelch(y,x) mvwdelch(stdscr,y,x) +#define mvgetch(y,x) mvwgetch(stdscr,y,x) #define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n) -#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) +#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) #define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n) -#define mvinch(y,x) mvwinch(stdscr,y,x) +#define mvinch(y,x) mvwinch(stdscr,y,x) #define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n) #define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s) #define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) -#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) +#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) #define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) #define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) #define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s) #define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n) /* - * XSI curses macros for XPG4 conformance. - * The underlying functions needed to make these work are: - * waddnwstr(), waddchnwstr(), wadd_wch(), wborder_set(), wchgat(), - * wecho_wchar(), wgetn_wstr(), wget_wch(), whline_set(), vhline_set(), - * winnwstr(), wins_nwstr(), wins_wch(), win_wch(), win_wchnstr(). - * Except for wchgat(), these are not yet implemented. They will be someday. + * Some wide-character functions do not depend on the extensions. */ -#define add_wch(c) wadd_wch(stdscr,c) -#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) -#define addwstr(wstr,n) waddnwstr(stdscr,wstr,-1) -#define attr_get(a,pair,opts) wattr_get(stdscr,a,pair,opts) -#define attr_off(a,opts) wattr_off(stdscr,a,opts) -#define attr_on(a,opts) wattr_on(stdscr,a,opts) -#define attr_set(a,pair,opts) wattr_set(stdscr,a,pair,opts) -#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) -#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) -#define echo_wchar(c) wecho_wchar(stdscr,c) -#define getbkgd(win) ((win)->_bkgd) -#define get_wch(c) wget_wch(stdscr,c) -#define get_wstr(t) wgetn_wstr(stdscr,t,-1) -#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) -#define hline_set(c,n) whline_set(stdscr,c,n) -#define in_wch(c) win_wch(stdscr,c) -#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) -#define in_wchstr(c) win_wchnstr(stdscr,c,-1) -#define innwstr(c,n) winnwstr(stdscr,c,n) -#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) -#define ins_wch(c) wins_wch(stdscr,c) -#define ins_wstr(t) wins_nwstr(stdscr,t,-1) -#define inwstr(c) winnwstr(stdscr,c,-1) - -#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) -#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) -#define mvaddwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,-1) -#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) -#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) -#define mvget_wstr(y,x,t) mvwgetn_wstr(stdscr,y,x,t,-1) -#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) -#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) -#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) -#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) -#define mvin_wchstr(y,x,c) mvwin_wchnstr(stdscr,y,x,c,-1) -#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) -#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) -#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) -#define mvins_wstr(y,x,t) mvwins_nwstr(stdscr,y,x,t,-1) -#define mvinwstr(y,x,c) mvwinnwstr(stdscr,y,x,c,-1) -#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) - -#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(stdscr,c)) -#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,n)) -#define mvwaddwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(stdscr,wstr,-1)) -#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) -#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) -#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,-1)) -#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) -#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) -#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) -#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,n)) -#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(stdscr,c,-1)) -#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,n)) -#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,n)) -#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(stdscr,c)) -#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(stdscr,t,-1)) -#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winnwstr(stdscr,c,-1)) -#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) +#define getbkgd(win) ((win)->_bkgd) #define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a)) #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) -#define vid_attr(a,pair,opts) vidattr(a) -#define vline_set(c,n) wvline_set(stdscr,c,n) -#define waddwstr(win,wstr,n) waddnwstr(win,wstr,-1) #define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \ (void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \ OK) -#define wget_wstr(w,t) wgetn_wstr(w,t,-1) -#define win_wchstr(w,c) win_wchnstr(w,c,-1) -#define wins_wstr(w,t) wins_nwstr(w,t,-1) -#define winwstr(w,c) winnwstr(w,c,-1) - /* * XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use @@ -1142,229 +996,28 @@ extern bool mouse_trafo(int*, int*, bool); /* generated */ #define vw_printw vwprintw #define vw_scanw vwscanw +/* + * Export fallback function for use in C++ binding. + */ +#if !@HAVE_VSSCANF@ +#define vsscanf(a,b,c) _nc_vsscanf(a,b,c) +NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); +#endif + /* * Pseudo-character tokens outside ASCII range. The curses wgetch() function * will return any given one of these only if the corresponding k- capability * is defined in your terminal's terminfo entry. + * + * Some keys (KEY_A1, etc) are arranged like this: + * a1 up a3 + * left b2 right + * c1 down c3 + * + * A few key codes do not depend upon the terminfo entry. */ #define KEY_CODE_YES 0400 /* A wchar_t contains a key code */ #define KEY_MIN 0401 /* Minimum curses key */ -#define KEY_BREAK 0401 /* Break key (unreliable) */ -#define KEY_DOWN 0402 /* Down-arrow */ -#define KEY_UP 0403 /* Up-arrow */ -#define KEY_LEFT 0404 /* Left-arrow */ -#define KEY_RIGHT 0405 /* Right-arrow */ -#define KEY_HOME 0406 /* Home key (upward+left arrow) */ -#define KEY_BACKSPACE 0407 /* Backspace (unreliable) */ -#define KEY_F0 0410 /* Function keys. Space for 64 */ -#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */ -#define KEY_DL 0510 /* Delete line */ -#define KEY_IL 0511 /* Insert line */ -#define KEY_DC 0512 /* Delete character */ -#define KEY_IC 0513 /* Insert char or enter insert mode */ -#define KEY_EIC 0514 /* Exit insert char mode */ -#define KEY_CLEAR 0515 /* Clear screen */ -#define KEY_EOS 0516 /* Clear to end of screen */ -#define KEY_EOL 0517 /* Clear to end of line */ -#define KEY_SF 0520 /* Scroll 1 line forward */ -#define KEY_SR 0521 /* Scroll 1 line backward (reverse) */ -#define KEY_NPAGE 0522 /* Next page */ -#define KEY_PPAGE 0523 /* Previous page */ -#define KEY_STAB 0524 /* Set tab */ -#define KEY_CTAB 0525 /* Clear tab */ -#define KEY_CATAB 0526 /* Clear all tabs */ -#define KEY_ENTER 0527 /* Enter or send (unreliable) */ -#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ -#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ -#define KEY_PRINT 0532 /* Print */ -#define KEY_LL 0533 /* Home down or bottom (lower left) */ - -/* The keypad is arranged like this: */ -/* a1 up a3 */ -/* left b2 right */ -/* c1 down c3 */ - -#define KEY_A1 0534 /* Upper left of keypad */ -#define KEY_A3 0535 /* Upper right of keypad */ -#define KEY_B2 0536 /* Center of keypad */ -#define KEY_C1 0537 /* Lower left of keypad */ -#define KEY_C3 0540 /* Lower right of keypad */ -#define KEY_BTAB 0541 /* Back tab */ -#define KEY_BEG 0542 /* Beg (beginning) */ -#define KEY_CANCEL 0543 /* Cancel */ -#define KEY_CLOSE 0544 /* Close */ -#define KEY_COMMAND 0545 /* Cmd (command) */ -#define KEY_COPY 0546 /* Copy */ -#define KEY_CREATE 0547 /* Create */ -#define KEY_END 0550 /* End */ -#define KEY_EXIT 0551 /* Exit */ -#define KEY_FIND 0552 /* Find */ -#define KEY_HELP 0553 /* Help */ -#define KEY_MARK 0554 /* Mark */ -#define KEY_MESSAGE 0555 /* Message */ -#define KEY_MOVE 0556 /* Move */ -#define KEY_NEXT 0557 /* Next */ -#define KEY_OPEN 0560 /* Open */ -#define KEY_OPTIONS 0561 /* Options */ -#define KEY_PREVIOUS 0562 /* Prev (previous) */ -#define KEY_REDO 0563 /* Redo */ -#define KEY_REFERENCE 0564 /* Ref (reference) */ -#define KEY_REFRESH 0565 /* Refresh */ -#define KEY_REPLACE 0566 /* Replace */ -#define KEY_RESTART 0567 /* Restart */ -#define KEY_RESUME 0570 /* Resume */ -#define KEY_SAVE 0571 /* Save */ -#define KEY_SBEG 0572 /* Shifted Beg (beginning) */ -#define KEY_SCANCEL 0573 /* Shifted Cancel */ -#define KEY_SCOMMAND 0574 /* Shifted Command */ -#define KEY_SCOPY 0575 /* Shifted Copy */ -#define KEY_SCREATE 0576 /* Shifted Create */ -#define KEY_SDC 0577 /* Shifted Delete char */ -#define KEY_SDL 0600 /* Shifted Delete line */ -#define KEY_SELECT 0601 /* Select */ -#define KEY_SEND 0602 /* Shifted End */ -#define KEY_SEOL 0603 /* Shifted Clear line */ -#define KEY_SEXIT 0604 /* Shifted Dxit */ -#define KEY_SFIND 0605 /* Shifted Find */ -#define KEY_SHELP 0606 /* Shifted Help */ -#define KEY_SHOME 0607 /* Shifted Home */ -#define KEY_SIC 0610 /* Shifted Input */ -#define KEY_SLEFT 0611 /* Shifted Left arrow */ -#define KEY_SMESSAGE 0612 /* Shifted Message */ -#define KEY_SMOVE 0613 /* Shifted Move */ -#define KEY_SNEXT 0614 /* Shifted Next */ -#define KEY_SOPTIONS 0615 /* Shifted Options */ -#define KEY_SPREVIOUS 0616 /* Shifted Prev */ -#define KEY_SPRINT 0617 /* Shifted Print */ -#define KEY_SREDO 0620 /* Shifted Redo */ -#define KEY_SREPLACE 0621 /* Shifted Replace */ -#define KEY_SRIGHT 0622 /* Shifted Right arrow */ -#define KEY_SRSUME 0623 /* Shifted Resume */ -#define KEY_SSAVE 0624 /* Shifted Save */ -#define KEY_SSUSPEND 0625 /* Shifted Suspend */ -#define KEY_SUNDO 0626 /* Shifted Undo */ -#define KEY_SUSPEND 0627 /* Suspend */ -#define KEY_UNDO 0630 /* Undo */ -#define KEY_MOUSE 0631 /* Mouse event has occurred */ -#define KEY_RESIZE 0632 /* Terminal resize event */ -#define KEY_MAX 0777 /* Maximum key value */ - -/* mouse interface */ -#define NCURSES_MOUSE_VERSION 1 - -/* event masks */ -#define BUTTON1_RELEASED 000000000001L -#define BUTTON1_PRESSED 000000000002L -#define BUTTON1_CLICKED 000000000004L -#define BUTTON1_DOUBLE_CLICKED 000000000010L -#define BUTTON1_TRIPLE_CLICKED 000000000020L -#define BUTTON1_RESERVED_EVENT 000000000040L -#define BUTTON2_RELEASED 000000000100L -#define BUTTON2_PRESSED 000000000200L -#define BUTTON2_CLICKED 000000000400L -#define BUTTON2_DOUBLE_CLICKED 000000001000L -#define BUTTON2_TRIPLE_CLICKED 000000002000L -#define BUTTON2_RESERVED_EVENT 000000004000L -#define BUTTON3_RELEASED 000000010000L -#define BUTTON3_PRESSED 000000020000L -#define BUTTON3_CLICKED 000000040000L -#define BUTTON3_DOUBLE_CLICKED 000000100000L -#define BUTTON3_TRIPLE_CLICKED 000000200000L -#define BUTTON3_RESERVED_EVENT 000000400000L -#define BUTTON4_RELEASED 000001000000L -#define BUTTON4_PRESSED 000002000000L -#define BUTTON4_CLICKED 000004000000L -#define BUTTON4_DOUBLE_CLICKED 000010000000L -#define BUTTON4_TRIPLE_CLICKED 000020000000L -#define BUTTON4_RESERVED_EVENT 000040000000L -#define BUTTON_CTRL 000100000000L -#define BUTTON_SHIFT 000200000000L -#define BUTTON_ALT 000400000000L -#define ALL_MOUSE_EVENTS 000777777777L -#define REPORT_MOUSE_POSITION 001000000000L - -/* macros to extract single event-bits from masks */ -#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1)))) -#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1)))) -#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1)))) -#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1)))) -#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1)))) -#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1)))) - -typedef unsigned long mmask_t; - -typedef struct -{ - short id; /* ID to distinguish multiple devices */ - int x, y, z; /* event coordinates (character-cell) */ - mmask_t bstate; /* button state bits */ -} -MEVENT; - -extern int getmouse(MEVENT *); -extern int ungetmouse(MEVENT *); -extern mmask_t mousemask(mmask_t, mmask_t *); -extern bool wenclose(const WINDOW *, int, int); -extern int mouseinterval(int); -extern bool wmouse_trafo(const WINDOW* win,int* y, int* x, bool to_screen); - -#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) - -/* other non-XSI functions */ - -extern int mcprint(char *, int); /* direct data to printer */ -extern int has_key(int); /* do we have given key? */ - -/* Debugging : use with libncurses_g.a */ - -extern void _tracef(const char *, ...) GCC_PRINTFLIKE(1,2); -extern void _tracedump(const char *, WINDOW *); -extern char *_traceattr(attr_t); -extern char *_traceattr2(int, chtype); -extern char *_nc_tracebits(void); -extern char *_tracechar(const unsigned char); -extern char *_tracechtype(chtype); -extern char *_tracechtype2(int, chtype); -extern char *_tracemouse(const MEVENT *); -extern void trace(const unsigned int); - -/* trace masks */ -#define TRACE_DISABLE 0x0000 /* turn off tracing */ -#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ -#define TRACE_TPUTS 0x0002 /* trace tputs calls */ -#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ -#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ -#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ -#define TRACE_ORDINARY 0x001F /* trace all update actions */ -#define TRACE_CALLS 0x0020 /* trace all curses calls */ -#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ -#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ -#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ -#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ -#define TRACE_CCALLS 0x0400 /* trace per-character calls */ -#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ -#define TRACE_ATTRS 0x1000 /* trace attribute updates */ -#define TRACE_MAXIMUM 0xffff /* maximum trace level */ - -#if defined(TRACE) || defined(NCURSES_TEST) -extern int _nc_optimize_enable; /* enable optimizations */ -extern const char *_nc_visbuf(const char *); -#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ -#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ -#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ -#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ -#endif - -#ifdef __cplusplus - -/* these names conflict with STL */ -#undef box -#undef clear -#undef erase -#undef move -#undef refresh - -} -#endif - -#endif /* __NCURSES_H */ +#define KEY_BREAK 0401 /* Break key (unreliable) */ +#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ +#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ diff --git a/include/curses.tail b/include/curses.tail new file mode 100644 index 00000000..b3991cdc --- /dev/null +++ b/include/curses.tail @@ -0,0 +1,140 @@ +/* $Id: curses.tail,v 1.7 2002/10/12 15:46:02 tom Exp $ */ + +/* mouse interface */ +#define NCURSES_MOUSE_VERSION 1 + +/* event masks */ +#define BUTTON1_RELEASED 000000000001L +#define BUTTON1_PRESSED 000000000002L +#define BUTTON1_CLICKED 000000000004L +#define BUTTON1_DOUBLE_CLICKED 000000000010L +#define BUTTON1_TRIPLE_CLICKED 000000000020L +#define BUTTON1_RESERVED_EVENT 000000000040L +#define BUTTON2_RELEASED 000000000100L +#define BUTTON2_PRESSED 000000000200L +#define BUTTON2_CLICKED 000000000400L +#define BUTTON2_DOUBLE_CLICKED 000000001000L +#define BUTTON2_TRIPLE_CLICKED 000000002000L +#define BUTTON2_RESERVED_EVENT 000000004000L +#define BUTTON3_RELEASED 000000010000L +#define BUTTON3_PRESSED 000000020000L +#define BUTTON3_CLICKED 000000040000L +#define BUTTON3_DOUBLE_CLICKED 000000100000L +#define BUTTON3_TRIPLE_CLICKED 000000200000L +#define BUTTON3_RESERVED_EVENT 000000400000L +#define BUTTON4_RELEASED 000001000000L +#define BUTTON4_PRESSED 000002000000L +#define BUTTON4_CLICKED 000004000000L +#define BUTTON4_DOUBLE_CLICKED 000010000000L +#define BUTTON4_TRIPLE_CLICKED 000020000000L +#define BUTTON4_RESERVED_EVENT 000040000000L +#define BUTTON_CTRL 000100000000L +#define BUTTON_SHIFT 000200000000L +#define BUTTON_ALT 000400000000L +#define ALL_MOUSE_EVENTS 000777777777L +#define REPORT_MOUSE_POSITION 001000000000L + +/* macros to extract single event-bits from masks */ +#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1)))) +#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1)))) +#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1)))) +#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1)))) +#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1)))) +#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1)))) + +typedef unsigned long mmask_t; + +typedef struct +{ + short id; /* ID to distinguish multiple devices */ + int x, y, z; /* event coordinates (character-cell) */ + mmask_t bstate; /* button state bits */ +} +MEVENT; + +extern NCURSES_EXPORT(int) getmouse (MEVENT *); +extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); +extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); +extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); +extern NCURSES_EXPORT(int) mouseinterval (int); +extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen); +extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ + +#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) + +/* other non-XSI functions */ + +extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ +extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ + +/* Debugging : use with libncurses_g.a */ + +extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); +extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); +extern NCURSES_EXPORT(char *) _traceattr (attr_t); +extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); +extern NCURSES_EXPORT(char *) _nc_tracebits (void); +extern NCURSES_EXPORT(char *) _tracechar (int); +extern NCURSES_EXPORT(char *) _tracechtype (chtype); +extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); +#ifdef _XOPEN_SOURCE_EXTENDED +#define _tracech_t _tracecchar_t +extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); +#define _tracech_t2 _tracecchar_t2 +extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); +#else +#define _tracech_t _tracechtype +#define _tracech_t2 _tracechtype2 +#endif +extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); +extern NCURSES_EXPORT(void) trace (const unsigned int); + +/* trace masks */ +#define TRACE_DISABLE 0x0000 /* turn off tracing */ +#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ +#define TRACE_TPUTS 0x0002 /* trace tputs calls */ +#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ +#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ +#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ +#define TRACE_ORDINARY 0x001F /* trace all update actions */ +#define TRACE_CALLS 0x0020 /* trace all curses calls */ +#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ +#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ +#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ +#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ +#define TRACE_CCALLS 0x0400 /* trace per-character calls */ +#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ +#define TRACE_ATTRS 0x1000 /* trace attribute updates */ + +#define TRACE_SHIFT 13 /* number of bits in the trace masks */ +#define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */ + +#if defined(TRACE) || defined(NCURSES_TEST) +extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ +#ifdef _XOPEN_SOURCE_EXTENDED +extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); +#endif +extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); +#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ +#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ +#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ +#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ +#endif + +#ifndef NCURSES_WGETCH_EVENTS +#undef KEY_EVENT +#endif + +#ifdef __cplusplus + +/* these names conflict with STL */ +#undef box +#undef clear +#undef erase +#undef move +#undef refresh + +} +#endif + +#endif /* __NCURSES_H */ diff --git a/include/curses.wide b/include/curses.wide new file mode 100644 index 00000000..ac03151b --- /dev/null +++ b/include/curses.wide @@ -0,0 +1,237 @@ + +#ifdef _XOPEN_SOURCE_EXTENDED + +/* $Id: curses.wide,v 1.25 2002/08/31 17:48:53 tom Exp $ */ + +extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; + +#define WACS_BSSB (&_nc_wacs['l']) +#define WACS_SSBB (&_nc_wacs['m']) +#define WACS_BBSS (&_nc_wacs['k']) +#define WACS_SBBS (&_nc_wacs['j']) +#define WACS_SBSS (&_nc_wacs['u']) +#define WACS_SSSB (&_nc_wacs['t']) +#define WACS_SSBS (&_nc_wacs['v']) +#define WACS_BSSS (&_nc_wacs['w']) +#define WACS_BSBS (&_nc_wacs['q']) +#define WACS_SBSB (&_nc_wacs['x']) +#define WACS_SSSS (&_nc_wacs['n']) + +#define WACS_ULCORNER WACS_BSSB +#define WACS_LLCORNER WACS_SSBB +#define WACS_URCORNER WACS_BBSS +#define WACS_LRCORNER WACS_SBBS +#define WACS_RTEE WACS_SBSS +#define WACS_LTEE WACS_SSSB +#define WACS_BTEE WACS_SSBS +#define WACS_TTEE WACS_BSSS +#define WACS_HLINE WACS_BSBS +#define WACS_VLINE WACS_SBSB +#define WACS_PLUS WACS_SSSS + +#define WACS_S1 (&_nc_wacs['o']) /* scan line 1 */ +#define WACS_S9 (&_nc_wacs['s']) /* scan line 9 */ +#define WACS_DIAMOND (&_nc_wacs['`']) /* diamond */ +#define WACS_CKBOARD (&_nc_wacs['a']) /* checker board */ +#define WACS_DEGREE (&_nc_wacs['f']) /* degree symbol */ +#define WACS_PLMINUS (&_nc_wacs['g']) /* plus/minus */ +#define WACS_BULLET (&_nc_wacs['~']) /* bullet */ + + /* Teletype 5410v1 symbols */ +#define WACS_LARROW (&_nc_wacs[',']) /* arrow left */ +#define WACS_RARROW (&_nc_wacs['+']) /* arrow right */ +#define WACS_DARROW (&_nc_wacs['.']) /* arrow down */ +#define WACS_UARROW (&_nc_wacs['-']) /* arrow up */ +#define WACS_BOARD (&_nc_wacs['h']) /* board of squares */ +#define WACS_LANTERN (&_nc_wacs['i']) /* lantern symbol */ +#define WACS_BLOCK (&_nc_wacs['0']) /* solid square block */ + + /* ncurses extensions */ +#define WACS_S3 (&_nc_wacs['p']) /* scan line 3 */ +#define WACS_S7 (&_nc_wacs['r']) /* scan line 7 */ +#define WACS_LEQUAL (&_nc_wacs['y']) /* less/equal */ +#define WACS_GEQUAL (&_nc_wacs['z']) /* greater/equal */ +#define WACS_PI (&_nc_wacs['{']) /* Pi */ +#define WACS_NEQUAL (&_nc_wacs['|']) /* not equal */ +#define WACS_STERLING (&_nc_wacs['}']) /* UK pound sign */ + +/* + * Function prototypes for wide-character operations. + * + * "generated" comments should include ":WIDEC" to make the corresponding + * functions ifdef'd in lib_gen.c + * + * "implemented" comments do not need this marker. + */ + +extern NCURSES_EXPORT(int) add_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* implemented */ +extern NCURSES_EXPORT(int) get_wch (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) get_wstr (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*); /* implemented */ +extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wch (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchnstr (cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchstr (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) innwstr (wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) inwstr (wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(NCURSES_CONST char*) key_name (wchar_t); /* implemented */ +extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wch (int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchstr (int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *); /* missing */ +extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */ +extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* missing */ +extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented */ +extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented */ +extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented */ +extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented */ +extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* implemented */ +extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wch (WINDOW *, cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ +extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ + +/* + * XSI curses macros for XPG4 conformance. + */ +#define add_wch(c) wadd_wch(stdscr,c) +#define add_wchnstr(str,n) wadd_wchnstr(stdscr,str,n) +#define add_wchstr(str) wadd_wchstr(stdscr,str) +#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) +#define addwstr(wstr) waddwstr(stdscr,wstr) +#define bkgrnd(c) wbkgrnd(stdscr,c) +#define bkgrndset(c) wbkgrndset(stdscr,c) +#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br) +#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) +#define echo_wchar(c) wecho_wchar(stdscr,c) +#define get_wch(c) wget_wch(stdscr,c) +#define get_wstr(t) wget_wstr(stdscr,t) +#define getbkgrnd(wch) wgetbkgrnd(stdscr,wch) +#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) +#define hline_set(c,n) whline_set(stdscr,c,n) +#define in_wch(c) win_wch(stdscr,c) +#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) +#define in_wchstr(c) win_wchstr(stdscr,c) +#define innwstr(c,n) winnwstr(stdscr,c,n) +#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) +#define ins_wch(c) wins_wch(stdscr,c) +#define ins_wstr(t) wins_wstr(stdscr,t) +#define inwstr(c) winwstr(stdscr,c) +#define vid_attr(a,pair,opts) vidattr(a) +#define vline_set(c,n) wvline_set(stdscr,c,n) +#define wadd_wchstr(win,str) wadd_wchnstr(win,str,-1) +#define waddwstr(win,wstr) waddnwstr(win,wstr,-1) +#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK) +#define wget_wstr(w,t) wgetn_wstr(w,t,-1) +#define wgetbkgrnd(win,wch) (*wch = win->_bkgrnd, OK) +#define win_wchstr(w,c) win_wchnstr(w,c,-1) +#define wins_wstr(w,t) wins_nwstr(w,t,-1) + +#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) +#define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,y,x,s,n) +#define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,y,x,s) +#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) +#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr) +#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) +#define mvget_wstr(y,x,t) mvwget_wstr(stdscr,y,x,t) +#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) +#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) +#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) +#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) +#define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,y,x,c) +#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) +#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) +#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) +#define mvins_wstr(y,x,t) mvwins_wstr(stdscr,y,x,t) +#define mvinwstr(y,x,c) mvwinwstr(stdscr,y,x,c) +#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) + +#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c)) +#define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n)) +#define mvwadd_wchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s)) +#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n)) +#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr)) +#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) +#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t)) +#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) +#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) +#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) +#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n)) +#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c)) +#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n)) +#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n)) +#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(win,c)) +#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t)) +#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winwstr(win,c)) +#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) + +#endif /* _XOPEN_SOURCE_EXTENDED */ diff --git a/include/edit_cfg.sh b/include/edit_cfg.sh index ef9694cb..8d64fee1 100755 --- a/include/edit_cfg.sh +++ b/include/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.10 2000/09/09 20:29:58 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/23 00:52:40 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -48,18 +48,20 @@ do mv $2 $BAK if ( grep "[ ]$name[ ]" $1 2>&1 >$TMP ) then - sed -e 's@#define '$name'.*$@'"`cat $TMP`@" $BAK >$2 - elif test "$name" = "NCURSES_CONST" ; then - sed -e 's/define '$name'.*$/define '$name' \/\*nothing\*\//' $BAK >$2 + value=1 else - sed -e 's/define '$name'.*$/define '$name' 0/' $BAK >$2 + value=0 fi + echo '** edit: '$name $value + sed \ + -e "s@#define ${name}.*\$@#define $name $value@" \ + -e "s@#if $name\$@#if $value /* $name */@" \ + -e "s@#if !$name\$@#if $value /* !$name */@" \ + $BAK >$2 if (cmp -s $2 $BAK) then - echo '** same: '$name mv $BAK $2 else - echo '** edit: '$name rm -f $BAK fi done diff --git a/include/headers b/include/headers index 2a185c21..da3738db 100644 --- a/include/headers +++ b/include/headers @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,3 +32,4 @@ term.h curses.h unctrl.h termcap.h +$(srcdir)/ncurses_dll.h diff --git a/include/nc_alloc.h b/include/nc_alloc.h index 5ac5a78d..8bf6dcc7 100644 --- a/include/nc_alloc.h +++ b/include/nc_alloc.h @@ -29,11 +29,15 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996,1997 * ****************************************************************************/ -/* $Id: nc_alloc.h,v 1.8 2000/04/08 23:42:57 tom Exp $ */ +/* $Id: nc_alloc.h,v 1.11 2002/07/20 13:16:40 tom Exp $ */ #ifndef NC_ALLOC_included #define NC_ALLOC_included 1 +#ifdef __cplusplus +extern "C" { +#endif + #if HAVE_LIBDMALLOC #include /* Gray Watson's library */ #else @@ -66,18 +70,22 @@ extern void _nc_leaks_dump_entry(void); #endif #ifndef ExitProgram -#define ExitProgram(code) return code +#define ExitProgram(code) exit(code) #endif /* doalloc.c */ -extern void *_nc_doalloc(void *, size_t); +extern NCURSES_EXPORT(void *) _nc_doalloc(void *, size_t); #if !HAVE_STRDUP #define strdup _nc_strdup -extern char *_nc_strdup(const char *); +extern NCURSES_EXPORT(char *) _nc_strdup(const char *); #endif #define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type)) #define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type)) #define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type)) +#ifdef __cplusplus +} +#endif + #endif /* NC_ALLOC_included */ diff --git a/include/nc_panel.h b/include/nc_panel.h index dbb20fa1..bb1f6745 100644 --- a/include/nc_panel.h +++ b/include/nc_panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ /* - * $Id: nc_panel.h,v 1.2 1998/02/11 12:13:45 tom Exp $ + * $Id: nc_panel.h,v 1.3 2000/12/10 02:04:35 tom Exp $ * * nc_panel.h * @@ -57,7 +57,7 @@ struct panelhook { }; /* Retrieve the panelhook of the current screen */ -extern struct panelhook* _nc_panelhook(void); +extern NCURSES_EXPORT(struct panelhook*) _nc_panelhook (void); #ifdef __cplusplus } diff --git a/include/ncurses_cfg.hin b/include/ncurses_cfg.hin index 4d40dab8..14391bad 100644 --- a/include/ncurses_cfg.hin +++ b/include/ncurses_cfg.hin @@ -30,7 +30,7 @@ * Author: Thomas E. Dickey 1997 * ****************************************************************************/ /* - * $Id: ncurses_cfg.hin,v 1.3 2000/09/02 17:13:32 tom Exp $ + * $Id: ncurses_cfg.hin,v 1.4 2002/09/07 16:55:14 tom Exp $ * * This is a template-file used to generate the "ncurses_cfg.h" file. * @@ -39,8 +39,8 @@ * 971222) to autoconf 2.12 or 2.13 to do this. * * See: - * http://dickey.his.com/autoconf/ - * ftp://dickey.his.com/autoconf/ + * http://invisible-island.net/autoconf/ + * ftp://invisible-island.net/autoconf/ */ #ifndef NC_CONFIG_H #define NC_CONFIG_H diff --git a/include/ncurses_defs b/include/ncurses_defs index e4a391f1..a4b49c00 100644 --- a/include/ncurses_defs +++ b/include/ncurses_defs @@ -1,6 +1,6 @@ -# $Id: ncurses_defs,v 1.4 2000/10/08 01:04:00 tom Exp $ +# $Id: ncurses_defs,v 1.15 2002/08/24 23:13:43 tom Exp $ ############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # +# Copyright (c) 2000-2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -36,6 +36,9 @@ BSD_TPUTS CC_HAS_INLINE_FUNCS CC_HAS_PROTOS CPP_HAS_PARAM_INIT +CPP_HAS_VSCAN_FUNC +CURSES_ACS_ARRAY acs_map +CURSES_WACS_ARRAY _nc_wacs DECL_ERRNO ETIP_NEEDS_MATH_H GCC_NORETURN /* nothing */ @@ -50,6 +53,7 @@ HAVE_FORM_H HAVE_GETCWD HAVE_GETEGID HAVE_GETEUID +HAVE_GETNSTR HAVE_GETOPT_H HAVE_GETTIMEOFDAY HAVE_GETTTYNAM @@ -76,6 +80,7 @@ HAVE_NC_ALLOC_H HAVE_PANEL_H HAVE_POLL HAVE_POLL_H +HAVE_PURIFY HAVE_REGEXPR_H_FUNCS HAVE_REGEXP_H_FUNCS HAVE_REGEX_H_FUNCS @@ -108,6 +113,7 @@ HAVE_TERMIO_H HAVE_TIMES HAVE_TTYENT_H HAVE_TYPEINFO +HAVE_TYPE_ATTR_T HAVE_TYPE_SIGACTION HAVE_UNISTD_H HAVE_UNLINK @@ -117,11 +123,13 @@ HAVE_VSNPRINTF HAVE_VSSCANF HAVE_WORKING_POLL HAVE_WRESIZE +HAVE__DOSCAN MIXEDCASE_FILENAMES NCURSES_EXPANDED NCURSES_EXT_FUNCS NCURSES_NOMACROS NCURSES_NO_PADDING +NCURSES_PATHSEP ':' NDEBUG NEED_PTEM_H NO_LEAKS @@ -132,6 +140,8 @@ SVR4_ACTION SVR4_TERMIO SYSTEM_NAME "unknown" TERMINFO "none" +TERMPATH "none" +TIME_WITH_SYS_TIME TYPEOF_CHTYPE USE_COLORFGBG USE_DATABASE @@ -146,6 +156,10 @@ USE_RCS_IDS USE_SAFE_SPRINTF USE_SCROLL_HINTS USE_SIGWINCH +USE_STDIO_VSCAN +USE_STRSTREAM_VSCAN +USE_STRSTREAM_VSCAN_CAST USE_SYMLINKS +USE_TERMCAP USE_WIDEC_SUPPORT USE_XMC_SUPPORT diff --git a/include/ncurses_dll.h b/include/ncurses_dll.h new file mode 100644 index 00000000..c961c3e0 --- /dev/null +++ b/include/ncurses_dll.h @@ -0,0 +1,48 @@ +/* $Id: ncurses_dll.h,v 1.2 2001/12/09 01:36:34 tom Exp $ */ + +#ifndef NCURSES_DLL_H_incl +#define NCURSES_DLL_H_incl 1 + +#undef NCURSES_DLL /* cygwin dll not implemented */ +#define NCURSES_STATIC /* cygwin dll not implemented */ + +#if defined(__CYGWIN__) +# if defined(NCURSES_DLL) +# if defined(NCURSES_STATIC) +# undef NCURSES_STATIC +# endif +# endif +# undef NCURSES_IMPEXP +# undef NCURSES_API +# undef NCURSES_EXPORT(type) +# undef NCURSES_EXPORT_VAR(type) +# if defined(NCURSES_DLL) +/* building a DLL */ +# define NCURSES_IMPEXP __declspec(dllexport) +# elif defined(NCURSES_STATIC) +/* building or linking to a static library */ +# define NCURSES_IMPEXP /* nothing */ +# else +/* linking to the DLL */ +# define NCURSES_IMPEXP __declspec(dllimport) +# endif +# define NCURSES_API __cdecl +# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API +# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type +#endif + +/* Take care of non-cygwin platforms */ +#if !defined(NCURSES_IMPEXP) +# define NCURSES_IMPEXP /* nothing */ +#endif +#if !defined(NCURSES_API) +# define NCURSES_API /* nothing */ +#endif +#if !defined(NCURSES_EXPORT) +# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API +#endif +#if !defined(NCURSES_EXPORT_VAR) +# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type +#endif + +#endif /* NCURSES_DLL_H_incl */ diff --git a/include/term_entry.h b/include/term_entry.h index 7d9f77b4..a066be99 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -31,14 +31,14 @@ * and: Eric S. Raymond * ****************************************************************************/ -/* $Id: term_entry.h,v 1.29 2000/03/19 02:04:15 tom Exp $ */ +/* $Id: term_entry.h,v 1.32 2001/03/24 21:53:10 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code */ -#ifndef _TERM_ENTRY_H -#define _TERM_ENTRY_H +#ifndef NCURSES_TERM_ENTRY_H_incl +#define NCURSES_TERM_ENTRY_H_incl 1 #ifdef __cplusplus extern "C" { @@ -90,7 +90,8 @@ ENTRY; #define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names) #define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names) -extern ENTRY *_nc_head, *_nc_tail; +extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head; +extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail; #define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next) #define MAX_LINE 132 @@ -116,46 +117,46 @@ extern ENTRY *_nc_head, *_nc_tail; } /* alloc_entry.c: elementary allocation code */ -extern ENTRY *_nc_copy_entry(ENTRY *oldp); -extern char *_nc_save_str(const char *const); -extern void _nc_init_entry(TERMTYPE *const); -extern void _nc_merge_entry(TERMTYPE *const, TERMTYPE *const); -extern void _nc_wrap_entry(ENTRY *const); +extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp); +extern NCURSES_EXPORT(char *) _nc_save_str (const char *const); +extern NCURSES_EXPORT(void) _nc_init_entry (TERMTYPE *const); +extern NCURSES_EXPORT(void) _nc_merge_entry (TERMTYPE *const, TERMTYPE *const); +extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool); /* alloc_ttype.c: elementary allocation code */ -extern void _nc_align_termtype(TERMTYPE *, TERMTYPE *); -extern void _nc_copy_termtype(TERMTYPE *, TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, TERMTYPE *); /* free_ttype.c: elementary allocation code */ -extern void _nc_free_termtype(TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *); /* lib_acs.c */ -extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */ +extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ /* parse_entry.c: entry-parsing code */ #if NCURSES_XNAMES -extern bool _nc_user_definable; -extern bool _nc_disable_period; +extern NCURSES_EXPORT_VAR(bool) _nc_user_definable; +extern NCURSES_EXPORT_VAR(bool) _nc_disable_period; #endif -extern int _nc_parse_entry(ENTRY *, int, bool); -extern int _nc_capcmp(const char *, const char *); +extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool); +extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); /* write_entry.c: writing an entry to the file system */ -extern void _nc_set_writedir(char *); -extern void _nc_write_entry(TERMTYPE *const); +extern NCURSES_EXPORT(void) _nc_set_writedir (char *); +extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const); /* comp_parse.c: entry list handling */ -extern void _nc_read_entry_source(FILE*, char*, int, bool, bool (*)(ENTRY*)); -extern bool _nc_entry_match(char *, char *); -extern int _nc_resolve_uses(bool); -extern void _nc_free_entries(ENTRY *); -extern void (*_nc_check_termtype)(TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*)); +extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); +extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); +extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); +extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* trace_xnames.c */ -extern void _nc_trace_xnames(TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); #ifdef __cplusplus } #endif -#endif /* _TERM_ENTRY_H */ +#endif /* NCURSES_TERM_ENTRY_H_incl */ diff --git a/include/termcap.h.in b/include/termcap.h.in index 21c62398..6adc3122 100644 --- a/include/termcap.h.in +++ b/include/termcap.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,14 +31,16 @@ * and: Eric S. Raymond * ****************************************************************************/ -/* $Id: termcap.h.in,v 1.12 2000/10/08 01:06:37 tom Exp $ */ +/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */ -#ifndef _NCU_TERMCAP_H -#define _NCU_TERMCAP_H 1 +#ifndef NCURSES_TERMCAP_H_incl +#define NCURSES_TERMCAP_H_incl 1 #undef NCURSES_VERSION #define NCURSES_VERSION "@NCURSES_MAJOR@.@NCURSES_MINOR@" +#include + #ifdef __cplusplus extern "C" { @@ -49,22 +51,25 @@ extern "C" #undef NCURSES_CONST #define NCURSES_CONST @NCURSES_CONST@ -extern char PC; -extern char *UP; -extern char *BC; -extern short ospeed; +#undef NCURSES_OSPEED +#define NCURSES_OSPEED @NCURSES_OSPEED@ + +extern NCURSES_EXPORT_VAR(char) PC; +extern NCURSES_EXPORT_VAR(char *) UP; +extern NCURSES_EXPORT_VAR(char *) BC; +extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed; -#if !defined(_NCU_TERM_H) -extern char *tgetstr(NCURSES_CONST char *, char **); -extern char *tgoto(const char *, int, int); -extern int tgetent(char *, const char *); -extern int tgetflag(NCURSES_CONST char *); -extern int tgetnum(NCURSES_CONST char *); -extern int tputs(const char *, int, int (*)(int)); +#if !defined(NCURSES_TERM_H_incl) +extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); +extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); +extern NCURSES_EXPORT(int) tgetent (char *, const char *); +extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); +extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); +extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); #endif #ifdef __cplusplus } #endif -#endif /* _NCU_TERMCAP_H */ +#endif /* NCURSES_TERMCAP_H_incl */ diff --git a/include/tic.h b/include/tic.h index bba0c0ff..806d43fd 100644 --- a/include/tic.h +++ b/include/tic.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ ****************************************************************************/ /* - * $Id: tic.h,v 1.35 2000/09/09 19:47:16 tom Exp $ + * $Id: tic.h,v 1.42 2002/10/12 15:46:15 tom Exp $ * tic.h - Global variables and structures for the terminfo * compiler. */ @@ -104,7 +104,7 @@ extern "C" { */ #define MAX_DEBUG_LEVEL 15 -#define DEBUG_LEVEL(n) ((n) << 12) /* see TRACE_MAXIMUM */ +#define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT) #define set_trace_level(n) \ _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \ @@ -116,9 +116,10 @@ extern "C" { #define DEBUG(n, a) /*nothing*/ #endif -extern unsigned _nc_tracing; -extern void _nc_tracef(char *, ...) GCC_PRINTFLIKE(1,2); -extern const char *_nc_visbuf(const char *); +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2); +extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); +extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); /* * These are the types of tokens returned by the scanner. The first @@ -149,7 +150,7 @@ struct token char *tk_valstring; /* value of capability (if a string) */ }; -extern struct token _nc_curr_token; +extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token; /* * List of keynames with their corresponding code. @@ -159,7 +160,7 @@ struct kn { int code; }; -extern const struct kn _nc_key_names[]; +extern NCURSES_EXPORT_VAR(const struct kn) _nc_key_names[]; /* * Offsets to string capabilities, with the corresponding functionkey @@ -173,11 +174,11 @@ struct tinfo_fkeys { #if BROKEN_LINKER #define _nc_tinfo_fkeys _nc_tinfo_fkeysf() -extern struct tinfo_fkeys *_nc_tinfo_fkeysf(void); +extern NCURSES_EXPORT(struct tinfo_fkeys *) _nc_tinfo_fkeysf (void); #else -extern struct tinfo_fkeys _nc_tinfo_fkeys[]; +extern NCURSES_EXPORT_VAR(struct tinfo_fkeys) _nc_tinfo_fkeys[]; #endif @@ -202,28 +203,30 @@ struct alias const char *source; }; -extern const struct name_table_entry * const _nc_info_hash_table[]; -extern const struct name_table_entry * const _nc_cap_hash_table[]; +extern NCURSES_EXPORT_VAR(int) _nc_tparm_err; -extern const struct alias _nc_capalias_table[]; -extern const struct alias _nc_infoalias_table[]; +extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_info_hash_table[]; +extern NCURSES_EXPORT_VAR(const struct name_table_entry * const) _nc_cap_hash_table[]; -extern const struct name_table_entry *_nc_get_table(bool); -extern const struct name_table_entry * const *_nc_get_hash_table(bool); +extern NCURSES_EXPORT_VAR(const struct alias) _nc_capalias_table[]; +extern NCURSES_EXPORT_VAR(const struct alias) _nc_infoalias_table[]; + +extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool); +extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_table (bool); #define NOTFOUND ((struct name_table_entry *) 0) /* out-of-band values for representing absent capabilities */ -#define ABSENT_BOOLEAN -1 -#define ABSENT_NUMERIC -1 +#define ABSENT_BOOLEAN (-1) /* 255 */ +#define ABSENT_NUMERIC (-1) #define ABSENT_STRING (char *)0 /* out-of-band values for representing cancels */ -#define CANCELLED_BOOLEAN (char)(-2) -#define CANCELLED_NUMERIC -2 -#define CANCELLED_STRING (char *)-1 +#define CANCELLED_BOOLEAN (char)(-2) /* 254 */ +#define CANCELLED_NUMERIC (-2) +#define CANCELLED_STRING (char *)(-1) -#define VALID_BOOLEAN(s) ((s) >= 0) +#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ #define VALID_NUMERIC(s) ((s) >= 0) #define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) @@ -238,59 +241,60 @@ extern const struct name_table_entry * const *_nc_get_hash_table(bool); #endif /* access.c */ -extern char *_nc_basename(char *); +extern NCURSES_EXPORT(char *) _nc_basename (char *); +extern NCURSES_EXPORT(char *) _nc_rootname (char *); /* comp_hash.c: name lookup */ -struct name_table_entry const *_nc_find_entry(const char *, - const struct name_table_entry *const *); -struct name_table_entry const *_nc_find_type_entry(const char *, - int, - const struct name_table_entry *); +extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry + (const char *, const struct name_table_entry *const *); +extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry + (const char *, int, const struct name_table_entry *); /* comp_scan.c: lexical analysis */ -extern int _nc_get_token(void); -extern void _nc_push_token(int); -extern void _nc_reset_input(FILE *, char *); -extern void _nc_panic_mode(char); -extern int _nc_curr_line; -extern int _nc_curr_col; -extern long _nc_curr_file_pos; -extern long _nc_comment_start, _nc_comment_end; -extern int _nc_syntax; -extern long _nc_start_line; +extern NCURSES_EXPORT(int) _nc_get_token (bool); +extern NCURSES_EXPORT(void) _nc_panic_mode (char); +extern NCURSES_EXPORT(void) _nc_push_token (int); +extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *); +extern NCURSES_EXPORT_VAR(int) _nc_curr_col; +extern NCURSES_EXPORT_VAR(int) _nc_curr_line; +extern NCURSES_EXPORT_VAR(int) _nc_syntax; +extern NCURSES_EXPORT_VAR(long) _nc_comment_end; +extern NCURSES_EXPORT_VAR(long) _nc_comment_start; +extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos; +extern NCURSES_EXPORT_VAR(long) _nc_start_line; #define SYN_TERMINFO 0 #define SYN_TERMCAP 1 /* comp_error.c: warning & abort messages */ -extern void _nc_set_source(const char *const name); -extern void _nc_get_type(char *name); -extern void _nc_set_type(const char *const name); -extern void _nc_syserr_abort(const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; -extern void _nc_err_abort(const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; -extern void _nc_warning(const char *const,...) GCC_PRINTFLIKE(1,2); -extern bool _nc_suppress_warnings; +extern NCURSES_EXPORT(void) _nc_set_source (const char *const name); +extern NCURSES_EXPORT(void) _nc_get_type (char *name); +extern NCURSES_EXPORT(void) _nc_set_type (const char *const name); +extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; +extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; +extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2); +extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings; /* comp_expand.c: expand string into readable form */ -extern char *_nc_tic_expand(const char *, bool, int); +extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int); /* comp_scan.c: decode string from readable form */ -extern char _nc_trans_string(char *, char *); +extern NCURSES_EXPORT(char) _nc_trans_string (char *, char *); /* captoinfo.c: capability conversion */ -extern char *_nc_captoinfo(const char *, const char *, int const); -extern char *_nc_infotocap(const char *, const char *, int const); +extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const); +extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const); /* lib_tputs.c */ -extern int _nc_nulls_sent; /* Add one for every null sent */ +extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */ /* comp_main.c: compiler main */ -extern const char *_nc_progname; +extern const char * _nc_progname; /* read_entry.c */ -extern const char *_nc_tic_dir(const char *); +extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *); /* write_entry.c */ -extern int _nc_tic_written(void); +extern NCURSES_EXPORT(int) _nc_tic_written (void); #ifdef __cplusplus } diff --git a/include/unctrl.h.in b/include/unctrl.h.in index cc10079f..70d74b77 100644 --- a/include/unctrl.h.in +++ b/include/unctrl.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,10 +39,10 @@ * as ^?. Printable characters are displayed as is. */ -/* $Id: unctrl.h.in,v 1.8 1998/02/11 12:13:45 tom Exp $ */ +/* $Id: unctrl.h.in,v 1.10 2001/03/24 21:53:25 tom Exp $ */ -#ifndef _UNCTRL_H -#define _UNCTRL_H 1 +#ifndef NCURSES_UNCTRL_H_incl +#define NCURSES_UNCTRL_H_incl 1 #undef NCURSES_VERSION #define NCURSES_VERSION "@NCURSES_MAJOR@.@NCURSES_MINOR@" @@ -54,10 +54,10 @@ extern "C" { #include #undef unctrl -extern NCURSES_CONST char *unctrl(chtype); +NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); #ifdef __cplusplus } #endif -#endif /* _UNCTRL_H */ +#endif /* NCURSES_UNCTRL_H_incl */ diff --git a/man/MKterminfo.sh b/man/MKterminfo.sh index d4e25c51..8160ca93 100755 --- a/man/MKterminfo.sh +++ b/man/MKterminfo.sh @@ -1,6 +1,10 @@ #!/bin/sh +# $Id: MKterminfo.sh,v 1.10 2002/06/29 20:04:28 tom Exp $ +# +# MKterminfo.sh -- generate terminfo.5 from Caps tabular data +# #*************************************************************************** -# Copyright (c) 1998-2000 Free Software Foundation, Inc. * +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * # * # Permission is hereby granted, free of charge, to any person obtaining a * # copy of this software and associated documentation files (the * @@ -27,10 +31,6 @@ # authorization. * #*************************************************************************** # -# $Id: MKterminfo.sh,v 1.6 2000/01/25 11:31:57 tom Exp $ -# -# MKterminfo.sh -- generate terminfo.5 from Caps tabular data -# # This script takes terminfo.head and terminfo.tail and splices in between # them a table derived from the Caps data file. Besides avoiding having # the docs fall out of sync with the table, this also lets us set up tbl @@ -41,10 +41,13 @@ # had better be no s in the table source text. # # keep the order independent of locale: -LANGUAGE=C -LC_ALL=C -export LANGUAGE -export LC_ALL +if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi + # head=$1 caps=$2 @@ -68,8 +71,9 @@ sed -n <$caps "\ /%%-STOP-HERE-%%/q /^#%/s///p /^#/d +s/[ ]\+/ /g s/$/T}/ -s/ [Y\-][B\-][C\-][G\-][E\-]\** / T{/ +s/ [A-Z0-9_()\-]\+ [0-9\-]\+ [Y\-][B\-][C\-][G\-][EK\-]\** / T{/ s/ bool / /p s/ num / /p s/ str / /p @@ -80,6 +84,7 @@ rm -f $temp saved=no while true do + data= read data test -z "$data" && break case "$data" in #(vi diff --git a/man/Makefile.in b/man/Makefile.in index 0d7648ac..56dbe093 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.28 2000/08/19 19:15:44 tom Exp $ +# $Id: Makefile.in,v 1.33 2002/01/19 22:49:44 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -47,10 +47,11 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ all \ -sources: terminfo.5 +sources : terminfo.5 +depend : $(DESTDIR)$(mandir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]* @@ -61,15 +62,18 @@ uninstall uninstall.man : -sh ./edit_man.sh removing $(EDITARGS) # We compose terminfo.5 from the real sources... -CAPLIST=$(srcdir)/../include/Caps +CAPLIST=$(srcdir)/../include/@TERMINFO_CAPS@ terminfo.5: $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail Makefile $(srcdir)/MKterminfo.sh sh $(srcdir)/MKterminfo.sh $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail >terminfo.5 mostlyclean : - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.ln *.atac trace clean: mostlyclean rm -f terminfo.5 +edit_man.sed : make_sed.sh @MANPAGE_RENAMES@ + sh $srcdir/make_sed.sh @MANPAGE_RENAMES@ >edit_man.sed + distclean realclean: clean rm -f Makefile edit_man.* diff --git a/man/curs_add_wch.3x b/man/curs_add_wch.3x new file mode 100644 index 00000000..fae59ae0 --- /dev/null +++ b/man/curs_add_wch.3x @@ -0,0 +1,134 @@ +.\"*************************************************************************** +.\" Copyright (c) 2001,2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_add_wch.3x,v 1.4 2002/02/16 22:28:43 tom Exp $ +.TH curs_add_wch 3X "" +.SH NAME +\fBadd_wch\fP, +\fBwadd_wch\fP, +\fBmvadd_wch\fP, +\fBmvwadd_wch\fP, +\fBecho_wchar\fP, +\fBwecho_wchar\fP - add a complex character and rendition to a \fBcurses\fR window, then advance the cursor +.SH SYNOPSIS +.PP +\fB#include \fP +.sp +.B "int add_wch( const cchar_t *\fIwch\fB );" +.br +.B "int wadd_wch( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );" +.br +.B "int mvadd_wch( int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );" +.br +.B "int mvwadd_wch( WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, const cchar_t *\fIwch\fB );" +.br +.B "int echo_wchar( const cchar_t *\fIwch\fB );" +.br +.B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );" +.br +.SH DESCRIPTION +.PP +The +\fBadd_wch\fP, +\fBwadd_wch\fP, +\fBmvadd_wch\fP, and +\fBmvwadd_wch\fP +functions put the complex character \fIwch\fP into the given +window at its current position, +which is then advanced. +These functions perform +wrapping and special-character processing as follows: +.TP 5 +- +If \fIwch\fP refers to a spacing character, +then any previous character at that location is removed. +A new character specified by \fIwch\fP is +placed at that location with rendition specified by \fIwch\fP. +The cursor then advances to +the next spacing character on the screen. +.TP 5 +- +If \fIwch\fP refers to a non-spacing character, +all previous characters at that location are preserved. +The non-spacing characters of \fIwch\fP +are added to the spacing complex character, +and the rendition specified by \fIwch\fP is ignored. +.TP 5 +- +If the character part of \fIwch\fP is +a tab, newline, backspace or other control character, +the window is updated and the cursor moves as if \fBaddch\fR(3X) were called. +.PP +The \fBecho_wchar\fP +function is functionally equivalent to a call to +\fBadd_wch\fP +followed by a call to +\fBrefresh\fP. +Similarly, the +\fBwecho_wchar\fP +is functionally equivalent to a call to +\fBwadd_wch\fP +followed by a call to +\fBwrefresh\fP. +The knowledge +that only a single character is being output is taken into consideration and, +for non-control characters, a considerable performance gain might be seen +by using the *\fBecho\fP* functions instead of their equivalents. +.SH RETURN VALUES +.PP +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH NOTES +.PP +Note that +\fBadd_wch\fP, +\fBmvadd_wch\fP, +\fBmvwadd_wch\fP, and +\fBecho_wchar\fP +may be macros. +.SH PORTABILITY +.PP +All these functions are described in the XSI Curses standard, Issue 4. +The defaults specified for forms-drawing characters apply in the POSIX locale. +.PP +XSI documents constants beginning with \fBWACS_\fP which are used for +line-drawing. +Those are not currently implemented in \fBncurses\fP. +.SH SEE ALSO +.PP +\fBcurses\fR(3X), +\fBcurs_attr_get\fR(3X), +\fBcurs_clear\fR(3X), +\fBcurs_outopts\fR(3X), +\fBcurs_refresh\fR(3X), +\fBputwc\fR(3) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_add_wchstr.3x b/man/curs_add_wchstr.3x new file mode 100644 index 00000000..17d34469 --- /dev/null +++ b/man/curs_add_wchstr.3x @@ -0,0 +1,98 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_add_wchstr.3x,v 1.1 2002/02/23 22:15:55 tom Exp $ +.TH curs_add_wchstr 3X "" +.SH NAME +.PP +\fBadd_wchstr\fR, +\fBadd_wchnstr\fR, +\fBwadd_wchstr\fR, +\fBwadd_wchnstr\fR, +\fBmvadd_wchstr\fR, +\fBmvadd_wchnstr\fR, +\fBmvwadd_wchstr\fR, +\fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window +.SH SYNOPSIS +.B #include + +.nf +\fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint add_wchnstr(const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wadd_wchstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint wadd_wchnstr(WINDOW *\fR \fIwin\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvadd_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvadd_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwadd_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvwadd_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines copy the array of complex characters \fIwchstr\fR +into the window image structure at and after the current cursor position. +The four routines with \fIn\fR as the last +argument copy at most \fIn\fR elements, but no more than will fit on the line. +If \fBn\fR=\fB-1\fR then the whole array is copied, +to the maximum number of characters that will fit on the line. +.PP +The window cursor is \fInot\fR advanced. +These routines work faster than \fBwaddnstr\fR. +On the other hand, they do not perform checking +(such as for the newline, backspace, or carriage return characters), +they do not advance the current cursor position, +they do not expand other control characters to ^-escapes, +and they truncate the string if it crosses the right margin, +rather then wrapping it around to the new line. +.PP +These routines end successfully +on encountering a null \fIcchar_t\fR, or +when they have filled the current line. +If a complex character cannot completely fit at the end of the current line, +the remaining columns are filled with the background character and rendition. +.SH NOTES +All functions except \fBwadd_wchnstr\fR may be macros. +.SH RETURN VALUES +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH PORTABILITY +All these entry points are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_addchstr\fR(3X) +\fBcurs_addwstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_addch.3x b/man/curs_addch.3x index 63e05269..3feb9e78 100644 --- a/man/curs_addch.3x +++ b/man/curs_addch.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_addch.3x,v 1.17 2000/07/01 19:53:01 tom Exp $ +.\" $Id: curs_addch.3x,v 1.20 2002/08/10 22:12:36 tom Exp $ .TH curs_addch 3X "" .SH NAME \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, @@ -36,17 +36,17 @@ .SH SYNOPSIS \fB#include \fR -\fBint addch(chtype ch);\fR +\fBint addch(const chtype ch);\fR .br -\fBint waddch(WINDOW *win, chtype ch);\fR +\fBint waddch(WINDOW *win, const chtype ch);\fR .br -\fBint mvaddch(int y, int x, chtype ch);\fR +\fBint mvaddch(int y, int x, const chtype ch);\fR .br -\fBint mvwaddch(WINDOW *win, int y, int x, chtype ch);\fR +\fBint mvwaddch(WINDOW *win, int y, int x, const chtype ch);\fR .br -\fBint echochar(chtype ch);\fR +\fBint echochar(const chtype ch);\fR .br -\fBint wechochar(WINDOW *win, chtype ch);\fR +\fBint wechochar(WINDOW *win, const chtype ch);\fR .br .SH DESCRIPTION The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put @@ -56,11 +56,15 @@ If the advance is at the right margin, the cursor automatically wraps to the beginning of the next line. At the bottom of the current scrolling region, if \fBscrollok\fR is enabled, the scrolling region is scrolled up one line. -If \fIch\fR is a tab, newline, or backspace, the cursor is moved appropriately -within the window. Backspace moves the cursor one character left; at the left -edge of a window it does nothing. Newline does a \fBclrtoeol\fR, then moves -the cursor to the window left margin on the next line, scrolling the window if -on the last line). Tabs are considered to be at every eighth column. +If \fIch\fR is a tab, newline, or backspace, +the cursor is moved appropriately within the window. +Backspace moves the cursor one character left; at the left +edge of a window it does nothing. +Newline does a \fBclrtoeol\fR, +then moves the cursor to the window left margin on the next line, +scrolling the window if on the last line). +Tabs are considered to be at every eighth column. +The tab interval may be altered by setting the \fBTABSIZE\fR variable. If \fIch\fR is any control character other than tab, newline, or backspace, it is drawn in \fB^\fR\fIX\fR notation. Calling \fBwinch\fR after adding a @@ -137,7 +141,7 @@ Note that \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and .SH PORTABILITY All these functions are described in the XSI Curses standard, Issue 4. The defaults specified for forms-drawing characters apply in the POSIX locale. - +.LP Some ACS symbols (ACS_S3, ACS_S7, @@ -151,6 +155,9 @@ any publicly released System V. However, many publicly available terminfos include \fBacsc\fR strings in which their key characters (pryz{|}) are embedded, and a second-hand list of their character descriptions has come to light. The ACS-prefixed names for them were invented for \fBncurses\fR(3X). +.LP +The \fBTABSIZE\fR variable is implemented in some versions of curses, +but is not part of X/Open curses. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_clear\fR(3X), \fBcurs_inch\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X), diff --git a/man/curs_addstr.3x b/man/curs_addstr.3x index 6b74452d..a845acbc 100644 --- a/man/curs_addstr.3x +++ b/man/curs_addstr.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_addstr.3x,v 1.9 2000/07/01 19:54:05 tom Exp $ +.\" $Id: curs_addstr.3x,v 1.10 2002/03/09 23:09:29 tom Exp $ .TH curs_addstr 3X "" .SH NAME \fBaddstr\fR, @@ -38,29 +38,34 @@ \fBmvwaddstr\fR, \fBmvwaddnstr\fR - add a string of characters to a \fBcurses\fR window and advance cursor .SH SYNOPSIS +.nf \fB#include \fR -\fBint addstr(const char *str);\fR +\fBint addstr(const char *\fR\fIstr\fR\fB);\fR .br -\fBint addnstr(const char *str, int n);\fR +\fBint addnstr(const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint waddstr(WINDOW *win, const char *str);\fR +\fBint waddstr(WINDOW *\fR\fIwin\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint waddnstr(WINDOW *win, const char *str, int n);\fR +\fBint waddnstr(WINDOW *\fR\fIwin\fR\fB, const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint mvaddstr(int y, int x, const char *str);\fR +\fBint mvaddstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint mvaddnstr(int y, int x, const char *str, int n);\fR +\fBint mvaddnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR .br -\fBint mvwaddstr(WINDOW *win, int y, int x, const char *str);\fR +\fBint mvwaddstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr\fR\fB);\fR .br -\fBint mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);\fR +\fBint mvwaddnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr, int \fR\fIn\fR\fB);\fR +.fi .SH DESCRIPTION These routines write the characters of the (null-terminated) character string -\fIstr\fR on the given window. It is similar to calling \fBwaddch\fR once for -each character in the string. The four routines with \fIn\fR as the last -argument write at most \fIn\fR characters. If \fIn\fR is -1, then the -entire string will be added. +\fIstr\fR on the given window. +It is similar to calling \fBwaddch\fR once for each character in the string. +The four routines with \fIn\fR as the last argument +write at most \fIn\fR characters. +If \fIn\fR is -1, then the entire string will be added, +up to the maximum number of characters that will fit on the line, +or until a terminating null is reached. .SH RETURN VALUE All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon diff --git a/man/curs_addwstr.3x b/man/curs_addwstr.3x new file mode 100644 index 00000000..4ce7c230 --- /dev/null +++ b/man/curs_addwstr.3x @@ -0,0 +1,91 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_addwstr.3x,v 1.2 2002/03/09 23:16:59 tom Exp $ +.TH curs_addwstr 3X "" +.SH NAME +\fBaddwstr\fR, +\fBaddnwstr\fR, +\fBwaddwstr\fR, +\fBwaddnwstr\fR, +\fBmvaddwstr\fR, +\fBmvaddnwstr\fR, +\fBmvwaddwstr\fR, +\fBmvwaddnwstr\fR \- add a string of wide characters to a \fBcurses\fR window and advance cursor +.SH SYNOPSIS +.nf +\fB#include \fR + +\fBint addwstr(const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint addnwstr(const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint waddwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint waddnwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvaddwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvaddnwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwaddwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwaddnwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines write the characters of the (null-terminated) \fBwchar_t\fRcharacter string +\fIwstr\fR on the given window. +It is similar to constructing a \fBcchar_t\fR for each wchar_t in the string, +then calling \fBwadd_wch\fR for the resulting \fBcchar_t\fR. +.PP +The \fImv\fR routines perform cursor movement once, before writing any +characters. +Thereafter, the cursor is advanced as a side-effect of writing to the window. +.PP +The four routines with \fIn\fR as the last argument +write at most \fIn\fR \fBwchar_t\fR characters. +If \fIn\fR is -1, then the entire string will be added, +up to the maximum number of characters that will fit on the line, +or until a terminating null is reached. +.SH RETURN VALUES +All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success. +.SH NOTES +Note that all of these routines except \fBwaddnwstr\fR may be macros. +.SH PORTABILITY +All these entry points are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +.PP +Functions: +\fBcurses\fR(3X), +\fBcurs_add_wch\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_attr.3x b/man/curs_attr.3x index e884fa88..3457ff2b 100644 --- a/man/curs_attr.3x +++ b/man/curs_attr.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_attr.3x,v 1.22 2000/07/08 11:59:58 tom Exp $ +.\" $Id: curs_attr.3x,v 1.26 2002/09/21 19:50:06 tom Exp $ .TH curs_attr 3X "" .SH NAME \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, @@ -105,7 +105,7 @@ a property of the character, and move with the character through any scrolling and insert/delete line/character operations. To the extent possible, they are displayed as appropriate modifications to the graphic rendition of characters put on the screen. - +.PP The routine \fBattrset\fR sets the current attributes of the given window to \fIattrs\fR. The routine \fBattroff\fR turns off the named attributes without turning any other attributes on or off. The routine \fBattron\fR turns on the @@ -113,19 +113,24 @@ named attributes without affecting any others. The routine \fBstandout\fR is the same as \fBattron(A_STANDOUT)\fR. The routine \fBstandend\fR is the same as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all attributes. - +.PP +The \fBattrset\fR and related routines do not affect the attributes used +when erasing portions of the window. +See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for +erasing and clearing. +.PP The routine \fBcolor_set\fR sets the current color of the given window to the foreground/background combination described by the color_pair_number. The parameter opts is reserved for future use, applications must supply a null pointer. - +.PP The routine \fBwattr_get\fR returns the current attribute and color pair for the given window; \fBattr_get\fR returns the current attribute and color pair for \fBstdscr\fR. The remaining \fBattr_\fR* functions operate exactly like the corresponding \fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR rather than \fBint\fR. - +.PP The routine \fBchgat\fR changes the attributes of a given number of characters starting at the current cursor location of \fBstdscr\fR. It does not update the cursor and does not perform wrapping. A character count of -1 or greater @@ -135,6 +140,10 @@ window; the \fBmvwchgat\fR function does a cursor move before acting. In these functions, the color argument is a color-pair index (as in the first argument of \fIinit_pair\fR, see \fBcurs_color\fR(3X)). The \fBopts\fR argument is not presently used, but is reserved for the future (leave it \fBNULL\fR). +Note that changing the attributes does not imply +that a subsequent \fBrefresh\fR will update the screen to match, +since the character values are not modified. +Use \fBtouchwin\fR to force the screen to match the updated attributes. .SS Attributes The following video attributes, defined in \fB\fR, can be passed to the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'ed with the @@ -159,15 +168,14 @@ l l . The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR: -.DS C +.br \fBPAIR_NUMBER(\fR\fIattrs\fR) Returns the pair number associated with the \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR attribute. -.DE +.br The return values of many of these routines are not meaningful (they are implemented as macro-expanded assignments and simply return their argument). The SVr4 manual page claims (falsely) that these routines always return \fB1\fR. - .SH NOTES Note that \fBattroff\fR, \fBwattroff\fR, \fBattron\fR, \fBwattron\fR, \fBattrset\fR, \fBwattrset\fR, \fBstandend\fR and \fBstandout\fR may be macros. @@ -176,14 +184,14 @@ All these functions are supported in the XSI Curses standard, Issue 4. The standard defined the dedicated type for highlights, \fBattr_t\fR, which is not defined in SVr4 curses. The functions taking \fBattr_t\fR arguments are not supported under SVr4. - +.PP The XSI Curses standard states that whether the traditional functions \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or \fBA_UNDERLINE\fR is "unspecified". Under this implementation as well as SVr4 curses, these functions correctly manipulate all other highlights (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR). - +.PP XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR, \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR, \fBwattr_get\fR, \fBwattr_set\fR. These are intended to work with @@ -205,13 +213,16 @@ l l . The XSI curses standard specifies that each pair of corresponding \fBA_\fR and \fBWA_\fR-using functions operates on the same current-highlight information. - +.PP The XSI standard extended conformance level adds new highlights \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR, \fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this curses does not yet support. .SH SEE ALSO -\fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_addstr\fR(3X), +\fBcurses\fR(3X), +\fBcurs_addch\fR(3X), +\fBcurs_addstr\fR(3X), +\fBcurs_bkgd\fR(3X), \fBcurs_printw\fR(3X) .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/man/curs_bkgd.3x b/man/curs_bkgd.3x index efd4f827..f5c620db 100644 --- a/man/curs_bkgd.3x +++ b/man/curs_bkgd.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,27 +26,26 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_bkgd.3x,v 1.14 2000/07/01 17:39:31 tom Exp $ +.\" $Id: curs_bkgd.3x,v 1.18 2002/09/21 19:46:26 tom Exp $ .TH curs_bkgd 3X "" .SH NAME \fBbkgdset\fR, \fBwbkgdset\fR, \fBbkgd\fR, \fBwbkgd\fR, \fBgetbkgd\fR - \fBcurses\fR window background manipulation routines -.. + .SH SYNOPSIS \fB#include \fR -\fBvoid bkgdset(const chtype ch);\fR +\fBvoid bkgdset(chtype ch);\fR .br -\fBvoid wbkgdset(WINDOW *win, const chtype ch);\fR +\fBvoid wbkgdset(WINDOW *win, chtype ch);\fR .br -\fBint bkgd(const chtype ch);\fR +\fBint bkgd(chtype ch);\fR .br -\fBint wbkgd(WINDOW *win, const chtype ch);\fR +\fBint wbkgd(WINDOW *win, chtype ch);\fR .br \fBchtype getbkgd(WINDOW *win);\fR .br -.. .SH DESCRIPTION The \fBbkgdset\fR and \fBwbkgdset\fR routines manipulate the background of the named window. @@ -59,8 +58,8 @@ the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations. -To the extent possible on a -particular terminal, the attribute part of the background is displayed +To the extent possible on a particular terminal, +the attribute part of the background is displayed as the graphic rendition of the character put on the screen. The \fBbkgd\fR and \fBwbkgd\fR functions @@ -77,23 +76,21 @@ appears, it is changed to the new background character. The \fBgetbkgd\fR function returns the given window's current background character/attribute pair. -.. .SH RETURN VALUE The routines \fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR. The SVr4.0 manual says "or a non-negative integer if \fBimmedok\fR is set", but this appears to be an error. -.. .SH NOTES Note that \fBbkgdset\fR and \fBbkgd\fR may be macros. -.. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. The draft -does not include \fBconst\fR qualifiers on the arguments. The standard -specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR, on failure. but -gives no failure conditions. -.. +These functions are described in the XSI Curses standard, Issue 4. +It specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR on failure. +but gives no failure conditions. .SH SEE ALSO -\fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_outopts\fR(3X) +\fBcurses\fR(3X), +\fBcurs_addch\fR(3X), +\fBcurs_attr\fR(3X), +\fBcurs_outopts\fR(3X) .\"# .\"# The following sets edit modes for GNU EMACS .\"# Local Variables: diff --git a/man/curs_bkgrnd.3x b/man/curs_bkgrnd.3x new file mode 100644 index 00000000..3be0dced --- /dev/null +++ b/man/curs_bkgrnd.3x @@ -0,0 +1,107 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_bkgrnd.3x,v 1.1 2002/02/23 23:23:42 tom Exp $ +.TH curs_bkgrnd 3X "" +.SH NAME +.PP +\fBbkgrnd\fR, +\fBwbkgrnd\fR, +\fBbkgrndset\fR, +\fBwbkgrndset\fR, +\fBgetbkgrnd\fR, +\fBwgetbkgrnd\fR \- \fBcurses\fR window complex background manipulation routines +.SH SYNOPSIS +.PP +.B #include + +\fBint bkgrnd(\fR\fB const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wbkgrnd(\fR\fB WINDOW *\fR\fIwin\fR\fB, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBvoid bkgrndset(const cchar_t *\fR\fIwch\fR \fB);\fR +.br +\fBvoid wbkgrndset(WINDOW *\fR\fIwin\fR\fB, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint getbkgrnd(cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wgetbkgrnd(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwch\fR\fB);\fR +.br +.SH DESCRIPTION +The \fBbkgrndset\fR and \fBwbkgrndset\fR routines manipulate the +background of the named window. +The window background is a \fBcchar_t\fR consisting of +any combination of attributes (i.e., rendition) and a complex character. +The attribute part of the background is combined (OR'ed) with all non-blank +characters that are written into the window with \fBwaddch\fR. Both +the character and attribute parts of the background are combined with +the blank characters. +The background becomes a property of the +character and moves with the character through any scrolling and +insert/delete line/character operations. + +To the extent possible on a +particular terminal, the attribute part of the background is displayed +as the graphic rendition of the character put on the screen. + +The \fBbkgrnd\fR and \fBwbkgrnd\fR functions +set the background property of the current or specified window +and then apply this setting to every character position in that window: + +.RS +The rendition of every character on the screen is changed to +the new background rendition. + +Wherever the former background character +appears, it is changed to the new background character. +.RE + +The \fBgetbkgrnd\fR function returns the given window's current background +character/attribute pair via the \fBwch\fR pointer. + +.SH NOTES +Note that +\fBbkgrnd\fR, +\fBbkgrndset\fR, and +\fBgetbkgrnd\fR +may be macros. +.SH RETURN VALUES +The \fBbkgrndset\fR and \fBwbkgrndset\fR routines do not return a value. +.PP +Upon successful completion, the other functions return \fBOK\fR. +Otherwise, they return \fBERR\fR. +A null window pointer is treated as an error. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_bkgd\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_border.3x b/man/curs_border.3x index 2bd96264..c087fad7 100644 --- a/man/curs_border.3x +++ b/man/curs_border.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_border.3x,v 1.14 2000/07/01 19:54:58 tom Exp $ +.\" $Id: curs_border.3x,v 1.15 2002/02/16 22:21:47 tom Exp $ .TH curs_border 3X "" .SH NAME \fBborder\fR, \fBwborder\fR, \fBbox\fR, @@ -63,15 +63,45 @@ \fBint mvwvline(WINDOW *, int y, int x, chtype ch, int n);\fR .br .SH DESCRIPTION -The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines draw a box around the -edges of a window. The argument \fIls\fR is a character and attributes used -for the left side of the border, \fIrs\fR - right side, \fIts\fR - top side, -\fIbs\fR - bottom side, \fItl\fR - top left-hand corner, \fItr\fR - top -right-hand corner, \fIbl\fR - bottom left-hand corner, and \fIbr\fR - bottom -right-hand corner. If any of these arguments is zero, then the following -default values (defined in \fBcurses.h\fR) are used instead: \fBACS_VLINE\fR, -\fBACS_VLINE\fR, \fBACS_HLINE\fR, \fBACS_HLINE\fR, \fB\fBACS_ULCORNER\fR, -\fBACS_URCORNER\fR, \fBACS_LLCORNER\fR, \fBACS_LRCORNER\fR. +The \fBborder\fR, \fBwborder\fR and \fBbox\fR routines +draw a box around the edges of a window. +Other than the window, each argument is a character with attributes: +.RS +\fIls\fR - left side, +.br +\fIrs\fR - right side, +.br +\fIts\fR - top side, +.br +\fIbs\fR - bottom side, +.br +\fItl\fR - top left-hand corner, +.br +\fItr\fR - top right-hand corner, +.br +\fIbl\fR - bottom left-hand corner, and +.br +\fIbr\fR - bottom right-hand corner. +.RE +If any of these arguments is zero, then the corresponding +default values (defined in \fBcurses.h\fR) are used instead: +.RS +\fBACS_VLINE\fR, +.br +\fBACS_VLINE\fR, +.br +\fBACS_HLINE\fR, +.br +\fBACS_HLINE\fR, +.br +\fBACS_ULCORNER\fR, +.br +\fBACS_URCORNER\fR, +.br +\fBACS_LLCORNER\fR, +.br +\fBACS_LRCORNER\fR. +.RE \fBbox(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIhorch\fR\fB)\fR is a shorthand for the following call: \fBwborder(\fR\fIwin\fR\fB,\fR \fIverch\fR\fB,\fR @@ -95,11 +125,9 @@ is also true of SVr4 curses, though the fact is not documented). Note that \fBborder\fR and \fBbox\fR may be macros. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. Additional -functions \fBmvhline\fR, \fBmvvline\fR, \fBmvwhline\fR, and \fBmvwvline\fR are -described there which this implementation does not yet support. The standard -specifies that they return \fBERR\fR on failure, but specifies no error -conditions. +These functions are described in the XSI Curses standard, Issue 4. +The standard specifies that they return \fBERR\fR on failure, +but specifies no error conditions. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_outopts\fR(3X). .\"# diff --git a/man/curs_border_set.3x b/man/curs_border_set.3x new file mode 100644 index 00000000..ba7a197b --- /dev/null +++ b/man/curs_border_set.3x @@ -0,0 +1,202 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_border_set.3x,v 1.3 2002/04/20 16:49:13 tom Exp $ +.TH curs_border_set 3X "" +.SH NAME +.PP +\fBborder_set\fR, +\fBwborder_set\fR, +\fBbox_set\fR, +\fBhline_set\fR, +\fBwhline_set\fR, +\fBmvhline_set\fR, +\fBmvwhline_set\fR, +\fBvline_set\fR, +\fBwvline_set\fR, +\fBmvvline_set\fR, +\fBmvwvline_set\fR \- create \fBcurses\fR borders or lines using complex characters and renditions +.SH SYNOPSIS +.PP +\fB#include \fR +.sp +\fBint border_set(\fR + \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR, + \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR, + \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR, + \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR +\fB);\fR +.br +\fBint wborder_set(\fR + \fBWINDOW *win\fR, + \fBconst cchar_t *\fR\fIls\fR, \fBconst cchar_t *\fR\fIrs\fR, + \fBconst cchar_t *\fR\fIts\fR, \fBconst cchar_t *\fR\fIbs\fR, + \fBconst cchar_t *\fR\fItl\fR, \fBconst cchar_t *\fR\fItr\fR, + \fBconst cchar_t *\fR\fIbl\fR, \fBconst cchar_t *\fR\fIbr\fR\fB);\fR +.br +\fBint box_set(\fR + \fBWINDOW *win\fR, + \fBconst cchar_t *\fR\fIverch\fR, + \fBconst cchar_t *\fR\fIhorch\fR\fB);\fR +.br +\fBint hline_set(\fR + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint whline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvhline_set(\fR + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvwhline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint vline_set(\fR + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint wvline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvvline_set(\fR + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +\fBint mvwvline_set(\fR + \fBWINDOW *\fR\fIwin\fR, + \fBint \fR\fIy\fR, \fBint \fR\fIx\fR, + \fBconst cchar_t *\fR\fIwch\fR, \fBint \fR\fIn\fR\fB);\fR +.br +.SH DESCRIPTION +.PP +The +\fBborder_set\fR +and +\fBwborder_set\fR +functions draw a border around the edges of the current or specified window. +These functions do not change the cursor position, and do not wrap. +.PP +Other than the window, each argument is a complex character with attributes: +.RS +\fIls\fR - left side, +.br +\fIrs\fR - right side, +.br +\fIts\fR - top side, +.br +\fIbs\fR - bottom side, +.br +\fItl\fR - top left-hand corner, +.br +\fItr\fR - top right-hand corner, +.br +\fIbl\fR - bottom left-hand corner, and +.br +\fIbr\fR - bottom right-hand corner. +.RE +.PP +If any of these arguments is zero, then the corresponding +default values (defined in \fBcurses.h\fR) are used instead: +.RS +\fBWACS_VLINE\fR, +.br +\fBWACS_VLINE\fR, +.br +\fBWACS_HLINE\fR, +.br +\fBWACS_HLINE\fR, +.br +\fBWACS_ULCORNER\fR, +.br +\fBWACS_URCORNER\fR, +.br +\fBWACS_LLCORNER\fR, and +.br +\fBWACS_LRCORNER\fR. +.RE +.PP +\fBbox_set(\fR\fIwin\fR, \fIverch\fR\fB, \fR\fIhorch\fR\fB);\fR +is a shorthand for the following call: +.PP +\fBwborder_set(\fR\fIwin\fR\fB, \fR\fIverch\fR\fB, \fR\fIverch\fR\fB,\fR + \fIhorch\fR\fB, \fR\fIhorch\fR\fB, NULL, NULL, NULL, NULL);\fR +.PP +The +\fB*line_set\fR +functions use +\fIwch\fR +to draw a line starting at the current cursor position in the window. +The line is at most \fIn\fR characters long or as many as fit into the window. +The current cursor position is not changed. +.PP +The +\fBhline_set\fR, +\fBmvhline_set\fR, +\fBmvwhline_set\fR, and +\fBwhline_set\fR +functions draw a line proceeding toward the last column of the same line. +.PP +The +\fBvline_set\fR, +\fBmvvline_set\fR, +\fBmvwvline_set\fR, and +\fBwvline_set\fR +functions draw a line proceeding toward the last line of the window. +.br +.SH NOTES +.PP +Note that +\fBborder_set\fR, +\fBhline_set\fR, +\fBmvhline_set\fR, +\fBmvvline_set\fR, +\fBmvwhline_set\fR, +\fBmvwvline_set\fR, and +\fBvline_set\fR +may be macros. +.br +.SH RETURN VALUES +.PP +Upon successful completion, these functions return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.SH SEE ALSO +\fBncurses\fR(3X), +\fBcurs_border\fR(3X), +\fBcurs_outopts\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_color.3x b/man/curs_color.3x index ccf8cf82..18926d92 100644 --- a/man/curs_color.3x +++ b/man/curs_color.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_color.3x,v 1.16 2000/07/15 22:57:03 tom Exp $ +.\" $Id: curs_color.3x,v 1.19 2002/02/16 22:38:32 tom Exp $ .TH curs_color 3X "" .SH NAME \fBstart_color\fR, @@ -100,8 +100,8 @@ third arguments must be between 0 and \fBCOLORS\fR (the 0 color pair is wired to white on black and cannot be changed). .PP If the color-pair was previously -initialized, the screen is refreshed and all occurrences of that color-pair is -changed to the new definition. +initialized, the screen is refreshed and all occurrences of that color-pair +are changed to the new definition. As an extension, ncurses allows you to set color pair 0 via the \fBassume_default_colors\fR routine, or to specify the use of @@ -202,7 +202,7 @@ but only if that routine has been first invoked. The assumption that \fBCOLOR_BLACK\fR is the default background color for all terminals can be modified using the \fBassume_default_colors\fP extension, -.. + .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), diff --git a/man/curs_deleteln.3x b/man/curs_deleteln.3x index 8e48384a..8b39402d 100644 --- a/man/curs_deleteln.3x +++ b/man/curs_deleteln.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_deleteln.3x,v 1.6 2000/07/01 19:56:12 tom Exp $ +.\" $Id: curs_deleteln.3x,v 1.7 2000/11/11 20:43:20 Bernhard.Rosenkraenzer Exp $ .TH curs_deleteln 3X "" .SH NAME \fBdeleteln\fR, @@ -61,7 +61,7 @@ bottom lines are lost. For negative \fIn\fR, delete \fIn\fR lines (starting with the one under the cursor), and move the remaining lines up. The bottom \fIn\fR lines are cleared. The current cursor position remains the same. -The \fBinsertln\fR and \fBinsertln\fR routines, insert a blank line above the +The \fBinsertln\fR and \fBwinsertln\fR routines, insert a blank line above the current line and the bottom line is lost. .SH RETURN VALUE All routines return the integer \fBERR\fR upon failure and an \fBOK\fR (SVr4 diff --git a/man/curs_extend.3x b/man/curs_extend.3x index 632fc382..dc05b39d 100644 --- a/man/curs_extend.3x +++ b/man/curs_extend.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1999-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,20 +28,18 @@ .\" .\" Author: Thomas E. Dickey 1999 .\" -.\" $Id: curs_extend.3x,v 1.6 2000/07/15 22:57:20 tom Exp $ +.\" $Id: curs_extend.3x,v 1.9 2002/02/16 22:39:04 tom Exp $ .TH curs_extend 3X "" .SH NAME -\fBcurs_extend\fR: \fBcurses_version\fP, \fBuse_extended_names\fP \- miscellaneous curses extensions -.. + .SH SYNOPSIS \fB#include \fP \fBconst char * curses_version(void);\fP .br \fBint use_extended_names(bool enable);\fP -.. .SH DESCRIPTION These functions are extensions to the curses library which do not fit easily into other categories. @@ -62,12 +60,10 @@ is made by using the \fB-x\fP option of \fItic\fP to compile extended terminal definitions. However you can disable this feature to ensure compatiblity with other implementations of curses -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBcurs_getch\fR(3X), \fBcurs_mouse\fR(3X), @@ -78,7 +74,6 @@ any code depending on them be conditioned using NCURSES_VERSION. \fBkeyok\fR(3X), \fBresizeterm\fR(3X), \fBwresize\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/man/curs_get_wch.3x b/man/curs_get_wch.3x new file mode 100644 index 00000000..26ff2d4c --- /dev/null +++ b/man/curs_get_wch.3x @@ -0,0 +1,161 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_get_wch.3x,v 1.3 2002/05/18 21:48:53 tom Exp $ +.TH curs_get_wch 3X "" +.SH NAME +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, +\fBmvwget_wch\fR, +\fBunget_wch\fR \- get (or push back) a wide character from curses terminal keyboard +.SH SYNOPSIS +\fB#include \fR +.sp +\fBint get_wch(win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wget_wch(WINDOW *\fR\fIwin\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvget_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvwget_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, win_t *\fR\fIwch\fR\fB);\fR +.br +\fBint unget_wch(const wchar_t \fR\fIwch\fR\fB);\fR +.SH DESCRIPTION +The +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, and +\fBmvwget_wch\fR +functions read a character +from the terminal associated with the current or specified window. +In no-delay mode, +if no input is waiting, the value \fBERR\fR is returned. +In delay mode, +the program waits until the system passes text through to the program. +Depending on the setting of \fBcbreak\fR, +this is after one character (cbreak mode), +or after the first newline (nocbreak mode). +In half-delay mode, +the program waits until the user types a character or the specified +timeout interval has elapsed. + +Unless \fBnoecho\fR has been set, +these routines echo the character into the designated window. + +If the window is not a pad and has been moved or modified since the +last call to \fBwrefresh\fR, +\fBwrefresh\fR will be called before another character is read. + +If \fBkeypad\fR is enabled, +these functions respond to +the pressing of a function key by setting the object pointed to by +\fIwch\fR +to the corresponding +\fBKEY_\fR +value defined +in +\fB\fR +and returning +\fBKEY_CODE_YES\fR. +If a character (such as escape) that could be the +beginning of a function key is received, curses sets a timer. +If the remainder +of the sequence does arrive within the designated time, curses passes through +the character; otherwise, curses returns the function key value. +For this +reason, many terminals experience a delay between the time a user presses +the escape key and the time the escape is returned to the program. +.PP +The +\fBunget_wch\fR +function pushes the wide character +\fIwch\fR +back onto the head of the input queue, so the wide character +is returned by the next call to +\fBget_wch\fR. +The pushback of +one character is guaranteed. +If the program calls +\fBunget_wch\fR +too many times without an intervening call to +\fBget_wch\fR, +the operation may fail. +.SH NOTES +The header file +\fB\fR +automatically +includes the header file +\fB\fR. +.PP +Applications should not define the escape key by itself as a single-character +function. +.PP +When using +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, or +\fBmvwget_wch\fR, applications should +not use +\fBnocbreak\fR +mode and +\fBecho\fR +mode +at the same time. +Depending on the state of the tty driver when each character +is typed, the program may produce undesirable results. +.PP +All functions except \fBwget_wch\fR and \fBunget_wch\fR +may be macros. +.SH RETURN VALUES +When +\fBget_wch\fR, +\fBwget_wch\fR, +\fBmvget_wch\fR, and +\fBmvwget_wch\fR +functions successfully +report the pressing of a function key, they return +\fBKEY_CODE_YES\fR. +When they successfully report a wide character, they return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.PP +Upon successful completion, +\fBunget_wch\fR +returns +\fBOK\fR. +Otherwise, the function returns +\fBERR\fR. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_getch\fR(3X), +\fBcurs_ins_wch\fR(3X), +\fBcurs_inopts\fR(3X), +\fBcurs_move\fR(3X), +\fBcurs_refresh\fR(3X) diff --git a/man/curs_get_wstr.3x b/man/curs_get_wstr.3x new file mode 100644 index 00000000..f8fa51d4 --- /dev/null +++ b/man/curs_get_wstr.3x @@ -0,0 +1,164 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_get_wstr.3x,v 1.2 2002/05/18 21:48:15 tom Exp $ +.TH curs_get_wstr 3X "" +.SH NAME +\fBget_wstr\fR, +\fBgetn_wstr\fR, +\fBwget_wstr\fR, +\fBwgetn_wstr\fR, +\fBmvget_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwget_wstr\fR, +\fBmvwgetn_wstr\fR \- get an array of wide characters from a curses terminal keyboard +.SH SYNOPSIS +.nf +\fB#include \fR + +\fBint get_wstr(wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint getn_wstr(wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wget_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint wgetn_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvget_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvgetn_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwget_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwgetn_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +The effect of +\fBget_wstr\fR +is as though a series of calls +to +\fBget_wch\fR +were made, until a newline, other end-of-line, or end-of-file condition is processed. +An end-of-file condition is represented by \fBWEOF\fR, as defined in \fB\fR. +The newline and end-of-line conditions are represented by the \fB\\n\fR \fBwchar_t\fR value. +In all instances, the end of the string is terminated by a null \fBwchar_t\fR. +The routine places resulting values in the area pointed to by \fIwstr\fR. + +The user's erase and kill characters are interpreted. If keypad +mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR +are both considered equivalent to the user's kill character. + +Characters input are echoed only if \fBecho\fR is currently on. In that case, +backspace is echoed as deletion of the previous character (typically a left +motion). + +The effect of +\fBwget_wstr\fR +is as though a series of +calls to +\fBwget_wch\fR +were made. + +The effect of +\fBmvget_wstr\fR +is as though a call to +\fBmove\fR +and then a series of calls to +\fBget_wch\fR +were +made. + +The effect of +\fBmvwget_wstr\fR +is as though a call to +\fBwmove\fR +and then a series of calls to +\fBwget_wch\fR +were made. + +The +\fBgetn_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwgetn_wstr\fR, and +\fBwgetn_wstr\fR +functions are identical +to the +\fBget_wstr\fR, +\fBmvget_wstr\fR, +\fBmvwget_wstr\fR, and +\fBwget_wstr\fR +functions, respectively, +except that the +\fB*n_*\fR +versions read at most +\fIn\fR +characters, letting the application prevent overflow of the +input buffer. +.SH NOTES +Using +\fBget_wstr\fR, +\fBmvget_wstr\fR, +\fBmvwget_wstr\fR, or +\fBwget_wstr\fR +to read a line that +overflows the array pointed to by +\fBwstr\fR +causes undefined +results. +The use of +\fBgetn_wstr\fR, +\fBmvgetn_wstr\fR, +\fBmvwgetn_wstr\fR, or +\fBwgetn_wstr\fR, respectively, is recommended. + +These functions cannot return \fBKEY_\fR values because there +is no way to distinguish a \fBKEY_\fR value from a valid \fBwchar_t\fR value. + +All of these routines except \fBwgetn_wstr\fR may be macros. +.SH RETURN VALUES +All of these functions return \fBOK\fR upon successful completion. +Otherwise, they return \fBERR\fR. +.SH PORTABILITY +These functions are described in The Single Unix Specification, Version 2. +No error conditions are defined. +This implementation returns ERR if the window pointer is null, +or if the lower-level \fBwget_wch\fR call returns an ERR. +In the latter case, +an ERR return without other data is treated as an end-of-file condition, +and the returned array contains a \fBWEOF\fR followed by a null \fBwchar_t\fR. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_get_wch\fR(3X), +\fBcurs_getstr\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_getcchar.3x b/man/curs_getcchar.3x new file mode 100644 index 00000000..2dfa10b7 --- /dev/null +++ b/man/curs_getcchar.3x @@ -0,0 +1,144 @@ +.\"*************************************************************************** +.\" Copyright (c) 2001,2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_getcchar.3x,v 1.6 2002/03/24 01:08:55 tom Exp $ +.TH curs_getcchar 3X "" +.SH NAME +\fBgetcchar\fP, +\fBsetcchar\fP \- Get a wide character string and rendition from a \fBcchar_t\fP or set a \fBcchar_t\fP from a wide-character string +.SH SYNOPSIS +\fB#include \fP +.sp +\fBint getcchar(\fP +.br +.B " const cchar_t *\fIwcval\fP," +.br +.B " wchar_t *\fIwch\fP," +.br +.B " attr_t *\fIattrs\fP," +.br +.B " short *\fIcolor_pair\fP," +.br +.B " void *\fIopts\fP );" +.sp +.B "int setcchar(" +.br +.B " cchar_t *\fIwcval\fP," +.br +.B " const wchar_t *\fIwch\fP," +.br +.B " const attr_t \fIattrs\fP," +.br +.B " short \fIcolor_pair\fP," +.br +.B " void *\fIopts\fP );" +.SH DESCRIPTION +.PP +The \fBgetcchar\fP function gets a wide-character string +and rendition from a \fBcchar_t\fP argument. +When \fIwch\fP is not a null pointer, +the \fBgetcchar\fP function does the following: +.TP 5 +- +Extracts information from a \fBcchar_t\fP value \fIwcval\fP +.TP 5 +- +Stores the character attributes in the location pointed to by \fIattrs\fP +.TP 5 +- +Stores the color-pair in the location pointed to by \fIcolor_pair\fP +.TP 5 +- +Stores the wide-character string, +characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP. +.PP +When +\fIwch\fP +is a null pointer, the +\fBgetcchar\fP +function does the following: +.TP 5 +- +Obtains the number of wide characters pointed to by \fIwcval\fP +.TP 5 +- +Does not change the data referenced by +\fIattrs\fP +or +\fIcolor_pair\fP +.PP +The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP +by using: +.TP 5 +- +The character attributes in +\fIattrs\fP +.TP 5 +- +The color pair in +\fIcolor_pair\fP +.TP 5 +- +The wide-character string pointed to by \fIwch\fP. +The string must be L'\\0' terminated, +contain at most one character with strictly positive width, +which must be the first, +and contain no characters of negative width. +.SH NOTES +.PP +The \fIopts\fP argument is reserved for future use. +Currently, an application must provide a null pointer as \fIopts\fP. +.PP +The \fIwcval\fP argument may be a value generated by a call to +\fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument. +If \fIwcval\fP is constructed by any other means, the effect is unspecified. +.SH RETURN VALUES +.PP +When \fIwch\fP is a null pointer, +\fBgetcchar\fP returns the number of wide characters referenced by +\fIwcval\fP, including the null terminator. +.PP +When \fIwch\fP is not a null pointer, +\fBgetcchar\fP returns \fBOK\fP upon successful completion, +and \fBERR\fP otherwise. +.PP +Upon successful completion, \fBsetcchar\fP returns \fBOK\fP. +Otherwise, it returns \fBERR\fP. +.SH SEE ALSO +.PP +Functions: +\fBcurses\fR(3X), +\fBwcwidth\fR(3X), +\fBcurs_attr_get\fR(3X), +\fBcan_change_color\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_getch.3x b/man/curs_getch.3x index b2b20ef4..73e1a296 100644 --- a/man/curs_getch.3x +++ b/man/curs_getch.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_getch.3x,v 1.17 2000/07/01 16:45:36 tom Exp $ +.\" $Id: curs_getch.3x,v 1.21 2002/03/17 14:36:21 tom Exp $ .TH curs_getch 3X "" .SH NAME \fBgetch\fR, @@ -53,14 +53,19 @@ .br .SH DESCRIPTION The \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR and \fBmvwgetch\fR, routines read -a character from the window. In no-delay mode, if no input is waiting, the -value \fBERR\fR is returned. In delay mode, the program waits until the system -passes text through to the program. Depending on the setting of \fBcbreak\fR, -this is after one character (cbreak mode), or after the first newline (nocbreak -mode). In half-delay mode, the program waits until a character is typed or the +a character from the window. +In no-delay mode, if no input is waiting, the value \fBERR\fR is returned. +In delay mode, the program waits until the system +passes text through to the program. +Depending on the setting of \fBcbreak\fR, +this is after one character (cbreak mode), +or after the first newline (nocbreak mode). +In half-delay mode, +the program waits until a character is typed or the specified timeout has been reached. -Unless \fBnoecho\fR has been set, then the character will also be echoed into the +Unless \fBnoecho\fR has been set, +then the character will also be echoed into the designated window according to the following rules: If the character is the current erase character, left arrow, or backspace, the cursor is moved one space to the left and that screen position is erased @@ -74,26 +79,30 @@ call to \fBwrefresh\fR, \fBwrefresh\fR will be called before another character is read. If \fBkeypad\fR is \fBTRUE\fR, and a function key is pressed, the token for -that function key is returned instead of the raw characters. Possible function +that function key is returned instead of the raw characters. +Possible function keys are defined in \fB\fR as macros with values outside the range of 8-bit characters whose names begin with \fBKEY_.\fR Thus, a variable intended to hold the return value of a function key must be of short size or larger. When a character that could be the beginning of a function key is received -(which, on modern terminals, means an escape character), \fBcurses\fR sets a -timer. If the remainder of the sequence does not come in within the designated -time, the character is passed through; otherwise, the function key value is -returned. For this reason, many terminals experience a delay between the time +(which, on modern terminals, means an escape character), +\fBcurses\fR sets a timer. +If the remainder of the sequence does not come in within the designated +time, the character is passed through; +otherwise, the function key value is returned. +For this reason, many terminals experience a delay between the time a user presses the escape key and the escape is returned to the program. The \fBungetch\fR routine places \fIch\fR back onto the input queue to be -returned by the next call to \fBwgetch\fR. Note that there is, in effect, -just one input queue for all windows. +returned by the next call to \fBwgetch\fR. +There is just one input queue for all windows. .SS Function Keys The following function keys, defined in \fB\fR, might be returned by -\fBgetch\fR if \fBkeypad\fR has been enabled. Note that not all of these are +\fBgetch\fR if \fBkeypad\fR has been enabled. +Note that not all of these are necessarily supported on any particular terminal. .sp .TS @@ -211,8 +220,8 @@ c c c . .TE .sp The \fBhas_key\fR routine takes a key value from the above list, and -returns TRUE or FALSE according as the current terminal type recognizes -a key with that value. +returns TRUE or FALSE according to whether +the current terminal type recognizes a key with that value. .SH RETURN VALUE All routines return the integer \fBERR\fR upon failure and an integer value @@ -223,32 +232,49 @@ Use of the escape key by a programmer for a single character function is discouraged, as it will cause a delay of up to one second while the keypad code looks for a following function-key sequence. +Note that some keys may be the same as commonly used control +keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE versus control/H. +Some curses implementations may differ according to whether they +treat these control keys specially (and ignore the terminfo), or +use the terminfo definitions. +\fBNcurses\fR uses the terminfo definition. +If it says that KEY_ENTER is control/M, \fBgetch\fR, will return KEY_ENTER +when you press control/M. + When using \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, or \fBmvwgetch\fR, nocbreak mode (\fBnocbreak\fR) and echo mode -(\fBecho\fR) should not be used at the same time. Depending on the +(\fBecho\fR) should not be used at the same time. +Depending on the state of the tty driver when each character is typed, the program may produce undesirable results. Note that \fBgetch\fR, \fBmvgetch\fR, and \fBmvwgetch\fR may be macros. Historically, the set of keypad macros was largely defined by the extremely -function-key-rich keyboard of the AT&T 7300, aka 3B1, aka Safari 4. Modern -personal computers usually have only a small subset of these. IBM PC-style +function-key-rich keyboard of the AT&T 7300, aka 3B1, aka Safari 4. +Modern +personal computers usually have only a small subset of these. +IBM PC-style consoles typically support little more than \fBKEY_UP\fR, \fBKEY_DOWN\fR, \fBKEY_LEFT\fR, \fBKEY_RIGHT\fR, \fBKEY_HOME\fR, \fBKEY_END\fR, -\fBKEY_NPAGE\fR, \fBKEY_PPAGE\fR, and function keys 1 through 12. The Ins key +\fBKEY_NPAGE\fR, \fBKEY_PPAGE\fR, and function keys 1 through 12. +The Ins key is usually mapped to \fBKEY_IC\fR. .SH PORTABILITY -The *get* functions are described in the XSI Curses standard, Issue 4. They -read single-byte characters only. The standard specifies that they return +The *get* functions are described in the XSI Curses standard, Issue 4. +They +read single-byte characters only. +The standard specifies that they return \fBERR\fR on failure, but specifies no error conditions. The echo behavior of these functions on input of \fBKEY_\fR or backspace -characters was not specified in the SVr4 documentation. This description is +characters was not specified in the SVr4 documentation. +This description is adopted from the XSI Curses standard. The behavior of \fBgetch\fR and friends in the presence of handled signals is -unspecified in the SVr4 and XSI Curses documentation. Under historical curses +unspecified in the SVr4 and XSI Curses documentation. +Under historical curses implementations, it varied depending on whether the operating system's implementation of handled signal receipt interrupts a \fBread\fR(2) call in progress or not, and also (in some implementations) depending on whether an @@ -257,10 +283,12 @@ input timeout or non-blocking mode hsd been set. Programmers concerned about portability should be prepared for either of two cases: (a) signal receipt does not interrupt \fBgetch\fR; (b) signal receipt interrupts \fBgetch\fR and causes it to return ERR with \fBerrno\fR set to -\fBEINTR\fR. Under the \fBncurses\fR implementation, handled signals never +\fBEINTR\fR. +Under the \fBncurses\fR implementation, handled signals never interrupt \fBgetch\fR. -The \fBhas_key\fR function is unique to \fBncurses\fR. We recommend that +The \fBhas_key\fR function is unique to \fBncurses\fR. +We recommend that any code using it be conditionalized on the \fBNCURSES_VERSION\fR feature macro. .SH SEE ALSO \fBcurses\fR(3X), diff --git a/man/curs_getstr.3x b/man/curs_getstr.3x index 42c22931..1a32a0be 100644 --- a/man/curs_getstr.3x +++ b/man/curs_getstr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_getstr.3x,v 1.9 2000/07/01 17:39:31 tom Exp $ +.\" $Id: curs_getstr.3x,v 1.11 2002/04/13 22:14:30 tom Exp $ .TH curs_getstr 3X "" .SH NAME \fBgetstr\fR, @@ -82,11 +82,11 @@ completion. .SH NOTES Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. They read -single-byte characters only. The standard specifies that they return \fBERR\fR -on failure, but the single error condition \fBEOVERFLOW\fR associated with -extended-level conformance is not yet returned (the XSI curses support for -multi-byte characters is not yet present). +These functions are described in the XSI Curses standard, Issue 4. +They read single-byte characters only. +The standard does not define any error conditions. +This implementation returns ERR if the window pointer is null, +or if the lower-level \fBwgetch\fR call returns an ERR. SVr3 and early SVr4 curses implementations did not reject function keys; the SVr4.0 documentation claimed that "special keys" (such as function diff --git a/man/curs_getyx.3x b/man/curs_getyx.3x index 820bf99c..87df1622 100644 --- a/man/curs_getyx.3x +++ b/man/curs_getyx.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,10 +26,20 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_getyx.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_getyx.3x,v 1.8 2002/09/21 19:00:38 tom Exp $ .TH curs_getyx 3X "" .SH NAME -\fBgetyx\fR, \fBgetparyx\fR, \fBgetbegyx\fR, +.IX getbegx +.IX getbegy +.IX getcurx +.IX getcury +.IX getmaxx +.IX getmaxy +.IX getparx +.IX getpary +\fBgetyx\fR, +\fBgetparyx\fR, +\fBgetbegyx\fR, \fBgetmaxyx\fR - get \fBcurses\fR cursor and window coordinates .SH SYNOPSIS \fB#include \fR @@ -48,20 +58,35 @@ the two integer variables \fIy\fR and \fIx\fR. If \fIwin\fR is a subwindow, the \fBgetparyx\fR macro places the beginning coordinates of the subwindow relative to the parent window into two integer -variables \fIy\fR and \fIx\fR. Otherwise, \fB-1\fR is placed into \fIy\fR and -\fIx\fR. +variables \fIy\fR and \fIx\fR. +Otherwise, \fB-1\fR is placed into \fIy\fR and \fIx\fR. Like \fBgetyx\fR, the \fBgetbegyx\fR and \fBgetmaxyx\fR macros store the current beginning coordinates and size of the specified window. .SH RETURN VALUE The return values of these macros are undefined (\fIi\fR.\fIe\fR., -they should not be used as the right-hand side of assignment -statements). +they should not be used as the right-hand side of assignment statements). .SH NOTES -All of these interfaces are macros and that "\fB&\fR" is not -necessary before the variables \fIy\fR and \fIx\fR. +All of these interfaces are macros. +A "\fB&\fR" is not necessary before the variables \fIy\fR and \fIx\fR. .SH PORTABILITY -These functions are described in the XSI Curses standard, Issue 4. +The +\fBgetyx\fR, +\fBgetparyx\fR, +\fBgetbegyx\fR and +\fBgetmaxyx\fR +functions are described in the XSI Curses standard, Issue 4. +.PP +This implementation also provides +\fBgetbegx\fR, +\fBgetbegy\fR, +\fBgetcurx\fR, +\fBgetcury\fR, +\fBgetmaxx\fR, +\fBgetmaxy\fR, +\fBgetparx\fR and +\fBgetpary\fR +for compatibility with older versions of curses. .SH SEE ALSO \fBcurses\fR(3X) .\"# diff --git a/man/curs_in_wch.3x b/man/curs_in_wch.3x new file mode 100644 index 00000000..668595c6 --- /dev/null +++ b/man/curs_in_wch.3x @@ -0,0 +1,68 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_in_wch.3x,v 1.1 2002/03/10 15:08:57 tom Exp $ +.TH curs_in_wch 3X "" +.SH NAME +\fBin_wch\fR, +\fBmvin_wch\fR, +\fBmvwin_wch\fR, +\fBwin_wch\fR - extract a complex character and rendition from a window +.SH SYNOPSIS +\fB#include \fR + +\fBint in_wch(cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint mvin_wch(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint mvwin_wch(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.br +\fBint win_wch(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwcval\fR\fB);\fR +.SH DESCRIPTION +These functions extract the complex character and rendition from +the current position in the named window into the \fBcchar_t\fR object +referenced by wcval. +.SH RETURN VALUE +No errors are defined in the XSI Curses standard. +This implementation checks for null pointers, returns ERR in that case. +Also, the \fImv\fR routines check for error moving the cursor, returning ERR +in that case. +Otherwise they return OK +.SH NOTES +Note that all of these routines may be macros. +.SH PORTABILITY +These functions are described in the XSI Curses standard, Issue 4. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_inch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_in_wchstr.3x b/man/curs_in_wchstr.3x new file mode 100644 index 00000000..0012789f --- /dev/null +++ b/man/curs_in_wchstr.3x @@ -0,0 +1,117 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_in_wchstr.3x,v 1.2 2002/05/18 21:48:30 tom Exp $ +.TH curs_in_wchstr 3X "" +.SH NAME +\fBin_wchstr\fR, +\fBin_wchnstr\fR, +\fBwin_wchstr\fR, +\fBwin_wchnstr\fR, +\fBmvin_wchstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchstr\fR, +\fBmvwin_wchnstr\fR \- get an array of complex characters and renditions from a curses window +.SH SYNOPSIS +.nf +\fB#include \fR + +\fBint in_wchstr(cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint in_wchnstr(cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint win_wchstr(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint win_wchnstr(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvin_wchstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvin_wchnstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwin_wchstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR\fB);\fR +.br +\fBint mvwin_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, cchar_t *\fR\fIwchstr\fR, int \fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These functions return an array of complex characters in \fIwchstr\fR, +starting at the current cursor position in the named window. +Attributes (rendition) are stored with the characters. +.PP +The +\fBin_wchnstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchnstr\fR +and +\fBwin_wchnstr\fR +fill the array +with at most +\fIn\fR +\fBcchar_t\fR +elements. +.br +.SH NOTES +Note that all routines except +\fBwin_wchnstr\fR +may be +macros. +.PP +Reading a line that overflows the array pointed to by +\fIwchstr\fR +with +\fBin_wchstr\fR, +\fBmvin_wchstr\fR, +\fBmvwin_wchstr\fR +or +\fBwin_wchstr\fR +causes undefined results. Therefore, the use of +\fBin_wchnstr\fR, +\fBmvin_wchnstr\fR, +\fBmvwin_wchnstr\fR, or +\fBwin_wchnstr\fR +is recommended. +.SH RETURN VALUES +Upon successful completion, these functions return +\fBOK\fR. +Otherwise, they return +\fBERR\fR. +.SH PORTABILITY +The XSI Curses defines no error conditions. +This implementation checks for null pointers, +returning ERR in that case. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_in_wch\fR(3X) +\fBcurs_instr\fR(3X), +\fBcurs_inwstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_initscr.3x b/man/curs_initscr.3x index daa5e1e8..ea41729e 100644 --- a/man/curs_initscr.3x +++ b/man/curs_initscr.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_initscr.3x,v 1.10 2000/07/08 12:47:39 tom Exp $ +.\" $Id: curs_initscr.3x,v 1.11 2002/07/20 14:51:04 tom Exp $ .TH curs_initscr 3X "" .SH NAME \fBinitscr\fR, @@ -44,7 +44,7 @@ .br \fBbool isendwin(void);\fR .br -\fBSCREEN *newterm(const char *type, FILE *outfd, FILE *infd);\fR +\fBSCREEN *newterm(char *type, FILE *outfd, FILE *infd);\fR .br \fBSCREEN *set_term(SCREEN *new);\fR .br diff --git a/man/curs_inopts.3x b/man/curs_inopts.3x index 1fc6a820..c129ae19 100644 --- a/man/curs_inopts.3x +++ b/man/curs_inopts.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_inopts.3x,v 1.8 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_inopts.3x,v 1.9 2002/08/10 22:29:49 tom Exp $ .TH curs_inopts 3X "" .SH NAME \fBcbreak\fR, \fBnocbreak\fR, \fBecho\fR, @@ -128,7 +128,7 @@ To force 8 bits to be returned, invoke \fBmeta\fR(\fIwin\fR, \fBTRUE\fR); this is equivalent, under POSIX, to setting the CS8 flag on the terminal. To force 7 bits to be returned, invoke \fBmeta\fR(\fIwin\fR, \fBFALSE\fR); this is equivalent, under POSIX, -to setting the CS8 flag on the terminal. The window argument, +to setting the CS7 flag on the terminal. The window argument, \fIwin\fR, is always ignored. If the terminfo capabilities \fBsmm\fR (meta_on) and \fBrmm\fR (meta_off) are defined for the terminal, \fBsmm\fR is sent to the terminal when \fBmeta\fR(\fIwin\fR, diff --git a/man/curs_ins_wch.3x b/man/curs_ins_wch.3x new file mode 100644 index 00000000..23cf0999 --- /dev/null +++ b/man/curs_ins_wch.3x @@ -0,0 +1,65 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_ins_wch.3x,v 1.2 2002/03/10 23:43:27 tom Exp $ +.TH curs_ins_wch 3X "" +.SH NAME +\fBins_wch\fR, +\fBmvins_wch\fR, +\fBmvwins_wch\fR, +\fBwins_wch\fR \- insert a complex character and rendition into a window +.SH SYNOPSIS +#include + +\fBint ins_wch(const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint wins_wch(WINDOW *\fR\fIwin, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvins_wch(int \fR\fIy, int \fR\fIx, const cchar_t *\fR\fIwch\fR\fB);\fR +.br +\fBint mvwins_wch(WINDOW *\fR\fIwin, int \fR\fIy, int \fR\fIx, const cchar_t *\fR\fIwch\fR\fB);\fR +.SH DESCRIPTION +These routines, insert the complex character \fIwch\fR with rendition +before the character under the cursor. +All characters to the right of the cursor are moved one space to the right, +with the possibility of the rightmost character on the line being lost. +The insertion operation does not change the cursor position. +.SH RETURN VALUE +If successful, these functions return OK. +If not, they return ERR. +.SH ERRORS +No errors are defined. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_insch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_ins_wstr.3x b/man/curs_ins_wstr.3x new file mode 100644 index 00000000..197f30f5 --- /dev/null +++ b/man/curs_ins_wstr.3x @@ -0,0 +1,104 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_ins_wstr.3x,v 1.2 2002/03/10 23:43:27 tom Exp $ +.TH curs_ins_wstr 3X "" +.SH NAME +\fBins_wstr\fR, +\fBins_nwstr\fR, +\fBwins_wstr\fR, +\fBwins_nwstr\fR, +\fBmvins_wstr\fR, +\fBmvins_nwstr\fR, +\fBmvwins_wstr\fR, +\fBmvwins_nwstr\fR \- insert a wide-character string into a curses window +.SH SYNOPSIS +.nf +\fB#include \fR + +\fBint ins_wstr(const wchar_t *\fR\fIwstr);\fR +.br +\fBint ins_nwstr(const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint wins_wstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint wins_nwstr(WINDOW *\fR\fIwin\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvins_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvins_nwstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwins_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB);\fR +.br +\fBint mvwins_nwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines insert a \fBwchar_t\fR character string +(as many characters as will fit on the line) +before the character under the cursor. +All characters to the right of the cursor are shifted right, +with the possibility of the rightmost characters on the line being lost. +No wrapping is performed. +The cursor position does not change +(after moving to \fIy\fR, \fIx\fR, if specified). +The four routines with \fIn\fR as the last argument +insert a leading substring of at most \fIn\fR \fBwchar_t\fR characters. +If \fIn\fR is less than 1, the entire string is inserted. + +If a character in \fIwstr\fR is a tab, newline, carriage return or +backspace, the cursor is moved appropriately within the window. +A newline also does a \fBclrtoeol\fR before moving. +Tabs are considered to be at every eighth column. +If a character in \fIwstr\fR is another control character, +it is drawn in the \fB^\fR\fIX\fR notation. +Calling \fBwin_wch\fR after adding a control character +(and moving to it, if necessary) +does not return the control character, +but instead returns a character in the ^-representation +of the control character. +.SH NOTES +Note that all but wins_nwstr may be macros. + +If the first character in the string is a nonspacing character, these +functions will fail. +XSI does not define what will happen if a nonspacing character follows +a control character. +.SH RETURN VALUES +Upon successful completion, these functions return OK. +Otherwise, they return ERR. +.SH SEE ALSO +\fBcurses\fR(3X), +\fBcurs_insstr\fR(3X), +\fBcurs_in_wch\fR(3X), +\fBcurs_ins_wch\fR(3X). +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_insstr.3x b/man/curs_insstr.3x index af84cb91..ed1e13ea 100644 --- a/man/curs_insstr.3x +++ b/man/curs_insstr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_insstr.3x,v 1.11 2000/07/01 19:57:49 tom Exp $ +.\" $Id: curs_insstr.3x,v 1.12 2001/11/03 19:59:03 tom Exp $ .TH curs_insstr 3X "" .SH NAME \fBinsstr\fR, @@ -83,7 +83,7 @@ Note that all but \fBwinsnstr\fR may be macros. These functions are described in the XSI Curses standard, Issue 4, which adds const qualifiers to the arguments. The XSI Curses error conditions \fBEILSEQ\fR and \fBEILOVERFLOW\fR associated with extended-level conformance -are not yet detected (this implementation does not yet support XPG4 multi-byte +are not yet detected (this implementation does not yet support XPG4 multibyte characters). .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_clear\fR(3X), \fBcurs_inch\fR(3X). diff --git a/man/curs_instr.3x b/man/curs_instr.3x index 283ae19a..9a09ab27 100644 --- a/man/curs_instr.3x +++ b/man/curs_instr.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_instr.3x,v 1.9 2000/07/01 20:05:03 tom Exp $ +.\" $Id: curs_instr.3x,v 1.10 2001/11/03 19:58:56 tom Exp $ .TH curs_instr 3X "" .SH NAME \fBinstr\fR, @@ -71,7 +71,7 @@ Note that all routines except \fBwinnstr\fR may be macros. The XSI Curses error conditions \fBEILSEQ\fR and \fBEILOVERFLOW\fR associated with extended-level conformance are not yet detected (this implementation does not -yet support XPG4 multi-byte characters). +yet support XPG4 multibyte characters). SVr4 does not document whether a length limit includes or excludes the trailing NUL. .PP diff --git a/man/curs_inwstr.3x b/man/curs_inwstr.3x new file mode 100644 index 00000000..b345ce6e --- /dev/null +++ b/man/curs_inwstr.3x @@ -0,0 +1,95 @@ +.\"*************************************************************************** +.\" Copyright (c) 2002 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: curs_inwstr.3x,v 1.2 2002/04/13 20:25:35 tom Exp $ +.TH curs_inwstr 3 "" +.SH NAME +.PP +\fBinwstr\fR, +\fBinnwstr\fR, +\fBwinwstr\fR, +\fBwinnwstr\fR, +\fBmvinwstr\fR, +\fBmvinnwstr\fR, +\fBmvwinwstr\fR, +\fBmvwinnwstr\fR \- get a string of \fBwchar_t\fR characters from a curses window +.SH SYNOPSIS +.nf +\fB#include \fR + +\fBint inwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint innwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint winwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint winnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvinwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint mvinnwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.br +\fBint mvwinwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR +.br +\fBint mvwinnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR +.fi +.SH DESCRIPTION +These routines return a string of \fBwchar_t\fR characters in \fIwstr\fR, +extracted starting at the current cursor position in the named window. +Attributes are stripped from the characters. +The four functions with \fIn\fR as the last argument return a leading substring at most +\fIn\fR bytes long (exclusive of the trailing NUL). +Transfer stops at the end of the current line, or when \fIn\fR bytes have +been stored at the location referenced by \fIwstr\fR. +.PP +If the size \fIn\fR is not large enough to store a complete character, +an error is generated. +.SH NOTES +Note that all routines except +\fBwinnwstr\fR +may be macros. +.SH RETURN VALUES +All routines return +\fBERR\fR +upon failure. Upon +successful completion, the *\fBinwstr\fR +routines return +\fBOK\fR, and the *\fBinnwstr\fR +routines return the +number of characters read into the string. +.SH SEE ALSO +Functions: +\fBcurses\fR(3X), +\fBcurs_instr\fR(3X), +\fBcurs_in_wchstr\fR(3X) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/man/curs_kernel.3x b/man/curs_kernel.3x index ada1a1d1..caeb5bba 100644 --- a/man/curs_kernel.3x +++ b/man/curs_kernel.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_kernel.3x,v 1.12 2000/02/27 01:37:46 tom Exp $ +.\" $Id: curs_kernel.3x,v 1.13 2001/12/08 18:01:25 tom Exp $ .TH curs_kernel 3X "" .SH NAME \fBdef_prog_mode\fR, \fBdef_shell_mode\fR, @@ -138,7 +138,7 @@ on the correctness of the return value anywhere else. Both ncurses and SVr4 will call \fBcurs_set\fR in \fBendwin\fR if \fBcurs_set\fR has been called to make the cursor other than normal, i.e., either -visible or very visible. +invisible or very visible. There is no way for ncurses to determine the initial cursor state to restore that. .SH PORTABILITY diff --git a/man/curs_mouse.3x b/man/curs_mouse.3x index 316598a5..c1e3e37f 100644 --- a/man/curs_mouse.3x +++ b/man/curs_mouse.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: curs_mouse.3x,v 1.15 2000/07/08 12:50:08 tom Exp $ +.\" $Id: curs_mouse.3x,v 1.20 2002/07/20 14:52:14 tom Exp $ .TH curs_mouse 3X "" .SH NAME \fBgetmouse\fR, \fBungetmouse\fR, @@ -55,7 +55,7 @@ MEVENT;\fR .br \fBmmask_t mousemask(mmask_t newmask, mmask_t *oldmask);\fR .br -\fBbool wenclose(WINDOW *win, int y, int x);\fR +\fBbool wenclose(const WINDOW *win, int y, int x);\fR .br \fBbool mouse_trafo(int* pY, int* pX, bool to_screen);\fR .br @@ -67,19 +67,23 @@ MEVENT;\fR .br .SH DESCRIPTION These functions provide an interface to mouse events from -\fBncurses\fR(3X). Mouse events are represented by \fBKEY_MOUSE\fR +\fBncurses\fR(3X). +Mouse events are represented by \fBKEY_MOUSE\fR pseudo-key values in the \fBwgetch\fR input stream. -To make mouse events visible, use the \fBmousemask\fR function. This will set -the mouse events to be reported. By default, no mouse events are reported. +To make mouse events visible, use the \fBmousemask\fR function. +This will set +the mouse events to be reported. +By default, no mouse events are reported. The function will return a mask to indicate which of the specified mouse events -can be reported; on complete failure it returns 0. If oldmask is non-NULL, +can be reported; on complete failure it returns 0. +If oldmask is non-NULL, this function fills the indicated location with the previous value of the given window's mouse event mask. As a side effect, setting a zero mousemask may turn off the mouse pointer; -setting a nonzero mask may turn it on. Whether this happens is -device-dependent. +setting a nonzero mask may turn it on. +Whether this happens is device-dependent. Here are the mouse event type masks: @@ -119,20 +123,24 @@ Once a class of mouse events have been made visible in a window, calling the \fBwgetch\fR function on that window may return \fBKEY_MOUSE\fR as an indicator that a mouse event has been queued. To read the event data and pop the event off the queue, call -\fBgetmouse\fR. This function will return \fBOK\fR if a mouse event +\fBgetmouse\fR. +This function will return \fBOK\fR if a mouse event is actually visible in the given window, \fBERR\fR otherwise. When \fBgetmouse\fR returns \fBOK\fR, the data deposited as y and x in the event structure coordinates will be screen-relative character-cell -coordinates. The returned state mask will have exactly one bit set to +coordinates. +The returned state mask will have exactly one bit set to indicate the event type. -The \fBungetmouse\fR function behaves analogously to \fBungetch\fR. It pushes +The \fBungetmouse\fR function behaves analogously to \fBungetch\fR. +It pushes a \fBKEY_MOUSE\fR event onto the input queue, and associates with that event the given state data and screen-relative character-cell coordinates. The \fBwenclose\fR function tests whether a given pair of screen-relative character-cell coordinates is enclosed by a given window, returning TRUE -if it is and FALSE otherwise. It is useful for determining what subset of +if it is and FALSE otherwise. +It is useful for determining what subset of the screen windows enclose the location of a mouse event. The \fBwmouse_trafo\fR function transforms a given pair of coordinates from @@ -140,24 +148,33 @@ stdscr-relative coordinates to screen-relative coordinates or vice versa. Please remember, that stdscr-relative coordinates are not always identical to screen-relative coordinates due to the mechanism to reserve lines on top or bottom of the screen for other purposes (ripoff() call, see also slk_... -functions). If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers +functions). +If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers \fBpY, pX\fR must reference the coordinates of a location inside the window -\fBwin\fR. They are converted to screen-relative coordinates and returned -through the pointers. If the conversion was successful, the function -returns \fBTRUE\fR. If one of the parameters was NULL or the location is -not inside the window, \fBFALSE\fR is returned. If \fBto_screen\fR is +\fBwin\fR. +They are converted to screen-relative coordinates and returned +through the pointers. +If the conversion was successful, the function returns \fBTRUE\fR. +If one of the parameters was NULL or the location is +not inside the window, \fBFALSE\fR is returned. +If \fBto_screen\fR is \fBFALSE\fR, the pointers \fBpY, pX\fR must reference screen-relative -coordinates. They are converted to stdscr-relative coordinates if the -window \fBwin\fR encloses this point. In this case the function returns -\fBTRUE\fR. If one of the parameters is NULL or the point is not inside the -window, \fBFALSE\fR is returned. Please notice, that the referenced coordinates +coordinates. +They are converted to stdscr-relative coordinates if the +window \fBwin\fR encloses this point. +In this case the function returns \fBTRUE\fR. +If one of the parameters is NULL or the point is not inside the +window, \fBFALSE\fR is returned. +Please notice, that the referenced coordinates are only replaced by the converted coordinates if the transformation was successful. The \fBmouseinterval\fR function sets the maximum time (in thousands of a -second) that can elapse between press and release events in order for them to -be recognized as a click. This function returns the previous interval value. -The default is one fifth of a second. +second) that can elapse between press and release events for them to +be recognized as a click. +Use \fBmouseinterval(-1)\fR to disable click resolution. +This function returns the previous interval value. +The default is one sixth of a second. Note that mouse events will be ignored when input is in cooked mode, and will cause an error beep when cooked mode is being simulated in a window by a @@ -167,8 +184,10 @@ termination. .SH RETURN VALUE \fBgetmouse\fR, \fBungetmouse\fR and \fBmouseinterval\fR return the integer \fBERR\fR upon failure or \fBOK\fR -upon successful completion. \fBmousemask\fR returns the -mask of reportable events. \fBwenclose\fR and \fBwmouse_trafo\fR +upon successful completion. +\fBmousemask\fR returns the +mask of reportable events. +\fBwenclose\fR and \fBwmouse_trafo\fR are boolean functions returning \fBTRUE\fR or \fBFALSE\fR depending on their test result. .SH PORTABILITY @@ -190,12 +209,14 @@ running on your machine, mouse events will not be visible to \fBncurses\fR(3X) (and the \fBwmousemask\fR function will always return \fB0\fR). -The z member in the event structure is not presently used. It is intended +The z member in the event structure is not presently used. +It is intended for use with touch screens (which may be pressure-sensitive) or with 3D-mice/trackballs/power gloves. .SH BUGS Mouse events under xterm will not in fact be ignored during cooked mode, -if they have been enabled by \fBwmousemask\fR. Instead, the xterm mouse +if they have been enabled by \fBwmousemask\fR. +Instead, the xterm mouse report sequence will appear in the string read. Mouse events under xterm will not be detected correctly in a window with @@ -205,7 +226,8 @@ of the response from xterm for mouse clicks). Because there are no standard terminal responses that would serve to identify terminals which support the xterm mouse protocol, \fBncurses\fR assumes that -if your $DISPLAY environment variable is set, and \fBkmous\fR is defined in +if your $TERM environment variable contains "xterm", +or \fBkmous\fR is defined in the terminal description, then the terminal may send mouse events. .SH SEE ALSO \fBcurses\fR(3X). diff --git a/man/curs_move.3x b/man/curs_move.3x index 25c47feb..2fff160c 100644 --- a/man/curs_move.3x +++ b/man/curs_move.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_move.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_move.3x,v 1.7 2001/11/03 19:58:47 tom Exp $ .TH curs_move 3X "" .SH NAME \fBmove\fR, \fBwmove\fR - move \fBcurses\fR window cursor @@ -52,7 +52,7 @@ Note that \fBmove\fR may be a macro. These functions are described in the XSI Curses standard, Issue 4. The standard specifies that if (y,x) is within a multi-column character, the cursor is moved to the first column of that character; however, this implementation -does not yet support the extended-level XSI multi-byte characters. +does not yet support the extended-level XSI multibyte characters. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_refresh\fR(3X) .\"# diff --git a/man/curs_outopts.3x b/man/curs_outopts.3x index 4c5bf1f4..f9db6f26 100644 --- a/man/curs_outopts.3x +++ b/man/curs_outopts.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,10 +26,10 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_outopts.3x,v 1.14 2000/02/27 01:41:58 tom Exp $ +.\" $Id: curs_outopts.3x,v 1.17 2001/10/14 00:50:30 tom Exp $ .TH curs_outopts 3X "" .SH NAME -\fBclearok\fR, \fBidlok\fR, \fBidcok immedok\fR, +\fBclearok\fR, \fBidlok\fR, \fBidcok\fR, \fBimmedok\fR, \fBleaveok\fR, \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBscrollok\fR, \fBnl\fR, \fBnonl\fR - \fBcurses\fR output options .SH SYNOPSIS @@ -57,75 +57,96 @@ .br .SH DESCRIPTION These routines set options that change the style of output within -\fBcurses\fR. All options are initially \fBFALSE\fR, unless otherwise stated. +\fBcurses\fR. +All options are initially \fBFALSE\fR, unless otherwise stated. It is not necessary to turn these options off before calling \fBendwin\fR. If \fBclearok\fR is called with \fBTRUE\fR as argument, the next call to \fBwrefresh\fR with this window will clear the screen completely and -redraw the entire screen from scratch. This is useful when the contents of the -screen are uncertain, or in some cases for a more pleasing visual effect. If +redraw the entire screen from scratch. +This is useful when the contents of the +screen are uncertain, or in some cases for a more pleasing visual effect. +If the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR, the next call to \fBwrefresh\fR with any window causes the screen to be cleared and repainted from scratch. If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR considers using the hardware insert/delete line feature of terminals so -equipped. Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use -of line insertion and deletion. This option should be enabled only if the -application needs insert/delete line, for example, for a screen editor. It is +equipped. +Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use +of line insertion and deletion. +This option should be enabled only if the +application needs insert/delete line, for example, for a screen editor. +It is disabled by default because insert/delete line tends to be visually annoying -when used in applications where it isn't really needed. If insert/delete line +when used in applications where it isn't really needed. +If insert/delete line cannot be used, \fBcurses\fR redraws the changed portions of all lines. If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR no longer considers using the hardware insert/delete character feature of -terminals so equipped. Use of character insert/delete is enabled by default. +terminals so equipped. +Use of character insert/delete is enabled by default. Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use of character insertion and deletion. If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR, -\fIetc\fR., automatically cause a call to \fBwrefresh\fR. However, it may +\fIetc\fR., automatically cause a call to \fBwrefresh\fR. +However, it may degrade performance considerably, due to repeated calls to \fBwrefresh\fR. It is disabled by default. Normally, the hardware cursor is left at the location of the window cursor -being refreshed. The \fBleaveok\fR option allows the cursor to be left -wherever the update happens to leave it. It is useful for applications where -the cursor is not used, since it reduces the need for cursor motions. If -possible, the cursor is made invisible when this option is enabled. +being refreshed. +The \fBleaveok\fR option allows the cursor to be left +wherever the update happens to leave it. +It is useful for applications where +the cursor is not used, since it reduces the need for cursor motions. The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application -programmer to set a software scrolling region in a window. \fItop\fR and +programmer to set a software scrolling region in a window. +\fItop\fR and \fIbot\fR are the line numbers of the top and bottom margin of the scrolling -region. (Line 0 is the top line of the window.) If this option and +region. +(Line 0 is the top line of the window.) If this option and \fBscrollok\fR are enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll one line in the direction -of the first line. Only the text of the window is scrolled. (Note that this +of the first line. +Only the text of the window is scrolled. +(Note that this has nothing to do with the use of a physical scrolling region capability in the -terminal, like that in the VT100. If \fBidlok\fR is enabled and the terminal +terminal, like that in the VT100. +If \fBidlok\fR is enabled and the terminal has either a scrolling region or insert/delete line capability, they will probably be used by the output routines.) The \fBscrollok\fR option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last -line. If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom -line. If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line -(Note that in order to get the physical scrolling effect on the terminal, it is +line. +If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom +line. +If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line +(Note that to get the physical scrolling effect on the terminal, it is also necessary to call \fBidlok\fR). The \fBnl\fR and \fBnonl\fR routines control whether the underlying display device translates the return key into newline on input, and whether it translates newline into return and line-feed on output (in either case, the call \fBaddch('\\n')\fR does the equivalent of return and line feed on the -virtual screen). Initially, these translations do occur. If you disable them +virtual screen). +Initially, these translations do occur. +If you disable them using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed -capability, resulting in faster cursor motion. Also, \fBcurses\fR will then be +capability, resulting in faster cursor motion. +Also, \fBcurses\fR will then be able to detect the return key. .SH RETURN VALUE The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success -and \fBERR\fR upon failure. All other routines that return an integer always +and \fBERR\fR upon failure. +All other routines that return an integer always return \fBOK\fR. .SH PORTABILITY These functions are described in the XSI Curses standard, Issue 4. @@ -133,19 +154,22 @@ These functions are described in the XSI Curses standard, Issue 4. The XSI Curses standard is ambiguous on the question of whether \fBraw\fR() should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR(). BSD curses did turn off these translations; AT&T curses (at least as late as -SVr1) did not. We choose to do so, on the theory that a programmer requesting +SVr1) did not. +We choose to do so, on the theory that a programmer requesting raw input wants a clean (ideally 8-bit clean) connection that the operating system does not mess with. Some historic curses implementations had, as an undocumented feature, the ability to do the equivalent of \fBclearok(..., 1)\fR by saying -\fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. This will not work under +\fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR. +This will not work under ncurses. Earlier System V curses implementations specified that with \fBscrollok\fR enabled, any window modification triggering a scroll also forced a physical -refresh. XSI Curses does not require this, and \fBncurses\fR avoids doing -it in order to perform better vertical-motion optimization at \fBwrefresh\fR +refresh. +XSI Curses does not require this, and \fBncurses\fR avoids doing +it to perform better vertical-motion optimization at \fBwrefresh\fR time. The XSI Curses standard does not mention that the cursor should be diff --git a/man/curs_overlay.3x b/man/curs_overlay.3x index 9c0b82c9..3d817d41 100644 --- a/man/curs_overlay.3x +++ b/man/curs_overlay.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_overlay.3x,v 1.9 2000/07/01 20:05:31 tom Exp $ +.\" $Id: curs_overlay.3x,v 1.11 2002/07/20 14:53:00 tom Exp $ .TH curs_overlay 3X "" .SH NAME \fBoverlay\fR, @@ -39,7 +39,7 @@ .br \fBint overwrite(const WINDOW *srcwin, WINDOW *dstwin);\fR .br -\fBint copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow,\fR +\fBint copywin(const WINDOW *srcwin, WINDOW *dstwin, int sminrow,\fR \fBint smincol, int dminrow, int dmincol, int dmaxrow,\fR \fBint dmaxcol, int overlay);\fR .SH DESCRIPTION @@ -65,7 +65,7 @@ Note that \fBoverlay\fR and \fBoverwrite\fR may be macros. .SH PORTABILITY The XSI Curses standard, Issue 4 describes these functions (adding the const qualifiers). It further specifies their behavior in the presence of characters -with multi-byte renditions (not yet supported in this implementation). +with multibyte renditions (not yet supported in this implementation). .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_pad\fR(3X), \fBcurs_refresh\fR(3X) .\"# diff --git a/man/curs_print.3x b/man/curs_print.3x index 7b781988..dd4b6e3c 100644 --- a/man/curs_print.3x +++ b/man/curs_print.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: curs_print.3x,v 1.3 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_print.3x,v 1.5 2002/02/16 22:39:04 tom Exp $ .TH curs_print 3X "" .SH NAME \fBmcprint\fR - ship binary data to printer diff --git a/man/curs_printw.3x b/man/curs_printw.3x index 8ba9d174..3b9c3582 100644 --- a/man/curs_printw.3x +++ b/man/curs_printw.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_printw.3x,v 1.11 2000/07/01 20:11:32 tom Exp $ +.\" $Id: curs_printw.3x,v 1.12 2002/07/20 15:01:43 tom Exp $ .TH curs_printw 3X "" .SH NAME \fBprintw\fR, @@ -37,20 +37,17 @@ .SH SYNOPSIS \fB#include \fR -\fBint printw(char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint printw(char *fmt, ...);\fR .br -\fBint wprintw(WINDOW *win, char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint wprintw(WINDOW *win, char *fmt, ...);\fR .br -\fBint mvprintw(int y, int x, char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint mvprintw(int y, int x, char *fmt, ...);\fR .br -\fBint mvwprintw(WINDOW *win, int y, int x,\fR - \fBchar *fmt\fR [\fB, arg]\fR ...); - -\fB#include \fR +\fBint mvwprintw(WINDOW *win, int y, int x, char *fmt, ...);\fR .br -\fBint vwprintw(WINDOW *win, char *fmt, varglist);\fR +\fBint vwprintw(WINDOW *win, char *fmt, va_list varglist);\fR .br -\fBint vw_printw(WINDOW *win, char *fmt, varglist);\fR +\fBint vw_printw(WINDOW *win, char *fmt, va_list varglist);\fR .br .SH DESCRIPTION The \fBprintw\fR, \fBwprintw\fR, \fBmvprintw\fR and \fBmvwprintw\fR @@ -58,10 +55,11 @@ routines are analogous to \fBprintf\fR [see \fBprintf\fR(3S)]. In effect, the string that would be output by \fBprintf\fR is output instead as though \fBwaddstr\fR were used on the given window. -The \fBvwprintw\fR routine is analogous to \fBvprintf\fR [see -\fBprintf\fR(3S)] and performs a \fBwprintw\fR using a variable -argument list. The third argument is a \fBva_list\fR, a pointer to a -list of arguments, as defined in \fB\fR. +The \fBvwprintw\fR and \fBwv_printw\fR routines are analogous +to \fBvprintf\fR [see \fBprintf\fR(3S)] +and perform a \fBwprintw\fR using a variable argument list. +The third argument is a \fBva_list\fR, a pointer to a +list of arguments, as defined in \fB\fR. .SH RETURN VALUE Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful @@ -70,6 +68,12 @@ completion. The XSI Curses standard, Issue 4 describes these functions. The function \fBvwprintw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function \fBvw_printw\fR using the \fB\fR interface. +The Single Unix Specification, Version 2 states that +\fBvw_printw\fR is preferred to \fBvwprintw\fR since the latter requires +including \fB\fR, which +cannot be used in the same file as \fB\fR. +This implementation uses \fB\fR for both, because that header +is included in \fB. .SH SEE ALSO \fBcurses\fR(3X), \fBprintf\fR(3S), \fBvprintf(3S)\fR .\"# diff --git a/man/curs_refresh.3x b/man/curs_refresh.3x index 9b4cb1df..210b326a 100644 --- a/man/curs_refresh.3x +++ b/man/curs_refresh.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,15 +26,15 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_refresh.3x,v 1.8 2000/07/01 20:06:14 tom Exp $ +.\" $Id: curs_refresh.3x,v 1.10 2001/11/03 18:57:12 tom Exp $ .TH curs_refresh 3X "" .SH NAME -\fBrefresh\fR, -\fBwrefresh\fR, -\fBwnoutrefresh\fR, \fBdoupdate\fR, \fBredrawwin\fR, -\fBwredrawln\fR - refresh \fBcurses\fR windows and lines +\fBrefresh\fR, +\fBwnoutrefresh\fR, +\fBwredrawln\fR, +\fBwrefresh\fR - refresh \fBcurses\fR windows and lines .SH SYNOPSIS \fB#include \fR @@ -53,15 +53,19 @@ .SH DESCRIPTION The \fBrefresh\fR and \fBwrefresh\fR routines (or \fBwnoutrefresh\fR and \fBdoupdate\fR) must be called to get actual output to the terminal, as other -routines merely manipulate data structures. The routine \fBwrefresh\fR copies +routines merely manipulate data structures. +The routine \fBwrefresh\fR copies the named window to the physical terminal screen, taking into account what is -already there in order to do optimizations. The \fBrefresh\fR routine is the -same, using \fBstdscr\fR as the default window. Unless \fBleaveok\fR has been +already there to do optimizations. +The \fBrefresh\fR routine is the +same, using \fBstdscr\fR as the default window. +Unless \fBleaveok\fR has been enabled, the physical cursor of the terminal is left at the location of the cursor for that window. The \fBwnoutrefresh\fR and \fBdoupdate\fR routines allow multiple updates with -more efficiency than \fBwrefresh\fR alone. In addition to all the window +more efficiency than \fBwrefresh\fR alone. +In addition to all the window structures, \fBcurses\fR keeps two data structures representing the terminal screen: a physical screen, describing what is actually on the screen, and a virtual screen, describing what the programmer wants to have on the screen. @@ -69,21 +73,26 @@ virtual screen, describing what the programmer wants to have on the screen. The routine \fBwrefresh\fR works by first calling \fBwnoutrefresh\fR, which copies the named window to the virtual screen, and then calling \fBdoupdate\fR, which compares the virtual screen to the physical screen and does the actual -update. If the programmer wishes to output several windows at once, a series +update. +If the programmer wishes to output several windows at once, a series of calls to \fBwrefresh\fR results in alternating calls to \fBwnoutrefresh\fR -and \fBdoupdate\fR, causing several bursts of output to the screen. By first +and \fBdoupdate\fR, causing several bursts of output to the screen. +By first calling \fBwnoutrefresh\fR for each window, it is then possible to call \fBdoupdate\fR once, resulting in only one burst of output, with fewer total -characters transmitted and less CPU time used. If the \fIwin\fR argument to +characters transmitted and less CPU time used. +If the \fIwin\fR argument to \fBwrefresh\fR is the global variable \fBcurscr\fR, the screen is immediately cleared and repainted from scratch. The phrase "copies the named window to the virtual screen" above is ambiguous. What actually happens is that all \fItouched\fR (changed) lines in the window -are copied to the virtual screen. This affects programs that use overlapping +are copied to the virtual screen. +This affects programs that use overlapping windows; it means that if two windows overlap, you can refresh them in either order and the overlap region will be modified only when it is explicitly -changed. (But see the section on \fBPORTABILITY\fR below for a warning about +changed. +(But see the section on \fBPORTABILITY\fR below for a warning about exploiting this behavior.) The \fBwredrawln\fR routine indicates to \fBcurses\fR that some screen lines @@ -101,9 +110,11 @@ The XSI Curses standard, Issue 4 describes these functions. Whether \fBwnoutrefresh()\fR copies to the virtual screen the entire contents of a window or just its changed portions has never been well-documented in -historic curses versions (including SVr4). It might be unwise to rely on +historic curses versions (including SVr4). +It might be unwise to rely on either behavior in programs that might have to be linked with other curses -implementations. Instead, you can do an explicit \fBtouchwin()\fR before the +implementations. +Instead, you can do an explicit \fBtouchwin()\fR before the \fBwnoutrefresh()\fR call to guarantee an entire-contents copy anywhere. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_outopts\fR(3X) diff --git a/man/curs_scanw.3x b/man/curs_scanw.3x index b7f3795d..8b67801f 100644 --- a/man/curs_scanw.3x +++ b/man/curs_scanw.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_scanw.3x,v 1.11 2000/07/15 21:48:17 tom Exp $ +.\" $Id: curs_scanw.3x,v 1.12 2002/07/20 15:48:09 tom Exp $ .TH curs_scanw 3X "" .SH NAME \fBscanw\fR, @@ -37,14 +37,13 @@ .SH SYNOPSIS \fB#include \fR -\fBint scanw(char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint scanw(char *fmt, ...);\fR .br -\fBint wscanw(WINDOW *win, char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint wscanw(WINDOW *win, char *fmt, ...);\fR .br -\fBint mvscanw(int y, int x, char *fmt\fR [\fB, arg\fR] \fB...);\fR +\fBint mvscanw(int y, int x, char *fmt, ...);\fR .br -\fBint mvwscanw(WINDOW *win, int y, int x,\fR - \fBchar *fmt\fR [\fB, arg]\fR \fB...);\fR +\fBint mvwscanw(WINDOW *win, int y, int x, char *fmt, ...);\fR .br \fBint vw_scanw(WINDOW *win, char *fmt, va_list varglist);\fR .br @@ -56,10 +55,10 @@ The \fBscanw\fR, \fBwscanw\fR and \fBmvscanw\fR routines are analogous to for \fBsscanf\fR(3). Fields which do not map to a variable in the \fIfmt\fR field are lost. -The \fBvwscanw\fR routine is similar to \fBvwprintw\fR in that it performs a -\fBwscanw\fR using a variable argument list. The third argument is a -\fIva\fR_\fIlist\fR, a pointer to a list of arguments, as defined in -\fB\fR. +The \fBvwscanw\fR and \fBvw_scanw\fR routines are analogous to \fBvscanf\fR. +They perform a \fBwscanw\fR using a variable argument list. +The third argument is a \fIva_list\fR, +a pointer to a list of arguments, as defined in \fB\fR. .SH RETURN VALUE \fBvwscanw\fR returns \fBERR\fR on failure and an integer equal to the number of fields scanned on success. @@ -71,6 +70,23 @@ which were mapped in the call. The XSI Curses standard, Issue 4 describes these functions. The function \fBvwscanw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function \fBvw_scanw\fR using the \fB\fR interface. +The Single Unix Specification, Version 2 states that +\fBvw_scanw\fR is preferred to \fBvwscanw\fR since the latter requires +including \fB\fR, which +cannot be used in the same file as \fB\fR. +This implementation uses \fB\fR for both, because that header +is included in \fB. +.LP +Both XSI and The Single Unix Specification, Version 2 state that these +functions return ERR or OK. +Since the underlying \fBscanf\fR can return the number of items scanned, +and the SVr4 code was documented to use this feature, +this is probably an editing error which was introduced in XSI, +rather than being done intentionally. +Portable applications should only test if the return value is ERR, +since the OK value (zero) is likely to be misleading. +One possible way to get useful results would be to use a "%n" conversion +at the end of the format string to ensure that something was processed. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_getstr\fR(3X), \fBcurs_printw\fR(3X), \fBscanf\fR(3S) .\"# diff --git a/man/curs_scroll.3x b/man/curs_scroll.3x index 863b587d..f957ac96 100644 --- a/man/curs_scroll.3x +++ b/man/curs_scroll.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_scroll.3x,v 1.8 2000/07/01 17:54:23 tom Exp $ +.\" $Id: curs_scroll.3x,v 1.9 2001/10/14 00:51:56 tom Exp $ .TH curs_scroll 3X "" .SH NAME \fBscroll\fR, \fBscrl\fR, \fBwscrl\fR - scroll a \fBcurses\fR window @@ -40,15 +40,19 @@ \fBint wscrl(WINDOW *win, int n);\fR .br .SH DESCRIPTION -The \fBscroll\fR routine scrolls the window up one line. This involves moving -the lines in the window data structure. As an optimization, if the scrolling +The \fBscroll\fR routine scrolls the window up one line. +This involves moving +the lines in the window data structure. +As an optimization, if the scrolling region of the window is the entire screen, the physical screen may be scrolled at the same time. For positive \fIn\fR, the \fBscrl\fR and \fBwscrl\fR routines scroll the window up \fIn\fR lines (line \fIi\fR+\fIn\fR becomes \fIi\fR); otherwise -scroll the window down \fIn\fR lines. This involves moving the lines in the -window character image structure. The current cursor position is not changed. +scroll the window down \fIn\fR lines. +This involves moving the lines in the +window character image structure. +The current cursor position is not changed. For these functions to work, scrolling must be enabled via \fBscrollok\fR. .SH RETURN VALUE @@ -59,8 +63,9 @@ Note that \fBscrl\fR and \fBscroll\fR may be macros. The SVr4 documentation says that the optimization of physically scrolling immediately if the scroll region is the entire screen "is" performed, not -"may be" performed. This implementation deliberately does not guarantee -that this will occur, in order to leave open the possibility of smarter +"may be" performed. +This implementation deliberately does not guarantee +that this will occur, to leave open the possibility of smarter optimization of multiple scroll actions on the next update. Neither the SVr4 nor the XSI documentation specify whether the current diff --git a/man/curs_slk.3x b/man/curs_slk.3x index c52a7055..8f1ae8a0 100644 --- a/man/curs_slk.3x +++ b/man/curs_slk.3x @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_slk.3x,v 1.10 2000/07/01 17:52:44 tom Exp $ +.\" $Id: curs_slk.3x,v 1.11 2001/03/03 21:05:41 Todd.C.Miller Exp $ .TH curs_slk 3X "" .SH NAME \fBslk_init\fR, \fBslk_set\fR, \fBslk_refresh\fR, @@ -34,7 +34,7 @@ \fBslk_clear\fR, \fBslk_restore\fR, \fBslk_touch\fR, \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR, \fBslk_attr_on\fR, \fBslk_attr_set\fR, \fBslk_attr_off\fR, -\fBslk_attr\fR \fBslk_color\fR - \fBcurses\fR soft label routines +\fBslk_attr\fR, \fBslk_color\fR - \fBcurses\fR soft label routines .SH SYNOPSIS \fB#include \fR diff --git a/man/curs_termattrs.3x b/man/curs_termattrs.3x index 3938bc0f..d285b866 100644 --- a/man/curs_termattrs.3x +++ b/man/curs_termattrs.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,11 +26,19 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_termattrs.3x,v 1.6 2000/07/08 12:53:34 tom Exp $ +.\" $Id: curs_termattrs.3x,v 1.8 2002/05/11 21:32:26 tom Exp $ .TH curs_termattrs 3X "" .SH NAME -\fBbaudrate\fR, \fBerasechar\fR, \fBhas_ic\fR, -\fBhas_il\fR, \fBkillchar\fR, \fBlongname\fR, \fBtermattrs\fR, +\fBbaudrate\fR, +\fBerasechar\fR, +\fBerasewchar\fR, +\fBhas_ic\fR, +\fBhas_il\fR, +\fBkillchar\fR, +\fBkillwchar\fR, +\fBlongname\fR, +\fBterm_attrs\fR, +\fBtermattrs\fR, \fBtermname\fR - \fBcurses\fR environment query routines .SH SYNOPSIS \fB#include \fR @@ -39,15 +47,21 @@ .br \fBchar erasechar(void);\fR .br +\fBint erasewchar(wchar_t *\fR\fIch\fR\fB);\fR +.br \fBbool has_ic(void);\fR .br \fBbool has_il(void);\fR .br \fBchar killchar(void);\fR .br +\fBint killwchar(wchar_t *\fR\fIch\fR\fB);\fR +.br \fBchar *longname(void);\fR .br -\fBattr_t termattrs(void);\fR +\fBattr_t term_attrs(void);\fR +.br +\fBchtype termattrs(void);\fR .br \fBchar *termname(void);\fR .br @@ -58,6 +72,11 @@ integer. The \fBerasechar\fR routine returns the user's current erase character. +The \fBerasewchar\fR routine stores the current erase character +in the location referenced by \fIch\fR. +If no erase character has been defined, the routine fails +and the location referenced by \fIch\fR is not changed. + The \fBhas_ic\fR routine is true if the terminal has insert- and delete- character capabilities. @@ -68,6 +87,11 @@ scrolling using \fBscrollok\fR. The \fBkillchar\fR routine returns the user's current line kill character. +The \fBkillwchar\fR routine stores the current line-kill character +in the location referenced by \fIch\fR. +If no line-kill character has been defined, +the routine fails and the location referenced by \fIch\fR is not changed. + The \fBlongname\fR routine returns a pointer to a static area containing a verbose description of the current terminal. The maximum length of a verbose description is 128 characters. It is defined only @@ -79,9 +103,11 @@ terminals. If a given terminal doesn't support a video attribute that an application program is trying to use, \fBcurses\fR may substitute a -different video attribute for it. The \fBtermattrs\fR function -returns a logical \fBOR\fR of all video attributes supported by the -terminal. This information is useful when a \fBcurses\fR program +different video attribute for it. +The \fBtermattrs\fR and \fBterm_attrs\fR functions +return a logical \fBOR\fR of all video attributes supported by the +terminal using \fIA_\fR and \fIWA_\fR constants respectively. +This information is useful when a \fBcurses\fR program needs complete control over the appearance of the screen. The \fBtermname\fR routine returns the value of the environmental diff --git a/man/curs_termcap.3x b/man/curs_termcap.3x index 01395bfe..828bb9ad 100644 --- a/man/curs_termcap.3x +++ b/man/curs_termcap.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_termcap.3x,v 1.13 2000/07/01 20:10:57 tom Exp $ +.\" $Id: curs_termcap.3x,v 1.16 2002/02/16 19:26:41 tom Exp $ .TH curs_termcap 3X "" .ds n 5 .SH NAME @@ -41,13 +41,18 @@ .br \fB#include \fR .br -\fBint tgetent(const char *bp, char *name);\fR +\fBextern char PC;\fR +\fBextern char * UP;\fR +\fBextern char * BC;\fR +\fBextern @NCURSES_OSPEED@ ospeed;\fR .br -\fBint tgetflag(const char *id);\fR +\fBint tgetent(char *bp, const char *name);\fR .br -\fBint tgetnum(const char *id);\fR +\fBint tgetflag(char *id);\fR .br -\fBchar *tgetstr(const char *id, char **area);\fR +\fBint tgetnum(char *id);\fR +.br +\fBchar *tgetstr(char *id, char **area);\fR .br \fBchar *tgoto(const char *cap, int col, int row);\fR .br @@ -78,12 +83,32 @@ The return value will also be copied to the buffer pointed to by \fIarea\fR, and the \fIarea\fR value will be updated to point past the null ending this value. +Only the first two characters of the \fBid\fR parameter of +\fBtgetflag\fR, +\fBtgetnum\fR and +\fBtgetstr\fR are compared in lookups. + The \fBtgoto\fR routine instantiates the parameters into the given capability. The output from this routine is to be passed to \fBtputs\fR. The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual page. It can retrieve capabilities by either termcap or terminfo name. +The variables +\fBPC\fR, +\fBUP\fR and +\fBBC\fR +are set by \fBtgetent\fR to the terminfo entry's data for +\fBpad_char\fR, +\fBcursor_up\fR and +\fBbackspace_if_not_bs\fR, +respectively. +\fBUP\fR is not used by ncurses. +\fBPC\fR is used in the \fBtdelay_output\fR function. +\fBBC\fR is used in the \fBtgoto\fR emulation. +The variable \fBospeed\fR is set by ncurses in a system-specific coding +to reflect the terminal speed. + .SH RETURN VALUE Except where explicitly noted, routines that return an integer return \fBERR\fR upon failure and \fBOK\fR @@ -96,7 +121,11 @@ If you call \fBtgetstr\fR to fetch \fBca\fR or any other parameterized string, be aware that it will be returned in terminfo notation, not the older and not-quite-compatible termcap notation. This won't cause problems if all you do with it is call \fBtgoto\fR or \fBtparm\fR, which both expand -terminfo-style. +terminfo-style strings as terminfo. +(The \fBtgoto\fR function, if configured to support termcap, will check +if the string is indeed terminfo-style by looking for "%p" parameters or +"$<..>" delays, and invoke a termcap-style parser if the string does not +appear to be terminfo). Because terminfo conventions for representing padding in string capabilities differ from termcap's, \fBtputs("50");\fR will put out a literal "50" rather @@ -108,6 +137,17 @@ are marked TO BE WITHDRAWN and may be removed in future versions. Neither the XSI Curses standard nor the SVr4 man pages documented the return values of \fBtgetent\fR correctly, though all three were in fact returned ever since SVr1. +In particular, an omission in the XSI Curses documentation has been +misinterpreted to mean that \fBtgetent\fR returns \fBOK\fR or \fBERR\fR. +Because the purpose of these functions is to provide compatibility with +the \fItermcap\fR library, that is a defect in XCurses, Issue 4, Version 2 +rather than in ncurses. + +External variables are provided for support of certain termcap applications. +However, termcap applications' use of those variables is poorly documented, +e.g., not distinguishing between input and output. +In particular, some applications are reported to declare and/or +modify \fBospeed\fR. .SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBputc\fR(3S). .\"# diff --git a/man/curs_terminfo.3x b/man/curs_terminfo.3x index bb5c8ca6..ee0ef0c0 100644 --- a/man/curs_terminfo.3x +++ b/man/curs_terminfo.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1999-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,57 +26,65 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_terminfo.3x,v 1.13 2000/07/01 20:07:34 tom Exp $ +.\" $Id: curs_terminfo.3x,v 1.16 2002/07/20 16:05:19 tom Exp $ .TH curs_terminfo 3X "" .ds n 5 .SH NAME -\fBsetupterm\fR, -\fBsetterm\fR, -\fBset_curterm\fR, \fBdel_curterm\fR, +\fBmvcur\fR, +\fBputp\fR, \fBrestartterm\fR, +\fBset_curterm\fR, +\fBsetterm\fR, +\fBsetupterm\fR, +\fBtigetflag\fR, +\fBtigetnum\fR, +\fBtigetstr\fR, \fBtparm\fR, \fBtputs\fR, -\fBputp\fR, -\fBvidputs\fR, +\fBvid_attr\fR, +\fBvid_puts\fR, \fBvidattr\fR, -\fBmvcur\fR, -\fBtigetflag\fR, -\fBtigetnum\fR, -\fBtigetstr\fR - \fBcurses\fR interfaces to terminfo database +\fBvidputs\fR - \fBcurses\fR interfaces to terminfo database .SH SYNOPSIS +.nf \fB#include \fR .br \fB#include \fR -\fBint setupterm(const char *term, int fildes, int *errret);\fR +\fBint setupterm(char *\fR\fIterm\fR\fB, int \fR\fIfildes\fR\fB, int *\fR\fIerrret\fR\fB);\fR +.br +\fBint setterm(char *\fR\fIterm\fR\fB);\fR .br -\fBint setterm(const char *term);\fR +\fBTERMINAL *set_curterm(TERMINAL *\fR\fInterm\fR\fB);\fR .br -\fBTERMINAL *set_curterm(TERMINAL *nterm);\fR +\fBint del_curterm(TERMINAL *\fR\fIoterm\fR\fB);\fR .br -\fBint del_curterm(TERMINAL *oterm);\fR +\fBint restartterm(const char *\fR\fIterm\fR\fB, int \fR\fIfildes\fR\fB, int *\fR\fIerrret\fR\fB);\fR .br -\fBint restartterm(const char *term, int fildes, int *errret);\fR +\fBchar *tparm(char *\fR\fIstr\fR\fB, ...);\fR .br -\fBchar *tparm(const char *str, ...);\fR +\fBint tputs(const char *\fR\fIstr\fR\fB, int \fR\fIaffcnt\fR\fB, int (*\fR\fIputc\fR\fB)(int));\fR .br -\fBint tputs(const char *str, int affcnt, int (*putc)(int));\fR +\fBint putp(const char *\fR\fIstr\fR\fB);\fR .br -\fBint putp(const char *str);\fR +\fBint vidputs(chtype \fR\fIattrs\fR\fB, int (*\fR\fIputc\fR\fB)(int));\fR .br -\fBint vidputs(chtype attrs, int (*putc)(char));\fR +\fBint vidattr(chtype \fR\fIattrs\fR\fB);\fR .br -\fBint vidattr(chtype attrs);\fR +\fBint vid_puts(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB, int (*\fR\fIputc\fR\fB)(char));\fR .br -\fBint mvcur(int oldrow, int oldcol, int newrow, int newcol);\fR +\fBint vid_attr(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB);\fR .br -\fBint tigetflag(const char *capname);\fR +\fBint mvcur(int \fR\fIoldrow\fR\fB, int \fR\fIoldcol\fR\fB, int \fR\fInewrow\fR, int \fR\fInewcol\fR\fB);\fR .br -\fBint tigetnum(const char *capname);\fR +\fBint tigetflag(char *\fR\fIcapname\fR\fB);\fR .br -\fBchar *tigetstr(const char *capname);\fR +\fBint tigetnum(char *\fR\fIcapname\fR\fB);\fR .br +\fBchar *tigetstr(char *\fR\fIcapname\fR\fB);\fR +.br +.fi .SH DESCRIPTION These low-level routines must be called by programs that have to deal directly with the \fBterminfo\fR database to handle certain terminal @@ -196,6 +204,17 @@ the \fBputchar\fR-like routine \fIputc\fR. The \fBvidattr\fR routine is like the \fBvidputs\fR routine, except that it outputs through \fBputchar\fR. +The \fBvid_attr\fR and \fBvid_puts\fR routines correspond to vidattr and vidputs, +respectively. +They use a set of arguments for representing the video attributes plus color, +i.e., +one of type attr_t for the attributes and one of short for +the color_pair number. +The \fBvid_attr\fR and \fBvid_puts\fR routines +are designed to use the attribute constants with the \fIWA_\fR prefix. +The opts argument is reserved for future use. +Currently, applications must provide a null pointer for that argument. + The \fBmvcur\fR routine provides low-level cursor motion. It takes effect immediately (rather than at the next refresh). @@ -253,6 +272,9 @@ In System V Release 4, the third argument of \fBtputs\fR has the type The XSI Curses standard prototypes \fBtparm\fR with a fixed number of parameters, rather than a variable argument list. +This implementation uses a variable argument list. +Portable applications should provide 9 parameters after the format; +zeroes are fine for this purpose. XSI notes that after calling \fBmvcur\fR, the curses state may not match the actual terminal state, and that an application should touch and refresh diff --git a/man/curs_trace.3x b/man/curs_trace.3x index a9dc57c7..4af258da 100644 --- a/man/curs_trace.3x +++ b/man/curs_trace.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2000 Free Software Foundation, Inc. * +.\" Copyright (c) 2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_trace.3x,v 1.3 2000/07/29 16:34:24 tom Exp $ +.\" $Id: curs_trace.3x,v 1.5 2002/02/16 22:39:52 tom Exp $ .TH curs_trace 3X "" .SH NAME \fB_tracef\fR, @@ -131,7 +131,6 @@ maximum trace level, enables all of the separate trace features. Some tracing features are enabled whenever the \fBtrace\fR parameter is nonzero. Some features overlap. The specific names are used as a guideline. -.. .SH RETURN VALUE Routines which return a value are designed to be used as parameters to the \fB_tracef\fR routine. diff --git a/man/curs_util.3x b/man/curs_util.3x index 8f85cf4e..90f00d07 100644 --- a/man/curs_util.3x +++ b/man/curs_util.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,22 +26,33 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_util.3x,v 1.6 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: curs_util.3x,v 1.9 2002/09/01 19:44:37 tom Exp $ .TH curs_util 3X "" .SH NAME -\fBunctrl\fR, \fBkeyname\fR, \fBfilter\fR, -\fBuse_env\fR, \fBputwin\fR, \fBgetwin\fR, \fBdelay_output\fR, -\fBflushinp\fR - miscellaneous \fBcurses\fR utility routines +\fBdelay_output\fR, +\fBfilter\fR, +\fBflushinp\fR, +\fBgetwin\fR, +\fBkey_name\fR, +\fBkeyname\fR, +\fBputwin\fR, +\fBunctrl\fR, +\fBuse_env\fR, +\fBwunctrl\fR - miscellaneous \fBcurses\fR utility routines .SH SYNOPSIS \fB#include \fR \fBchar *unctrl(chtype c);\fR .br +\fBchar *wunctrl(wchar_t w);\fR +.br \fBchar *keyname(int c);\fR .br +\fBchar *key_name(wchar_t w);\fR +.br \fBvoid filter(void);\fR .br -\fBvoid use_env(char bool);\fR +\fBvoid use_env(bool f);\fR .br \fBint putwin(WINDOW *win, FILE *filep);\fR .br @@ -52,12 +63,21 @@ \fBint flushinp(void);\fR .br .SH DESCRIPTION -The \fBunctrl\fR macro expands to a character string which is a printable -representation of the character \fIc\fR. Control characters are displayed in -the \fB^\fR\fIX\fR notation. Printing characters are displayed as is. +The \fBunctrl\fR routine returns a character string which is a printable +representation of the character \fIc\fR, ignoring attributes. +Control characters are displayed in the \fB^\fR\fIX\fR notation. +Printing characters are displayed as is. +The corresponding \fBwunctrl\fR returns a printable representation of +a wide-character. -The \fBkeyname\fR routine returns a character string corresponding to -the key \fIc\fR. +The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR. +Control characters are displayed in the \fB^\fR\fIX\fR notation. +Values above 128 are either meta characters, shown in the \fBM-\fR\fIX\fR notation, +or the names of function keys, or null. +The corresponding \fBkey_name\fR returns a character string corresponding +to the wide-character value \fIw\fR. +The two functions do not return the same set of strings; +the latter returns null where the former would display a meta character. The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or \fBnewterm\fR are called. The effect is that, during those calls, \fBLINES\fR @@ -98,12 +118,12 @@ upon failure and \fBOK\fR (SVr4 specifies only "an integer value other than Routines that return pointers return \fBNULL\fR on error. .SH PORTABILITY The XSI Curses standard, Issue 4 describes these functions. +It states that \fBunctrl\fR and \fBwunctrl\fR will return a null pointer if +unsuccessful, but does not define any error conditions. The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest terms. The description here is adapted from the XSI Curses standard (which erroneously fails to describe the disabling of \fBcuu\fR). -.SH NOTES -Note that \fBunctrl\fR is a macro, which is defined in <\fBunctrl.h\fR>. .SH SEE ALSO \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_scr_dump\fR(3X). .\"# diff --git a/man/default_colors.3x b/man/default_colors.3x index 9d6d97c9..4ebb9012 100644 --- a/man/default_colors.3x +++ b/man/default_colors.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,20 +28,17 @@ .\" .\" Author: Thomas E. Dickey 1997,1999,2000 .\" -.\" $Id: default_colors.3x,v 1.13 2000/07/15 22:06:50 tom Exp $ +.\" $Id: default_colors.3x,v 1.16 2002/02/16 22:39:52 tom Exp $ .TH default_colors 3X "" .SH NAME -\fBdefault_colors\fR: \fBuse_default_colors\fR, \fBassume_default_colors\fR \- use terminal's default colors -.. .SH SYNOPSIS \fB#include \fP \fBint use_default_colors(void);\fP .br \fBint assume_default_colors(int fg, int bg);\fP -.. .SH DESCRIPTION The .I use_default_colors() @@ -100,28 +97,23 @@ or .I assume_default_colors() ncurses will paint a white foreground (text) with black background for color pair 0. -.. .SH RETURN VALUE These functions return the integer \fBERR\fP upon failure and \fBOK\fP on success. They will fail if either the terminal does not support the \fIorig_pair\fP or \fIorig_colors\fP capability. If the \fIinitialize_pair\fP capability is found, this causes an error as well. -.. .SH NOTES Associated with this extension, the \fBinit_pair\fR(3X) function accepts negative arguments to specify default foreground or background colors. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBcurs_color\fR(3X), \fBded\fP(1). -.. .SH AUTHOR Thomas Dickey (from an analysis of the requirements for color xterm for XFree86 3.1.2C, February 1996). diff --git a/man/define_key.3x b/man/define_key.3x index 047d78f8..1019c42f 100644 --- a/man/define_key.3x +++ b/man/define_key.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,16 +28,14 @@ .\" .\" Author: Thomas E. Dickey 1997 .\" -.\" $Id: define_key.3x,v 1.6 1999/02/19 11:43:17 tom Exp $ +.\" $Id: define_key.3x,v 1.8 2002/02/16 22:39:52 tom Exp $ .TH define_key 3X "" .SH NAME \fBdefine_key\fP \- define a keycode -.. .SH SYNOPSIS \fB#include \fP \fBint define_key(char *definition, int keycode);\fP -.. .SH DESCRIPTION This is an extension to the curses library. It permits an application to define keycodes with their corresponding control @@ -48,18 +46,14 @@ If the given string is null, any existing definition for the keycode is removed. Similarly, if the given keycode is negative or zero, any existing string for the given definition is removed. -.. .SH RETURN VALUE The keycode must be greater than zero, else ERR is returned. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBkeyok\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/man/form.3x b/man/form.3x index 51c1e8c1..811b9ff7 100644 --- a/man/form.3x +++ b/man/form.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form.3x,v 1.13 1999/07/10 21:53:03 tom Exp $ +.\" $Id: form.3x,v 1.15 2002/01/19 22:48:05 tom Exp $ .TH form 3X "" .SH NAME \fBform\fR - curses extension for programming forms @@ -177,7 +177,7 @@ No fields are connected to the form. \fBE_REQUEST_DENIED\fR The form driver could not process the request. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header files diff --git a/man/form_driver.3x b/man/form_driver.3x index 408aecd9..23540891 100644 --- a/man/form_driver.3x +++ b/man/form_driver.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: form_driver.3x,v 1.7 1999/07/10 23:13:18 tom Exp $ +.\" $Id: form_driver.3x,v 1.9 2002/02/16 22:39:52 tom Exp $ .TH form_driver 3X "" .SH NAME \fBform_driver\fR - command-processing loop of the form system diff --git a/man/form_field_attributes.3x b/man/form_field_attributes.3x index 7f6293dc..ac7a3b53 100644 --- a/man/form_field_attributes.3x +++ b/man/form_field_attributes.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_field_attributes.3x,v 1.5 1998/11/29 01:06:02 Rick.Ohnemus Exp $ +.\" $Id: form_field_attributes.3x,v 1.7 2002/01/19 22:48:14 tom Exp $ .TH form_field_attributes 3X "" .SH NAME \fBform_field_attributes\fR - color and attribute control for form fields @@ -44,7 +44,7 @@ chtype field_back(const FIELD *field); .br int set_field_pad(FIELD *field, int pad); .br -chtype field_pad(const FIELD *field); +int field_pad(const FIELD *field); .br .SH DESCRIPTION The function \fBset_field_fore\fR sets the foreground attribute of @@ -72,7 +72,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/form_field_buffer.3x b/man/form_field_buffer.3x index 202d4e7e..814c5d9d 100644 --- a/man/form_field_buffer.3x +++ b/man/form_field_buffer.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_field_buffer.3x,v 1.8 1999/06/16 00:37:09 juergen Exp $ +.\" $Id: form_field_buffer.3x,v 1.9 2002/01/19 22:48:23 tom Exp $ .TH form_field_buffer 3X "" .SH NAME \fBform_field_buffer\fR - field buffer control @@ -80,7 +80,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/form_field_info.3x b/man/form_field_info.3x index 6165dd76..56b81ac7 100644 --- a/man/form_field_info.3x +++ b/man/form_field_info.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_field_info.3x,v 1.6 2000/04/15 22:21:31 tom Exp $ +.\" $Id: form_field_info.3x,v 1.8 2002/01/19 22:48:32 tom Exp $ .TH form_field_info 3X "" .SH NAME \fBform_field_info\fR - retrieve field characteristics @@ -37,7 +37,7 @@ int field_info(const FIELD *field, int *rows, int *cols, int *frow, int *fcol, int *nrow, int *nbuf); .br -int dynamic_field_info(const FIELD *field, int *rows, int *cols, *max); +int dynamic_field_info(const FIELD *field, int *rows, int *cols, int *max); .br .SH DESCRIPTION The function \fBfield_info\fR returns the sizes and other attributes passed in @@ -61,7 +61,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/form_field_just.3x b/man/form_field_just.3x index dcb46768..9468d8b7 100644 --- a/man/form_field_just.3x +++ b/man/form_field_just.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_field_just.3x,v 1.5 1998/11/29 01:06:32 Rick.Ohnemus Exp $ +.\" $Id: form_field_just.3x,v 1.6 2002/01/19 22:48:41 tom Exp $ .TH form_field_just 3X "" .SH NAME \fBform_field_just\fR - retrieve field characteristics @@ -59,7 +59,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/form_field_new.3x b/man/form_field_new.3x index b798b5bb..96915205 100644 --- a/man/form_field_new.3x +++ b/man/form_field_new.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: form_field_new.3x,v 1.9 1998/11/29 01:06:44 Rick.Ohnemus Exp $ +.\" $Id: form_field_new.3x,v 1.11 2002/02/16 22:39:52 tom Exp $ .TH form_field_new 3X "" .SH NAME \fBform_field_new\fR - create and destroy form fields diff --git a/man/form_field_validation.3x b/man/form_field_validation.3x index c3f90ba5..cc3d508d 100644 --- a/man/form_field_validation.3x +++ b/man/form_field_validation.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: form_field_validation.3x,v 1.10 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: form_field_validation.3x,v 1.12 2002/02/16 22:39:52 tom Exp $ .TH form_field_validation 3X "" .SH NAME \fBform_field_validation\fR - data type validation for fields diff --git a/man/form_fieldtype.3x b/man/form_fieldtype.3x index d93ba281..69a8e208 100644 --- a/man/form_fieldtype.3x +++ b/man/form_fieldtype.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_fieldtype.3x,v 1.8 2000/07/15 22:02:03 tom Exp $ +.\" $Id: form_fieldtype.3x,v 1.9 2001/08/04 20:36:25 William.Setzer Exp $ .TH form_fieldtype 3X "" .SH NAME \fBform_fieldtype\fR - define validation-field types @@ -47,7 +47,7 @@ int set_fieldtype_arg( void (* const free_arg)(void *)); .br int set_fieldtype_choice( - FIELDTYPE *fieldtype + FIELDTYPE *fieldtype, bool (* const next_choice)(FIELD *, const void *), bool (* const prev_choice)(FIELD *, const void *)); .br diff --git a/man/form_new_page.3x b/man/form_new_page.3x index b93b48c1..432f624f 100644 --- a/man/form_new_page.3x +++ b/man/form_new_page.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_new_page.3x,v 1.5 1998/11/29 01:07:45 Rick.Ohnemus Exp $ +.\" $Id: form_new_page.3x,v 1.6 2002/01/19 22:48:51 tom Exp $ .TH form_new_page 3X "" .SH NAME \fBform_new_page\fR - form pagination functions @@ -58,7 +58,7 @@ System error occurred (see \fBerrno\fR). \fBE_CONNECTED\fR The given field is already connected to a form. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "form_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/infocmp.1m b/man/infocmp.1m index 1276cca5..9ecdfa3e 100644 --- a/man/infocmp.1m +++ b/man/infocmp.1m @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,14 +27,38 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: infocmp.1m,v 1.27 2000/08/19 18:51:05 tom Exp $ +.\" $Id: infocmp.1m,v 1.30 2002/10/05 21:22:21 tom Exp $ .TH infocmp 1M "" .ds n 5 .ds d @TERMINFO@ .SH NAME \fBinfocmp\fR - compare or print out \fIterminfo\fR descriptions .SH SYNOPSIS -\fBinfocmp\fR [\fB-dceEGgnpqrILCuV1\fR] [\fB-v\fR \fIn\fR] [\fB-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] +\fBinfocmp\fR [\fB-\ +1\ +C\ +E\ +F\ +G\ +I\ +L\ +T\ +V\ +c\ +d\ +e\ +g\ +i\ +l\ +n\ +p\ +q\ +r\ +t\ +u\ +\fR] +.br + [\fB-v\fR \fIn\fR] [\fB-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB-R \fR\fBsubset\fR] .br [\fB-w\fR\ \fIwidth\fR] [\fB-A\fR\ \fIdirectory\fR] [\fB-B\fR\ \fIdirectory\fR] .br @@ -46,12 +70,10 @@ terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the binary file (\fBterm\fR) in a variety of formats. In all cases, the boolean fields will be printed first, followed by the numeric fields, followed by the string fields. -.. .SS Default Options If no options are specified and zero or one \fItermnames\fR are specified, the \fB-I\fR option will be assumed. If more than one \fItermname\fR is specified, the \fB-d\fR option will be assumed. -.. .SS Comparison Options [-d] [-c] [-n] \fBinfocmp\fR compares the \fBterminfo\fR description of the first terminal \fItermname\fR with each of the descriptions given by the entries for the other @@ -72,7 +94,6 @@ The \fB-n\fR option produces a list of each capability that is in neither entry. If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be used for both of the \fItermnames\fR. This can be used as a quick check to see if anything was left out of a description. -.. .SS Source Listing Options [-I] [-L] [-C] [-r] The \fB-I\fR, \fB-L\fR, and \fB-C\fR options will produce a source listing for each terminal named. @@ -166,7 +187,6 @@ Another error that does not cause incorrect compiled files, but will slow down the compilation time, is specifying extra \fBuse=\fR fields that are superfluous. \fBinfocmp\fR will flag any other \fItermname use=\fR fields that were not needed. -.. .SS Changing Databases [-A \fIdirectory\fR] [-B \fIdirectory\fR] The location of the compiled \fBterminfo\fR database is taken from the environment variable \fBTERMINFO\fR . If the variable is not defined, or the @@ -178,81 +198,17 @@ set \fBTERMINFO\fR for the other \fItermnames\fR. With this, it is possible to compare descriptions for a terminal with the same name located in two different databases. This is useful for comparing descriptions for the same terminal created by different people. -.. -.SS Other Options [-s d|i|l|c] [-1FTVefip] [-Rsubset] [-v \fIn\fR] [-w \fIwidth\fR] -The \fB-s\fR option sorts the fields within each type according to the argument -below: -.. -.TP 5 -\fBd\fR -leave fields in the order that they are stored in the \fIterminfo\fR database. -.TP 5 -\fBi\fR -sort by \fIterminfo\fR name. -.TP 5 -\fBl\fR -sort by the long C variable name. -.TP 5 -\fBc\fR -sort by the \fItermcap\fR name. - -If the \fB-s\fR option is not given, the fields printed out will be -sorted alphabetically by the \fBterminfo\fR name within each type, -except in the case of the \fB-C\fR or the \fB-L\fR options, which cause the -sorting to be done by the \fBtermcap\fR name or the long C variable -name, respectively. +.SS Other Options .TP 5 \fB-1\fR causes the fields to be printed out one to a line. Otherwise, the fields will be printed several to a line to a maximum width of 60 characters. -.TP 5 -\fB-F\fR -compare terminfo files. This assumes that two following arguments are -filenames. The files are searched for pairwise matches between -entries, with two entries considered to match if any of their names do. -The report printed to standard output lists entries with no matches in -the other file, and entries with more than one match. For entries -with exactly one match it includes a difference report. Normally, -to reduce the volume of the report, use references are -not resolved before looking for differences, but resolution can be forced -by also specifying \fB-r\fR. -.TP -\fB-G\fR -Display constant literals in decimal form -rather than their character equivalents. .TP \fB-a\fR tells \fBinfocmp\fP to retain commented-out capabilities rather than discarding them. Capabilities are commented by prefixing them with a period. .TP 5 -\fB-q\fR -Make the comparison listing shorter by omitting subheadings, and using -"-" for absent capabilities, "@" for canceled rather than "NULL". -.TP 5 -\fB-R\fR\fIsubset\fR -Restrict output to a given subset. This option is for use with archaic -versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support -the full set of SVR4/XSI Curses terminfo; and variants such as AIX -that have their own extensions incompatible with SVr4/XSI. Available terminfo -subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for -details. You can also choose the subset "BSD" which selects only capabilities -with termcap equivalents recognized by 4.4BSD. -.TP 5 -\fB-T\fR -eliminates size-restrictions on the generated text. -This is mainly useful for testing and analysis, since the compiled -descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo). -.TP 5 -\fB-V\fR -reports the version of ncurses which was used in this program, and exits. -.TP 5 -\fB-e\fR -Dump the capabilities of the given terminal as a C initializer for a -TERMTYPE structure (the terminal capability structure in the \fB\fR). -This option is useful for preparing versions of the curses library hardwired -for a given terminal type. -.TP 5 \fB-E\fR Dump the capabilities of the given terminal as tables, needed in the C initializer for a @@ -265,11 +221,32 @@ and the name of the corresponding terminal entry. Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP options was not needed; but support for extended names required making the arrays of terminal capabilities separate from the TERMTYPE structure. -.TP +.TP 5 +\fB-e\fR +Dump the capabilities of the given terminal as a C initializer for a +TERMTYPE structure (the terminal capability structure in the \fB\fR). +This option is useful for preparing versions of the curses library hardwired +for a given terminal type. +.TP 5 +\fB-F\fR +compare terminfo files. This assumes that two following arguments are +filenames. The files are searched for pairwise matches between +entries, with two entries considered to match if any of their names do. +The report printed to standard output lists entries with no matches in +the other file, and entries with more than one match. For entries +with exactly one match it includes a difference report. Normally, +to reduce the volume of the report, use references are +not resolved before looking for differences, but resolution can be forced +by also specifying \fB-r\fR. +.TP 5 \fB-f\fR Display complex terminfo strings which contain if/then/else/endif expressions indented for readability. -.TP +.TP 5 +\fB-G\fR +Display constant literals in decimal form +rather than their character equivalents. +.TP 5 \fB-g\fR Display constant character literals in quoted form rather than their decimal equivalents. @@ -325,21 +302,73 @@ REVERSE. All but NORMAL may be prefixed with `+' (turn on) or `-' (turn off). An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}). .TP 5 +\bB-l\fR +Set output format to terminfo. +.TP 5 \fB-p\fR Ignore padding specifications when comparing strings. .TP 5 +\fB-q\fR +Make the comparison listing shorter by omitting subheadings, and using +"-" for absent capabilities, "@" for canceled rather than "NULL". +.TP 5 +\fB-R\fR\fIsubset\fR +Restrict output to a given subset. This option is for use with archaic +versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support +the full set of SVR4/XSI Curses terminfo; and variants such as AIX +that have their own extensions incompatible with SVr4/XSI. Available terminfo +subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for +details. You can also choose the subset "BSD" which selects only capabilities +with termcap equivalents recognized by 4.4BSD. +.TP +\fB-s \fR\fI[d|i|l|c]\fR +The \fB-s\fR option sorts the fields within each type according to the argument +below: +.br +.RS 5 +.TP 5 +\fBd\fR +leave fields in the order that they are stored in the \fIterminfo\fR database. +.TP 5 +\fBi\fR +sort by \fIterminfo\fR name. +.TP 5 +\fBl\fR +sort by the long C variable name. +.TP 5 +\fBc\fR +sort by the \fItermcap\fR name. +.RE +.IP +If the \fB-s\fR option is not given, the fields printed out will be +sorted alphabetically by the \fBterminfo\fR name within each type, +except in the case of the \fB-C\fR or the \fB-L\fR options, which cause the +sorting to be done by the \fBtermcap\fR name or the long C variable +name, respectively. +.TP 5 +\fB-T\fR +eliminates size-restrictions on the generated text. +This is mainly useful for testing and analysis, since the compiled +descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo). +.TP +\fB-t\fR +tells \fBtic\fP to discard commented-out capabilities. +Normally when translating from terminfo to termcap, +untranslatable capabilities are commented-out. +.TP 5 +\fB-V\fR +reports the version of ncurses which was used in this program, and exits. +.TP 5 \fB-v\fR \fIn\fR prints out tracing information on standard error as the program runs. Higher values of n induce greater verbosity. .TP 5 \fB-w\fR \fIwidth\fR changes the output to \fIwidth\fR characters. -.. .SH FILES .TP 20 \*d Compiled terminal description database. -.. .SH EXTENSIONS The \fB-E\fR, @@ -353,8 +382,10 @@ The \fB-f\fR, \fB-g\fR, \fB-i\fR, -\fB-p\fR, and -\fB-q\fR +\fB-l\fR, +\fB-p\fR, +\fB-q\fR and +\fB-t\fR options are not supported in SVr4 curses. The \fB-r\fR option's notion of `termcap' capabilities is System V Release 4's. @@ -369,6 +400,7 @@ The -F option of \fBinfocmp\fR(1M) should be a \fBtoe\fR(1M) mode. .SH AUTHOR Eric S. Raymond and +.br Thomas E. Dickey .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/man/keybound.3x b/man/keybound.3x index e6bf5e4e..79c480cf 100644 --- a/man/keybound.3x +++ b/man/keybound.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1999 Free Software Foundation, Inc. * +.\" Copyright (c) 1999,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,35 +28,29 @@ .\" .\" Author: Thomas E. Dickey 1999 .\" -.\" $Id: keybound.3x,v 1.1 1999/02/19 11:59:24 tom Exp $ +.\" $Id: keybound.3x,v 1.3 2002/02/16 22:30:36 tom Exp $ .TH keyok 3X "" .SH NAME \fBkeybound\fP \- return definition of keycode -.. .SH SYNOPSIS \fB#include \fP -\fBint keybound(int keycode, int count);\fP -.. +\fBchar * keybound(int keycode, int count);\fP .SH DESCRIPTION This is an extension to the curses library. It permits an application to determine the string which is defined in the terminfo for specific keycodes. -.. .SH RETURN VALUE The keycode must be greater than zero, else NULL is returned. If it does not correspond to a defined key, then NULL is returned. Otherwise, the function returns a string, which must be freed by the caller. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBdefine_key\fR(3X), \fBkeyok\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/man/keyok.3x b/man/keyok.3x index 21befe83..e3f2287a 100644 --- a/man/keyok.3x +++ b/man/keyok.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,37 +28,31 @@ .\" .\" Author: Thomas E. Dickey 1997 .\" -.\" $Id: keyok.3x,v 1.5 1998/03/14 23:43:07 tom Exp $ +.\" $Id: keyok.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH keyok 3X "" .SH NAME \fBkeyok\fP \- enable or disable a keycode -.. .SH SYNOPSIS \fB#include \fP \fBint keyok(int keycode, bool enable);\fP -.. .SH DESCRIPTION This is an extension to the curses library. It permits an application to disable specific keycodes, rather than use the \fIkeypad\fP function to disable all keycodes. Keys that have been disabled can be reenabled. -.. .SH RETURN VALUE The keycode must be greater than zero, else ERR is returned. If it does not correspond to a defined key, then ERR is returned. If the \fIenable\fP parameter is true, then the key must have been disabled, and vice versa. Otherwise, the function returns OK. -.. .SH PORTABILITY These routines are specific to ncurses. They were not supported on Version 7, BSD or System V implementations. It is recommended that any code depending on them be conditioned using NCURSES_VERSION. -.. .SH SEE ALSO \fBdefine_key\fR(3X). -.. .SH AUTHOR Thomas Dickey. .\"# diff --git a/man/man_db.renames b/man/man_db.renames index b8248610..7aaf1de2 100644 --- a/man/man_db.renames +++ b/man/man_db.renames @@ -1,30 +1,44 @@ -# $Id: man_db.renames,v 0.20 2000/07/15 22:58:35 tom Exp $ +# $Id: man_db.renames,v 0.31 2002/04/13 21:49:08 tom Exp $ # Manual-page renamings for the man_db program # +# Files: captoinfo.1m captoinfo.1 clear.1 clear.1 +curs_add_wch.3x add_wch.3ncurses +curs_add_wchstr.3x add_wchstr.3ncurses curs_addch.3x addch.3ncurses curs_addchstr.3x addchstr.3ncurses curs_addstr.3x addstr.3ncurses +curs_addwstr.3x addwstr.3ncurses curs_attr.3x attr.3ncurses curs_beep.3x beep.3ncurses curs_bkgd.3x bkgd.3ncurses +curs_bkgrnd.3x bkgrnd.3ncurses curs_border.3x border.3ncurses +curs_border_set.3x border_set.3ncurses curs_clear.3x clear.3ncurses curs_color.3x color.3ncurses curs_delch.3x delch.3ncurses curs_deleteln.3x deleteln.3ncurses curs_extend.3x extensions.3ncurses +curs_get_wch.3x get_wch.3ncurses +curs_get_wstr.3x get_wstr.3ncurses +curs_getcchar.3x getcchar.3ncurses curs_getch.3x getch.3ncurses curs_getstr.3x getstr.3ncurses curs_getyx.3x getyx.3ncurses +curs_in_wch.3x in_wch.3ncurses +curs_in_wchstr.3x in_wchstr.3ncurses curs_inch.3x inch.3ncurses curs_inchstr.3x inchstr.3ncurses curs_initscr.3x initscr.3ncurses curs_inopts.3x inopts.3ncurses +curs_ins_wch.3x ins_wch.3ncurses +curs_ins_wstr.3x ins_wstr.3ncurses curs_insch.3x insch.3ncurses curs_insstr.3x insstr.3ncurses curs_instr.3x instr.3ncurses +curs_inwstr.3x inwstr.3ncurses curs_kernel.3x kernel.3ncurses curs_mouse.3x mouse.3ncurses curs_move.3x move.3ncurses @@ -115,3 +129,10 @@ tput.1 tput.1 tset.1 tset.1 vprintf.3s vprintf.3 wresize.3x wresize.3ncurses +# +# Other cross-references: +addch.3x addch.3ncurses +can_change_color.3x can_change_color.3ncurses +curs_attr_get.3x attr_get.3ncurses +dup_field.3x dup_field.3ncurses +init_pair.3x init_pair.3ncurses diff --git a/man/manlinks.sed b/man/manlinks.sed index e175148a..5babc5db 100644 --- a/man/manlinks.sed +++ b/man/manlinks.sed @@ -1,6 +1,6 @@ -# $Id: manlinks.sed,v 1.9 2000/09/30 23:32:24 tom Exp $ +# $Id: manlinks.sed,v 1.10 2002/09/21 19:02:03 tom Exp $ ############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # +# Copyright (c) 2000,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -33,6 +33,7 @@ /\.\\"/d /^\.br/d /^\.sp/d +s/^\.IX// s/\\f.//g s/[:,]/ /g s/^[ ][ ]*// diff --git a/man/menu.3x b/man/menu.3x index 8279844a..e81913c4 100644 --- a/man/menu.3x +++ b/man/menu.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: menu.3x,v 1.14 2000/07/15 22:55:59 tom Exp $ +.\" $Id: menu.3x,v 1.15 2002/01/19 22:48:58 tom Exp $ .TH menu 3X "" .SH NAME \fBmenu\fR - curses extension for programming menus @@ -167,7 +167,7 @@ No items are connected to the menu. \fBE_REQUEST_DENIED\fR The menu driver could not process the request. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "menu_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header files diff --git a/man/menu_attributes.3x b/man/menu_attributes.3x index 82412609..99a2ac2b 100644 --- a/man/menu_attributes.3x +++ b/man/menu_attributes.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: menu_attributes.3x,v 1.6 1998/11/29 01:09:20 Rick.Ohnemus Exp $ +.\" $Id: menu_attributes.3x,v 1.7 2002/01/19 22:49:06 tom Exp $ .TH menu_attributes 3X "" .SH NAME \fBmenu_attributes\fR - color and attribute control for menus @@ -81,7 +81,7 @@ System error occurred (see \fBerrno\fR). \fBE_BAD_ARGUMENT\fR Routine detected an incorrect or out-of-range argument. .SH SEE ALSO -\fBcurses\fR(3X) and 3X pages whose names begin "menu_" for detailed +\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed descriptions of the entry points. .SH NOTES The header file \fB\fR automatically includes the header file diff --git a/man/menu_driver.3x b/man/menu_driver.3x index cffd08d8..0e6f9e02 100644 --- a/man/menu_driver.3x +++ b/man/menu_driver.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: menu_driver.3x,v 1.8 1999/01/09 22:55:18 tom Exp $ +.\" $Id: menu_driver.3x,v 1.10 2002/02/16 22:40:59 tom Exp $ .TH menu_driver 3X "" .SH NAME \fBmenu_driver\fR - command-processing loop of the menu system diff --git a/man/menu_format.3x b/man/menu_format.3x index 57c77a39..7dde28fa 100644 --- a/man/menu_format.3x +++ b/man/menu_format.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: menu_format.3x,v 1.7 1998/11/29 01:09:39 Rick.Ohnemus Exp $ +.\" $Id: menu_format.3x,v 1.8 2001/08/04 20:36:19 William.Setzer Exp $ .TH menu_format 3X "" .SH NAME \fBmenu_format\fR - set and get menu sizes @@ -36,7 +36,7 @@ .br int set_menu_format(MENU *menu, int rows, int cols); .br -int menu_format(const MENU *menu, int *rows, int *cols); +void menu_format(const MENU *menu, int *rows, int *cols); .br .SH DESCRIPTION The function \fBset_menu_format\fR sets the maximum display size of the given diff --git a/man/menu_pattern.3x b/man/menu_pattern.3x index 693ebe35..990a9dc5 100644 --- a/man/menu_pattern.3x +++ b/man/menu_pattern.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: menu_pattern.3x,v 1.5 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: menu_pattern.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH menu_pattern 3X "" .SH NAME \fBmenu_pattern\fR - get and set a menu's pattern buffer diff --git a/man/menu_spacing.3x b/man/menu_spacing.3x index 0480b3c0..18316219 100644 --- a/man/menu_spacing.3x +++ b/man/menu_spacing.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2001 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: menu_spacing.3x,v 1.5 1998/11/29 01:10:51 Rick.Ohnemus Exp $ +.\" $Id: menu_spacing.3x,v 1.6 2001/08/04 20:36:16 William.Setzer Exp $ .TH menu_spacing 3X "" .SH NAME \fBmenu_spacing\fR - Control spacing between menu items. @@ -35,12 +35,12 @@ \fB#include \fR .br int set_menu_spacing(MENU *menu, - int spc_description + int spc_description, int spc_rows, int spc_columns); .br int menu_spacing(const MENU *menu, - int* spc_description + int* spc_description, int* spc_rows, int* spc_columns); .br diff --git a/man/mitem_value.3x b/man/mitem_value.3x index 680fda88..5817d8d2 100644 --- a/man/mitem_value.3x +++ b/man/mitem_value.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.'" $Id: mitem_value.3x,v 1.4 1998/03/11 21:12:53 juergen Exp $ +.\" $Id: mitem_value.3x,v 1.6 2002/02/16 22:40:59 tom Exp $ .TH mitem_value 3X "" .SH NAME \fBmitem_value\fR - set and get menu item values diff --git a/man/ncurses.3x b/man/ncurses.3x index 3b36fa9a..f5abde44 100644 --- a/man/ncurses.3x +++ b/man/ncurses.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,1999,2001,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: ncurses.3x,v 1.44 2000/10/08 01:39:26 tom Exp $ +.\" $Id: ncurses.3x,v 1.63 2002/08/10 21:56:07 tom Exp $ .hy 0 .TH ncurses 3X "" .ds n 5 @@ -209,11 +209,16 @@ _tracechtype2/\fBcurs_trace\fR(3X)* _tracedump/\fBcurs_trace\fR(3X)* _tracef/\fBcurs_trace\fR(3X)* _tracemouse/\fBcurs_trace\fR(3X)* +add_wch/\fBcurs_add_wch\fR(3X) +add_wchnstr/\fBcurs_add_wchstr\fR(3X) +add_wchstr/\fBcurs_add_wchstr\fR(3X) addch/\fBcurs_addch\fR(3X) addchnstr/\fBcurs_addchstr\fR(3X) addchstr/\fBcurs_addchstr\fR(3X) addnstr/\fBcurs_addstr\fR(3X) +addnwstr/\fBcurs_addwstr\fR(3X) addstr/\fBcurs_addstr\fR(3X) +addwstr/\fBcurs_addwstr\fR(3X) assume_default_colors/\fBdefault_colors\fR(3X)* attr_get/\fBcurs_attr\fR(3X) attr_off/\fBcurs_attr\fR(3X) @@ -226,8 +231,12 @@ baudrate/\fBcurs_termattrs\fR(3X) beep/\fBcurs_beep\fR(3X) bkgd/\fBcurs_bkgd\fR(3X) bkgdset/\fBcurs_bkgd\fR(3X) +bkgrnd/\fBcurs_bkgrnd\fR(3X) +bkgrndset/\fBcurs_bkgrnd\fR(3X) border/\fBcurs_border\fR(3X) +border_set/\fBcurs_border_set\fR(3X) box/\fBcurs_border\fR(3X) +box_set/\fBcurs_border_set\fR(3X) can_change_color/\fBcurs_color\fR(3X) cbreak/\fBcurs_inopts\fR(3X) chgat/\fBcurs_attr\fR(3X) @@ -253,18 +262,25 @@ derwin/\fBcurs_window\fR(3X) doupdate/\fBcurs_refresh\fR(3X) dupwin/\fBcurs_window\fR(3X) echo/\fBcurs_inopts\fR(3X) +echo_wchar/\fBcurs_add_wch\fR(3X) echochar/\fBcurs_addch\fR(3X) endwin/\fBcurs_initscr\fR(3X) erase/\fBcurs_clear\fR(3X) erasechar/\fBcurs_termattrs\fR(3X) +erasewchar/\fBcurs_termattrs\fR(3X) filter/\fBcurs_util\fR(3X) flash/\fBcurs_beep\fR(3X) flushinp/\fBcurs_util\fR(3X) +get_wch/\fBcurs_get_wch\fR(3X) +get_wstr/\fBcurs_get_wstr\fR(3X) getbegyx/\fBcurs_getyx\fR(3X) getbkgd/\fBcurs_bkgd\fR(3X) +getbkgrnd/\fBcurs_bkgrnd\fR(3X) +getcchar/\fBcurs_getcchar\fR(3X) getch/\fBcurs_getch\fR(3X) getmaxyx/\fBcurs_getyx\fR(3X) getmouse/\fBcurs_mouse\fR(3X)* +getn_wstr/\fBcurs_get_wstr\fR(3X) getnstr/\fBcurs_getstr\fR(3X) getparyx/\fBcurs_getyx\fR(3X) getstr/\fBcurs_getstr\fR(3X) @@ -277,9 +293,13 @@ has_ic/\fBcurs_termattrs\fR(3X) has_il/\fBcurs_termattrs\fR(3X) has_key/\fBcurs_getch\fR(3X)* hline/\fBcurs_border\fR(3X) +hline_set/\fBcurs_border_set\fR(3X) idcok/\fBcurs_outopts\fR(3X) idlok/\fBcurs_outopts\fR(3X) immedok/\fBcurs_outopts\fR(3X) +in_wch/\fBcurs_in_wch\fR(3X) +in_wchnstr/\fBcurs_in_wchstr\fR(3X) +in_wchstr/\fBcurs_in_wchstr\fR(3X) inch/\fBcurs_inch\fR(3X) inchnstr/\fBcurs_inchstr\fR(3X) inchstr/\fBcurs_inchstr\fR(3X) @@ -287,6 +307,10 @@ init_color/\fBcurs_color\fR(3X) init_pair/\fBcurs_color\fR(3X) initscr/\fBcurs_initscr\fR(3X) innstr/\fBcurs_instr\fR(3X) +innwstr/\fBcurs_inwstr\fR(3X) +ins_nwstr/\fBcurs_ins_wstr\fR(3X) +ins_wch/\fBcurs_ins_wch\fR(3X) +ins_wstr/\fBcurs_ins_wstr\fR(3X) insch/\fBcurs_insch\fR(3X) insdelln/\fBcurs_deleteln\fR(3X) insertln/\fBcurs_deleteln\fR(3X) @@ -294,14 +318,17 @@ insnstr/\fBcurs_insstr\fR(3X) insstr/\fBcurs_insstr\fR(3X) instr/\fBcurs_instr\fR(3X) intrflush/\fBcurs_inopts\fR(3X) +inwstr/\fBcurs_inwstr\fR(3X) is_linetouched/\fBcurs_touch\fR(3X) is_wintouched/\fBcurs_touch\fR(3X) isendwin/\fBcurs_initscr\fR(3X) +key_name/\fBcurs_util\fR(3X) keybound/\fBkeybound\fR(3X)* keyname/\fBcurs_util\fR(3X) keyok/\fBkeyok\fR(3X)* keypad/\fBcurs_inopts\fR(3X) killchar/\fBcurs_termattrs\fR(3X) +killwchar/\fBcurs_termattrs\fR(3X) leaveok/\fBcurs_outopts\fR(3X) longname/\fBcurs_termattrs\fR(3X) mcprint/\fBcurs_print\fR(3X)* @@ -310,53 +337,89 @@ mouse_trafo/\fBcurs_mouse\fR(3X)* mouseinterval/\fBcurs_mouse\fR(3X)* mousemask/\fBcurs_mouse\fR(3X)* move/\fBcurs_move\fR(3X) +mvadd_wch/\fBcurs_add_wch\fR(3X) +mvadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +mvadd_wchstr/\fBcurs_add_wchstr\fR(3X) mvaddch/\fBcurs_addch\fR(3X) mvaddchnstr/\fBcurs_addchstr\fR(3X) mvaddchstr/\fBcurs_addchstr\fR(3X) mvaddnstr/\fBcurs_addstr\fR(3X) +mvaddnwstr/\fBcurs_addwstr\fR(3X) mvaddstr/\fBcurs_addstr\fR(3X) +mvaddwstr/\fBcurs_addwstr\fR(3X) mvchgat/\fBcurs_attr\fR(3X) mvcur/\fBcurs_terminfo\fR(3X) mvdelch/\fBcurs_delch\fR(3X) mvderwin/\fBcurs_window\fR(3X) +mvget_wch/\fBcurs_get_wch\fR(3X) +mvget_wstr/\fBcurs_get_wstr\fR(3X) mvgetch/\fBcurs_getch\fR(3X) +mvgetn_wstr/\fBcurs_get_wstr\fR(3X) mvgetnstr/\fBcurs_getstr\fR(3X) mvgetstr/\fBcurs_getstr\fR(3X) mvhline/\fBcurs_border\fR(3X) +mvhline_set/\fBcurs_border_set\fR(3X) +mvin_wch/\fBcurs_in_wch\fR(3X) +mvin_wchnstr/\fBcurs_in_wchstr\fR(3X) +mvin_wchstr/\fBcurs_in_wchstr\fR(3X) mvinch/\fBcurs_inch\fR(3X) mvinchnstr/\fBcurs_inchstr\fR(3X) mvinchstr/\fBcurs_inchstr\fR(3X) mvinnstr/\fBcurs_instr\fR(3X) +mvinnwstr/\fBcurs_inwstr\fR(3X) +mvins_nwstr/\fBcurs_ins_wstr\fR(3X) +mvins_wch/\fBcurs_ins_wch\fR(3X) +mvins_wstr/\fBcurs_ins_wstr\fR(3X) mvinsch/\fBcurs_insch\fR(3X) mvinsnstr/\fBcurs_insstr\fR(3X) mvinsstr/\fBcurs_insstr\fR(3X) mvinstr/\fBcurs_instr\fR(3X) +mvinwstr/\fBcurs_inwstr\fR(3X) mvprintw/\fBcurs_printw\fR(3X) mvscanw/\fBcurs_scanw\fR(3X) mvvline/\fBcurs_border\fR(3X) +mvvline_set/\fBcurs_border_set\fR(3X) +mvwadd_wch/\fBcurs_add_wch\fR(3X) +mvwadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +mvwadd_wchstr/\fBcurs_add_wchstr\fR(3X) mvwaddch/\fBcurs_addch\fR(3X) mvwaddchnstr/\fBcurs_addchstr\fR(3X) mvwaddchstr/\fBcurs_addchstr\fR(3X) mvwaddnstr/\fBcurs_addstr\fR(3X) +mvwaddnwstr/\fBcurs_addwstr\fR(3X) mvwaddstr/\fBcurs_addstr\fR(3X) +mvwaddwstr/\fBcurs_addwstr\fR(3X) mvwchgat/\fBcurs_attr\fR(3X) mvwdelch/\fBcurs_delch\fR(3X) +mvwget_wch/\fBcurs_get_wch\fR(3X) +mvwget_wstr/\fBcurs_get_wstr\fR(3X) mvwgetch/\fBcurs_getch\fR(3X) +mvwgetn_wstr/\fBcurs_get_wstr\fR(3X) mvwgetnstr/\fBcurs_getstr\fR(3X) mvwgetstr/\fBcurs_getstr\fR(3X) mvwhline/\fBcurs_border\fR(3X) +mvwhline_set/\fBcurs_border_set\fR(3X) mvwin/\fBcurs_window\fR(3X) +mvwin_wch/\fBcurs_in_wch\fR(3X) +mvwin_wchnstr/\fBcurs_in_wchstr\fR(3X) +mvwin_wchstr/\fBcurs_in_wchstr\fR(3X) mvwinch/\fBcurs_inch\fR(3X) mvwinchnstr/\fBcurs_inchstr\fR(3X) mvwinchstr/\fBcurs_inchstr\fR(3X) mvwinnstr/\fBcurs_instr\fR(3X) +mvwinnwstr/\fBcurs_inwstr\fR(3X) +mvwins_nwstr/\fBcurs_ins_wstr\fR(3X) +mvwins_wch/\fBcurs_ins_wch\fR(3X) +mvwins_wstr/\fBcurs_ins_wstr\fR(3X) mvwinsch/\fBcurs_insch\fR(3X) mvwinsnstr/\fBcurs_insstr\fR(3X) mvwinsstr/\fBcurs_insstr\fR(3X) mvwinstr/\fBcurs_instr\fR(3X) +mvwinwstr/\fBcurs_inwstr\fR(3X) mvwprintw/\fBcurs_printw\fR(3X) mvwscanw/\fBcurs_scanw\fR(3X) mvwvline/\fBcurs_border\fR(3X) +mvwvline_set/\fBcurs_border_set\fR(3X) napms/\fBcurs_kernel\fR(3X) newpad/\fBcurs_pad\fR(3X) newterm/\fBcurs_initscr\fR(3X) @@ -399,6 +462,7 @@ scroll/\fBcurs_scroll\fR(3X) scrollok/\fBcurs_outopts\fR(3X) set_curterm/\fBcurs_terminfo\fR(3X) set_term/\fBcurs_initscr\fR(3X) +setcchar/\fBcurs_getcchar\fR(3X) setscrreg/\fBcurs_outopts\fR(3X) setsyx/\fBcurs_kernel\fR(3X) setterm/\fBcurs_terminfo\fR(3X) @@ -425,6 +489,7 @@ start_color/\fBcurs_color\fR(3X) subpad/\fBcurs_pad\fR(3X) subwin/\fBcurs_window\fR(3X) syncok/\fBcurs_window\fR(3X) +term_attrs/\fBcurs_termattrs\fR(3X) termattrs/\fBcurs_termattrs\fR(3X) termname/\fBcurs_termattrs\fR(3X) tgetent/\fBcurs_termcap\fR(3X) @@ -444,24 +509,33 @@ tputs/\fBcurs_terminfo\fR(3X) trace/\fBcurs_trace\fR(3X)* typeahead/\fBcurs_inopts\fR(3X) unctrl/\fBcurs_util\fR(3X) +unget_wch/\fBcurs_get_wch\fR(3X) ungetch/\fBcurs_getch\fR(3X) ungetmouse/\fBcurs_mouse\fR(3X)* untouchwin/\fBcurs_touch\fR(3X) use_default_colors/\fBdefault_colors\fR(3X)* use_env/\fBcurs_util\fR(3X) use_extended_names/\fBcurs_extend\fR(3X)* +vid_attr/\fBcurs_terminfo\fR(3X) +vid_puts/\fBcurs_terminfo\fR(3X) vidattr/\fBcurs_terminfo\fR(3X) vidputs/\fBcurs_terminfo\fR(3X) vline/\fBcurs_border\fR(3X) +vline_set/\fBcurs_border_set\fR(3X) vw_printw/\fBcurs_printw\fR(3X) vw_scanw/\fBcurs_scanw\fR(3X) vwprintw/\fBcurs_printw\fR(3X) vwscanw/\fBcurs_scanw\fR(3X) +wadd_wch/\fBcurs_add_wch\fR(3X) +wadd_wchnstr/\fBcurs_add_wchstr\fR(3X) +wadd_wchstr/\fBcurs_add_wchstr\fR(3X) waddch/\fBcurs_addch\fR(3X) waddchnstr/\fBcurs_addchstr\fR(3X) waddchstr/\fBcurs_addchstr\fR(3X) waddnstr/\fBcurs_addstr\fR(3X) +waddnwstr/\fBcurs_addwstr\fR(3X) waddstr/\fBcurs_addstr\fR(3X) +waddwstr/\fBcurs_addwstr\fR(3X) wattr_get/\fBcurs_attr\fR(3X) wattr_off/\fBcurs_attr\fR(3X) wattr_on/\fBcurs_attr\fR(3X) @@ -471,7 +545,10 @@ wattron/\fBcurs_attr\fR(3X) wattrset/\fBcurs_attr\fR(3X) wbkgd/\fBcurs_bkgd\fR(3X) wbkgdset/\fBcurs_bkgd\fR(3X) +wbkgrnd/\fBcurs_bkgrnd\fR(3X) +wbkgrndset/\fBcurs_bkgrnd\fR(3X) wborder/\fBcurs_border\fR(3X) +wborder_set/\fBcurs_border_set\fR(3X) wchgat/\fBcurs_attr\fR(3X) wclear/\fBcurs_clear\fR(3X) wclrtobot/\fBcurs_clear\fR(3X) @@ -480,23 +557,37 @@ wcolor_set/\fBcurs_attr\fR(3X) wcursyncup/\fBcurs_window\fR(3X) wdelch/\fBcurs_delch\fR(3X) wdeleteln/\fBcurs_deleteln\fR(3X) +wecho_wchar/\fBcurs_add_wch\fR(3X) wechochar/\fBcurs_addch\fR(3X) wenclose/\fBcurs_mouse\fR(3X)* werase/\fBcurs_clear\fR(3X) +wget_wch/\fBcurs_get_wch\fR(3X) +wget_wstr/\fBcurs_get_wstr\fR(3X) +wgetbkgrnd/\fBcurs_bkgrnd\fR(3X) wgetch/\fBcurs_getch\fR(3X) +wgetn_wstr/\fBcurs_get_wstr\fR(3X) wgetnstr/\fBcurs_getstr\fR(3X) wgetstr/\fBcurs_getstr\fR(3X) whline/\fBcurs_border\fR(3X) +whline_set/\fBcurs_border_set\fR(3X) +win_wch/\fBcurs_in_wch\fR(3X) +win_wchnstr/\fBcurs_in_wchstr\fR(3X) +win_wchstr/\fBcurs_in_wchstr\fR(3X) winch/\fBcurs_inch\fR(3X) winchnstr/\fBcurs_inchstr\fR(3X) winchstr/\fBcurs_inchstr\fR(3X) winnstr/\fBcurs_instr\fR(3X) +winnwstr/\fBcurs_inwstr\fR(3X) +wins_nwstr/\fBcurs_ins_wstr\fR(3X) +wins_wch/\fBcurs_ins_wch\fR(3X) +wins_wstr/\fBcurs_ins_wstr\fR(3X) winsch/\fBcurs_insch\fR(3X) winsdelln/\fBcurs_deleteln\fR(3X) winsertln/\fBcurs_deleteln\fR(3X) winsnstr/\fBcurs_insstr\fR(3X) winsstr/\fBcurs_insstr\fR(3X) winstr/\fBcurs_instr\fR(3X) +winwstr/\fBcurs_inwstr\fR(3X) wmouse_trafo/\fBcurs_mouse\fR(3X)* wmove/\fBcurs_move\fR(3X) wnoutrefresh/\fBcurs_refresh\fR(3X) @@ -513,7 +604,9 @@ wsyncdown/\fBcurs_window\fR(3X) wsyncup/\fBcurs_window\fR(3X) wtimeout/\fBcurs_inopts\fR(3X) wtouchln/\fBcurs_touch\fR(3X) +wunctrl/\fBcurs_util\fR(3X) wvline/\fBcurs_border\fR(3X) +wvline_set/\fBcurs_border_set\fR(3X) .TE .SH RETURN VALUE Routines that return an integer return \fBERR\fR upon failure and an @@ -613,6 +706,17 @@ This symbol lets you customize the mouse. The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321. If it is not specified, \fBncurses\fR uses 132. .TP 5 +NCURSES_ASSUMED_COLORS +Override the compiled-in assumption that the +terminal's default colors are white-on-black +(see \fBassume_default_colors\fR(3X)). +You may set the foreground and background color values with this environment +variable by proving a 2-element list: foreground,background. +For example, to tell ncurses to not assume anything +about the colors, set this to "-1,-1". +To make it green-on-black, set it to "2,0". +Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed. +.TP 5 NCURSES_NO_PADDING Most of the terminal descriptions in the terminfo database are written for real "hardware" terminals. @@ -699,14 +803,14 @@ ncurses library, e.g., .TP 5 TERMINFO_DIRS Specifies a list of directories to search for terminal descriptions. -The list is separated by colons (i.e., ":"). +The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX. All of the terminal descriptions are in terminfo form, which makes a subdirectory named for the first letter of the terminal names therein. .TP 5 TERMPATH If TERMCAP does not hold a file name then \fBncurses\fR checks the TERMPATH symbol. -This is a list of filenames separated by colons (i.e., ":"). +This is a list of filenames separated by spaces or colons (i.e., ":") on Unix, semicolons on OS/2 EMX. If the TERMPATH symbol is not set, \fBncurses\fR looks in the files /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order. .PP @@ -721,7 +825,7 @@ directory containing initialization files for the terminal capability database @TERMINFO@ terminal capability database .SH SEE ALSO -\fBterminfo\fR(\*n) and 3X pages whose names begin "curs_" for detailed routine +\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine descriptions. .SH EXTENSIONS The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR) @@ -752,7 +856,7 @@ to reset the terminal to its original foreground and background colors. From the users' perspective, the application is able to draw colored text on a background whose color is set independently, providing better control over color contrasts. -See the \fBuse_default_colors\fR(3X) manual page for details. +See the \fBdefault_colors\fR(3X) manual page for details. The \fBncurses\fR library includes a function for directing application output to a printer attached to the terminal device. See the \fBcurs_print\fR(3X) @@ -762,113 +866,8 @@ The \fBncurses\fR library is intended to be BASE-level conformant with the XSI Curses standard. Certain portions of the EXTENDED XSI Curses functionality (including color support) are supported. The following EXTENDED XSI Curses calls in support of wide (multibyte) characters are not yet implemented: -\fBadd_wch\fP, -\fBadd_wchnstr\fP, -\fBadd_wchstr\fP, -\fBaddnwstr\fP, -\fBaddwstr\fP, -\fBbkgrnd\fP, -\fBbkgrndset\fP, -\fBborder_set\fP, -\fBbox_set\fP, -\fBecho_wchar\fP, -\fBerasewchar\fP, -\fBget_wch\fP, -\fBget_wstr\fP, -\fBgetbkgrnd\fP, -\fBgetcchar\fP, -\fBgetn_wstr\fP, -\fBgetwchtype\fP, -\fBhline_set\fP, -\fBin_wch\fP, -\fBin_wchnstr\fP, -\fBin_wchstr\fP, -\fBinnwstr\fP, -\fBins_nwstr\fP, -\fBins_wch\fP, -\fBins_wstr\fP, -\fBinwchnstr\fP, -\fBinwchstr\fP, -\fBinwstr\fP, -\fBkey_name\fP, -\fBkillwchar\fP, -\fBmvadd_wch\fP, -\fBmvadd_wchnstr\fP, -\fBmvadd_wchstr\fP, -\fBmvaddnwstr\fP, -\fBmvaddwstr\fP, -\fBmvget_wch\fP, -\fBmvget_wstr\fP, -\fBmvgetn_wstr\fP, -\fBmvhline_set\fP, -\fBmvin_wch\fP, -\fBmvinnwstr\fP, -\fBmvins_nwstr\fP, -\fBmvins_wch\fP, -\fBmvins_wstr\fP, -\fBmvinwchnstr\fP, -\fBmvinwchstr\fP, -\fBmvinwchstr\fP, -\fBmvinwstr\fP, -\fBmvvline_set\fP, -\fBmvwadd_wch\fP, -\fBmvwadd_wchnstr\fP, -\fBmvwadd_wchstr\fP, -\fBmvwaddnwstr\fP, -\fBmvwaddwstr\fP, -\fBmvwget_ch\fP, -\fBmvwget_wch\fP, -\fBmvwget_wstr\fP, -\fBmvwgetn_wstr\fP, -\fBmvwhline_set\fP, -\fBmvwin_wch\fP, -\fBmvwin_wchnstr\fP, -\fBmvwin_wchstr\fP, -\fBmvwinnwstr\fP, -\fBmvwins_nwstr\fP, -\fBmvwins_wch\fP, -\fBmvwins_wstr\fP, -\fBmvwinwchnstr\fP. -\fBmvwinwstr\fP, -\fBmvwvline_set\fP, \fBpecho_wchar\fP, -\fBsetcchar\fP, -\fBslk_wset\fP, -\fBterm_attrs\fP, -\fBunget_wch\fP, -\fBvhline_set\fP, -\fBvid_attr\fP, -\fBvid_puts\fP, -\fBvline_set\fP, -\fBwadd_wch\fP, -\fBwadd_wchnstr\fP, -\fBwadd_wchstr\fP, -\fBwaddnwstr\fP, -\fBwaddwstr\fP, -\fBwaddwstr\fP, -\fBwbkgrnd\fP, -\fBwbkgrndset\fP, -\fBwbkgrndset\fP, -\fBwborder_set\fP, -\fBwecho_wchar\fP, -\fBwecho_wchar\fP, -\fBwget_wch\fP, -\fBwget_wstr\fP, -\fBwgetbkgrnd\fP, -\fBwgetn_wstr\fP, -\fBwhline_set\fP, -\fBwin_wch\fP, -\fBwin_wchnstr\fP, -\fBwin_wchstr\fP, -\fBwinnwstr\fP, -\fBwins_nwstr\fP, -\fBwins_wch\fP, -\fBwins_wstr\fP, -\fBwinwchnstr\fP, -\fBwinwchstr\fP, -\fBwinwstr\fP, -\fBwunctrl\fP, -\fBwvline_set\fP, +\fBslk_wset\fP. .PP A small number of local differences (that is, individual differences between the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR @@ -897,18 +896,6 @@ bits in the UNIX tty driver. In this implementation, all padding is done by NUL sends. This method is slightly more expensive, but narrows the interface to the UNIX kernel significantly and increases the package's portability correspondingly. -.PP -In the XSI standard and SVr4 manual pages, many entry points have prototype -arguments of the for \fBchar *const\fR (or \fBcchar_t *const\fR, or -\fBwchar_t *const\fR, or \fBvoid *const\fR). Depending on one's interpretation of the -ANSI C standard (see section 3.5.4.1), these declarations are either (a) -meaningless, or (b) meaningless and illegal. The declaration -\fBconst char *x\fR is a modifiable pointer to unmodifiable data, but -\fBchar *const x\fR' is -an unmodifiable pointer to modifiable data. Given that C passes arguments by -value, \fB *const\fR as a formal type is at best dubious. Some compilers -choke on the prototypes. Therefore, in this implementation, they have been -changed to \fBconst *\fR globally. .SH NOTES The header file \fB\fR automatically includes the header files \fB\fR and \fB\fR. diff --git a/man/resizeterm.3x b/man/resizeterm.3x index 9c7cc8fd..562c3532 100644 --- a/man/resizeterm.3x +++ b/man/resizeterm.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,18 +26,22 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" Author: Thomas E. Dickey 1996,1997 +.\" Author: Thomas E. Dickey 1996,1997,2002 .\" -.\" $Id: resizeterm.3x,v 1.7 1998/03/14 23:42:52 tom Exp $ +.\" $Id: resizeterm.3x,v 1.9 2002/02/16 22:32:24 tom Exp $ .TH resizeterm 3X "" .SH NAME +\fBis_term_resized\fR, +\fBresize_term\fR, \fBresizeterm\fR - change the curses terminal size -.. .SH SYNOPSIS \fB#include \fR +\fBbool is_term_resized(int lines, int columns);\fR +.br +\fBint resize_term(int lines, int columns);\fR +.br \fBint resizeterm(int lines, int columns);\fR -.. .SH DESCRIPTION This is an extension to the curses library. It provides callers with a hook into the \fBncurses\fR data to resize windows, @@ -46,26 +50,29 @@ The function \fBresizeterm\fR resizes the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by the \fBncurses\fR library that record the window dimensions. -When resizing the windows, the function blank-fills the areas that are -extended. The calling application should fill in these areas with -appropriate data. - -The function attempts to resize all windows. +Most of the work is done by the inner function \fBresize_term\fR. +The outer function \fBresizeterm\fR adds bookkeeping for the SIGWINCH handler. +When resizing the windows, +\fBresize_term\fR blank-fills the areas that are extended. +The calling application should fill in these areas with appropriate data. +The \fBresize_term\fR function attempts to resize all windows. However, due to the calling convention of pads, it is not possible to resize these without additional interaction with the application. -.. + +A support function \fBis_term_resized\fR is provided so that applications +can check if the \fBresize_term\fR function would modify the window structures. +It returns TRUE if the windows would be modified, and FALSE otherwise. .SH RETURN VALUE -The function returns the integer \fBERR\fR upon failure and \fBOK\fR on success. -It will fail if either of the dimensions less than or equal to zero, -or if an error occurs while (re)allocating memory for the windows. -.. +Except as notes, these function return +the integer \fBERR\fR upon failure and \fBOK\fR on success. +They will fail if either of the dimensions are less than or equal to zero, +or if an error occurs while (re)allocating memory for the windows. .SH NOTES -While this function is intended to be used to support a signal handler -(i.e., for SIGWINCH), care should be taken to avoid invoking it in a +While these functions are intended to be used to support a signal handler +(i.e., for SIGWINCH), care should be taken to avoid invoking them in a context where \fBmalloc\fR or \fBrealloc\fR may have been interrupted, since it uses those functions. -.. .PP If ncurses is configured to supply its own SIGWINCH handler, the \fBresizeterm\fR function ungetch's a \fBKEY_RESIZE\fR which @@ -73,10 +80,8 @@ will be read on the next call to \fBgetch\fR. This is used to alert an application that the screen size has changed, and that it should repaint special features such as pads that cannot be done automatically. -.. .SH SEE ALSO \fBwresize\fR(3X). -.. .SH AUTHOR Thomas Dickey (from an equivalent function written in 1988 for BSD curses). .\"# diff --git a/man/term.5 b/man/term.5 index 63a2d35f..1dcb87de 100644 --- a/man/term.5 +++ b/man/term.5 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: term.5,v 1.10 2000/08/13 01:56:45 tom Exp $ +.\" $Id: term.5,v 1.14 2002/08/10 21:59:37 tom Exp $ .TH TERM 5 .ds n 5 .ds d @TERMINFO@ @@ -38,7 +38,7 @@ term \- format of compiled term file. .PP Compiled terminfo descriptions are placed under the directory \fB\*d\fP. In order to avoid a linear search of a huge \s-1UNIX\s+1 system directory, a -two-level scheme is used: \fB\*b/c/name\fP +two-level scheme is used: \fB\*d/c/name\fP where .I name is the name of the terminal, and @@ -164,7 +164,7 @@ adm3a|lsi adm3a, am, cols#80, lines#24, bel=^G, clear=\032$<1>, cr=^M, cub1=^H, cud1=^J, - cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, + cuf1=^L, cup=\\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, home=^^, ind=^J, .sp .ft CW @@ -198,7 +198,7 @@ Some limitations: total compiled entries cannot exceed 4096 bytes. The name field cannot exceed 128 bytes. .SH FILES \*d/*/* compiled terminal capability data base -.SH "SEE ALSO" +.SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n). .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/man/term.7 b/man/term.7 index 5a48c5a3..5d51e92e 100644 --- a/man/term.7 +++ b/man/term.7 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: term.7,v 1.12 2000/08/13 01:56:42 tom Exp $ +.\" $Id: term.7,v 1.13 2002/04/20 16:50:47 tom Exp $ .TH TERM 7 .ds n 5 .ds d @TERMINFO@ @@ -194,7 +194,7 @@ tty line initialization (AT&T-like UNIXes). .TP 5 /etc/ttys tty line initialization (BSD-like UNIXes). -.SH "SEE ALSO" +.SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBterm\fR(\*n). .\"# .\"# The following sets edit modes for GNU EMACS diff --git a/man/terminfo.head b/man/terminfo.head index 36945ff2..3869cca0 100644 --- a/man/terminfo.head +++ b/man/terminfo.head @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: terminfo.head,v 1.9 2000/08/13 01:56:40 tom Exp $ +.\" $Id: terminfo.head,v 1.10 2002/08/17 23:37:10 tom Exp $ .TH TERMINFO 5 "" "" "File Formats" .ds n 5 .ds d @TERMINFO@ @@ -49,7 +49,7 @@ specifying padding requirements and initialization sequences. Entries in .I terminfo consist of a sequence of `,' separated fields (embedded commas may be -escaped with a backslash or notated as \e072). +escaped with a backslash or notated as \e054). White space after the `,' separator is ignored. The first entry for each terminal gives the names which are known for the terminal, separated by `|' characters. diff --git a/man/terminfo.tail b/man/terminfo.tail index e39230f8..bd585b12 100644 --- a/man/terminfo.tail +++ b/man/terminfo.tail @@ -1,4 +1,4 @@ -.\" $Id: terminfo.tail,v 1.33 2000/10/14 14:06:50 tom Exp $ +.\" $Id: terminfo.tail,v 1.35 2002/04/20 16:49:33 tom Exp $ .\" Beginning of terminfo.tail file .ps +1 .PP @@ -49,7 +49,8 @@ terminal operations. .PP .SS Types of Capabilities .PP -All capabilities have names. For instance, the fact that +All capabilities have names. +For instance, the fact that ANSI-standard terminals have .I "automatic margins" (i.e., an automatic return and line-feed @@ -66,7 +67,8 @@ sequence) are given by the two-character code, an `=', and then a string ending at the next following `,'. .PP A number of escape sequences are provided in the string valued capabilities -for easy encoding of characters there. Both \fB\eE\fR and \fB\ee\fR +for easy encoding of characters there. +Both \fB\eE\fR and \fB\ee\fR map to an \s-1ESCAPE\s0 character, \fB^x\fR maps to a control-x for any appropriate x, and the sequences \fB\en \el \er \et \eb \ef \es\fR give @@ -77,21 +79,26 @@ Other escapes include \fB\e^\fR for \fB^\fR, \fB\e:\fR for \fB:\fR, and \fB\e0\fR for null. (\fB\e0\fR will produce \e200, which does not terminate a string but behaves -as a null character on most terminals, providing CS7 is specified. See stty(1).) +as a null character on most terminals, providing CS7 is specified. +See stty(1).) Finally, characters may be given as three octal digits after a \fB\e\fR. .PP A delay in milliseconds may appear anywhere in a string capability, enclosed in $<..> brackets, as in \fBel\fP=\eEK$<5>, and padding characters are supplied by .I tputs -to provide this delay. The delay must be a number with at most one decimal -place of precision; it may be followed by suffixes `*' or '/' or both. A `*' +to provide this delay. +The delay must be a number with at most one decimal +place of precision; it may be followed by suffixes `*' or '/' or both. +A `*' indicates that the padding required is proportional to the number of lines affected by the operation, and the amount given is the per-affected-unit -padding required. (In the case of insert character, the factor is still the +padding required. +(In the case of insert character, the factor is still the number of .IR lines affected.) Normally, padding is advisory if the device has the \fBxon\fR -capability; it is used for cost computation but does not trigger delays. A `/' +capability; it is used for cost computation but does not trigger delays. +A `/' suffix indicates that the padding is mandatory and forces a delay of the given number of milliseconds even on devices for which \fBxon\fR is present to indicate flow control. @@ -107,7 +114,8 @@ in the example above. .SS Fetching Compiled Descriptions .PP If the environment variable TERMINFO is set, it is interpreted as the pathname -of a directory containing the compiled description you are working on. Only +of a directory containing the compiled description you are working on. +Only that directory is searched. .PP If TERMINFO is not set, the \fBncurses\fR version of the terminfo reader code @@ -116,7 +124,8 @@ for a compiled description. If it fails to find one there, and the environment variable TERMINFO_DIRS is set, it will interpret the contents of that variable as a list of colon- separated directories to be searched (an empty entry is interpreted as a -command to search \fI\*d\fR). If no description is found in any of the +command to search \fI\*d\fR). +If no description is found in any of the TERMINFO_DIRS directories, the fetch fails. .PP If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will be the @@ -151,7 +160,8 @@ A similar test can be used for insert character. .SS Basic Capabilities .PP The number of columns on each line for the terminal is given by the -\fBcols\fR numeric capability. If the terminal is a \s-1CRT\s0, then the +\fBcols\fR numeric capability. +If the terminal is a \s-1CRT\s0, then the number of lines on the screen is given by the \fBlines\fR capability. If the terminal wraps around to the beginning of the next line when it reaches the right margin, then it should have the \fBam\fR capability. @@ -298,7 +308,8 @@ that can be indicated by .BR mrcup . .PP The parameter mechanism uses a stack and special \fB%\fP codes -to manipulate it. Typically a sequence will push one of the +to manipulate it. +Typically a sequence will push one of the parameters onto the stack and then print it in some format. Often more complex operations are necessary. .PP @@ -338,11 +349,13 @@ The \fB%\fR encodings have the following meanings: .fi .PP Binary operations are in postfix form with the operands in the usual order. -That is, to get x-5 one would use "%gx%{5}%-". %P and %g variables are +That is, to get x-5 one would use "%gx%{5}%-". +%P and %g variables are persistent across escape-string evaluations. .PP Consider the HP2645, which, to get to row 3 and column 12, needs -to be sent \eE&a12c03Y padded for 6 milliseconds. Note that the order +to be sent \eE&a12c03Y padded for 6 milliseconds. +Note that the order of the rows and columns is inverted here, and that the row and column are printed as two digits. Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq. @@ -439,7 +452,8 @@ is not available.) .PP If the terminal can open a new blank line before the line where the cursor is, this should be given as \fBil1\fR; this is done only from the first -position of a line. The cursor must then appear on the newly blank line. +position of a line. +The cursor must then appear on the newly blank line. If the terminal can delete the line which the cursor is on, then this should be given as \fBdl1\fR; this is done only from the first position on the line to be deleted. @@ -485,12 +499,15 @@ on many terminals without a true insert/delete line, and is often faster even on terminals with those features. .PP The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling -window is effectively a view port on a screen-sized canvas. To test for +window is effectively a view port on a screen-sized canvas. +To test for this capability, create a scrolling region in the middle of the screen, write something to the bottom line, move the cursor to the top of the region, -and do \fBri\fR followed by \fBdl1\fR or \fBind\fR. If the data scrolled +and do \fBri\fR followed by \fBdl1\fR or \fBind\fR. +If the data scrolled off the bottom of the region by the \fBri\fR re-appears, then scrolling -is non-destructive. System V and XSI Curses expect that \fBind\fR, \fBri\fR, +is non-destructive. +System V and XSI Curses expect that \fBind\fR, \fBri\fR, \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their documentation cautions you not to define \fBcsr\fR unless this is true. This \fBcurses\fR implementation is more liberal and will do explicit erases @@ -505,7 +522,8 @@ and the starting and ending columns in memory, in that order. .PP If the terminal can retain display memory above, then the \fBda\fR capability should be given; if display memory can be retained -below, then \fBdb\fR should be given. These indicate +below, then \fBdb\fR should be given. +These indicate that deleting a line or scrolling may bring non-blank lines up from below or that scrolling back with \fBri\fR may bring down non-blank lines. .PP @@ -519,19 +537,23 @@ on the current line and shift characters off the end of the line rigidly. Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make a distinction between typed and untyped blanks on the screen, shifting upon an insert or delete only to an untyped blank on the screen which is -either eliminated, or expanded to two untyped blanks. You can determine the +either eliminated, or expanded to two untyped blanks. +You can determine the kind of terminal you have by clearing the screen and then typing -text separated by cursor motions. Type \*(lqabc\ \ \ \ def\*(rq using local +text separated by cursor motions. +Type \*(lqabc\ \ \ \ def\*(rq using local cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq. Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert -mode. If typing characters causes the rest of the line to shift +mode. +If typing characters causes the rest of the line to shift rigidly and characters to fall off the end, then your terminal does -not distinguish between blanks and untyped positions. If the \*(lqabc\*(rq +not distinguish between blanks and untyped positions. +If the \*(lqabc\*(rq shifts over to the \*(lqdef\*(rq which then move together around the end of the current line and onto the next as you insert, you have the second type of terminal, and should give the capability \fBin\fR, which stands for \*(lqinsert null\*(rq. -While these are two logically separate attributes (one line vs. multi-line +While these are two logically separate attributes (one line versus multi-line insert mode, and special treatment of untyped spaces) we have seen no terminals whose insert mode cannot be described with the single attribute. .PP @@ -540,24 +562,30 @@ which send a simple sequence to open a blank position on the current line. Give as \fBsmir\fR the sequence to get into insert mode. Give as \fBrmir\fR the sequence to leave insert mode. Now give as \fBich1\fR any sequence needed to be sent just before sending -the character to be inserted. Most terminals with a true insert mode +the character to be inserted. +Most terminals with a true insert mode will not give \fBich1\fR; terminals which send a sequence to open a screen position should give it here. .PP If your terminal has both, insert mode is usually preferable to \fBich1\fR. Technically, you should not give both unless the terminal actually requires -both to be used in combination. Accordingly, some non-curses applications get +both to be used in combination. +Accordingly, some non-curses applications get confused if both are present; the symptom is doubled characters in an update -using insert. This requirement is now rare; most \fBich\fR sequences do not +using insert. +This requirement is now rare; most \fBich\fR sequences do not require previous smir, and most smir insert modes do not require \fBich1\fR -before each character. Therefore, the new \fBcurses\fR actually assumes this +before each character. +Therefore, the new \fBcurses\fR actually assumes this is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as -appropriate (but not both). If you have to write an entry to be used under +appropriate (but not both). +If you have to write an entry to be used under new curses for a terminal old enough to need both, include the \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR. .PP If post insert padding is needed, give this as a number of milliseconds -in \fBip\fR (a string option). Any other sequence which may need to be +in \fBip\fR (a string option). +Any other sequence which may need to be sent after an insert of a single character may also be given in \fBip\fR. If your terminal needs both to be placed into an `insert mode' and a special code to precede each inserted character, then both @@ -579,9 +607,12 @@ in insert mode, give this as a number of milliseconds padding in \fBrmp\fP. .PP It is occasionally necessary to move around while in insert mode to delete characters on the same line (e.g., if there is a tab after -the insertion position). If your terminal allows motion while in +the insertion position). +If your terminal allows motion while in insert mode you can give the capability \fBmir\fR to speed up inserting -in this case. Omitting \fBmir\fR will affect only speed. Some terminals +in this case. +Omitting \fBmir\fR will affect only speed. +Some terminals (notably Datamedia's) must not have \fBmir\fR because of the way their insert mode works. .PP @@ -772,7 +803,8 @@ then this should be indicated by giving \fBeo\fR. .SS Keypad and Function Keys .PP If the terminal has a keypad that transmits codes when the keys are pressed, -this information can be given. Note that it is not possible to handle +this information can be given. +Note that it is not possible to handle terminals where the keypad only works in local (this applies, for example, to the unshifted HP 2621 keys). If the keypad can be set to transmit or not transmit, @@ -977,21 +1009,24 @@ or .PP Many older and slower terminals don't support either XON/XOFF or DTR handshaking, including hard copy terminals and some very archaic CRTs -(including, for example, DEC VT100s). These may require padding characters +(including, for example, DEC VT100s). +These may require padding characters after certain cursor motions and screen changes. .PP If the terminal uses xon/xoff handshaking for flow control (that is, it automatically emits ^S back to the host when its input buffers are close to full), set .BR xon . -This capability suppresses the emission of padding. You can also set it +This capability suppresses the emission of padding. +You can also set it for memory-mapped console devices effectively that don't have a speed limit. Padding information should still be included so that routines can make better decisions about relative costs, but actual pad characters will not be transmitted. .PP If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates -below the value of \fBpb\fR. If the entry has no padding baud rate, then +below the value of \fBpb\fR. +If the entry has no padding baud rate, then whether padding is emitted or not is completely controlled by \fBxon\fR. .PP If the terminal requires other than a null (zero) character as a pad, @@ -1007,25 +1042,30 @@ software (and thus not counted in the terminal's \fBlines\fR capability). The simplest case is a status line which is cursor-addressable but not part of the main scrolling region on the screen; the Heathkit H19 has a status line of this kind, as would a 24-line VT100 with a 23-line -scrolling region set up on initialization. This situation is indicated +scrolling region set up on initialization. +This situation is indicated by the \fBhs\fR capability. .PP Some terminals with status lines need special sequences to access the -status line. These may be expressed as a string with single parameter +status line. +These may be expressed as a string with single parameter \fBtsl\fR which takes the cursor to a given zero-origin column on the -status line. The capability \fBfsl\fR must return to the main-screen -cursor positions before the last \fBtsl\fR. You may need to embed the +status line. +The capability \fBfsl\fR must return to the main-screen +cursor positions before the last \fBtsl\fR. +You may need to embed the string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor) in \fBtsl\fR and \fBfsl\fR to accomplish this. .PP The status line is normally assumed to be the same width as the width -of the terminal. If this is untrue, you can specify it with the numeric +of the terminal. +If this is untrue, you can specify it with the numeric capability \fBwsl\fR. .PP A command to erase or blank the status line may be specified as \fBdsl\fR. .PP The boolean capability \fBeslok\fR specifies that escape sequences, tabs, -etc. work ordinarily in the status line. +etc., work ordinarily in the status line. .PP The \fBncurses\fR implementation does not yet use any of these capabilities. They are documented here in case they ever become important. @@ -1082,25 +1122,33 @@ vertical line ACS_VLINE | x The best way to define a new device's graphics set is to add a column to a copy of this table for your terminal, giving the character which (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered -as the corresponding graphic. Then read off the VT100/your terminal +as the corresponding graphic. +Then read off the VT100/your terminal character pairs right to left in sequence; these become the ACSC string. .PP .SS Color Handling .PP -Most color terminals are either `Tektronix-like' or `HP-like'. Tektronix-like +Most color terminals are either `Tektronix-like' or `HP-like'. +Tektronix-like terminals have a predefined set of N colors (where N usually 8), and can set character-cell foreground and background characters independently, mixing them -into N * N color-pairs. On HP-like terminals, the use must set each color +into N * N color-pairs. +On HP-like terminals, the use must set each color pair up separately (foreground and background are not independently settable). -Up to M color-pairs may be set up from 2*M different colors. ANSI-compatible +Up to M color-pairs may be set up from 2*M different colors. +ANSI-compatible terminals are Tektronix-like. .PP -Some basic color capabilities are independent of the color method. The numeric +Some basic color capabilities are independent of the color method. +The numeric capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors -and color-pairs that can be displayed simultaneously. The \fBop\fR (original +and color-pairs that can be displayed simultaneously. +The \fBop\fR (original pair) string resets foreground and background colors to their default values -for the terminal. The \fBoc\fR string resets all colors or color-pairs to -their default values for the terminal. Some terminals (including many PC +for the terminal. +The \fBoc\fR string resets all colors or color-pairs to +their default values for the terminal. +Some terminals (including many PC terminal emulators) erase screen areas with the current background color rather than the power-up default background; these should have the boolean capability \fBbce\fR. @@ -1108,19 +1156,24 @@ than the power-up default background; these should have the boolean capability To change the current foreground or background color on a Tektronix-type terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background). -These take one parameter, the color number. The SVr4 documentation describes +These take one parameter, the color number. +The SVr4 documentation describes only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal supports ANSI escape sequences to set background and foreground, they should -be coded as \fBsetaf\fR and \fBsetab\fR, respectively. If the terminal +be coded as \fBsetaf\fR and \fBsetab\fR, respectively. +If the terminal supports other escape sequences to set background and foreground, they should -be coded as \fBsetf\fR and \fBsetb\fR, respectively. The \fIvidputs()\fR +be coded as \fBsetf\fR and \fBsetb\fR, respectively. +The \fIvidputs()\fR function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are defined." .PP The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a -single numeric argument each. Argument values 0-7 are portably defined as +single numeric argument each. +Argument values 0-7 are portably defined as follows (the middle column is the symbolic #define available in the header for -the \fBcurses\fR or \fBncurses\fR libraries). The terminal hardware is free to +the \fBcurses\fR or \fBncurses\fR libraries). +The terminal hardware is free to map these as it likes, but the RGB values indicate normal locations in color space. .PP @@ -1143,22 +1196,31 @@ On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set which color pair is current. .PP On a Tektronix-like terminal, the capability \fBccc\fR may be present to -indicate that colors can be modified. If so, the \fBinitc\fR capability will +indicate that colors can be modified. +If so, the \fBinitc\fR capability will take a color number (0 to \fBcolors\fR - 1)and three more parameters which -describe the color. These three parameters default to being interpreted as RGB -(Red, Green, Blue) values. If the boolean capability \fBhls\fR is present, -they are instead as HLS (Hue, Lightness, Saturation) indices. The ranges are +describe the color. +These three parameters default to being interpreted as RGB +(Red, Green, Blue) values. +If the boolean capability \fBhls\fR is present, +they are instead as HLS (Hue, Lightness, Saturation) indices. +The ranges are terminal-dependent. .PP On an HP-like terminal, \fBinitp\fR may give a capability for changing a -color-pair value. It will take seven parameters; a color-pair number (0 to +color-pair value. +It will take seven parameters; a color-pair number (0 to \fBmax_pairs\fR - 1), and two triples describing first background and then -foreground colors. These parameters must be (Red, Green, Blue) or +foreground colors. +These parameters must be (Red, Green, Blue) or (Hue, Lightness, Saturation) depending on \fBhls\fR. .PP -On some color terminals, colors collide with highlights. You can register -these collisions with the \fBncv\fR capability. This is a bit-mask of -attributes not to be used when colors are enabled. The correspondence with the +On some color terminals, colors collide with highlights. +You can register +these collisions with the \fBncv\fR capability. +This is a bit-mask of +attributes not to be used when colors are enabled. +The correspondence with the attributes understood by \fBcurses\fR is as follows: .PP .TS @@ -1178,7 +1240,8 @@ A_ALTCHARSET 8 256 .TE .PP For example, on many IBM PC consoles, the underline attribute collides with the -foreground color blue and is not available in color mode. These should have +foreground color blue and is not available in color mode. +These should have an \fBncv\fR capability of 2. .PP SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes @@ -1313,7 +1376,8 @@ older versions, it was teleray_glitch. This glitch is also taken to mean that it is not possible to position the cursor on top of a ``magic cookie'', that to erase standout mode it is instead necessary to use -delete and insert line. The ncurses implementation ignores this glitch. +delete and insert line. +The ncurses implementation ignores this glitch. .PP The Beehive Superbee, which is unable to correctly transmit the escape or control C characters, has @@ -1329,15 +1393,18 @@ capabilities of the form \fBx\fR\fIx\fR. .SS Similar Terminals .PP If there are two very similar terminals, one (the variant) can be defined as -being just like the other (the base) with certain exceptions. In the +being just like the other (the base) with certain exceptions. +In the definition of the variant, the string capability \fBuse\fR can be given with -the name of the base terminal. The capabilities given before +the name of the base terminal. +The capabilities given before .B use override those in the base type named by .BR use . If there are multiple \fBuse\fR capabilities, they are merged in reverse order. That is, the rightmost \fBuse\fR reference is processed first, then the one to -its left, and so forth. Capabilities given explicitly in the entry override +its left, and so forth. +Capabilities given explicitly in the entry override those brought in by \fBuse\fR references. .PP A capability can be canceled by placing \fBxx@\fR to the left of the @@ -1354,30 +1421,37 @@ user preferences. .SS Pitfalls of Long Entries .PP Long terminfo entries are unlikely to be a problem; to date, no entry has even -approached terminfo's 4K string-table maximum. Unfortunately, the termcap +approached terminfo's 4K string-table maximum. +Unfortunately, the termcap translations are much more strictly limited (to 1K), thus termcap translations of long terminfo entries can cause problems. .PP The man pages for 4.3BSD and older versions of tgetent() instruct the user to -allocate a 1K buffer for the termcap entry. The entry gets null-terminated by +allocate a 1K buffer for the termcap entry. +The entry gets null-terminated by the termcap library, so that makes the maximum safe length for a termcap entry -1k-1 (1023) bytes. Depending on what the application and the termcap library +1k-1 (1023) bytes. +Depending on what the application and the termcap library being used does, and where in the termcap file the terminal type that tgetent() is searching for is, several bad things can happen. .PP Some termcap libraries print a warning message or exit if they find an entry that's longer than 1023 bytes; others don't; others truncate the -entries to 1023 bytes. Some application programs allocate more than +entries to 1023 bytes. +Some application programs allocate more than the recommended 1K for the termcap entry; others don't. .PP Each termcap entry has two important sizes associated with it: before -"tc" expansion, and after "tc" expansion. "tc" is the capability that +"tc" expansion, and after "tc" expansion. +"tc" is the capability that tacks on another termcap entry to the end of the current one, to add -on its capabilities. If a termcap entry doesn't use the "tc" +on its capabilities. +If a termcap entry doesn't use the "tc" capability, then of course the two lengths are the same. .PP The "before tc expansion" length is the most important one, because it -affects more than just users of that particular terminal. This is the +affects more than just users of that particular terminal. +This is the length of the entry as it exists in /etc/termcap, minus the backslash-newline pairs, which tgetent() strips out while reading it. Some termcap libraries strip off the final newline, too (GNU termcap does not). @@ -1401,10 +1475,13 @@ doesn't appear in the file at all (so that tgetent() has to search the whole termcap file). .PP Then tgetent() will overwrite memory, perhaps its stack, and probably core dump -the program. Programs like telnet are particularly vulnerable; modern telnets -pass along values like the terminal type automatically. The results are almost +the program. +Programs like telnet are particularly vulnerable; modern telnets +pass along values like the terminal type automatically. +The results are almost as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that -prints warning messages when it reads an overly long termcap entry. If a +prints warning messages when it reads an overly long termcap entry. +If a termcap library truncates long entries, like OSF/1 3.0, it is immune to dying here but will return incorrect data for the terminal. .PP @@ -1415,18 +1492,21 @@ terminal type it was looking for, not while searching. .PP In summary, a termcap entry that is longer than 1023 bytes can cause, on various combinations of termcap libraries and applications, a core -dump, warnings, or incorrect operation. If it's too long even before +dump, warnings, or incorrect operation. +If it's too long even before "tc" expansion, it will have this effect even for users of some other terminal types and users whose TERM variable does not have a termcap entry. .PP When in -C (translate to termcap) mode, the \fBncurses\fR implementation of \fBtic\fR(1) issues warning messages when the pre-tc length of a termcap -translation is too long. The -c (check) option also checks resolved (after tc +translation is too long. +The -c (check) option also checks resolved (after tc expansion) lengths. .SS Binary Compatibility It is not wise to count on portability of binary terminfo entries between -commercial UNIX versions. The problem is that there are at least two versions +commercial UNIX versions. +The problem is that there are at least two versions of terminfo (under HP-UX and AIX) which diverged from System V terminfo after SVr1, and have added extension capabilities to the string table that (in the binary format) collide with System V and XSI Curses extensions. @@ -1438,24 +1518,29 @@ SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in an alternate-character-set mode (such modes may, among other things, map CR and NL to characters that don't trigger local motions). The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR -mode. This raises the possibility that an XPG4 +mode. +This raises the possibility that an XPG4 implementation making the opposite interpretation may need terminfo entries made for \fBncurses\fR to have \fBmsgr\fR turned off. .PP The \fBncurses\fR library handles insert-character and insert-character modes -in a slightly non-standard way in order to get better update efficiency. See +in a slightly non-standard way to get better update efficiency. +See the \fBInsert/Delete Character\fR subsection above. .PP The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are -not documented in SVr4 or the XSI Curses standard. They are deduced from the +not documented in SVr4 or the XSI Curses standard. +They are deduced from the documentation for the AT&T 505 terminal. .PP -Be careful assigning the \fBkmous\fR capability. The \fBncurses\fR wants to +Be careful assigning the \fBkmous\fR capability. +The \fBncurses\fR wants to interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm that can return mouse-tracking information in the keyboard-input stream. .PP Different commercial ports of terminfo and curses support different subsets of -the XSI Curses standard and (in some cases) different extension sets. Here +the XSI Curses standard and (in some cases) different extension sets. +Here is a summary, accurate as of October 1995: .PP \fBSVR4, Solaris, ncurses\fR -- @@ -1466,7 +1551,8 @@ Supports the SVr4 set, adds one undocumented extended string capability (\fBset_pglen\fR). .PP \fBSVr1, Ultrix\fR -- -These support a restricted subset of terminfo capabilities. The booleans +These support a restricted subset of terminfo capabilities. +The booleans end with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and the strings with \fBprtr_non\fR. .PP @@ -1486,7 +1572,7 @@ Supports both the SVr4 set and the AIX extensions. .TP 25 \*d/?/* files containing terminal descriptions -.SH "SEE ALSO" +.SH SEE ALSO \fBtic\fR(1M), \fBcurses\fR(3X), \fBprintf\fR(3S), \fBterm\fR(\*n). .SH AUTHORS Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. diff --git a/man/tic.1m b/man/tic.1m index e3a09545..829fe400 100644 --- a/man/tic.1m +++ b/man/tic.1m @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: tic.1m,v 1.29 2000/08/19 18:51:05 tom Exp $ +.\" $Id: tic.1m,v 1.33 2002/10/05 20:06:13 tom Exp $ .TH tic 1M "" .ds n 5 .ds d @TERMINFO@ @@ -37,20 +37,24 @@ [\fB\-\ 1\ C\ +G\ I\ +L\ N\ -R\ T\ V\ a\ c\ f\ +g\ r\ s\ +t\ x\ \fR] [\fB-e\fR \fInames\fR] [\fB-o\fR \fIdir\fR] +[\fB-R\fR \fIsubset\fR] [\fB-v\fR[\fIn\fR]] [\fB-w\fR[\fIn\fR]] \fIfile\fR @@ -74,12 +78,22 @@ Libraries that read terminfo entries are expected to check for a TERMINFO directory first, look at \fI$HOME/.terminfo\fR if TERMINFO is not set, and finally look in \fI\*d\fR. .TP +\fB-1\fR +restricts the output to a single column +.TP \fB-a\fR tells \fBtic\fP to retain commented-out capabilities rather than discarding them. Capabilities are commented by prefixing them with a period. This sets the \fB-x\fR option, because it treats the commented-out entries as user-defined names. .TP +\fB-C\fR +Force source translation to termcap format. Note: this differs from the -C +option of \fIinfocmp\fR(1M) in that it does not merely translate capability +names, but also translates terminfo strings to termcap format. Capabilities +that are not translatable are left in the entry under their terminfo names +but commented out with two preceding dots. +.TP \fB-c\fR tells \fBtic\fP to only check \fIfile\fR for errors, including syntax problems and bad use links. If you specify \fB-C\fR (\fB-I\fR) with this option, the code @@ -88,35 +102,28 @@ will print warnings about entries which, after use resolution, are more than libraries (and a documented limit in terminfo), these entries may cause core dumps. .TP -\fB-v\fR\fIn\fR -specifies that (verbose) output be written to standard error trace -information showing \fBtic\fR's progress. The optional integer -\fIn\fR is a number from 1 to 10, inclusive, indicating the desired -level of detail of information. If \fIn\fR is omitted, the default -level is 1. If \fIn\fR is specified and greater than 1, the level of -detail is increased. -.TP -\fB-o\fR\fIdir\fR -Write compiled entries to given directory. Overrides the TERMINFO environment -variable. -.TP -\fB-w\fR\fIn\fR -specifies the width of the output. -.TP -\fB-1\fR -restricts the output to a single column +\fB-e \fR\fInames\fR +Limit writes and translations to the following comma-separated list of +terminals. +If any name or alias of a terminal matches one of the names in +the list, the entry will be written or translated as normal. +Otherwise no output will be generated for it. +The option value is interpreted as a file containing the list if it +contains a '/'. +(Note: depending on how tic was compiled, this option may require -I or -C.) .TP -\fB-C\fR -Force source translation to termcap format. Note: this differs from the -C -option of \fIinfocmp\fR(1M) in that it does not merely translate capability -names, but also translates terminfo strings to termcap format. Capabilities -that are not translatable are left in the entry under their terminfo names -but commented out with two preceding dots. +\fB-f\fR +Display complex terminfo strings which contain if/then/else/endif expressions +indented for readability. .TP \fB-G\fR Display constant literals in decimal form rather than their character equivalents. .TP +\fB-g\fR +Display constant character literals in quoted form +rather than their decimal equivalents. +.TP \fB-I\fR Force source translation to terminfo format. .TP @@ -136,49 +143,51 @@ normally suppresses output of obsolete termcap capabilities such as \fBbs\fR. This option forces a more literal translation that also preserves the obsolete capabilities. .TP +\fB-o\fR\fIdir\fR +Write compiled entries to given directory. Overrides the TERMINFO environment +variable. +.TP \fB-R\fR\fIsubset\fR Restrict output to a given subset. This option is for use with archaic -versions of terminfo like those on SVr1, Ultrix, or HP/UX that don't support +versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x that have their own extensions incompatible with SVr4/XSI. Available subsets are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see \fBterminfo\fR(\*n) for details. .TP +\fB-r\fR +Force entry resolution (so there are no remaining tc capabilities) even +when doing translation to termcap format. This may be needed if you are +preparing a termcap file for a termcap library (such as GNU termcap through +version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple +tc capabilities per entry. +.TP +\fB-s\fR +Summarize the compile by showing the directory into which entries +are written, and the number of entries which are compiled. +.TP \fB-T\fR eliminates size-restrictions on the generated text. This is mainly useful for testing and analysis, since the compiled descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo). .TP +\fB-t\fR +tells \fBtic\fP to discard commented-out capabilities. +Normally when translating from terminfo to termcap, +untranslatable capabilities are commented-out. +.TP \fB-V\fR reports the version of ncurses which was used in this program, and exits. .TP -\fB-r\fR -Force entry resolution (so there are no remaining tc capabilities) even -when doing translation to termcap format. This may be needed if you are -preparing a termcap file for a termcap library (such as GNU termcap up -to version 1.3 or BSD termcap up to 4.3BSD) that doesn't handle multiple -tc capabilities per entry. -.TP -\fB-e\fR -Limit writes and translations to the following comma-separated list of -terminals. -If any name or alias of a terminal matches one of the names in -the list, the entry will be written or translated as normal. -Otherwise no output will be generated for it. -The option value is interpreted as a file containing the list if it -contains a '/'. -(Note: depending on how tic was compiled, this option may require -I or -C.) -.TP -\fB-f\fR -Display complex terminfo strings which contain if/then/else/endif expressions -indented for readability. -.TP -\fB-g\fR -Display constant character literals in quoted form -rather than their decimal equivalents. +\fB-v\fR\fIn\fR +specifies that (verbose) output be written to standard error trace +information showing \fBtic\fR's progress. The optional integer +\fIn\fR is a number from 1 to 10, inclusive, indicating the desired +level of detail of information. If \fIn\fR is omitted, the default +level is 1. If \fIn\fR is specified and greater than 1, the level of +detail is increased. .TP -\fB-s\fR -Summarize the compile by showing the directory into which entries -are written, and the number of entries which are compiled. +\fB-w\fR\fIn\fR +specifies the width of the output. .TP \fB-x\fR Treat unknown capabilities as user-defined. @@ -214,7 +223,7 @@ List of tokens encountered by scanner 9 All values computed in construction of the hash table .LP -If n is not given, it is taken to be one. +If the debug level \fIn\fR is not given, it is taken to be one. .PP All but one of the capabilities recognized by \fBtic\fR are documented in \fBterminfo\fR(\*n). The exception is the \fBuse\fR capability. @@ -278,7 +287,8 @@ The \fB-g\fR, \fB-o\fR, \fB-r\fR, -\fB-s\fR and +\fB-s\fR, +\fB-t\fR and \fB-x\fR options are not supported under SVr4. diff --git a/man/tput.1 b/man/tput.1 index 898df1e6..7e73b0e0 100644 --- a/man/tput.1 +++ b/man/tput.1 @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,10 +27,10 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: tput.1,v 1.16 2000/09/09 20:43:33 tom Exp $ +.\" $Id: tput.1,v 1.18 2002/10/12 13:53:20 tom Exp $ .TH tput 1 "" .ds d @TERMINFO@ -.ds n 5 +.ds n 1 .SH NAME \fBtput\fR, \fBreset\fR - initialize a terminal or query terminfo database .SH SYNOPSIS @@ -76,16 +76,27 @@ the attribute is also accepted. .TP \fIparms\fR If the attribute is a string that takes parameters, the arguments -\fIparms\fR will be instantiated into the string. An all numeric -argument will be passed to the attribute as a number. +\fIparms\fR will be instantiated into the string. +An all-numeric argument will be passed to the attribute as a number. +.IP +Only a few terminfo capabilities require string parameters; +\fBtput\fR uses a table to decide which to pass as strings. +Normally \fBtput\fR uses \fBtparm\fR (3X) to perform the substitution. +If no parameters are given for the attribute, +\fBtput\fR writes the string without performing the substitution. .TP \fB-S\fR allows more than one capability per invocation of \fBtput\fR. The capabilities must be passed to \fBtput\fR from the standard input -instead of from the command line (see example). Only one -\fIcapname\fR is allowed per line. The \fB-S\fR option changes the +instead of from the command line (see example). +Only one \fIcapname\fR is allowed per line. +The \fB-S\fR option changes the meaning of the \fB0\fR and \fB1\fR boolean and string exit codes (see the EXIT CODES section). +.IP +Again, \fBtput\fR uses a table and the presence of parameters in its input +to decide whether to use \fBtparm\fR (3X), +and how to interpret the parameters. .TP \fB-V\fR reports the version of ncurses which was used in this program, and exits. @@ -126,7 +137,7 @@ Initialize the terminal according to the type of terminal in the environmental variable \fBTERM\fR. This command should be included in everyone's .profile after the environmental variable \fBTERM\fR has been exported, as -illustrated on the \fBprofile\fR(4) manual page. +illustrated on the \fBprofile\fR(5) manual page. .TP 5 \fBtput -T5620 reset\fR Reset an AT&T 5620 terminal, overriding the type of @@ -158,6 +169,9 @@ Set exit code to indicate if the current terminal is a hard copy terminal. \fBtput cup 23 4\fR Send the sequence to move the cursor to row 23, column 4. .TP 5 +\fBtput cup\fR +Send the terminfo string for cursor-movement, with no parameters substituted. +.TP 5 \fBtput longname\fR Print the long name from the \fBterminfo\fR database for the type of terminal specified in the environmental @@ -176,10 +190,11 @@ variable \fBTERM\fR. .RE .TP 5 \& -This example shows tput processing several capabilities in one -invocation. This example clears the screen, moves the cursor to -position 10, 10 and turns on bold (extra bright) mode. The list is -terminated by an exclamation mark (\fB!\fR) on a line by itself. +This example shows \fBtput\fR processing several capabilities in one invocation. +It clears the screen, +moves the cursor to position 10, 10 +and turns on bold (extra bright) mode. +The list is terminated by an exclamation mark (\fB!\fR) on a line by itself. .SH FILES .TP \fB\*d\fR @@ -196,39 +211,50 @@ tab settings for some terminals, in a format appropriate to be output to the terminal (escape sequences that set margins and tabs); for more information, see the "Tabs and Initialization" -section of \fBterminfo\fR(4) -.SH SEE ALSO -\fB@CLEAR@\fR(1), \fBstty\fR(1), \fBtabs\fR(\*n). \fBprofile\fR(\*n), -\fBterminfo\fR(4) in the \fISystem\fR \fIAdministrator\fR'\fIs\fR -\fIReference\fR \fIManual\fR. Chapter 10 of the -\fIProgrammer\fR'\fIs\fR \fIGuide\fR. +section of \fBterminfo\fR(5) .SH EXIT CODES -If \fIcapname\fR is of type boolean, a value of \fB0\fR is set for -TRUE and \fB1\fR for FALSE unless the \fB-S\fR option is used. -.PP -If \fIcapname\fR is of type string, a value of \fB0\fR is set if the -\fIcapname\fR is defined for this terminal \fItype\fR (the value of -\fIcapname\fR is returned on standard output); a value of \fB1\fR is -set if \fIcapname\fR is not defined for this terminal \fItype\fR (a -null value is returned on standard output). -.PP -If \fIcapname\fR is of type boolean or string and the \fB-S\fR option -is used, a value of \fB0\fR is returned to indicate that all lines -were successful. No indication of which line failed can be given so +If the \fB-S\fR option is used, +\fBtput\fR checks for errors from each line, +and if any errors are found, will set the exit code to 4 plus the +number of lines with errors. +If no errors are found, the exit code is \fB0\fR. +No indication of which line failed can be given so exit code \fB1\fR will never appear. Exit codes \fB2\fR, \fB3\fR, and \fB4\fR retain their usual interpretation. -.PP -If \fIcapname\fR is of type integer, a value of \fB0\fR is always set, +If the \fB-S\fR option is not used, +the exit code depends on the type of \fIcapname\fR: +.RS 5 +.TP +.I boolean +a value of \fB0\fR is set for TRUE and \fB1\fR for FALSE. +.TP +.I string +a value of \fB0\fR is set if the +\fIcapname\fR is defined for this terminal \fItype\fR (the value of +\fIcapname\fR is returned on standard output); +a value of \fB1\fR is set if \fIcapname\fR +is not defined for this terminal \fItype\fR +(nothing is written to standard output). +.TP +.I integer +a value of \fB0\fR is always set, whether or not \fIcapname\fR is defined for this terminal \fItype\fR. To determine if \fIcapname\fR is defined for this terminal \fItype\fR, -the user must test the value of standard output. A value of \fB-1\fR +the user must test the value written to standard output. +A value of \fB-1\fR means that \fIcapname\fR is not defined for this terminal \fItype\fR. +.TP +.I other +\fBreset\fR or \fBinit\fR may fail to find their respective files. +In that case, the exit code is set to 4 + \fBerrno\fR. +.RE .PP Any other exit code indicates an error; see the DIAGNOSTICS section. .SH DIAGNOSTICS \fBtput\fR prints the following error messages and sets the corresponding exit codes. .PP +.ne 15 .TS l l. exit code error message @@ -242,12 +268,18 @@ T} \fB2\fR usage error \fB3\fR unknown terminal \fItype\fR or no \fBterminfo\fR database \fB4\fR unknown \fBterminfo\fR capability \fIcapname\fR +\fB>4\fR error occurred in -S = .TE .SH PORTABILITY The \fBlongname\fR and \fB-S\fR options, and the parameter-substitution features used in the \fBcup\fR example, are not supported in BSD curses or in AT&T/USL curses before SVr4. +.SH SEE ALSO +\fB@CLEAR@\fR(1), +\fBstty\fR(1), +\fBtabs\fR(\*n), +\fBterminfo\fR(5). .\"# .\"# The following sets edit modes for GNU EMACS .\"# Local Variables: diff --git a/man/wresize.3x b/man/wresize.3x index 5988f198..62933f1a 100644 --- a/man/wresize.3x +++ b/man/wresize.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1998,2002 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,38 +28,32 @@ .\" .\" Author: Thomas E. Dickey 1996 .\" -.\" $Id: wresize.3x,v 1.5 1998/03/14 23:42:44 tom Exp $ +.\" $Id: wresize.3x,v 1.7 2002/02/16 22:40:59 tom Exp $ .TH wresize 3X "" .SH NAME \fBwresize\fR - resize a curses window -.. .SH SYNOPSIS \fB#include \fR \fBint wresize(WINDOW *win, int lines, int columns);\fR -.. .SH DESCRIPTION The \fBwresize\fR function reallocates storage for an \fBncurses\fR window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition (as set by \fBwbkgndset\fR) merged into them. -.. .SH RETURN VALUE The function returns the integer \fBERR\fR upon failure and \fBOK\fR on success. It will fail if either of the dimensions less than or equal to zero, or if an error occurs while (re)allocating memory for the window. -.. .SH NOTES The only restriction placed on the dimensions is that they be greater than zero. The dimensions are not compared to \fBcurses\fR screen dimensions to simplify the logic of \fBresizeterm\fR. The caller must ensure that the window's dimensions fit within the actual screen dimensions. -.. .SH SEE ALSO \fBresizeterm\fR(3X). -.. .SH AUTHOR Thomas Dickey (from an equivalent function written in 1988 for BSD curses). .\"# diff --git a/menu/Makefile.in b/menu/Makefile.in index 08f7dc25..b5c7b68c 100644 --- a/menu/Makefile.in +++ b/menu/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.31 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +# $Id: Makefile.in,v 1.36 2002/01/20 01:49:17 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ @@ -57,6 +58,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -85,7 +87,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -97,6 +99,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -115,8 +119,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources : $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make copies to simplify include-paths while still keeping menu's include # file in this directory. @@ -142,7 +147,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/menu/READ.ME b/menu/READ.ME index 3fd56274..7867bc94 100644 --- a/menu/READ.ME +++ b/menu/READ.ME @@ -11,4 +11,5 @@ directory. Juergen Pfeifer -eMail: juergen.pfeifer@gmx.net +Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en + diff --git a/menu/eti.h b/menu/eti.h index cc1c8308..d46636b0 100644 --- a/menu/eti.h +++ b/menu/eti.h @@ -27,11 +27,12 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ -#ifndef _ETI_ERRNO_H_ -#define _ETI_ERRNO_H_ +#ifndef NCURSES_ETI_H_incl +#define NCURSES_ETI_H_incl 1 #define E_OK (0) #define E_SYSTEM_ERROR (-1) diff --git a/menu/llib-lmenu b/menu/llib-lmenu index 3f421c11..82a7af48 100644 --- a/menu/llib-lmenu +++ b/menu/llib-lmenu @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996,1997,1999 * + * Author: Thomas E. Dickey 1996-1999,2002 * ****************************************************************************/ /* LINTLIBRARY */ @@ -122,10 +122,10 @@ MENU _nc_Default_Menu; ITEM _nc_Default_Item; #undef _nc_Connect_Items -bool _nc_Connect_Items( +NCURSES_BOOL _nc_Connect_Items( MENU *menu, ITEM **items) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_Disconnect_Items void _nc_Disconnect_Items( @@ -310,20 +310,20 @@ void *item_userptr( #undef set_item_value int set_item_value( ITEM *item, - bool value) + NCURSES_BOOL value) { return(*(int *)0); } #undef item_value -bool item_value( +NCURSES_BOOL item_value( const ITEM *item) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./m_item_vis.c */ #undef item_visible -bool item_visible( +NCURSES_BOOL item_visible( const ITEM *item) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./m_items.c */ diff --git a/menu/llib-lmenuw b/menu/llib-lmenuw new file mode 100644 index 00000000..3abc5f39 --- /dev/null +++ b/menu/llib-lmenuw @@ -0,0 +1,508 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./m_attribs.c */ + +#include "menu.priv.h" + +#undef set_menu_fore +int set_menu_fore( + MENU *menu, + chtype attr) + { return(*(int *)0); } + +#undef menu_fore +chtype menu_fore( + const MENU *menu) + { return(*(chtype *)0); } + +#undef set_menu_back +int set_menu_back( + MENU *menu, + chtype attr) + { return(*(int *)0); } + +#undef menu_back +chtype menu_back( + const MENU *menu) + { return(*(chtype *)0); } + +#undef set_menu_grey +int set_menu_grey( + MENU *menu, + chtype attr) + { return(*(int *)0); } + +#undef menu_grey +chtype menu_grey( + const MENU *menu) + { return(*(chtype *)0); } + +/* ./m_cursor.c */ + +#undef _nc_menu_cursor_pos +int _nc_menu_cursor_pos( + const MENU *menu, + const ITEM *item, + int *pY, + int *pX) + { return(*(int *)0); } + +#undef pos_menu_cursor +int pos_menu_cursor( + const MENU *menu) + { return(*(int *)0); } + +/* ./m_driver.c */ + +#undef _nc_Match_Next_Character_In_Item_Name +int _nc_Match_Next_Character_In_Item_Name( + MENU *menu, + int ch, + ITEM **item) + { return(*(int *)0); } + +#undef menu_driver +int menu_driver( + MENU *menu, + int c) + { return(*(int *)0); } + +/* ./m_format.c */ + +#undef set_menu_format +int set_menu_format( + MENU *menu, + int rows, + int cols) + { return(*(int *)0); } + +#undef menu_format +void menu_format( + const MENU *menu, + int *rows, + int *cols) + { /* void */ } + +/* ./m_global.c */ + +#undef _nc_Default_Menu +MENU _nc_Default_Menu; +#undef _nc_Default_Item +ITEM _nc_Default_Item; + +#undef _nc_Connect_Items +NCURSES_BOOL _nc_Connect_Items( + MENU *menu, + ITEM **items) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_Disconnect_Items +void _nc_Disconnect_Items( + MENU *menu) + { /* void */ } + +#undef _nc_Calculate_Item_Length_and_Width +void _nc_Calculate_Item_Length_and_Width( + MENU *menu) + { /* void */ } + +#undef _nc_Link_Items +void _nc_Link_Items( + MENU *menu) + { /* void */ } + +#undef _nc_Show_Menu +void _nc_Show_Menu( + const MENU *menu) + { /* void */ } + +#undef _nc_New_TopRow_and_CurrentItem +void _nc_New_TopRow_and_CurrentItem( + MENU *menu, + int new_toprow, + ITEM *new_current_item) + { /* void */ } + +/* ./m_hook.c */ + +#undef set_menu_init +int set_menu_init( + MENU *menu, + Menu_Hook func) + { return(*(int *)0); } + +#undef menu_init +Menu_Hook menu_init( + const MENU *menu) + { return(*(Menu_Hook *)0); } + +#undef set_menu_term +int set_menu_term( + MENU *menu, + Menu_Hook func) + { return(*(int *)0); } + +#undef menu_term +Menu_Hook menu_term( + const MENU *menu) + { return(*(Menu_Hook *)0); } + +#undef set_item_init +int set_item_init( + MENU *menu, + Menu_Hook func) + { return(*(int *)0); } + +#undef item_init +Menu_Hook item_init( + const MENU *menu) + { return(*(Menu_Hook *)0); } + +#undef set_item_term +int set_item_term( + MENU *menu, + Menu_Hook func) + { return(*(int *)0); } + +#undef item_term +Menu_Hook item_term( + const MENU *menu) + { return(*(Menu_Hook *)0); } + +/* ./m_item_cur.c */ + +#undef set_current_item +int set_current_item( + MENU *menu, + ITEM *item) + { return(*(int *)0); } + +#undef current_item +ITEM *current_item( + const MENU *menu) + { return(*(ITEM **)0); } + +#undef item_index +int item_index( + const ITEM *item) + { return(*(int *)0); } + +/* ./m_item_nam.c */ + +#undef item_name +const char *item_name( + const ITEM *item) + { return(*(const char **)0); } + +#undef item_description +const char *item_description( + const ITEM *item) + { return(*(const char **)0); } + +/* ./m_item_new.c */ + +#undef new_item +ITEM *new_item( + const char *name, + const char *description) + { return(*(ITEM **)0); } + +#undef free_item +int free_item( + ITEM *item) + { return(*(int *)0); } + +#undef set_menu_mark +int set_menu_mark( + MENU *menu, + const char *mark) + { return(*(int *)0); } + +#undef menu_mark +const char *menu_mark( + const MENU *menu) + { return(*(const char **)0); } + +/* ./m_item_opt.c */ + +#undef set_item_opts +int set_item_opts( + ITEM *item, + Item_Options opts) + { return(*(int *)0); } + +#undef item_opts_off +int item_opts_off( + ITEM *item, + Item_Options opts) + { return(*(int *)0); } + +#undef item_opts_on +int item_opts_on( + ITEM *item, + Item_Options opts) + { return(*(int *)0); } + +#undef item_opts +Item_Options item_opts( + const ITEM *item) + { return(*(Item_Options *)0); } + +/* ./m_item_top.c */ + +#undef set_top_row +int set_top_row( + MENU *menu, + int row) + { return(*(int *)0); } + +#undef top_row +int top_row( + const MENU *menu) + { return(*(int *)0); } + +/* ./m_item_use.c */ + +#undef set_item_userptr +int set_item_userptr( + ITEM *item, + void *userptr) + { return(*(int *)0); } + +#undef item_userptr +void *item_userptr( + const ITEM *item) + { return(*(void **)0); } + +/* ./m_item_val.c */ + +#undef set_item_value +int set_item_value( + ITEM *item, + NCURSES_BOOL value) + { return(*(int *)0); } + +#undef item_value +NCURSES_BOOL item_value( + const ITEM *item) + { return(*(NCURSES_BOOL *)0); } + +/* ./m_item_vis.c */ + +#undef item_visible +NCURSES_BOOL item_visible( + const ITEM *item) + { return(*(NCURSES_BOOL *)0); } + +/* ./m_items.c */ + +#undef set_menu_items +int set_menu_items( + MENU *menu, + ITEM **items) + { return(*(int *)0); } + +#undef menu_items +ITEM **menu_items( + const MENU *menu) + { return(*(ITEM ***)0); } + +#undef item_count +int item_count( + const MENU *menu) + { return(*(int *)0); } + +/* ./m_new.c */ + +#undef new_menu +MENU *new_menu( + ITEM **items) + { return(*(MENU **)0); } + +#undef free_menu +int free_menu( + MENU *menu) + { return(*(int *)0); } + +/* ./m_opts.c */ + +#undef set_menu_opts +int set_menu_opts( + MENU *menu, + Menu_Options opts) + { return(*(int *)0); } + +#undef menu_opts_off +int menu_opts_off( + MENU *menu, + Menu_Options opts) + { return(*(int *)0); } + +#undef menu_opts_on +int menu_opts_on( + MENU *menu, + Menu_Options opts) + { return(*(int *)0); } + +#undef menu_opts +Menu_Options menu_opts( + const MENU *menu) + { return(*(Menu_Options *)0); } + +/* ./m_pad.c */ + +#undef set_menu_pad +int set_menu_pad( + MENU *menu, + int pad) + { return(*(int *)0); } + +#undef menu_pad +int menu_pad( + const MENU *menu) + { return(*(int *)0); } + +/* ./m_pattern.c */ + +#undef menu_pattern +char *menu_pattern( + const MENU *menu) + { return(*(char **)0); } + +#undef set_menu_pattern +int set_menu_pattern( + MENU *menu, + const char *p) + { return(*(int *)0); } + +/* ./m_post.c */ + +#undef _nc_Post_Item +void _nc_Post_Item( + const MENU *menu, + const ITEM *item) + { /* void */ } + +#undef _nc_Draw_Menu +void _nc_Draw_Menu( + const MENU *menu) + { /* void */ } + +#undef post_menu +int post_menu( + MENU *menu) + { return(*(int *)0); } + +#undef unpost_menu +int unpost_menu( + MENU *menu) + { return(*(int *)0); } + +/* ./m_req_name.c */ + +#undef menu_request_name +const char *menu_request_name( + int request) + { return(*(const char **)0); } + +#undef menu_request_by_name +int menu_request_by_name( + const char *str) + { return(*(int *)0); } + +/* ./m_scale.c */ + +#undef scale_menu +int scale_menu( + const MENU *menu, + int *rows, + int *cols) + { return(*(int *)0); } + +/* ./m_spacing.c */ + +#undef set_menu_spacing +int set_menu_spacing( + MENU *menu, + int s_desc, + int s_row, + int s_col) + { return(*(int *)0); } + +#undef menu_spacing +int menu_spacing( + const MENU *menu, + int *s_desc, + int *s_row, + int *s_col) + { return(*(int *)0); } + +/* ./m_sub.c */ + +#undef set_menu_sub +int set_menu_sub( + MENU *menu, + WINDOW *win) + { return(*(int *)0); } + +#undef menu_sub +WINDOW *menu_sub( + const MENU *menu) + { return(*(WINDOW **)0); } + +/* ./m_userptr.c */ + +#undef set_menu_userptr +int set_menu_userptr( + MENU *menu, + void *userptr) + { return(*(int *)0); } + +#undef menu_userptr +void *menu_userptr( + const MENU *menu) + { return(*(void **)0); } + +/* ./m_win.c */ + +#undef set_menu_win +int set_menu_win( + MENU *menu, + WINDOW *win) + { return(*(int *)0); } + +#undef menu_win +WINDOW *menu_win( + const MENU *menu) + { return(*(WINDOW **)0); } diff --git a/menu/m_attribs.c b/menu/m_attribs.c index 3cf2a118..34db8802 100644 --- a/menu/m_attribs.c +++ b/menu/m_attribs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_attribs.c,v 1.8 1999/05/16 17:24:24 juergen Exp $") +MODULE_ID("$Id: m_attribs.c,v 1.10 2002/07/06 15:22:16 juergen Exp $") /* Macro to redraw menu if it is posted and changed */ #define Refresh_Menu(menu) \ @@ -49,7 +50,7 @@ MODULE_ID("$Id: m_attribs.c,v 1.8 1999/05/16 17:24:24 juergen Exp $") /* "Template" macro to generate a function to set a menus attribute */ #define GEN_MENU_ATTR_SET_FCT( name ) \ -int set_menu_ ## name (MENU * menu, chtype attr)\ +NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU * menu, chtype attr)\ {\ if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\ RETURN(E_BAD_ARGUMENT);\ @@ -64,7 +65,7 @@ int set_menu_ ## name (MENU * menu, chtype attr)\ /* "Template" macro to generate a function to get a menus attribute */ #define GEN_MENU_ATTR_GET_FCT( name ) \ -chtype menu_ ## name (const MENU * menu)\ +NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\ {\ return (Normalize_Menu( menu ) -> name);\ } diff --git a/menu/m_cursor.c b/menu/m_cursor.c index a4630895..0ab3b7a3 100644 --- a/menu/m_cursor.c +++ b/menu/m_cursor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_cursor.c,v 1.13 1999/05/16 17:24:43 juergen Exp $") +MODULE_ID("$Id: m_cursor.c,v 1.15 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -49,9 +50,9 @@ MODULE_ID("$Id: m_cursor.c,v 1.13 1999/05/16 17:24:43 juergen Exp $") | E_BAD_ARGUMENT - invalid menu | E_NOT_POSTED - Menu is not posted +--------------------------------------------------------------------------*/ -int _nc_menu_cursor_pos(const MENU* menu, - const ITEM* item, - int* pY, int* pX) +NCURSES_EXPORT(int) +_nc_menu_cursor_pos +(const MENU* menu, const ITEM* item, int* pY, int* pX) { if (!menu || !pX || !pY) return(E_BAD_ARGUMENT); @@ -80,7 +81,8 @@ int _nc_menu_cursor_pos(const MENU* menu, | E_BAD_ARGUMENT - invalid menu | E_NOT_POSTED - Menu is not posted +--------------------------------------------------------------------------*/ -int pos_menu_cursor(const MENU * menu) +NCURSES_EXPORT(int) +pos_menu_cursor (const MENU * menu) { WINDOW *win, *sub; int x, y; diff --git a/menu/m_driver.c b/menu/m_driver.c index fef3e8ea..d86100d7 100644 --- a/menu/m_driver.c +++ b/menu/m_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_driver.c,v 1.17 1999/05/16 17:24:55 juergen Exp $") +MODULE_ID("$Id: m_driver.c,v 1.19 2002/07/06 15:22:16 juergen Exp $") /* Macros */ @@ -111,7 +112,9 @@ static bool Is_Sub_String( | Return Values : E_OK - an item matching the pattern was found | E_NO_MATCH - nothing found +--------------------------------------------------------------------------*/ -int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item) +NCURSES_EXPORT(int) +_nc_Match_Next_Character_In_Item_Name +(MENU *menu, int ch, ITEM **item) { bool found = FALSE, passed = FALSE; int idx, last; @@ -198,7 +201,8 @@ int _nc_Match_Next_Character_In_Item_Name(MENU *menu, int ch, ITEM **item) | E_BAD_STATE - menu is in user hook routine | E_NOT_POSTED - menu is not posted +--------------------------------------------------------------------------*/ -int menu_driver(MENU * menu, int c) +NCURSES_EXPORT(int) +menu_driver (MENU * menu, int c) { #define NAVIGATE(dir) \ if (!item->dir)\ diff --git a/menu/m_format.c b/menu/m_format.c index 829fbe8c..4f19f76c 100644 --- a/menu/m_format.c +++ b/menu/m_format.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_format.c,v 1.9 1999/05/16 17:25:04 juergen Exp $") +MODULE_ID("$Id: m_format.c,v 1.11 2002/07/06 15:22:16 juergen Exp $") #define minimum(a,b) ((a)<(b) ? (a): (b)) @@ -55,7 +56,8 @@ MODULE_ID("$Id: m_format.c,v 1.9 1999/05/16 17:25:04 juergen Exp $") | E_NOT_CONNECTED - there are no items connected | E_POSTED - the menu is already posted +--------------------------------------------------------------------------*/ -int set_menu_format(MENU *menu, int rows, int cols) +NCURSES_EXPORT(int) +set_menu_format (MENU *menu, int rows, int cols) { int total_rows, total_cols; @@ -114,7 +116,8 @@ int set_menu_format(MENU *menu, int rows, int cols) | | Return Values : - +--------------------------------------------------------------------------*/ -void menu_format(const MENU *menu, int *rows, int *cols) +NCURSES_EXPORT(void) +menu_format (const MENU *menu, int *rows, int *cols) { if (rows) *rows = Normalize_Menu(menu)->frows; diff --git a/menu/m_global.c b/menu/m_global.c index 3633e55b..b1f73f5c 100644 --- a/menu/m_global.c +++ b/menu/m_global.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,9 +38,11 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_global.c,v 1.11 1999/05/16 17:25:14 juergen Exp $") +MODULE_ID("$Id: m_global.c,v 1.14 2002/07/06 15:22:16 juergen Exp $") -MENU _nc_Default_Menu = { +static char mark[] = "-"; + +NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { 16, /* Nr. of chars high */ 1, /* Nr. of chars wide */ 16, /* Nr. of items high */ @@ -73,12 +76,12 @@ MENU _nc_Default_Menu = { (Menu_Hook)0, /* Item init */ (Menu_Hook)0, /* Item term */ (void *)0, /* userptr */ - "-", /* mark */ + mark, /* mark */ ALL_MENU_OPTS, /* options */ 0 /* status */ }; -ITEM _nc_Default_Item = { +NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { { (char *)0, 0 }, /* name */ { (char *)0, 0 }, /* description */ (MENU *)0, /* Pointer to parent menu */ @@ -161,7 +164,8 @@ INLINE static void ResetConnectionInfo(MENU *menu, ITEM **items) | Return Values : TRUE - successfull connection | FALSE - connection failed +--------------------------------------------------------------------------*/ -bool _nc_Connect_Items(MENU *menu, ITEM **items) +NCURSES_EXPORT(bool) +_nc_Connect_Items (MENU *menu, ITEM **items) { ITEM **item; unsigned int ItemCount = 0; @@ -222,7 +226,8 @@ bool _nc_Connect_Items(MENU *menu, ITEM **items) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Disconnect_Items(MENU * menu) +NCURSES_EXPORT(void) +_nc_Disconnect_Items (MENU * menu) { if (menu && menu->items) ResetConnectionInfo( menu, menu->items ); @@ -237,7 +242,8 @@ void _nc_Disconnect_Items(MENU * menu) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Calculate_Item_Length_and_Width(MENU * menu) +NCURSES_EXPORT(void) +_nc_Calculate_Item_Length_and_Width (MENU * menu) { int l; @@ -265,7 +271,8 @@ void _nc_Calculate_Item_Length_and_Width(MENU * menu) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Link_Items(MENU * menu) +NCURSES_EXPORT(void) +_nc_Link_Items (MENU * menu) { if (menu && menu->items && *(menu->items)) { @@ -391,7 +398,8 @@ void _nc_Link_Items(MENU * menu) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Show_Menu(const MENU *menu) +NCURSES_EXPORT(void) +_nc_Show_Menu (const MENU *menu) { WINDOW *win; int maxy, maxx; @@ -430,8 +438,9 @@ void _nc_Show_Menu(const MENU *menu) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_New_TopRow_and_CurrentItem(MENU *menu, int new_toprow, - ITEM *new_current_item) +NCURSES_EXPORT(void) +_nc_New_TopRow_and_CurrentItem +(MENU *menu, int new_toprow, ITEM *new_current_item) { ITEM *cur_item; bool mterm_called = FALSE; diff --git a/menu/m_hook.c b/menu/m_hook.c index e031d37e..62f72978 100644 --- a/menu/m_hook.c +++ b/menu/m_hook.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,11 +38,11 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_hook.c,v 1.8 1999/05/16 17:25:24 juergen Exp $") +MODULE_ID("$Id: m_hook.c,v 1.10 2002/07/06 15:22:16 juergen Exp $") /* "Template" macro to generate function to set application specific hook */ #define GEN_HOOK_SET_FUNCTION( typ, name ) \ -int set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\ +NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\ {\ (Normalize_Menu(menu) -> typ ## name = func );\ RETURN(E_OK);\ @@ -49,7 +50,7 @@ int set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\ /* "Template" macro to generate function to get application specific hook */ #define GEN_HOOK_GET_FUNCTION( typ, name ) \ -Menu_Hook typ ## _ ## name ( const MENU *menu )\ +NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\ {\ return (Normalize_Menu(menu) -> typ ## name);\ } diff --git a/menu/m_item_cur.c b/menu/m_item_cur.c index 7ac9f33d..92215f3c 100644 --- a/menu/m_item_cur.c +++ b/menu/m_item_cur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_cur.c,v 1.11 1999/05/16 17:25:34 juergen Exp $") +MODULE_ID("$Id: m_item_cur.c,v 1.13 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -47,7 +48,8 @@ MODULE_ID("$Id: m_item_cur.c,v 1.11 1999/05/16 17:25:34 juergen Exp $") | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_current_item(MENU * menu, ITEM * item) +NCURSES_EXPORT(int) +set_current_item (MENU * menu, ITEM * item) { if (menu && item && (item->imenu==menu)) { @@ -85,7 +87,8 @@ int set_current_item(MENU * menu, ITEM * item) | | Return Values : Item pointer or NULL if failure +--------------------------------------------------------------------------*/ -ITEM *current_item(const MENU * menu) +NCURSES_EXPORT(ITEM *) +current_item (const MENU * menu) { return (menu && menu->items) ? menu->curitem : (ITEM *)0; } @@ -98,7 +101,8 @@ ITEM *current_item(const MENU * menu) | | Return Values : The index or ERR if this is an invalid item pointer +--------------------------------------------------------------------------*/ -int item_index(const ITEM *item) +NCURSES_EXPORT(int) +item_index (const ITEM *item) { return (item && item->imenu) ? item->index : ERR; } diff --git a/menu/m_item_nam.c b/menu/m_item_nam.c index 1be8a6da..0a74c6c6 100644 --- a/menu/m_item_nam.c +++ b/menu/m_item_nam.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_nam.c,v 1.9 1999/05/16 17:25:43 juergen Exp $") +MODULE_ID("$Id: m_item_nam.c,v 1.11 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -47,7 +48,8 @@ MODULE_ID("$Id: m_item_nam.c,v 1.9 1999/05/16 17:25:43 juergen Exp $") | | Return Values : See above; returns NULL if item is invalid +--------------------------------------------------------------------------*/ -const char *item_name(const ITEM * item) +NCURSES_EXPORT(const char *) +item_name (const ITEM * item) { return ((item) ? item->name.str : (char *)0); } @@ -60,7 +62,8 @@ const char *item_name(const ITEM * item) | | Return Values : See above; Returns NULL if item is invalid +--------------------------------------------------------------------------*/ -const char *item_description(const ITEM * item) +NCURSES_EXPORT(const char *) +item_description (const ITEM * item) { return ((item) ? item->description.str : (char *)0); } diff --git a/menu/m_item_new.c b/menu/m_item_new.c index a7b50ada..50dde292 100644 --- a/menu/m_item_new.c +++ b/menu/m_item_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -38,7 +39,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_new.c,v 1.11 1999/05/16 17:28:49 juergen Exp $") +MODULE_ID("$Id: m_item_new.c,v 1.13 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -72,7 +73,8 @@ static bool Is_Printable_String(const char *s) | | Return Values : The item pointer or NULL if creation failed. +--------------------------------------------------------------------------*/ -ITEM *new_item(const char *name, const char *description) +NCURSES_EXPORT(ITEM *) +new_item (const char *name, const char *description) { ITEM *item; @@ -120,7 +122,8 @@ ITEM *new_item(const char *name, const char *description) | E_BAD_ARGUMENT - invalid value has been passed | E_CONNECTED - item is still connected to a menu +--------------------------------------------------------------------------*/ -int free_item(ITEM * item) +NCURSES_EXPORT(int) +free_item (ITEM * item) { if (!item) RETURN( E_BAD_ARGUMENT ); @@ -150,7 +153,8 @@ int free_item(ITEM * item) | E_BAD_ARGUMENT - an invalid value has been passed | E_SYSTEM_ERROR - no memory to store mark +--------------------------------------------------------------------------*/ -int set_menu_mark(MENU * menu, const char * mark) +NCURSES_EXPORT(int) +set_menu_mark (MENU * menu, const char * mark) { int l; @@ -219,7 +223,8 @@ int set_menu_mark(MENU * menu, const char * mark) | | Return Values : The marker string pointer or NULL if no marker defined +--------------------------------------------------------------------------*/ -const char *menu_mark(const MENU * menu) +NCURSES_EXPORT(const char *) +menu_mark (const MENU * menu) { return Normalize_Menu( menu )->mark; } diff --git a/menu/m_item_opt.c b/menu/m_item_opt.c index a37fadcb..c9aed839 100644 --- a/menu/m_item_opt.c +++ b/menu/m_item_opt.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_opt.c,v 1.10 1999/05/16 17:25:52 juergen Exp $") +MODULE_ID("$Id: m_item_opt.c,v 1.12 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -50,7 +51,8 @@ MODULE_ID("$Id: m_item_opt.c,v 1.10 1999/05/16 17:25:52 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid item options +--------------------------------------------------------------------------*/ -int set_item_opts(ITEM *item, Item_Options opts) +NCURSES_EXPORT(int) +set_item_opts (ITEM *item, Item_Options opts) { opts &= ALL_ITEM_OPTS; @@ -90,7 +92,8 @@ int set_item_opts(ITEM *item, Item_Options opts) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int item_opts_off(ITEM *item, Item_Options opts) +NCURSES_EXPORT(int) +item_opts_off (ITEM *item, Item_Options opts) { ITEM *citem = item; /* use a copy because set_item_opts must detect NULL item itself to adjust its behaviour */ @@ -114,7 +117,8 @@ int item_opts_off(ITEM *item, Item_Options opts) | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ -int item_opts_on(ITEM *item, Item_Options opts) +NCURSES_EXPORT(int) +item_opts_on (ITEM *item, Item_Options opts) { ITEM *citem = item; /* use a copy because set_item_opts must detect NULL item itself to adjust its behaviour */ @@ -138,7 +142,8 @@ int item_opts_on(ITEM *item, Item_Options opts) | | Return Values : Items options +--------------------------------------------------------------------------*/ -Item_Options item_opts(const ITEM * item) +NCURSES_EXPORT(Item_Options) +item_opts (const ITEM * item) { return (ALL_ITEM_OPTS & Normalize_Item(item)->opt); } diff --git a/menu/m_item_top.c b/menu/m_item_top.c index cbe092af..04eab641 100644 --- a/menu/m_item_top.c +++ b/menu/m_item_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_top.c,v 1.4 1999/05/16 17:26:01 juergen Exp $") +MODULE_ID("$Id: m_item_top.c,v 1.6 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -49,7 +50,8 @@ MODULE_ID("$Id: m_item_top.c,v 1.4 1999/05/16 17:26:01 juergen Exp $") | E_BAD_ARGUMENT - not a menu pointer or invalid row | E_NOT_CONNECTED - there are no items for the menu +--------------------------------------------------------------------------*/ -int set_top_row(MENU * menu, int row) +NCURSES_EXPORT(int) +set_top_row (MENU * menu, int row) { ITEM *item; @@ -88,7 +90,8 @@ int set_top_row(MENU * menu, int row) | | Return Values : The row number or ERR if there is no row +--------------------------------------------------------------------------*/ -int top_row(const MENU * menu) +NCURSES_EXPORT(int) +top_row (const MENU * menu) { if (menu && menu->items && *(menu->items)) { diff --git a/menu/m_item_use.c b/menu/m_item_use.c index 2659f4b3..4f52ea1a 100644 --- a/menu/m_item_use.c +++ b/menu/m_item_use.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_use.c,v 1.10 1999/05/16 17:26:11 juergen Exp $") +MODULE_ID("$Id: m_item_use.c,v 1.12 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -48,7 +49,8 @@ MODULE_ID("$Id: m_item_use.c,v 1.10 1999/05/16 17:26:11 juergen Exp $") | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_item_userptr(ITEM * item, void * userptr) +NCURSES_EXPORT(int) +set_item_userptr (ITEM * item, void * userptr) { Normalize_Item(item)->userptr = userptr; RETURN( E_OK ); @@ -64,7 +66,8 @@ int set_item_userptr(ITEM * item, void * userptr) | Return Values : Value of the pointer. If no such pointer has been set, | NULL is returned. +--------------------------------------------------------------------------*/ -void *item_userptr(const ITEM * item) +NCURSES_EXPORT(void *) +item_userptr (const ITEM * item) { return Normalize_Item(item)->userptr; } diff --git a/menu/m_item_val.c b/menu/m_item_val.c index cf52d1dd..aa3e43ac 100644 --- a/menu/m_item_val.c +++ b/menu/m_item_val.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_val.c,v 1.8 1999/05/16 17:26:20 juergen Exp $") +MODULE_ID("$Id: m_item_val.c,v 1.10 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -52,7 +53,8 @@ MODULE_ID("$Id: m_item_val.c,v 1.8 1999/05/16 17:26:20 juergen Exp $") | Return Values : E_OK - success | E_REQUEST_DENIED - not selectable or single valued menu +--------------------------------------------------------------------------*/ -int set_item_value(ITEM *item, bool value) +NCURSES_EXPORT(int) +set_item_value (ITEM *item, bool value) { MENU *menu; @@ -92,7 +94,8 @@ int set_item_value(ITEM *item, bool value) | Return Values : TRUE - if item is selected | FALSE - if item is not selected +--------------------------------------------------------------------------*/ -bool item_value(const ITEM *item) +NCURSES_EXPORT(bool) +item_value (const ITEM *item) { return ((Normalize_Item(item)->value) ? TRUE : FALSE); } diff --git a/menu/m_item_vis.c b/menu/m_item_vis.c index dab5ecb3..5ae40ae5 100644 --- a/menu/m_item_vis.c +++ b/menu/m_item_vis.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_vis.c,v 1.10 1999/05/16 17:26:34 juergen Exp $") +MODULE_ID("$Id: m_item_vis.c,v 1.12 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -49,7 +50,8 @@ MODULE_ID("$Id: m_item_vis.c,v 1.10 1999/05/16 17:26:34 juergen Exp $") | Return Values : TRUE if visible | FALSE if invisible +--------------------------------------------------------------------------*/ -bool item_visible(const ITEM * item) +NCURSES_EXPORT(bool) +item_visible (const ITEM * item) { MENU *menu; diff --git a/menu/m_items.c b/menu/m_items.c index 1bda088a..54459e75 100644 --- a/menu/m_items.c +++ b/menu/m_items.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_items.c,v 1.8 1999/05/16 17:26:50 juergen Exp $") +MODULE_ID("$Id: m_items.c,v 1.10 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -52,7 +53,8 @@ MODULE_ID("$Id: m_items.c,v 1.8 1999/05/16 17:26:50 juergen Exp $") | E_BAD_ARGUMENT - An incorrect menu or item array was | passed to the function +--------------------------------------------------------------------------*/ -int set_menu_items(MENU * menu, ITEM ** items) +NCURSES_EXPORT(int) +set_menu_items (MENU * menu, ITEM ** items) { if (!menu || (items && !(*items))) RETURN(E_BAD_ARGUMENT); @@ -81,7 +83,8 @@ int set_menu_items(MENU * menu, ITEM ** items) | | Return Values : NULL on error +--------------------------------------------------------------------------*/ -ITEM **menu_items(const MENU *menu) +NCURSES_EXPORT(ITEM **) +menu_items (const MENU *menu) { return(menu ? menu->items : (ITEM **)0); } @@ -95,7 +98,8 @@ ITEM **menu_items(const MENU *menu) | | Return Values : Number of items or -1 to indicate error. +--------------------------------------------------------------------------*/ -int item_count(const MENU *menu) +NCURSES_EXPORT(int) +item_count (const MENU *menu) { return(menu ? menu->nitems : -1); } diff --git a/menu/m_new.c b/menu/m_new.c index ba2b90cf..b5143e24 100644 --- a/menu/m_new.c +++ b/menu/m_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_new.c,v 1.10 1999/05/16 17:26:59 juergen Exp $") +MODULE_ID("$Id: m_new.c,v 1.12 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -50,7 +51,8 @@ MODULE_ID("$Id: m_new.c,v 1.10 1999/05/16 17:26:59 juergen Exp $") | | Return Values : NULL on error +--------------------------------------------------------------------------*/ -MENU *new_menu(ITEM ** items) +NCURSES_EXPORT(MENU *) +new_menu (ITEM ** items) { MENU *menu = (MENU *)calloc(1,sizeof(MENU)); @@ -87,7 +89,8 @@ MENU *new_menu(ITEM ** items) | E_BAD_ARGUMENT - Invalid menu pointer passed | E_POSTED - Menu is already posted +--------------------------------------------------------------------------*/ -int free_menu(MENU * menu) +NCURSES_EXPORT(int) +free_menu (MENU * menu) { if (!menu) RETURN(E_BAD_ARGUMENT); diff --git a/menu/m_opts.c b/menu/m_opts.c index 1875f418..298d7084 100644 --- a/menu/m_opts.c +++ b/menu/m_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_opts.c,v 1.12 1999/05/16 17:27:08 juergen Exp $") +MODULE_ID("$Id: m_opts.c,v 1.14 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -52,7 +53,8 @@ MODULE_ID("$Id: m_opts.c,v 1.12 1999/05/16 17:27:08 juergen Exp $") | E_BAD_ARGUMENT - invalid menu options | E_POSTED - menu is already posted +--------------------------------------------------------------------------*/ -int set_menu_opts(MENU * menu, Menu_Options opts) +NCURSES_EXPORT(int) +set_menu_opts (MENU * menu, Menu_Options opts) { opts &= ALL_MENU_OPTS; @@ -109,7 +111,8 @@ int set_menu_opts(MENU * menu, Menu_Options opts) | E_BAD_ARGUMENT - invalid options | E_POSTED - menu is already posted +--------------------------------------------------------------------------*/ -int menu_opts_off(MENU *menu, Menu_Options opts) +NCURSES_EXPORT(int) +menu_opts_off (MENU *menu, Menu_Options opts) { MENU *cmenu = menu; /* use a copy because set_menu_opts must detect NULL menu itself to adjust its behaviour */ @@ -138,7 +141,8 @@ int menu_opts_off(MENU *menu, Menu_Options opts) | E_BAD_ARGUMENT - invalid menu options | E_POSTED - menu is already posted +--------------------------------------------------------------------------*/ -int menu_opts_on(MENU * menu, Menu_Options opts) +NCURSES_EXPORT(int) +menu_opts_on (MENU * menu, Menu_Options opts) { MENU *cmenu = menu; /* use a copy because set_menu_opts must detect NULL menu itself to adjust its behaviour */ @@ -162,7 +166,8 @@ int menu_opts_on(MENU * menu, Menu_Options opts) | | Return Values : Menu options +--------------------------------------------------------------------------*/ -Menu_Options menu_opts(const MENU *menu) +NCURSES_EXPORT(Menu_Options) +menu_opts (const MENU *menu) { return (ALL_MENU_OPTS & Normalize_Menu( menu )->opt); } diff --git a/menu/m_pad.c b/menu/m_pad.c index 18022832..8a3382ea 100644 --- a/menu/m_pad.c +++ b/menu/m_pad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_pad.c,v 1.4 1999/05/16 17:27:17 juergen Exp $") +MODULE_ID("$Id: m_pad.c,v 1.6 2002/07/06 15:22:16 juergen Exp $") /* Macro to redraw menu if it is posted and changed */ #define Refresh_Menu(menu) \ @@ -58,7 +59,8 @@ MODULE_ID("$Id: m_pad.c,v 1.4 1999/05/16 17:27:17 juergen Exp $") | Return Values : E_OK - success | E_BAD_ARGUMENT - an invalid value has been passed +--------------------------------------------------------------------------*/ -int set_menu_pad(MENU *menu, int pad) +NCURSES_EXPORT(int) +set_menu_pad (MENU *menu, int pad) { bool do_refresh = (menu != (MENU*)0); @@ -82,7 +84,8 @@ int set_menu_pad(MENU *menu, int pad) | | Return Values : The pad character +--------------------------------------------------------------------------*/ -int menu_pad(const MENU * menu) +NCURSES_EXPORT(int) +menu_pad (const MENU * menu) { return (Normalize_Menu( menu ) -> pad); } diff --git a/menu/m_pattern.c b/menu/m_pattern.c index 7187c224..34870012 100644 --- a/menu/m_pattern.c +++ b/menu/m_pattern.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_pattern.c,v 1.4 1999/05/16 17:27:28 juergen Exp $") +MODULE_ID("$Id: m_pattern.c,v 1.7 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -50,7 +51,8 @@ MODULE_ID("$Id: m_pattern.c,v 1.4 1999/05/16 17:27:28 juergen Exp $") | pattern is stored | PatternString - as expected +--------------------------------------------------------------------------*/ -char *menu_pattern(const MENU * menu) +NCURSES_EXPORT(char *) +menu_pattern (const MENU * menu) { return (menu ? (menu->pattern ? menu->pattern : "") : (char *)0); } @@ -68,7 +70,8 @@ char *menu_pattern(const MENU * menu) | E_BAD_STATE - menu in user hook routine | E_NO_MATCH - no item matches pattern +--------------------------------------------------------------------------*/ -int set_menu_pattern(MENU *menu, const char *p) +NCURSES_EXPORT(int) +set_menu_pattern (MENU *menu, const char *p) { ITEM *matchitem; int matchpos; @@ -99,7 +102,7 @@ int set_menu_pattern(MENU *menu, const char *p) while(*p) { - if ( !isprint(*p) || + if ( !isprint((unsigned char)(*p)) || (_nc_Match_Next_Character_In_Item_Name(menu,*p,&matchitem) != E_OK) ) { Reset_Pattern(menu); diff --git a/menu/m_post.c b/menu/m_post.c index 8825f3e5..8751712b 100644 --- a/menu/m_post.c +++ b/menu/m_post.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_post.c,v 1.16 1999/05/16 17:27:38 juergen Exp $") +MODULE_ID("$Id: m_post.c,v 1.18 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -48,7 +49,8 @@ MODULE_ID("$Id: m_post.c,v 1.16 1999/05/16 17:27:38 juergen Exp $") | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Post_Item(const MENU * menu, const ITEM * item) +NCURSES_EXPORT(void) +_nc_Post_Item (const MENU * menu, const ITEM * item) { int i; chtype ch; @@ -189,7 +191,8 @@ void _nc_Post_Item(const MENU * menu, const ITEM * item) | | Return Values : - +--------------------------------------------------------------------------*/ -void _nc_Draw_Menu(const MENU * menu) +NCURSES_EXPORT(void) +_nc_Draw_Menu (const MENU * menu) { ITEM *item = menu->items[0]; ITEM *lasthor, *lastvert; @@ -257,7 +260,8 @@ void _nc_Draw_Menu(const MENU * menu) | E_BAD_STATE - Menu in userexit routine | E_POSTED - Menu already posted +--------------------------------------------------------------------------*/ -int post_menu(MENU * menu) +NCURSES_EXPORT(int) +post_menu (MENU * menu) { if (!menu) RETURN(E_BAD_ARGUMENT); @@ -330,7 +334,8 @@ int post_menu(MENU * menu) | E_BAD_STATE - menu in userexit routine | E_NOT_POSTED - menu is not posted +--------------------------------------------------------------------------*/ -int unpost_menu(MENU * menu) +NCURSES_EXPORT(int) +unpost_menu (MENU * menu) { WINDOW *win; diff --git a/menu/m_req_name.c b/menu/m_req_name.c index d90d0afc..758721ba 100644 --- a/menu/m_req_name.c +++ b/menu/m_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_req_name.c,v 1.12 1999/05/16 17:27:47 juergen Exp $") +MODULE_ID("$Id: m_req_name.c,v 1.14 2002/07/06 15:22:16 juergen Exp $") static const char *request_names[ MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1 ] = { "LEFT_ITEM" , @@ -69,7 +70,8 @@ static const char *request_names[ MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1 ] = { | Return Values : Pointer to name - on success | NULL - on invalid request code +--------------------------------------------------------------------------*/ -const char *menu_request_name( int request ) +NCURSES_EXPORT(const char *) +menu_request_name ( int request ) { if ( (request < MIN_MENU_COMMAND) || (request > MAX_MENU_COMMAND) ) { @@ -90,7 +92,8 @@ const char *menu_request_name( int request ) | Return Values : Request Id - on success | E_NO_MATCH - request not found +--------------------------------------------------------------------------*/ -int menu_request_by_name( const char *str ) +NCURSES_EXPORT(int) +menu_request_by_name ( const char *str ) { /* because the table is so small, it doesn't really hurt to run sequentially through it. diff --git a/menu/m_scale.c b/menu/m_scale.c index d6f964bf..a6daf027 100644 --- a/menu/m_scale.c +++ b/menu/m_scale.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_scale.c,v 1.4 1999/05/16 17:28:00 juergen Exp $") +MODULE_ID("$Id: m_scale.c,v 1.6 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -50,7 +51,8 @@ MODULE_ID("$Id: m_scale.c,v 1.4 1999/05/16 17:28:00 juergen Exp $") | E_BAD_ARGUMENT - invalid menu pointer | E_NOT_CONNECTED - no items are connected to menu +--------------------------------------------------------------------------*/ -int scale_menu(const MENU *menu, int *rows, int *cols) +NCURSES_EXPORT(int) +scale_menu (const MENU *menu, int *rows, int *cols) { if (!menu) RETURN( E_BAD_ARGUMENT ); diff --git a/menu/m_spacing.c b/menu/m_spacing.c index 1d035ab0..25e54e0d 100644 --- a/menu/m_spacing.c +++ b/menu/m_spacing.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_spacing.c,v 1.11 1999/05/16 17:28:09 juergen Exp $") +MODULE_ID("$Id: m_spacing.c,v 1.13 2002/07/06 15:22:16 juergen Exp $") #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8) #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8) @@ -51,7 +52,9 @@ MODULE_ID("$Id: m_spacing.c,v 1.11 1999/05/16 17:28:09 juergen Exp $") | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col ) +NCURSES_EXPORT(int) +set_menu_spacing +(MENU *menu, int s_desc, int s_row, int s_col ) { MENU *m; /* split for ATAC workaround */ m = Normalize_Menu(menu); @@ -82,7 +85,8 @@ int set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col ) | | Return Values : E_OK - on success +--------------------------------------------------------------------------*/ -int menu_spacing( const MENU *menu, int* s_desc, int* s_row, int* s_col) +NCURSES_EXPORT(int) +menu_spacing ( const MENU *menu, int* s_desc, int* s_row, int* s_col) { const MENU *m; /* split for ATAC workaround */ m = Normalize_Menu(menu); diff --git a/menu/m_sub.c b/menu/m_sub.c index 35a361e6..76cb0021 100644 --- a/menu/m_sub.c +++ b/menu/m_sub.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_sub.c,v 1.4 1999/05/16 17:28:20 juergen Exp $") +MODULE_ID("$Id: m_sub.c,v 1.6 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -48,7 +49,8 @@ MODULE_ID("$Id: m_sub.c,v 1.4 1999/05/16 17:28:20 juergen Exp $") | Return Values : E_OK - success | E_POSTED - menu is already posted +--------------------------------------------------------------------------*/ -int set_menu_sub(MENU *menu, WINDOW *win) +NCURSES_EXPORT(int) +set_menu_sub (MENU *menu, WINDOW *win) { if (menu) { @@ -71,7 +73,8 @@ int set_menu_sub(MENU *menu, WINDOW *win) | | Return Values : NULL on error, otherwise a pointer to the window +--------------------------------------------------------------------------*/ -WINDOW *menu_sub(const MENU * menu) +NCURSES_EXPORT(WINDOW *) +menu_sub (const MENU * menu) { const MENU* m = Normalize_Menu(menu); return Get_Menu_Window(m); diff --git a/menu/m_userptr.c b/menu/m_userptr.c index 45818a3e..908758b1 100644 --- a/menu/m_userptr.c +++ b/menu/m_userptr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_userptr.c,v 1.10 1999/05/16 17:28:29 juergen Exp $") +MODULE_ID("$Id: m_userptr.c,v 1.12 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -48,7 +49,8 @@ MODULE_ID("$Id: m_userptr.c,v 1.10 1999/05/16 17:28:29 juergen Exp $") | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -int set_menu_userptr(MENU * menu, void * userptr) +NCURSES_EXPORT(int) +set_menu_userptr (MENU * menu, void * userptr) { Normalize_Menu(menu)->userptr = userptr; RETURN( E_OK ); @@ -64,7 +66,8 @@ int set_menu_userptr(MENU * menu, void * userptr) | Return Values : Value of the pointer. If no such pointer has been set, | NULL is returned +--------------------------------------------------------------------------*/ -void *menu_userptr(const MENU * menu) +NCURSES_EXPORT(void *) +menu_userptr (const MENU * menu) { return( Normalize_Menu(menu)->userptr); } diff --git a/menu/m_win.c b/menu/m_win.c index 73f34b5c..5fe760c8 100644 --- a/menu/m_win.c +++ b/menu/m_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -37,7 +38,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_win.c,v 1.9 1999/05/16 17:28:37 juergen Exp $") +MODULE_ID("$Id: m_win.c,v 1.11 2002/07/06 15:22:16 juergen Exp $") /*--------------------------------------------------------------------------- | Facility : libnmenu @@ -48,7 +49,8 @@ MODULE_ID("$Id: m_win.c,v 1.9 1999/05/16 17:28:37 juergen Exp $") | Return Values : E_OK - success | E_POSTED - menu is already posted +--------------------------------------------------------------------------*/ -int set_menu_win(MENU *menu, WINDOW *win) +NCURSES_EXPORT(int) +set_menu_win (MENU *menu, WINDOW *win) { if (menu) { @@ -71,7 +73,8 @@ int set_menu_win(MENU *menu, WINDOW *win) | | Return Values : NULL on error, otherwise pointer to window +--------------------------------------------------------------------------*/ -WINDOW *menu_win(const MENU *menu) +NCURSES_EXPORT(WINDOW *) +menu_win (const MENU *menu) { const MENU* m = Normalize_Menu(menu); return (m->userwin ? m->userwin : stdscr); diff --git a/menu/menu.h b/menu/menu.h index 5be728b1..d8270722 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ #ifndef ETI_MENU @@ -170,82 +171,82 @@ typedef struct tagMENU /* --------- prototypes for libmenu functions ----------------------------- */ -extern ITEM **menu_items(const MENU *), - *current_item(const MENU *), - *new_item(const char *,const char *); - -extern MENU *new_menu(ITEM **); - -extern Item_Options item_opts(const ITEM *); -extern Menu_Options menu_opts(const MENU *); - -Menu_Hook item_init(const MENU *), - item_term(const MENU *), - menu_init(const MENU *), - menu_term(const MENU *); - -extern WINDOW *menu_sub(const MENU *), - *menu_win(const MENU *); - -extern const char *item_description(const ITEM *), - *item_name(const ITEM *), - *menu_mark(const MENU *), - *menu_request_name(int); - -extern char *menu_pattern(const MENU *); - -extern void *menu_userptr(const MENU *), - *item_userptr(const ITEM *); - -extern chtype menu_back(const MENU *), - menu_fore(const MENU *), - menu_grey(const MENU *); - -extern int free_item(ITEM *), - free_menu(MENU *), - item_count(const MENU *), - item_index(const ITEM *), - item_opts_off(ITEM *,Item_Options), - item_opts_on(ITEM *,Item_Options), - menu_driver(MENU *,int), - menu_opts_off(MENU *,Menu_Options), - menu_opts_on(MENU *,Menu_Options), - menu_pad(const MENU *), - pos_menu_cursor(const MENU *), - post_menu(MENU *), - scale_menu(const MENU *,int *,int *), - set_current_item(MENU *menu,ITEM *item), - set_item_init(MENU *,void(*)(MENU *)), - set_item_opts(ITEM *,Item_Options), - set_item_term(MENU *,void(*)(MENU *)), - set_item_userptr(ITEM *, void *), - set_item_value(ITEM *,bool), - set_menu_back(MENU *,chtype), - set_menu_fore(MENU *,chtype), - set_menu_format(MENU *,int,int), - set_menu_grey(MENU *,chtype), - set_menu_init(MENU *,void(*)(MENU *)), - set_menu_items(MENU *,ITEM **), - set_menu_mark(MENU *, const char *), - set_menu_opts(MENU *,Menu_Options), - set_menu_pad(MENU *,int), - set_menu_pattern(MENU *,const char *), - set_menu_sub(MENU *,WINDOW *), - set_menu_term(MENU *,void(*)(MENU *)), - set_menu_userptr(MENU *,void *), - set_menu_win(MENU *,WINDOW *), - set_top_row(MENU *,int), - top_row(const MENU *), - unpost_menu(MENU *), - menu_request_by_name(const char *), - set_menu_spacing(MENU *,int,int,int), - menu_spacing(const MENU *,int *,int *,int *); - - -extern bool item_value(const ITEM *), - item_visible(const ITEM *); - -void menu_format(const MENU *,int *,int *); +extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); +extern NCURSES_EXPORT(ITEM *) current_item (const MENU *); +extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *); + +extern NCURSES_EXPORT(MENU *) new_menu (ITEM **); + +extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *); +extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *); + +extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *); +extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *); +extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *); +extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *); + +extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *); +extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *); + +extern NCURSES_EXPORT(const char *) item_description (const ITEM *); +extern NCURSES_EXPORT(const char *) item_name (const ITEM *); +extern NCURSES_EXPORT(const char *) menu_mark (const MENU *); +extern NCURSES_EXPORT(const char *) menu_request_name (int); + +extern NCURSES_EXPORT(char *) menu_pattern (const MENU *); + +extern NCURSES_EXPORT(void *) menu_userptr (const MENU *); +extern NCURSES_EXPORT(void *) item_userptr (const ITEM *); + +extern NCURSES_EXPORT(chtype) menu_back (const MENU *); +extern NCURSES_EXPORT(chtype) menu_fore (const MENU *); +extern NCURSES_EXPORT(chtype) menu_grey (const MENU *); + +extern NCURSES_EXPORT(int) free_item (ITEM *); +extern NCURSES_EXPORT(int) free_menu (MENU *); +extern NCURSES_EXPORT(int) item_count (const MENU *); +extern NCURSES_EXPORT(int) item_index (const ITEM *); +extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options); +extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options); +extern NCURSES_EXPORT(int) menu_driver (MENU *,int); +extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options); +extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options); +extern NCURSES_EXPORT(int) menu_pad (const MENU *); +extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *); +extern NCURSES_EXPORT(int) post_menu (MENU *); +extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *); +extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item); +extern NCURSES_EXPORT(int) set_item_init (MENU *,void(*)(MENU *)); +extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options); +extern NCURSES_EXPORT(int) set_item_term (MENU *,void(*)(MENU *)); +extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *); +extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool); +extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype); +extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype); +extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int); +extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype); +extern NCURSES_EXPORT(int) set_menu_init (MENU *,void(*)(MENU *)); +extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **); +extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *); +extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options); +extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int); +extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *); +extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *); +extern NCURSES_EXPORT(int) set_menu_term (MENU *,void(*)(MENU *)); +extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *); +extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *); +extern NCURSES_EXPORT(int) set_top_row (MENU *,int); +extern NCURSES_EXPORT(int) top_row (const MENU *); +extern NCURSES_EXPORT(int) unpost_menu (MENU *); +extern NCURSES_EXPORT(int) menu_request_by_name (const char *); +extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); +extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); + + +extern NCURSES_EXPORT(bool) item_value (const ITEM *); +extern NCURSES_EXPORT(bool) item_visible (const ITEM *); + +extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *); #ifdef __cplusplus } diff --git a/menu/menu.priv.h b/menu/menu.priv.h index 4c2a22d1..b249e435 100644 --- a/menu/menu.priv.h +++ b/menu/menu.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /*************************************************************************** @@ -35,14 +36,20 @@ * Top level private header file for all libnmenu modules * ***************************************************************************/ +#ifndef MENU_PRIV_H_incl +#define MENU_PRIV_H_incl 1 + +#include +#include + #include "mf_common.h" #include "menu.h" /* Backspace code */ #define BS (8) -extern ITEM _nc_Default_Item; -extern MENU _nc_Default_Menu; +extern NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item; +extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; /* Normalize item to default if none was given */ #define Normalize_Item( item ) ((item)=(item)?(item):&_nc_Default_Item) @@ -101,14 +108,16 @@ extern MENU _nc_Default_Menu; (menu)->pattern[0] = '\0'; } /* Internal functions. */ -extern void _nc_Draw_Menu(const MENU *); -extern void _nc_Show_Menu(const MENU *); -extern void _nc_Calculate_Item_Length_and_Width(MENU *); -extern void _nc_Post_Item(const MENU *, const ITEM *); -extern bool _nc_Connect_Items(MENU *, ITEM **); -extern void _nc_Disconnect_Items(MENU *); -extern void _nc_New_TopRow_and_CurrentItem(MENU *,int, ITEM *); -extern void _nc_Link_Items(MENU *); -extern int _nc_Match_Next_Character_In_Item_Name(MENU*,int,ITEM**); -extern int _nc_menu_cursor_pos(const MENU* menu, const ITEM* item, +extern NCURSES_EXPORT(void) _nc_Draw_Menu (const MENU *); +extern NCURSES_EXPORT(void) _nc_Show_Menu (const MENU *); +extern NCURSES_EXPORT(void) _nc_Calculate_Item_Length_and_Width (MENU *); +extern NCURSES_EXPORT(void) _nc_Post_Item (const MENU *, const ITEM *); +extern NCURSES_EXPORT(bool) _nc_Connect_Items (MENU *, ITEM **); +extern NCURSES_EXPORT(void) _nc_Disconnect_Items (MENU *); +extern NCURSES_EXPORT(void) _nc_New_TopRow_and_CurrentItem (MENU *,int, ITEM *); +extern NCURSES_EXPORT(void) _nc_Link_Items (MENU *); +extern NCURSES_EXPORT(int) _nc_Match_Next_Character_In_Item_Name (MENU*,int,ITEM**); +extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* item, int* pY, int* pX); + +#endif /* MENU_PRIV_H_incl */ diff --git a/menu/mf_common.h b/menu/mf_common.h index 6b1e8fee..40ed1e29 100644 --- a/menu/mf_common.h +++ b/menu/mf_common.h @@ -27,14 +27,17 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1995,1997 * + * Author: Juergen Pfeifer, 1995,1997 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /* Common internal header for menu and form library */ -#if HAVE_CONFIG_H -# include -#endif +#ifndef MF_COMMON_H_incl +#define MF_COMMON_H_incl 1 + +#include +#include #include #include @@ -91,3 +94,5 @@ extern int errno; # define INLINE inline # endif #endif + +#endif /* MF_COMMON_H_incl */ diff --git a/misc/Makefile.in b/misc/Makefile.in index 4ea04461..b8f25b8e 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.29 2000/09/30 20:01:10 tom Exp $ +# $Id: Makefile.in,v 1.34 2002/01/12 23:54:39 Robert.Joop Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -40,7 +40,7 @@ # and the programs with the configured default model. # turn off _all_ suffix rules; we'll generate our own -.SUFFIXES: +.SUFFIXES : SHELL = /bin/sh THIS = Makefile @@ -57,6 +57,9 @@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ +CC = @CC@ +HOSTCC = @BUILD_CC@ + tabsetdir = $(datadir)/tabset ticdir = @TERMINFO@ source = @TERMINFO_SRC@ @@ -65,11 +68,13 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ ################################################################################ -all: +all : + +depend : -sources: +sources : -install: install.data +install : install.data install.data : $(DESTDIR)$(libdir) \ $(DESTDIR)$(ticdir) \ @@ -83,9 +88,11 @@ install.data : $(DESTDIR)$(libdir) \ datadir=${datadir} \ ticdir=${ticdir} \ source=${source} \ - $(SHELL) ./run_tic.sh + THIS_CC="$(CC)" \ + THAT_CC="$(HOSTCC)" \ + sh ./run_tic.sh @cd $(srcdir)/tabset && \ - $(SHELL) -c 'for i in * ; do \ + sh -c 'for i in * ; do \ if test -f $$i ; then \ echo installing $$i; \ $(INSTALL_DATA) $$i $(DESTDIR)$(tabsetdir)/$$i; \ @@ -94,27 +101,27 @@ install.data : $(DESTDIR)$(libdir) \ $(DESTDIR)$(libdir) \ $(DESTDIR)$(tabsetdir) \ $(DESTDIR)$(ticdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ -uninstall: uninstall.data +uninstall : uninstall.data -uninstall.data: +uninstall.data : -cd $(DESTDIR)$(ticdir) && rm -rf * -cd $(DESTDIR)$(tabsetdir) && rm -rf * -tags: +tags : -@MAKE_UPPER_TAGS@TAGS: +@MAKE_UPPER_TAGS@TAGS : -mostlyclean: - -rm -f core tags TAGS *~ *.ln *.atac trace +mostlyclean : + -rm -f core tags TAGS *~ *.bak *.ln *.atac trace clean :: mostlyclean -distclean: clean +distclean : clean -rm -f Makefile run_tic.sh -realclean: distclean +realclean : distclean ############################################################################### # The remainder of this file is automatically generated during configuration diff --git a/misc/makellib b/misc/makellib index fe9f99f1..04604073 100755 --- a/misc/makellib +++ b/misc/makellib @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,9 +27,9 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996,1997,2000 # -# $Id: makellib,v 1.7 1998/02/11 12:13:50 tom Exp $ +# $Id: makellib,v 1.8 2000/10/28 21:37:10 tom Exp $ # System-dependent wrapper for 'lint' that creates a lint-library via the # following method (XXX is the name of the library): # a. If the file llib-lXXX doesn't exist, create it using the make-rule @@ -116,6 +116,11 @@ Solaris) TARGET=$llib.c ln $llib $TARGET ;; +FreeBSD) + CREATE="-g -z -C$LLIB" + TARGET=$llib.c + ln $llib $TARGET + ;; CLIX) CREATE="-DLINTLIBRARY -vxo$LLIB" TARGET=$llib.c diff --git a/misc/run_tic.in b/misc/run_tic.in index 59ae3279..295ae078 100644 --- a/misc/run_tic.in +++ b/misc/run_tic.in @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996,2000 # -# $Id: run_tic.in,v 1.10 2000/10/09 22:57:35 tom Exp $ +# $Id: run_tic.in,v 1.11 2001/10/14 00:44:33 tom Exp $ # This script is used to install terminfo.src using tic. We use a script # because the path checking is too awkward to do in a makefile. # @@ -52,15 +52,21 @@ echo '** Building terminfo database, please wait...' : ${ticdir=@TERMINFO@} : ${source=@TERMINFO_SRC@} : ${LN_S="@LN_S@"} +: ${THAT_CC=cc} +: ${THIS_CC=cc} test -z "${DESTDIR}" && DESTDIR= -# Allow tic to run either from the install-path, or from the build-directory +# Allow tic to run either from the install-path, or from the build-directory. +# Do not do this if we appear to be cross-compiling. In that case, we rely +# on the host's copy of tic to compile the terminfo database. +if test "$THAT_CC" = "$THIS_CC" ; then case "$PATH" in :*) PATH=../progs:${DESTDIR}$bindir$PATH ;; *) PATH=../progs:${DESTDIR}$bindir:$PATH ;; esac export PATH +fi # # set another env var that doesn't get reset when `shlib' runs, so `shlib' uses diff --git a/misc/tdlint b/misc/tdlint index 869a34bf..c0e652b6 100755 --- a/misc/tdlint +++ b/misc/tdlint @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996 # -# $Id: tdlint,v 1.4 1998/02/11 12:13:50 tom Exp $ +# $Id: tdlint,v 1.5 2000/10/28 20:53:36 tom Exp $ # # Lint-script that allows user's own lint libraries, in addition to the ones # installed in the system. @@ -48,6 +48,8 @@ else ;; IRIX) set - $* -n -lc ;; + FreeBSD) set - $* -g -p -u -v -z + ;; SunOS) case `uname -r` in 5.*) ARCH=Solaris diff --git a/misc/terminfo.src b/misc/terminfo.src index 9e58d167..03add0e1 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -1,11 +1,16 @@ ######## TERMINAL TYPE DESCRIPTIONS SOURCE FILE # # This version of terminfo.src is distributed with ncurses. -# Report bugs to +# Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # +# The original header is preserved below for reference. It is noted that there +# is a newer version which differs in some cosmetic details; we have decided +# to not change the header unless there is also a change in content. +# +#------------------------------------------------------------------------------ # Version 10.2.1 -# $Date: 2000/09/24 02:29:16 $ +# $Date: 2002/10/05 18:40:53 $ # terminfo syntax # # Eric S. Raymond (current maintainer) @@ -329,11 +334,11 @@ ansi+sgrul|ansi underline only, rmul=\E[m, smul=\E[4m, ansi+sgrbold|ansi graphic renditions; assuming terminal has bold; not dim, bold=\E[1m, - sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m, + sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;%?%p7%t8;%;m, use=ansi+sgr, use=ansi+sgrso, use=ansi+sgrul, ansi+sgrdim|ansi graphic renditions; assuming terminal has dim; not bold, dim=\E[2m, - sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p5%t2;%;m, + sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p5%t2;%;%?%p7%t8;%;m, use=ansi+sgr, use=ansi+sgrso, use=ansi+sgrul, ansi+pp|ansi printer port, mc0=\E[0i, mc4=\E[4i, mc5=\E[5i, @@ -657,12 +662,6 @@ beterm|BeOS Terminal, # * * # *************************************************************************** # -# The 1.3.x kernels add color-change capabilities; if yours doesn't have this -# and it matters, turn off . The %02x escape used to implement this is -# not back-portable to SV curses and not supported in ncurses versions before -# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size -# themselves; this entry assumes that capability. -# # This entry is good for the 1.2.13 or later version of the Linux console. # # *************************************************************************** @@ -683,25 +682,18 @@ beterm|BeOS Terminal, # * * # *************************************************************************** # -# The 1.3.x kernels add color-change capabilities; if yours doesn't have this -# and it matters, turn off . The %02x escape used to implement this is -# not back-portable to SV curses and not supported in ncurses versions before -# 1.9.9. All linux kernels since 1.2.13 (at least) set the screen size +# All linux kernels since 1.2.13 (at least) set the screen size # themselves; this entry assumes that capability. # -# The 2.2.x kernels add a private mode that sets the cursor type; use that to -# get a block cursor for cvvis. -# reported by Frank Heckenbach . -linux|linux console, +linux-basic|linux console, am, bce, eo, mir, msgr, xenl, xon, it#8, ncv#18, acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, - bel=^G, civis=\E[?25l\E[?1c, clear=\E[H\E[J, - cnorm=\E[?25h\E[?0c, cr=^M, csr=\E[%i%p1%d;%p2%dr, + bel=^G, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu1=\E[A, cvvis=\E[?25h\E[?8c, dch=\E[%p1%dP, dch1=\E[P, - dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, - el=\E[K, el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H, + cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, + dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, + el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, @@ -717,19 +709,32 @@ linux|linux console, smir=\E[4h, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, vpa=\E[%i%p1%dd, use=klone+sgr, use=ecma+color, + linux-m|Linux console no color, colors@, pairs@, setab@, setaf@, setb@, setf@, use=linux, -linux-c-nc|linux console 1.3.x hack for ncurses only, + +# The 1.3.x kernels add color-change capabilities; if yours doesn't have this +# and it matters, turn off . The %02x escape used to implement this is +# not supposedly back-portable to older SV curses (although it has worked fine +# on Solaris for several years) and not supported in ncurses versions before +# 1.9.9. +linux-c-nc|linux console with color-change, ccc, - initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x, - oc=\E]R, use=linux, + initc=\E]P%p1%x%p2%{256}%*%{1000}%/%02x%p3%{256}%*%{1000}%/%02x%p4%{256}%*%{1000}%/%02x, + oc=\E]R, use=linux-basic, # From: Dennis Henriksen , 9 July 1996 -linux-c|linux console 1.3.6+ with private palette for each virtual console, +linux-c|linux console 1.3.6+ for older ncurses, ccc, - colors#8, pairs#64, - initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;, - oc=\E]R, use=linux, + initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p3%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p4%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;, + oc=\E]R, use=linux-basic, + +# The 2.2.x kernels add a private mode that sets the cursor type; use that to +# get a block cursor for cvvis. +# reported by Frank Heckenbach . +linux|linux console, + civis=\E[?25l\E[?1c, cnorm=\E[?25h\E[?0c, + cvvis=\E[?25h\E[?8c, use=linux-c-nc, # See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file linux-nic|linux with ich/ich1 suppressed for non-curses programs, @@ -763,7 +768,7 @@ mach|Mach Console, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, il=\E[%p1%dL, il1=\E[L, ind=^J, - kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kbs=\177, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[9, kend=\E[Y, kf1=\EOP, kf10=\EOY, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW, kf9=\EOX, khome=\E[H, kich1=\E[@, kll=\E[F, knp=\E[U, @@ -799,21 +804,37 @@ pmcons|pmconsole|PMAX console, # # klone+sgr-dumb is an error since the acsc does not match -TD # -# In this description based on SCO's keyboard(HW) manpage list of default function key -# values: +# In this description based on SCO's keyboard(HW) manpage list of default +# function key values: # F13-F24 are shifted F1-F12 # F25-F36 are control F1-F12 # F37-F48 are shift+control F1-F12 -scoansi|SCO Extended ANSI standard crt, - OTbs, am, eo, xon, +# +# hpa/vpa work in the console, but not in scoterm: +# hpa=\E[%p1%dG, +# vpa=\E[%p1%dd, +# +# SCO's terminfo uses +# kLFT=\E[d, +# kRIT=\E[c, +# which do not work (console or scoterm). +# +# Console documents only 3 attributes can be set with SGR (so we don't use sgr). +scoansi-old|SCO Extended ANSI standard crt (5.0.5), + OTbs, am, bce, eo, xon, colors#8, cols#80, it#8, lines#25, pairs#64, - acsc=0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`ja0fxgqh2jYk?lZm@nEqDtCu4vAwBx3~y, - blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[2J, - cub1=\E[D, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, - cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, - ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S, invis=\E[8m, kbeg=\E[E, - kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, - kcuu1=\E[A, kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W, + acsc=-\230.\231\,.+/0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`\204a0fxgqh2jYk?lZm@nEqDtCu4vAwBx3yszr{c}\034~\207, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, + civis=\E[=14;12C, clear=\E[H\E[2J, cnorm=\E[=10;12C, + cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[=0;12C, dch=\E[%p1%dP, + dch1=\E[P, dispc=\E[=%p1%dg, dl=\E[%p1%dM, dl1=\E[M, + ed=\E[m\E[J, el=\E[m\E[K, el1=\E[1K, home=\E[H, ht=^I, + hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, + ind=\E[S, indn=\E[%p1%dS, invis=\E[8m, kbeg=\E[E, kbs=^H, + kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, + kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W, kf12=\E[X, kf13=\E[Y, kf15=\E[a, kf16=\E[b, kf17=\E[c, kf18=\E[d, kf19=\E[e, kf2=\E[N, kf20=\E[f, kf21=\E[g, kf22=\E[h, kf23=\E[i, kf24=\E[j, kf25=\E[k, kf26=\E[l, @@ -823,11 +844,26 @@ scoansi|SCO Extended ANSI standard crt, kf40=\E[z, kf41=\E[@, kf42=\E[[, kf43=\E[\\, kf44=\E[], kf45=\E[\^, kf46=\E[_, kf47=\E[`, kf48=\E[{, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, - kich1=\E[L, knp=\E[G, kpp=\E[I, op=\E[37;40m, rev=\E[7m, - ri=\E[T, rmacs=\E[10m, rmso=\E[m, rmul=\E[m, - setab=\E[4%p1%dm, setaf=\E[3%p1%dm, - sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m, - sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m, + kich1=\E[L, knp=\E[G, kpp=\E[I, op=\E[0;37;40m, rc=\E8, + rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, rmacs=\E[10m, + rmam=\E[?7l, rmso=\E[m, rmul=\E[m, sc=\E7, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[0;10m, + smacs=\E[12m, smam=\E[?7h, smso=\E[7m, smul=\E[4m, +scoansi-new|SCO Extended ANSI standard crt (5.0.6), + km, + civis=\E[=0c, cnorm=\E[=1c, csr=\E[%i%p1%d;%p2%dr, + cvvis=\E[=2c, mgc=\E[=r, oc=\E[51m, op=\E[50m, + rep=\E[%p1%d;%p2%db, rmm=\E[=11L, + sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m, + smgb=\E[=1;0m, smgbp=\E[=1;%i%p1%dm, + smglp=\E[=2;%i%p1%dm, smgr=\E[=3;0m, + smgrp=\E[=3;%i%p1%dm, smgt=\E[=0;0m, + smgtp=\E[=0;%i%p1%dm, smm=\E[=10L, + wind=\E[%i%p1%d;%p2%d;%i%p3%d;%p4%dr, + use=scoansi-old, +# make this easy to change... +scoansi|SCO Extended ANSI standard crt, + use=scoansi-old, # This actually describes the generic SVr4 display driver for Intel boxes. # The isn't documented and therefore may not be reliable. @@ -1263,7 +1299,7 @@ qansi-g|QNX ANSI, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;%?%p3%p1%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;%?%p3%p1%|%t;7%;%?%p7%t;9%;m%?%p9%t\016%e\017%;, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smso=\E[7m, smul=\E[4m, tbc=\E[2g, tsl=\E7\E1;24r\E[?6l\E[25;%i%p1%dH, @@ -1365,6 +1401,16 @@ pcvt50w|dec vt220 emulation with 50 lines and 132 cols, cols#132, lines#50, is2=\E[1;50r\E[50;1H, use=pcvtXX, +# OpenBSD implements a color variation +pcvt25-color|dec vt220 emulation with 25 lines and color, + cols#80, lines#25, + is2=\E[1;25r\E[25;1H, kf1=\EOP, kf10=\E[29~, kf11=\E[23~, + kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, + kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, + kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf5=\E[17~, + kf6=\E[18~, kf7=\E[19~, kf8=\E[20~, kf9=\E[21~, use=pcvtXX, + use=ecma+color, + # Terminfo entries to enable the use of the ncurses library in colour on a # NetBSD-arm32 console (only tested on a RiscPC). # Created by Dave Millen 22.07.98 @@ -1385,11 +1431,11 @@ arm100|arm100-am|Arm(RiscPC) ncurses compatible (for 640x480), kc1=\E[p, kc3=\E[n, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kent=\E[M, kf0=\E[y, kf1=\E[P, kf10=\E[x, kf2=\E[Q, kf3=\E[R, kf4=\E[S, kf5=\E[t, kf6=\E[u, kf7=\E[v, - kf8=\E[l, kf9=\E[w, rc=\E8, rev=\E[6m$<2>, ri=\EM$<5>, + kf8=\E[l, kf9=\E[w, rc=\E8, rev=\E[7m$<2>, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;$<2>, sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, use=ecma+sgr, use=klone+color, @@ -1491,6 +1537,12 @@ mgterm, # # Setting colors turns off reverse; we cannot guarantee order, so use ncv. # Note that this disables standout with color. +# +# The emulator sends difference strings based on shift- and control-keys, +# like scoansi: +# F13-F24 are shifted F1-F12 +# F25-F36 are control F1-F12 +# F37-F48 are shift+control F1-F12 cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode), am, bce, bw, eo, msgr, npc, colors#8, cols#80, it#8, lines#25, ncv#21, pairs#64, @@ -1504,12 +1556,19 @@ cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode), il=\E[%p1%dL, il1=\E[L, ind=\E[S, indn=\E[%p1%dS, kb2=\E[E, kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V, - kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q, - kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, - kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, op=\E[x, rev=\E[7m, - ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, rs2=\E[x\E[m\Ec, - setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m, - smso=\E[7m, vpa=\E[%i%p1%dd, + kf11=\E[W, kf12=\E[X, kf13=\E[Y, kf14=\E[Z, kf15=\E[a, + kf16=\E[b, kf17=\E[c, kf18=\E[d, kf19=\E[e, kf2=\E[N, + kf20=\E[f, kf21=\E[g, kf22=\E[h, kf23=\E[i, kf24=\E[j, + kf25=\E[k, kf26=\E[l, kf27=\E[m, kf28=\E[n, kf29=\E[o, + kf3=\E[O, kf30=\E[p, kf31=\E[q, kf32=\E[r, kf33=\E[s, + kf34=\E[t, kf35=\E[u, kf36=\E[v, kf37=\E[w, kf38=\E[x, + kf39=\E[y, kf4=\E[P, kf40=\E[z, kf41=\E[@, kf42=\E[[, + kf43=\E[\\, kf44=\E[], kf45=\E[\^, kf46=\E[_, kf47=\E[`, + kf48=\E[{, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, + khome=\E[H, kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, + op=\E[x, rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, + rs2=\E[x\E[m\Ec, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr0=\E[m, smso=\E[7m, vpa=\E[%i%p1%dd, cons25|ansis|ansi80x25|freebsd console (25-line ansi mode), acsc=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371, use=cons25w, @@ -1802,7 +1861,7 @@ vt100|vt100-am|dec vt100 (w/advanced video), rev=\E[7m$<2>, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<2>, sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, vt100nam|vt100-nam|vt100 no automargins, @@ -1925,7 +1984,7 @@ vt220-old|vt200-old|DEC VT220 in vt100 emulation mode, ri=\EM$<14/>, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;$<2>, sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h, smso=\E[7m, smul=\E[4m, @@ -2030,7 +2089,7 @@ vt200-js|vt220-js|dec vt200 series with jump scroll, is2=\E[61"p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E>\E[m, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=^M\ED, rc=\E8, - rf=/usr/lib/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l, + rf=/usr/share/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m$<5/>, rmul=\E[24m, rs1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, smdc=, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m$<5/>, smul=\E[4m, @@ -2219,7 +2278,7 @@ vt420|DEC VT420, rmam=\E[?7l, rmir=\E[4l, rmkx=\E>, rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7, - sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;$<2>, sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h, smkx=\E=, smso=\E[7m, smul=\E[4m, @@ -2317,7 +2376,7 @@ vt520|DEC VT520, ri=\EM, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l, rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7, - sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;$<2>, sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h, smso=\E[7m, smul=\E[4m, @@ -2344,7 +2403,7 @@ vt525|DEC VT525, ri=\EM, rmacs=\E(B$<4>, rmam=\E[?7l, rmir=\E[4l, rmsc=\E[?0;0r\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, rmso=\E[m, rmul=\E[m, rs3=\E[?67h\E[64;1"p, sc=\E7, - sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;$<2>, sgr0=\E[m$<2>, smacs=\E(0$<2>, smam=\E[?7h, smir=\E[4h, smso=\E[7m, smul=\E[4m, @@ -2387,6 +2446,57 @@ crt|crt-vt220|CRT 2.3 emulating VT220, hts=\EH, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, use=vt220, use=ecma+color, +# PuTTY 0.51 (released 14 December 2000) +# http://www.chiark.greenend.org.uk/~sgtatham/putty/ +# +# This emulates vt100 + vt52 (plus a few vt220 features: ech, SRM, DECTCEM, as +# well as SCO and Atari, color palettes from Linux console). Reading the code, +# it is intended to be VT102 plus selected features By default, it sets $TERM +# to xterm, which is incorrect, since several features are misimplemented: +# +# Alt+key always sends ESC+key, so 'km' capability is removed. +# +# Control responses, wrapping and tabs are buggy, failing a couple of +# screens in vttest. +# +# xterm mouse support is not implemented (unrelease version may). +# +# Several features such as backspace/delete are optional; this entry documents +# the default behavior -TD +putty|xterm clone (win32), + am, bw, ccc, km, mir, msgr, xenl, + colors#8, cols#80, it#8, lines#24, pairs#64, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, + clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, + ech=\E[%p1%dX, ed=\E[J, el=\E[K, enacs=\E)0, home=\E[H, + hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, + ind=^J, + initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p3%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%p4%{255}%&%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'A'%+%c%e%gx%d%;, + is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, + kbs=\177, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, + kcuu1=\EOA, kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, + kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, + kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, + kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, + kpp=\E[5~, kslt=\E[4~, oc=\E]R, op=\E[39;49m, rc=\E8, + rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l, + rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, + rmso=\E[27m, rmul=\E[24m, + rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h, + smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, + tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + vpa=\E[%i%p1%dd, + # This entry is for Tera Term Pro version 2.3, for MS-Windows 95/NT written by # T. Teranishi dated Mar 10, 1998. It is a free software terminal emulator # (communication program) which supports: @@ -2448,11 +2558,31 @@ teraterm|Tera Term Pro, # Tested with WinNT 4.0, the telnet application assumes the screensize is # 25x80. This entry uses the 'Terminal' font, to get line-drawing characters. +# +# Other notes: +# a) Fails tack's cup (cursor-addressing) test, though cup works well enough +# for casual (occasional) use. Also fails several of the vttest screens, +# but that is not unusual for vt100 "emulators". +# b) Does not implement vt100 keypad +# c) Recognizes a subset of vt52 controls. ms-vt100|MS telnet imitating dec vt100, lines#25, acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, - tbc@, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, - use=vt100, + ka1@, ka3@, kb2@, kc1@, kc3@, kent@, kf0@, kf1@, kf10@, kf2@, kf3@, kf4@, + kf5@, kf6@, kf7@, kf8@, kf9@, tbc@, u6=\E[%i%d;%dR, u7=\E[6n, + u8=\E[?6c, u9=\E[c, use=vt100, + +# Tested with Windows 2000, the telnet application runs in a console window, +# also using 'Terminal' font. +# +# Other notes: +# a) This version has no function keys or numeric keypad. Unlike the older +# version, the numeric keypad is entirely ignored. +# b) The program sets $TERM to "ansi", which of course is inaccurate. +ms-vt100-color|windows 2000 ansi (sic), + bce, + dch=\E[%p1%dP, ich=\E[%p1%d@, use=ecma+color, + use=ms-vt100, #### X terminal emulators # @@ -2617,13 +2747,13 @@ xterm-xf86-v40|xterm terminal emulator (XFree86 4.0 Window System), kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~, khome=\EOH, rmcup=\E[?1049l, - sgr=\E[0%?%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, smcup=\E[?1049h, use=xterm-xf86-v333, xterm-xfree86|xterm-new|xterm terminal emulator (XFree86 4.0 Window System), npc, - kDC=\E[3;5~, kEND=\EO5F, kHOM=\EO5H, kIC=\E[2;5~, - kLFT=\EO5D, kNXT=\E[6;5~, kPRV=\E[5;5~, kRIT=\EO5C, + kDC=\E[3;2~, kEND=\EO2F, kHOM=\EO2H, kIC=\E[2;2~, + kLFT=\EO2D, kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\EO2C, kb2=\EOE, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\EO2P, kf14=\EO2Q, @@ -2664,7 +2794,7 @@ xterm-basic|xterm terminal emulator - common (XFree86), setaf=\E[3%p1%dm, setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=\E[0%?%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, @@ -2676,12 +2806,7 @@ xterm-xi|xterm on XI Graphics Accelerated X under BSD/OS 3.1, # This is one of the variants of XFree86 3.3 xterm, updated for 4.0 (T.Dickey) xterm-16color|xterm with 16 colors like aixterm, - colors#16, ncv#32, pairs#256, - setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm, - setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm, - setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, - setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, - use=xterm-xfree86, + ncv#32, use=ibm+16color, use=xterm-xfree86, # These variants of XFree86 3.9.16 xterm are built as a configure option. xterm-256color|xterm with 256 colors, @@ -2737,7 +2862,7 @@ xterm-8bit|xterm terminal emulator 8-bit controls (X Window System), sc=\E7, setab=\2334%p1%dm, setaf=\2333%p1%dm, setb=\2334%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, setf=\2333%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=\2330%?%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, + sgr=\2330%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;, sgr0=\233m^O, smacs=^N, smam=\233?7h, smcup=\233?1049h, smir=\2334h, smkx=\233?1h\E=, smso=\2337m, smul=\2334m, tbc=\2333g, u6=\233[%i%d;%dR, u7=\E[6n, u8=\233[?1;2c, @@ -2822,10 +2947,13 @@ xterm-bold|xterm terminal emulator (X11R6 Window System) standout w/bold, # (kterm: this had extension capabilities ":KJ:TY=ascii:" -- esr) # (kterm should not invoke DEC Graphics as the alternate character set # -- Kenji Rikitake) +# (proper setting of enacs, smacs, rmacs makes kterm to use DEC Graphics +# -- MATSUMOTO Shoji) kterm|kterm kanji terminal emulator (X window system), eslok, hs, - acsc@, csr=\E[%i%p1%d;%p2%dr, dsl=\E[?H, enacs@, fsl=\E[?F, - kmous=\E[M, rc=\E8, rmacs@, sc=\E7, smacs@, + acsc=++\,\,--..00II``aaffgghhjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + csr=\E[%i%p1%d;%p2%dr, dsl=\E[?H, enacs=, fsl=\E[?F, + kmous=\E[M, rc=\E8, rmacs=\E(B, sc=\E7, smacs=\E(0, tsl=\E[?E\E[?%i%dT, use=xterm-r6, use=ecma+color, kterm-color|kterm-co|kterm with ANSI colors, ncv@, use=kterm, use=ecma+color, @@ -2882,17 +3010,109 @@ nxterm|xterm-color|generic color xterm, op=\E[m, use=xterm-r6, use=klone+color, # this describes the alpha-version of Gnome terminal shipped with Redhat 6.0 -gnome|Gnome terminal, +gnome-rh62|Gnome terminal, bce, kdch1=\177, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, use=xterm-color, +# GNOME Terminal 1.4.0.4 (Redhat 7.2) +# +# This implements a subset of vt102 with a random selection of features from +# other terminals such as color and function-keys. +# +# shift-f1 to shift-f10 are f11 to f20 +# +# NumLock changes the application keypad to approximate vt100 keypad, except +# that there is no escape sequence matching comma (,). +# +# Other defects observed: +# vt100 LNM mode is not implemented. +# vt100 80/132 column mode is not implemented. +# vt100 DECALN is not implemented. +# vt100 DECSCNM mode is not implemented, so flash does not work. +# vt100 TBC (tab reset) is not implemented. +# xterm alternate screen controls do not restore cursor position properly +# it hangs in tack after running function-keys test. +gnome-rh72|GNOME Terminal, + bce, + civis=\E[?25l, cnorm=\E[?25h, kdch1=\E[3~, kf1=\EOP, + kf2=\EOQ, kf3=\EOR, kf4=\EOS, rmam=\E[?7l, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m%?%p9%t\016%e\017%;, + smam=\E[?7h, tbc@, use=xterm-color, + +gnome|GNOME Terminal, + use=gnome-rh72, + # This is kvt 0-18.7, shipped with Redhat 6.0 (though whether it supports bce # or not is debatable). kvt|KDE terminal, bce, km@, kdch1=\177, kend=\E[F, khome=\E[H, use=xterm-color, +# Konsole 1.0.1 +# (formerly known as kvt) +# +# This program hardcodes $TERM to 'xterm', which is not accurate. However, to +# simplify this entry (and point out why konsole isn't xterm), we base this on +# xterm-r6. The default keyboard appears to be 'linux'. +# +# Notes: +# a) konsole implements several features from XFree86 xterm, though none of +# that is documented - except of course in its source code - apparently +# because its implementors are unaccustomed to reading documentation - as +# evidenced by the sparse and poorly edited documentation distributed with +# konsole. Some features such as the 1049 private mode are recognized but +# incorrectly implemented as a duplicate of the 47 private mode. +# b) even with the "vt100 (historical)" keyboard setting, the numeric keypad +# sends PC-style escapes rather than vt100. +# c) fails vttest menu 3 (Test of character sets) because it does not properly +# parse some control sequences. Also fails vttest Primary Device Attributes +# by sending a bogus code (in the source it says it's supposed to be a +# vt220, which is doubly incorrect because it does not implement vt220 +# control sequences except for a few special cases). Treat it as a +# mildly-broken vt102. +konsole-base|KDE console window, + bce, km@, npc, + bel@, blink=\E[5m, civis=\E[?25l, cnorm=\E[?25h, + ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l, + hpa=\E[%i%p1%dG, kbs@, kdch1@, kend@, kf1@, kf10@, kf11@, kf12@, + kf13@, kf14@, kf15@, kf16@, kf17@, kf18@, kf19@, kf2@, kf20@, kf3@, + kf4@, kf5@, kf6@, kf7@, kf8@, kf9@, kfnd@, khome@, kslt@, + rmam=\E[?7l, rmso=\E[27m, rmul=\E[24m, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smam=\E[?7h, vpa=\E[%i%p1%dd, use=ecma+color, + use=xterm-r6, +konsole-linux|KDE console window with linux keyboard, + kdch1=\E[3~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, + kf12=\E[24~, kf13@, kf14@, kf15@, kf16@, kf17@, kf18@, kf19@, + kf2=\E[[B, kf20@, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, + kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + use=konsole-base, +# KDE's "XFree86 3.x.x" keyboard is based on reading the xterm terminfo rather +# than testing the code. +konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm, + kend=\E[4~, khome=\E[1~, use=konsole-vt100, +# The value for kbs reflects local customization rather than the settings used +# for XFree86 xterm. +konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, + kbs=^H, kend=\EOF, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, + khome=\EOH, use=konsole-vt100, +# KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but +# it is still useful for deriving the other entries. +konsole-vt100|KDE console window with vt100 (sic) keyboard, + kbs=\177, kdch1=\E[3~, kend=\E[F, kf1=\E[11~, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13@, kf14@, kf15@, kf16@, kf17@, + kf18@, kf19@, kf2=\E[12~, kf20@, kf3=\E[13~, kf4=\E[14~, + kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + khome=\E[H, use=konsole-base, +konsole-vt420pc|KDE console window with vt420 pc keyboard, + kbs=^H, kdch1=\177, use=konsole-vt100, +konsole-16color|klone of xterm-16color, + ncv#32, use=ibm+16color, use=konsole, +# make a default entry for konsole +konsole|KDE console window, + use=konsole-linux, + # From: Thomas Dickey 04 Oct 1997 # Updated: Oezguer Kesim 02 Nov 1997 # Notes: @@ -2947,10 +3167,14 @@ rxvt|rxvt terminal emulator (X Window System), ncv@, sgr0=\E[m\017, use=rxvt-basic, use=ecma+color, +# This variant is supposed to work with rxvt 2.7.7 when compiled with +# NO_BRIGHTCOLOR defined. rxvt needs more work... +rxvt-16color|xterm with 16 colors like aixterm, + ncv#32, use=ibm+16color, use=rxvt, + # From: Michael Jennings # removed kf0 which conflicts with kf10 -TD # remove cvvis which conflicts with cnorm -TD -# There's no u6 because Eterm appears to lack CPR (cursor position report). Eterm|Eterm-color|Eterm with xterm-style color support (X Window System), am, bce, bw, eo, km, mc5i, mir, msgr, xenl, xon, btns#5, cols#80, it#8, lines#24, lm#0, ncv@, @@ -2986,8 +3210,8 @@ Eterm|Eterm-color|Eterm with xterm-style color support (X Window System), sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h, smir=\E[4h, smkx=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u7=\E[6n, u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, - use=ecma+color, + u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, + vpa=\E[%i%p1%dd, use=ecma+color, # These (xtermc and xtermm) are distributed with Solaris. They refer to a # variant of xterm which is apparently no longer supported, but are interesting @@ -2996,7 +3220,7 @@ xtermm|xterm terminal emulator (monocrome), OTbs, am, km, mir, msgr, xenl, btns#3, cols#80, it#8, lines#24, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, - bel=^G, blink=@, bold=\E[1m, clear=\E[H\E[2J, cr=^M, + bel=^G, blink@, bold=\E[1m, clear=\E[H\E[2J, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[1D, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, @@ -3104,6 +3328,40 @@ emu|emu native mode, setaf=\Er%i%p1%d;, sgr0=\ES, smacs=\0, smir=\EY, smso=\ES\ET, smul=\ES\EV, tbc=\Ej, +# A commercial product, Reportedly a version of Xterm with an OPEN LOOK UI, +# print interface, ANSI X3.64 colour escape sequences, etc. Newsgroup postings +# indicate that it emulates more than one terminal, but incompletely. +# +# This is dapted from a FreeBSD bug-report by Daniel Rudy +# It is based on vt102's entry, with some subtle differences, but also +# has status line +# supports ANSI colors (except for 'op' string) +# apparently implements alternate screen like xterm +# does not use padding, of course. +mvterm|vv100|SwitchTerm aka mvTERM, + am, eslok, hs, km, mir, msgr, xenl, + colors#8, cols#80, it#8, lines#24, pairs#64, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, + dsl=\E[?E, ed=\E[J, el=\E[K, el1=\E[1K$<3>, enacs=\E(B\E)0, + fsl=\E[?F, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, + ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, ka1=\EOq, + ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOp, kc3=\EOn, kcub1=\EOD, + kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, kf0=\EOy, + kf1=\EOP, kf10=\EOx, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOt, + kf6=\EOu, kf7=\EOv, kf8=\EOl, kf9=\EOw, op=\E[100m, rc=\E8, + rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, + rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, + rs2=\E>\E[1;3;4;5;6l\E[?7h\E[100m\E[m\E[r\E[2J\E[H, + sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, + smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, + tsl=\E[?E\E[?%i%p1%dT, #### MGR # # MGR is a Bell Labs window system lighter-weight than X. @@ -3189,6 +3447,8 @@ eterm|gnu emacs term.el terminal emulation, # (\E[39m / \E[49m). # S0 (str) Switch charset 'G0' to the specified charset. # E0 (str) Switch charset 'G0' back to standard charset. +# +# tested with screen 3.09.08 screen|VT 100/ANSI X3.64 virtual terminal, OTbs, OTpt, am, km, mir, msgr, xenl, G0, colors#8, cols#80, it#8, lines#24, pairs#64, @@ -3201,16 +3461,56 @@ screen|VT 100/ANSI X3.64 virtual terminal, cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, - il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcub1=\EOD, - kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\EOP, - kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, - kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, - kf9=\E[20~, khome=\E[1~, kich1=\E[2~, kll=\E[4~, knp=\E[6~, - kpp=\E[5~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, - rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, - rs2=\Ec, sc=\E7, sgr0=\E[m, smacs=^N, smir=\E[4h, - smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, E0=\E(B, - S0=\E(%p1%c, use=ecma+color, + il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcbt=\E[Z, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, + kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, + nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmir=\E[4l, + rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, + sgr0=\E[m, smacs=^N, smir=\E[4h, smkx=\E[?1h\E=, + smso=\E[3m, smul=\E[4m, tbc=\E[3g, E0=\E(B, S0=\E(%p1%c, + use=ecma+color, + +# Read the fine manpage: +# When screen tries to figure out a terminal name for +# itself, it first looks for an entry named "screen.", +# where is the contents of your $TERM variable. If +# no such entry exists, screen tries "screen" (or "screen-w" +# if the terminal is wide (132 cols or more)). If even this +# entry cannot be found, "vt100" is used as a substitute. +# +# Here are a few customized entries which are useful -TD +# +# Notes: +# (a) screen does not support invis. +# (b) screen's implementation of bw is incorrect according to tack. +# (c) screen appears to hardcode the strings for khome/kend, making it +# necessary to override the "use=" clause's values. +# (d) screen sets $TERMCAP to a termcap-formatted copy of the 'screen' entry, +# which is NOT the same as the terminfo screen.. +# (e) when screen finds one of these customized entries, it sets $TERM to +# match. Hence, no "screen.xterm" entry is provided, since that would +# create heartburn for people running remote xterm's. +# +# xterm (-xfree86 or -r6) does not normally support kIC, kNXT and kPRV +# since the default translations override the built-in keycode +# translation. They are suppressed here to show what is tested by tack. +screen.xterm-xfree86|screen customized for XFree86 xterm, + bce@, bw, + invis@, kIC@, kNXT@, kPRV@, kend=\E[4~, khome=\E[1~, meml@, + memu@, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + use=xterm-xfree86, +# xterm-r6 does not really support khome/kend unless it is propped up by +# the translations resource. +screen.xterm-r6|screen customized for X11R6 xterm, + bw, use=xterm-r6, +# Color applications running in screen and TeraTerm do not play well together +# on Solaris. +screen.teraterm|disable ncv in teraterm, + ncv#127, use=screen, screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols, cols#132, use=screen, @@ -3340,6 +3640,45 @@ pilot|tgtelnet|Top Gun Telnet on the Palm Pilot Professional, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, knp=^L, kpp=^K, nel=\Em~\s, rmso=\EB, smso=\Eb, +# From: Federico Bianchi +# These entries are for the Embeddable Linux Kernel System (ELKS) +# project - an heavily stripped down Linux to be run on 16 bit +# boxes or, eventually, to be used in embedded systems - and have been +# adapted from the stock ELKS termcap. The project itself looks stalled, +# and the latest improvements I know of date back to March 2000. +# +# To cope with the ELKS dumb console I added an "elks-glasstty" entry; +# as an added bonus, this deals with all the capabilities common to +# both VT52 and ANSI (or, eventually, "special") modes. + +elks-glasstty|ELKS glass-TTY capabilities, + OTbs, am, + cols#80, it#8, lines#25, + bel=^G, cr=^M, ht=^I, ind=^J, kbs=^H, kcub1=^H, kcud1=^J, + nel=^M^J, + +elks-vt52|ELKS vt52 console, + clear=\EH\EJ, cub1=\ED, cud1=\EB, cuf1=\EC, + cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, el=\EK, + home=\EH, use=elks-glasstty, + +elks-ansi|ELKS ANSI console, + clear=\E[H\E[2J, cub1=\E[D, cud1=\E[B, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, el=\E[K, home=\E[H, + rmso=\E[m, smso=\E[7m, use=elks-glasstty, + +# As a matter of fact, ELKS 0.0.83 on PCs defaults to ANSI emulation +# instead of VT52, but the "elks" entry still refers to the latter. + +elks|default ELKS console, + use=elks-vt52, + +# Project SIBO (for Psion 3 palmtops) console is identical to the ELKS +# one but in screen size + +sibo|ELKS SIBO console, + cols#61, it#8, lines#20, use=elks-vt52, + ######## COMMERCIAL WORKSTATION CONSOLES # @@ -3517,7 +3856,7 @@ news-unk|SONY NEWS vt100 emulator common entry, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I, - if=/usr/lib/tabset/vt100, il=\E[%p1%dL, il1=\E[L, + if=/usr/share/tabset/vt100, il=\E[%p1%dL, il1=\E[L, is2=\E[?7h\E[?1l\E[?3l\E7\E8, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf0=\EOY, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, @@ -3565,7 +3904,7 @@ news-old-unk|SONY NEWS vt100 emulator common entry, OTnl=^J, bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[;H\E[2J, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, ed=\E[J, el=\E[K, - home=\E[H, ht=^I, if=/usr/lib/tabset/vt100, kbs=^H, + home=\E[H, ht=^I, if=/usr/share/tabset/vt100, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, rc=\E8, rev=\E[7m, ri=\EM, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, @@ -3700,7 +4039,7 @@ dtterm|CDE desktop terminal, # Removed: rmacs=\E[10m, smacs=\E[11m, because OS/2 does not implement acs. ansi-emx|ANSI.SYS color, am, bce, eo, mir, msgr, xenl, xon, - colors#16, cols#80, it#8, lines#25, pairs#64, + colors#8, cols#80, it#8, lines#25, pairs#64, bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[1;33;44m\E[H\E[J, cnorm=\E[?25h, cr=^M, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, @@ -3717,7 +4056,7 @@ ansi-emx|ANSI.SYS color, tbc=\E[3g, u8=\E[?6c, u9=\E[c, ansi-color-2-emx|ANSI.SYS color 2, am, bce, eo, mir, msgr, xenl, xon, - colors#16, cols#80, it#8, lines#25, pairs#64, + colors#8, cols#80, it#8, lines#25, pairs#64, bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[0;37;44m\E[H\E[J, cnorm=\E[?25h, cr=^M, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, @@ -3734,7 +4073,7 @@ ansi-color-2-emx|ANSI.SYS color 2, tbc=\E[3g, u8=\E[?6c, u9=\E[c, ansi-color-3-emx|ANSI.SYS color 3, am, bce, eo, mir, msgr, xenl, xon, - colors#16, cols#80, it#8, lines#25, pairs#64, + colors#8, cols#80, it#8, lines#25, pairs#64, bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[0;37;40m\E[H\E[J, cnorm=\E[?25h, cr=^M, cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, @@ -3763,7 +4102,7 @@ mono-emx|stupid monochrome ansi terminal with only one kind of emphasis, # Use this for cygwin32 (tested with beta 19.1) # underline is colored bright magenta # shifted kf1-kf12 are kf11-kf22 -cygwin|ansi emulation for cygwin32, +cygwinB19|ansi emulation for cygwin32, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, @@ -3773,6 +4112,36 @@ cygwin|ansi emulation for cygwin32, khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, rmam@, smam@, use=ansi.sys, +# Use this for cygwin (tested with version 1.1.0). +# I've combined pcansi and linux. Some values of course were different and +# I've indicated which of these were and which I used. +# Cheers, earnie_boyd@yahoo.com +# several changes based on running with tack and comparing with older entry -TD +cygwin|ansi emulation for Cygwin, + am, eo, in, msgr, xon, + colors#8, cols#80, it#8, lines#25, ncv#3, pairs#64, + acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, + bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M, cub1=^H, + cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, + dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, + el=\E[K, el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, + hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, + ind=^J, invis=\E[8m, kbs=^H, kcub1=\E[D, kcud1=\E[B, + kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, + kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, + kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, + kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, + kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, + knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, op=\E[39;49m, + rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmpch=\E[10m, + rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, + setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, + sgr0=\E[0;10m, smir=\E[4h, smpch=\E[11m, smso=\E[7m, + smul=\E[4m, u6=\E[%i%d;%dR, u7=\E[6n, u9=\E[c, + vpa=\E[%i%p1%dd, + # This entry fits the Windows NT console when the _POSIX_TERM environment # variable is set to 'on'. While the Windows NT POSIX console is seldom used, # the Telnet client supplied with both the Windows for WorkGroup 3.11 TCP/IP @@ -4890,7 +5259,7 @@ adm31-old|o31|old adm31, adm36|LSI ADM36, OTbs, OTpt, OTkn#4, - if=/usr/lib/tabset/vt100, + if=/usr/share/tabset/vt100, is2=\E<\E>\E[6;?2;?7;?8h\E[4;20;?1;?3;?4;?5;?6;?18;?19l, use=vt100, # (adm42: removed obsolete ":ma=^K^P:" -- esr) @@ -5034,7 +5403,7 @@ qvt103|qume qvt 103, rev=\E[7m$<2>, ri=\EM$<5>, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m, + sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m$<2>, sgr0=\E[m$<2>, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, qvt103-w|qume qvt103 132 cols, @@ -7615,7 +7984,7 @@ v5410|att5410 in terms of a vt100, rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<2>, sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[1;7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, @@ -11018,7 +11387,7 @@ ts100|ts100-sp|falco ts100-sp, rev=\E[7m$<2>, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<2>, sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[1;7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, ts100-ctxt|falco ts-100 saving context, @@ -11651,6 +12020,12 @@ ibm+color|IBM color definitions, op=\E[32m\E[40m, setb=\E[%?%p1%{0}%=%t40m%e%p1%{1}%=%t41m%e%p1%{2}%=%t42m%e%p1%{3}%=%t43m%e%p1%{4}%=%t44m%e%p1%{5}%=%t45m%e%p1%{6}%=%t46m%e%p1%{7}%=%t107m%;, setf=\E[%?%p1%{0}%=%t30m%e%p1%{1}%=%t31m%e%p1%{2}%=%t32m%e%p1%{3}%=%t33m%e%p1%{4}%=%t34m%e%p1%{5}%=%t35m%e%p1%{6}%=%t36m%e%p1%{7}%=%t97m%;, +ibm+16color|IBM aixterm color definitions, + colors#16, pairs#256, + setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm, + setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm, + setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, + setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m, ibm5154|IBM 5154 Color display, colors#8, ncv@, pairs#64, bold@, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=ibm5151, @@ -11792,6 +12167,7 @@ ibm8514-c|IBM 8514 color display with standout and underline, # # AIX entries. IBM ships these with AIX 3.2.5. # -- added rc, sc based on manpage -TD +# Note that we could use ibm+16color, but that is not how IBM defines this one. aixterm|IBM Aixterm Terminal Emulator, eslok, hs, acsc=jjkkllmmnnqqttuuvvwwxx, bold=\E[1m, dsl=\E[?E, @@ -13637,7 +14013,7 @@ tek4105-30|4015 emulating 30 line vt100, rev=\E[7m$<2>, ri=\EM$<5>, rmacs=^O, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, - sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;$<2>, sgr0=\E[m\017$<2>, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[1;7m$<2>, smul=\E[4m$<2>, tbc=\E[3g, @@ -13739,7 +14115,7 @@ tek4107|tek4109|tektronix terminals 4107 4109, kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, rev=\E%!1\E[7m$<2>\E%0, ri=\EI, rmso=\E%!1\E[m$<2>\E%!0, rmul=\E%!1\E[m$<2>\E%!0, - sgr=\E%%!1\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m\E%%!0, + sgr=\E%%!1\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m$<2>\E%%!0, sgr0=\E%!1\E[m$<2>\E%!0, smso=\E%!1\E[7;5m$<2>\E%!0, smul=\E%!1\E[4m$<2>\E%!0, # Tektronix 4207 with sysline. In the ancestral termcap file this was 4107-s; @@ -14327,6 +14703,495 @@ mac|macintosh|Macintosh with MacTerminal, mac-w|macterminal-w|Apple Macintosh with Macterminal in 132 column mode, cols#132, use=mac, +# The AppKit Terminal.app descriptions all have names beginning with +# "nsterm". Note that the statusline (-s) versions use the window +# titlebar as a phony status line, and may produce warnings during +# compilation as a result ("tsl uses 0 parameters, expected 1".) Ignore +# these warnings, or even ignore these entries entirely. Apps which +# need to position the cursor or do other fancy stuff inside the status +# line won't work with these entries. They're primarily useful for +# programs like Pine which provide simple notifications in the status +# line. Please note that non-ASCII characters don't work right in the +# status line, since Terminal.app incorrectly interprets their Unicode +# codepoints as MacRoman codepoints. +# +# * Renamed the AppKit Terminal.app entry from "Apple_Terminal" to +# "nsterm" to comply with the name length and case conventions and +# limitations of various software packages [notably Solaris terminfo +# and UNIX.] A single Apple_Terminal alias is retained for +# backwards-compatbility. +# +# * Added function key support (F1-F4). These only work in Terminal.app +# version 51, hopefully the capabilities won't cause problems for people +# using version 41. +# +# * Added "full color" (-c) entries which support the 16-color mode in +# version 51. +# +# * By default, version 51 uses UTF-8 encoding with broken altcharset +# support, so "ASCII" (-7) entries without altcharset support were +# added. + +# nsterm - AppKit Terminal.app +# +# Apple's Mac OS X includes a Terminal.app derived from the old NeXT +# Terminal.app. It is a partial VT100 emulation with some xterm-like +# extensions. This terminfo was written to describe versions 41 +# (shipped with Mac OS X version 10.0) and 51 (shipped with Mac OS X +# version 10.1) of Terminal.app. +# +# Terminal.app runs under the Mac OS X Quartz windowing system (and +# other AppKit-supported windowing systems.) On the Mac OS X machine I +# use, the executable for Terminal.app is: +# /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal +# +# If you're looking for a description of the full-screen system +# console which runs under Apple's Darwin operating system on PowerPC +# platforms, see the "xnuppc" entry instead. +# +# There were no function keys in version 41. In version 51, there are +# four working function keys (F1, F2, F3 and F4.) The function keys +# are included in all of these entries. +# +# It does not support mouse pointer position reporting. Under some +# circumstances the cursor can be positioned using option-click; this +# works by comparing the cursor position and the selected position, +# and simulating enough cursor-key presses to move the cursor to the +# selected position. This technique fails in all but the simplest +# applications. +# +# It provides partial ANSI color support (background colors interacted +# badly with bold in version 41, though, as reflected in :ncv:.) The +# monochrome (-m) entries are useful if you've disabled color support +# or use a monochrome monitor. The full color (-c) entries are useful +# in version 51, which doesn't exhibit the background color bug. They +# also enable an xterm-compatible 16-color mode. +# +# The configurable titlebar is set using xterm-compatible sequences; +# it is used as a status bar in the statusline (-s) entries. Its width +# depends on font sizes and window sizes, but 50 characters seems to +# be the default for an 80x24 window. +# +# The MacRoman character encoding is used for some of the alternate +# characters in the "MacRoman" entries; the "ASCII" (-7) entries +# disable alternate character set support entirely, and the "VT100" +# (-acs) entries rely instead on Terminal.app's own buggy VT100 +# graphics emulation, which seems to think the character encoding is +# the old NeXT charset instead of MacRoman. The "ASCII" (-7) entries +# are useful in Terminal.app version 51, which supports UTF-8 and +# other ASCII-compatible character encodings but does not correctly +# implement VT100 graphics; once VT100 graphics are correctly +# implemented in Terminal.app, the "VT100" (-acs) entries should be +# usable in any ASCII-compatible character encoding [except perhaps +# in UTF-8, where some experts argue for disallowing alternate +# characters entirely.] +# +# Terminal.app reports "vt100" as the terminal type, but exports +# several environment variables which may aid detection in a shell +# profile (i.e. .profile or .login): +# +# TERM=vt100 +# TERM_PROGRAM=Apple_Terminal +# TERM_PROGRAM_VERSION=41 # in Terminal.app version 41 +# TERM_PROGRAM_VERSION=51 # in Terminal.app version 51 +# +# For example, the following Bourne shell script would detect the +# correct terminal type: +# +# if [ :"$TERM" = :"vt100" -a :"$TERM_PROGRAM" = :"Apple_Terminal" ] +# then +# export TERM +# if [ :"$TERM_PROGRAM_VERSION" = :41 ] +# then +# TERM="nsterm" +# else +# TERM="nsterm-c-7" +# fi +# fi +# +# In a C shell derivative, this would be accomplished by: +# +# if ( $?TERM && $?TERM_PROGRAM && $?TERM_PROGRAM_VERSION) then +# if ( :"$TERM" == :"vt100" && :"$TERM_PROGRAM" == :"Apple_Terminal" ) then +# if ( :"$TERM_PROGRAM_VERSION" == :41 ) then +# setenv TERM "nsterm" +# else +# setenv TERM "nsterm-c-7" +# endif +# endif +# endif + +# The '+' entries are building blocks +nsterm+7|AppKit Terminal.app v41+ basic capabilities w/ASCII charset, + am, bw, msgr, xenl, xon, + cols#80, it#8, lines#24, + bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, + home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J, + ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, + kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, rc=\E8, rev=\E[7m, + ri=\EM, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, + rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m, + sgr0=\E[m\017, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, + u8=\E[?1;2c, u9=\E[c, + +nsterm+acs|AppKit Terminal.app v41+ basic capabilities w/VT100 alternate-charset, + acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + enacs=\E(B\E)0, rmacs=^O, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smacs=^N, use=nsterm+7, + +nsterm+mac|AppKit Terminal.app v41+ basic capabilities w/MacRoman alternate-charset, + acsc=0#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245+\335-\366\,\334.\377, + enacs=\E(B\E)0, rmacs=^O, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + smacs=^N, use=nsterm+7, + +nsterm+s|AppKit Terminal.app v41+ status-line (window titlebar) support, + hs, + wsl#50, + dsl=\E]2;\007, fsl=^G, tsl=\E]2;, + +nsterm+c|AppKit Terminal.app v51+ full color support (including 16 colors), + op=\E[0m, use=ibm+16color, + +nsterm+c41|AppKit Terminal.app v41 color support, + colors#8, ncv#37, pairs#64, + op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + +# These are different combinations of the building blocks + +# ASCII charset (-7) +nsterm-m-7|nsterm-7-m|AppKit Terminal.app v41+ w/ASCII charset (monochrome), + use=nsterm+7, + +nsterm-m-s-7|nsterm-7-m-s|AppKit Terminal.app v41+ w/ASCII charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+7, + +nsterm-7|AppKit Terminal.app v41+ w/ASCII charset (color), + use=nsterm+c41, use=nsterm+7, + +nsterm-7-c|nsterm-c-7|AppKit Terminal.app v51+ w/ASCII charset (full color), + use=nsterm+c, use=nsterm+7, + +nsterm-s-7|nsterm-7-s|AppKit Terminal.app v41+ w/ASCII charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+7, + +nsterm-c-s-7|nsterm-7-c-s|AppKit Terminal.app v51+ w/ASCII charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+7, + +# VT100 alternate-charset (-acs) +nsterm-m-acs|nsterm-acs-m|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome), + use=nsterm+acs, + +nsterm-m-s-acs|nsterm-acs-m-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+acs, + +nsterm-acs|AppKit Terminal.app v41+ w/VT100 alternate-charset (color), + use=nsterm+c41, use=nsterm+acs, + +nsterm-c-acs|nsterm-acs-c|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color), + use=nsterm+c, use=nsterm+acs, + +nsterm-s-acs|nsterm-acs-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+acs, + +nsterm-c-s-acs|nsterm-acs-c-s|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+acs, + +# MacRoman charset +nsterm-m|AppKit Terminal.app v41+ w/MacRoman charset (monochrome), + use=nsterm+mac, + +nsterm-m-s|AppKit Terminal.app v41+ w/MacRoman charset (monochrome w/statusline), + use=nsterm+s, use=nsterm+mac, + +nsterm|Apple_Terminal|AppKit Terminal.app v41+ w/MacRoman charset (color), + use=nsterm+c41, use=nsterm+mac, + +nsterm-c|AppKit Terminal.app v51+ w/MacRoman charset (full color), + use=nsterm+c, use=nsterm+mac, + +nsterm-s|AppKit Terminal.app v41+ w/MacRoman charset (color w/statusline), + use=nsterm+s, use=nsterm+c41, use=nsterm+mac, + +nsterm-c-s|AppKit Terminal.app v51+ w/MacRoman charset (full color w/statusline), + use=nsterm+s, use=nsterm+c, use=nsterm+mac, + +# xnuppc - Darwin PowerPC Console (a.k.a. "darwin") +# +# On PowerPC platforms, Apple's Darwin operating system uses a +# full-screen system console derived from a NetBSD framebuffer +# console. It is an ANSI-style terminal, and is not really VT-100 +# compatible. +# +# Under Mac OS X, this is the system console driver used while in +# single-user mode [reachable by holding down Command-S during the +# boot process] and when logged in using console mode [reachable by +# typing ">console" at the graphical login prompt.] +# +# If you're looking for a description of the Terminal.app terminal +# emulator which runs under the Mac OS X Quartz windowing system (and +# other AppKit-supported windowing systems,) see the "nsterm" +# entry instead. +# +# NOTE: Under Mac OS X version 10.1, the default login window does not +# prompt for user name, instead requiring an icon to be selected from +# a list of known users. Since the special ">console" login is not in +# this list, you must make one of two changes in the Login Window +# panel of the Login section of System Prefs to make the special +# ">console" login accessible. The first option is to enable 'Show +# "Other User" in list for network users', which will add a special +# "Other..." icon to the graphical login panel. Selecting "Other..." +# will present the regular graphical login prompt. The second option +# is to change the 'Display Login Window as:' setting to 'Name and +# password entry fields', which replaces the login panel with a +# graphical login prompt. +# +# There are no function keys, at least not in Darwin 1.3. +# +# It has no mouse support. +# +# It has full ANSI color support, and color combines correctly with +# all three supported attributes: bold, inverse-video and underline. +# However, bold colored text is almost unreadable (bolding is +# accomplished using shifting and or-ing, and looks smeared) so bold +# has been excluded from the list of color-compatible attributes +# [using (ncv)]. The monochrome entry (-m) is useful if you use a +# monochrome monitor. +# +# There is one serious bug with this terminal emulation's color +# support: repositioning the cursor onto a cell with non-matching +# colors obliterates that cell's contents, replacing it with a blank +# and displaying a colored cursor in the "current" colors. There is +# no complete workaround at present [other than using the monochrome +# (-m) entries,] but removing the (msgr) capability seemed to help. +# +# The "standout" chosen was simple reverse-video, although a colorful +# standout might be more aesthetically pleasing. Similarly, the bold +# chosen is the terminal's own smeared bold, although a simple +# color-change might be more readable. The color-bold (-b) entries +# uses magenta colored text for bolding instead. The fancy color (-f +# and -f2) entries use color for bold, standout and underlined text +# (underlined text is still underlined, though.) +# +# Apparently the terminal emulator does support a VT-100-style +# alternate character set, but all the alternate character set +# positions have been left blank in the font. For this reason, no +# alternate character set capabilities have been included in this +# description. The console driver appears to be ASCII-only, so (enacs) +# has been excluded [although the VT-100 sequence does work.] +# +# The default Mac OS X and Darwin installation reports "vt100" as the +# terminal type, and exports no helpful environment variables. To fix +# this, change the "console" entry in /etc/ttys from "vt100" to +# "xnuppc-WxH", where W and H are the character dimensions of your +# console (see below.) +# +# The font used by the terminal emulator is apparently one originally +# drawn by Ka-Ping Yee, and uses 8x16-pixel characters. This +# file includes descriptions for the following geometries: +# +# Pixels Characters Entry Name (append -m for monochrome) +# ------------------------------------------------------------------- +# 640x400 80x25 xnuppc-80x25 +# 640x480 80x30 xnuppc-80x30 +# 720x480 90x30 xnuppc-90x30 +# 800x600 100x37 xnuppc-100x37 +# 896x600 112x37 xnuppc-112x37 +# 1024x640 128x40 xnuppc-128x40 +# 1024x768 128x48 xnuppc-128x48 +# 1152x768 144x48 xnuppc-144x48 +# 1280x1024 160x64 xnuppc-160x64 +# 1600x1024 200x64 xnuppc-200x64 +# 1600x1200 200x75 xnuppc-200x75 +# 2048x1536 256x96 xnuppc-256x96 +# +# The basic "xnuppc" entry includes no size information, and the +# emulator includes no reporting capability, so you'll be at the mercy +# of the TTY device (which reports incorrectly on my hardware.) The +# color-bold entries do not include size information. + +# The '+' entries are building blocks +xnuppc+basic|Darwin PowerPC Console basic capabilities, + am, bce, mir, xenl, + it#8, + bold=\E[1m, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr, + cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, + cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, + cuu=\E[%p1%dA, cuu1=\E[A, dsl=\E]2;\007, ed=\E[J, el=\E[K, + el1=\E[1K, home=\E[H, ht=^I, hts=\EH, ind=^J, ka1=\EOq, + ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcub1=\EOD, + kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, rc=\E8, rev=\E[7m, + ri=\EM, rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, + rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, + sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m, + sgr0=\E[m\017, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, + +xnuppc+c|Darwin PowerPC Console ANSI color support, + colors#8, ncv#32, pairs#64, + op=\E[37;40m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, + +xnuppc+b|Darwin PowerPC Console color-bold support, + ncv#32, + bold=\E[35m, + sgr=\E[0%?%p6%t;35%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m, + use=xnuppc+basic, + +xnuppc+f|Darwin PowerPC Console fancy color support, + ncv#35, + sgr=\E[0%?%p6%t;35%;%?%p2%t;36;4%;%?%p1%t;33;44%;%p3%t;7%;m, + smso=\E[33;44m, smul=\E[36;4m, use=xnuppc+b, + +xnuppc+f2|Darwin PowerPC Console alternate fancy color support, + ncv#35, + bold=\E[33m, + sgr=\E[0%?%p6%t;33%;%?%p2%t;34%;%?%p1%t;31;47%;%p3%t;7%;m, + smso=\E[31;47m, smul=\E[34m, use=xnuppc+basic, + +# Building blocks for specific screen sizes +xnuppc+80x25|Darwin PowerPC Console 80x25 support (640x400 pixels), + cols#80, lines#25, + +xnuppc+80x30|Darwin PowerPC Console 80x30 support (640x480 pixels), + cols#80, lines#30, + +xnuppc+90x30|Darwin PowerPC Console 90x30 support (720x480 pixels), + cols#90, lines#30, + +xnuppc+100x37|Darwin PowerPC Console 100x37 support (800x600 pixels), + cols#100, lines#37, + +xnuppc+112x37|Darwin PowerPC Console 112x37 support (896x600 pixels), + cols#112, lines#37, + +xnuppc+128x40|Darwin PowerPC Console 128x40 support (1024x640 pixels), + cols#128, lines#40, + +xnuppc+128x48|Darwin PowerPC Console 128x48 support (1024x768 pixels), + cols#128, lines#48, + +xnuppc+144x48|Darwin PowerPC Console 144x48 support (1152x768 pixels), + cols#144, lines#48, + +xnuppc+160x64|Darwin PowerPC Console 160x64 support (1280x1024 pixels), + cols#160, lines#64, + +xnuppc+200x64|Darwin PowerPC Console 200x64 support (1600x1024 pixels), + cols#200, lines#64, + +xnuppc+200x75|Darwin PowerPC Console 200x75 support (1600x1200 pixels), + cols#200, lines#75, + +xnuppc+256x96|Darwin PowerPC Console 256x96 support (2048x1536 pixels), + cols#256, lines#96, + +# These are different combinations of the building blocks + +xnuppc-m|darwin-m|Darwin PowerPC Console (monochrome), + use=xnuppc+basic, + +xnuppc|darwin|Darwin PowerPC Console (color), + use=xnuppc+c, use=xnuppc+basic, + +xnuppc-m-b|darwin-m-b|Darwin PowerPC Console (monochrome w/color-bold), + use=xnuppc+b, + +xnuppc-b|darwin-b|Darwin PowerPC Console (color w/color-bold), + use=xnuppc+b, use=xnuppc+c, + +xnuppc-m-f|darwin-m-f|Darwin PowerPC Console (fancy monochrome), + use=xnuppc+f, + +xnuppc-f|darwin-f|Darwin PowerPC Console (fancy color), + use=xnuppc+f, use=xnuppc+c, + +xnuppc-m-f2|darwin-m-f2|Darwin PowerPC Console (alternate fancy monochrome), + use=xnuppc+f2, + +xnuppc-f2|darwin-f2|Darwin PowerPC Console (alternate fancy color), + use=xnuppc+f2, use=xnuppc+c, + +# Combinations for specific screen sizes +xnuppc-80x25-m|darwin-80x25-m|Darwin PowerPC Console (monochrome) 80x25, + use=xnuppc+80x25, use=xnuppc+basic, + +xnuppc-80x25|darwin-80x25|Darwin PowerPC Console (color) 80x25, + use=xnuppc+c, use=xnuppc+80x25, use=xnuppc+basic, + +xnuppc-80x30-m|darwin-80x30-m|Darwin PowerPC Console (monochrome) 80x30, + use=xnuppc+80x30, use=xnuppc+basic, + +xnuppc-80x30|darwin-80x30|Darwin PowerPC Console (color) 80x30, + use=xnuppc+c, use=xnuppc+80x30, use=xnuppc+basic, + +xnuppc-90x30-m|darwin-90x30-m|Darwin PowerPC Console (monochrome) 90x30, + use=xnuppc+90x30, use=xnuppc+basic, + +xnuppc-90x30|darwin-90x30|Darwin PowerPC Console (color) 90x30, + use=xnuppc+c, use=xnuppc+90x30, use=xnuppc+basic, + +xnuppc-100x37-m|darwin-100x37-m|Darwin PowerPC Console (monochrome) 100x37, + use=xnuppc+100x37, use=xnuppc+basic, + +xnuppc-100x37|darwin-100x37|Darwin PowerPC Console (color) 100x37, + use=xnuppc+c, use=xnuppc+100x37, use=xnuppc+basic, + +xnuppc-112x37-m|darwin-112x37-m|Darwin PowerPC Console (monochrome) 112x37, + use=xnuppc+112x37, use=xnuppc+basic, + +xnuppc-112x37|darwin-112x37|Darwin PowerPC Console (color) 112x37, + use=xnuppc+c, use=xnuppc+112x37, use=xnuppc+basic, + +xnuppc-128x40-m|darwin-128x40-m|Darwin PowerPC Console (monochrome) 128x40, + use=xnuppc+128x40, use=xnuppc+basic, + +xnuppc-128x40|darwin-128x40|Darwin PowerPC Console (color) 128x40, + use=xnuppc+c, use=xnuppc+128x40, use=xnuppc+basic, + +xnuppc-128x48-m|darwin-128x48-m|Darwin PowerPC Console (monochrome) 128x48, + use=xnuppc+128x48, use=xnuppc+basic, + +xnuppc-128x48|darwin-128x48|Darwin PowerPC Console (color) 128x48, + use=xnuppc+c, use=xnuppc+128x48, use=xnuppc+basic, + +xnuppc-144x48-m|darwin-144x48-m|Darwin PowerPC Console (monochrome) 144x48, + use=xnuppc+144x48, use=xnuppc+basic, + +xnuppc-144x48|darwin-144x48|Darwin PowerPC Console (color) 144x48, + use=xnuppc+c, use=xnuppc+144x48, use=xnuppc+basic, + +xnuppc-160x64-m|darwin-160x64-m|Darwin PowerPC Console (monochrome) 160x64, + use=xnuppc+160x64, use=xnuppc+basic, + +xnuppc-160x64|darwin-160x64|Darwin PowerPC Console (color) 160x64, + use=xnuppc+c, use=xnuppc+160x64, use=xnuppc+basic, + +xnuppc-200x64-m|darwin-200x64-m|Darwin PowerPC Console (monochrome) 200x64, + use=xnuppc+200x64, use=xnuppc+basic, + +xnuppc-200x64|darwin-200x64|Darwin PowerPC Console (color) 200x64, + use=xnuppc+c, use=xnuppc+200x64, use=xnuppc+basic, + +xnuppc-200x75-m|darwin-200x75-m|Darwin PowerPC Console (monochrome) 200x75, + use=xnuppc+200x75, use=xnuppc+basic, + +xnuppc-200x75|darwin-200x75|Darwin PowerPC Console (color) 200x75, + use=xnuppc+c, use=xnuppc+200x75, use=xnuppc+basic, + +xnuppc-256x96-m|darwin-256x96-m|Darwin PowerPC Console (monochrome) 256x96, + use=xnuppc+256x96, use=xnuppc+basic, + +xnuppc-256x96|darwin-256x96|Darwin PowerPC Console (color) 256x96, + use=xnuppc+c, use=xnuppc+256x96, use=xnuppc+basic, + #### Radio Shack/Tandy # @@ -14679,7 +15544,7 @@ mai|basic4|MAI Basic Four in ansi mode, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=^X, cup=\E[%i%p1%d;%p2%dH, cuu1=^Z, cvvis=\E[?7l, dch1=\E[1P, dl1=\E[M, ed=^_, el=^^, home=^], ht=^I, - if=/usr/lib/tabset/vt100, il1=\E[L, ind=\ED, + if=/usr/share/tabset/vt100, il1=\E[L, ind=\ED, is2=\E>\E[?1h\E[?7h\E[?5l\017\E(B\E[m\E[20l\E[1;24r\E[24;1H, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, @@ -17058,7 +17923,7 @@ dwk|dwk-vt|dwk terminal, env230|envision230|envision 230 graphics terminal, xenl@, mc0=\E[0i, mc4=\E[4i, mc5=\E[5i, - sgr=\E[%?%p1%t;1%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m, + sgr=\E[%?%p1%t;1%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m$<2>, use=vt100, # These execuports were impact-printer ttys with a 30- or maybe 15-cps acoustic # coupler attached, the whole rig fitting in a suitcase and more or less @@ -18597,6 +19462,83 @@ v3220|LANPAR Vision II model 3220/3221/3222, # bracketing sequences that reset video attributes (\E8 would restore # them) -TD # +# 2000-11-11 +# * rename cygwin to cygwinB19, adapt newer entry from Earnie Boyd -TD +# +# 2000-12-16 +# * improved scoansi, based on SCO man-page, and testing console, +# scoterm with tack -TD +# +# 2001-01-27 +# * modify kterm to use acsc via SCS controls. +# +# 2001-02-10 +# * screen 3.9.8 allows xterm mouse controls to pass-through +# +# 2001-03-11 +# * remove spurious "%|" from some xterm entries. +# +# 2001-03-31 +# * modify 'screen' khome/kend to match screen 3.09.08 +# * add examples of 'screen' customization (screen.xterm-xfree86, +# screen.xterm-r6, screen.teraterm) -TD +# +# 2001-04-14 +# * correct definitions of shifted editing keys for xterm-xfree86 -TD +# * add "Apple_Terminal" entries -Benjamin Sittler +# * remove time-delays from "Apple_Terminal" entries -TD +# * make sgr entries time-delays consistent with individual caps -TD +# +# 2001-05-05 +# * corrected/updated screen.xterm-xfree86 +# +# 2001-05-19 +# * ELKS descriptions, from Federico Bianchi +# * add u6 (CSR) to Eterm (Michael Jennings). +# +# 2001-07-21 +# * renamed "Apple_Terminal" entries to "nsterm" to work with Solaris's +# tic which handles names no longer than 14 characters. Add +# corresponding descriptions for the Darwin PowerPC console named +# "xnuppc" -Benjamin Sittler +# +# 2001-09-01 +# * change kbs in mach entries to ^? (Marcus Brinkmann). +# +# 2001-11-17 +# * add "putty" entry -TD +# * updated "Apple_Terminal" entries -Benjamin Sittler +# +# 2001-11-24 +# * add ms-vt100-color entry -TD +# * add "konsole" entries -TD +# +# 2001-12-08 +# * update gnome entry to Redhat 7.2 -TD +# +# 2002-05-25 +# * add kf13-kf48 strings to cons25w -TD +# * add pcvt25-color entry -TD +# * changed a few /usr/lib/tabset -> /usr/share/tabset. +# * improve some features of scoansi entry based on SCO's version -TD +# * add scoansi-new entry corresponding to OpenServer 5.0.6 +# +# 2002-06-15 +# * add kcbt to screen entry -TD +# +# 2002-06-22 +# * add rxvt-16color, ibm+16color, mvterm entries -TD +# +# 2002-09-28 +# * split out linux-basic entry, making linux-c inherit from that, and +# in turn linux (with cnorm, etc) inherit from linux-c-nc to reflect +# the history of this console type -TD +# * scaled the linux-c terminfo entry to match linux-c-nc, i.e., the +# r/g/b parameters of initc are in the range 0 to 1000 -TD +# +# 2002-1005 +# * minor fix for scale-factor of linux-c and linux-c-nc -TD +# # The following sets edit modes for GNU EMACS. # Local Variables: # fill-prefix:"\t" diff --git a/mk-0th.awk b/mk-0th.awk index 5173269e..399f156b 100644 --- a/mk-0th.awk +++ b/mk-0th.awk @@ -1,6 +1,6 @@ -# $Id: mk-0th.awk,v 1.8 2000/01/09 00:29:10 tom Exp $ +# $Id: mk-0th.awk,v 1.14 2002/08/31 21:36:54 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998-2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,32 +32,42 @@ # Generate list of sources for a library, together with lint/lintlib rules # # Variables: -# name (library name, e.g., "ncurses", "panel", "forms", "menus") +# libname (library name, e.g., "ncurses", "panel", "forms", "menus") # BEGIN { print "" print "# generated by mk-0th.awk" print "" - print ".SUFFIXES: .c .h .i" + print ".SUFFIXES: .c .cc .h .i .ii" print ".c.i :" printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" + print ".cc.ii :" + printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" print ".h.i :" printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" print "" found = 0; } !/^[@#]/ { - if ( $0 != "" ) + if ( $0 != "" && $1 != "link_test" ) { if ( found == 0 ) { + if ( subsets ~ /widechar/ ) + widechar = 1; + else + widechar = 0; printf "C_SRC =" if ( $2 == "lib" ) found = 1 else found = 2 } - printf " \\\n\t%s/%s.c", $3, $1 + if ( libname == "c++" || libname == "c++w" ) { + printf " \\\n\t%s/%s.cc", $3, $1 + } else if ( widechar == 1 || $3 != "$(wide)" ) { + printf " \\\n\t%s/%s.c", $3, $1 + } } } END { @@ -65,19 +75,19 @@ END { if ( found == 1 ) { print "" - printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", name + printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", libname print "# it in the lintlib rule. We'll only remove in the cleanest setup." print "clean ::" - printf "\trm -f llib-l%s.*\n", name + printf "\trm -f llib-l%s.*\n", libname print "" print "realclean ::" - printf "\trm -f llib-l%s\n", name + printf "\trm -f llib-l%s\n", libname print "" - printf "llib-l%s : $(C_SRC)\n", name + printf "llib-l%s : $(C_SRC)\n", libname printf "\tcproto -a -l -DLINT $(CPPFLAGS) $(C_SRC) >$@\n" print "" print "lintlib :" - printf "\t$(srcdir)/../misc/makellib %s $(CPPFLAGS)", name + printf "\tsh $(srcdir)/../misc/makellib %s $(CPPFLAGS)", libname print "" print "lint :" print "\t$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(C_SRC) $(LINT_LIBS)" diff --git a/mk-1st.awk b/mk-1st.awk index c14219cd..bbd7c40e 100644 --- a/mk-1st.awk +++ b/mk-1st.awk @@ -1,6 +1,6 @@ -# $Id: mk-1st.awk,v 1.46 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +# $Id: mk-1st.awk,v 1.55 2002/04/20 17:32:47 tom Exp $ ############################################################################## -# Copyright (c) 1998,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -40,6 +40,7 @@ # subset ("none", "base", "base+ext_funcs" or "termlib") # target (cross-compile target, if any) # ShlibVer ("rel", "abi" or "auto", to augment DoLinks variable) +# ShlibVerInfix ("yes" or "no", determines location of version #) # DoLinks ("yes", "reverse" or "no", flag to add symbolic links) # rmSoLocs ("yes" or "no", flag to add extra clean target) # overwrite ("yes" or "no", flag to add link to libcurses.a @@ -77,7 +78,7 @@ function removelinks(directory) { } } function sharedlinks(directory) { - if ( ShlibVer != "auto" ) { + if ( ShlibVer != "auto" && ShlibVer != "cygdll" ) { printf "\tcd %s && (", directory if ( DoLinks == "reverse" ) { if ( ShlibVer == "rel" ) { @@ -131,6 +132,7 @@ BEGIN { } { if (using \ + && ( $1 != "link_test" ) \ && ( $2 == "lib" \ || $2 == "progs" \ || $2 == "c++" \ @@ -159,35 +161,76 @@ END { lib_name = sprintf("%s%s%s", prefix, name, suffix) if ( MODEL == "SHARED" ) { - abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); - rel_name = sprintf("%s.$(REL_VERSION)", lib_name); + if (ShlibVerInfix == "cygdll") { + abi_name = sprintf("%s%s$(ABI_VERSION)%s", prefix, name, suffix); + rel_name = sprintf("%s%s$(REL_VERSION)%s", prefix, name, suffix); + imp_name = sprintf("%s%s%s.a", prefix, name, suffix); + } else if (ShlibVerInfix == "yes") { + abi_name = sprintf("%s%s.$(ABI_VERSION)%s", prefix, name, suffix); + rel_name = sprintf("%s%s.$(REL_VERSION)%s", prefix, name, suffix); + } else { + abi_name = sprintf("%s.$(ABI_VERSION)", lib_name); + rel_name = sprintf("%s.$(REL_VERSION)", lib_name); + } if ( DoLinks == "reverse") { end_name = lib_name; } else { if ( ShlibVer == "rel" ) { end_name = rel_name; - } else if ( ShlibVer == "abi" ) { + } else if ( ShlibVer == "abi" || ShlibVer == "cygdll" ) { end_name = abi_name; } else { end_name = lib_name; } } - printf "../lib/%s : $(%s_OBJS)\n", end_name, OBJS - print "\t-@rm -f $@" + + if ( ShlibVer == "cygdll" ) { + dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)"; + printf "$(SHARED_LIB) $(IMPORT_LIB) : $(%s_OBJS)\n", OBJS; + print "\t-@rm -f $(SHARED_LIB) $(IMPORT_LIB)"; + } else { + dst_dirs = "$(DESTDIR)$(libdir)"; + printf "../lib/%s : $(%s_OBJS)\n", end_name, OBJS + print "\t-@rm -f $@"; + } if ( subset == "termlib") { printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(TINFO_LIST)\n", OBJS } else { - printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST)\n", OBJS + printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST) $(LDFLAGS)\n", OBJS } sharedlinks("../lib") + print "" print "install \\" print "install.libs \\" - printf "install.%s :: $(DESTDIR)$(libdir) ../lib/%s\n", name, end_name - printf "\t@echo installing ../lib/%s as $(DESTDIR)$(libdir)/%s\n", end_name, end_name - printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", end_name - printf "\t$(INSTALL_LIB) ../lib/%s $(DESTDIR)$(libdir)/%s\n", end_name, end_name - sharedlinks("$(DESTDIR)$(libdir)") + printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs + + if ( ShlibVer == "cygdll" ) { + + src_name = sprintf("../lib/%s", end_name); + dst_name = sprintf("$(DESTDIR)$(bindir)/%s", end_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + src_name = sprintf("../lib/%s", imp_name); + dst_name = sprintf("$(DESTDIR)$(libdir)/%s", imp_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + } else { + + src_name = sprintf("../lib/%s", end_name); + dst_name = sprintf("$(DESTDIR)$(libdir)/%s", end_name); + printf "\t@echo installing %s as %s\n", src_name, dst_name + printf "\t-@rm -f %s\n", dst_name + printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name + + sharedlinks("$(DESTDIR)$(libdir)") + + } + if ( overwrite == "yes" && name == "ncurses" ) { ovr_name = sprintf("libcurses%s", suffix) @@ -201,12 +244,22 @@ END { print "uninstall \\" print "uninstall.libs \\" printf "uninstall.%s ::\n", name - printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", end_name - removelinks("$(DESTDIR)$(libdir)") - if ( overwrite == "yes" && name == "ncurses" ) - { - ovr_name = sprintf("libcurses%s", suffix) - printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", ovr_name + if ( ShlibVer == "cygdll" ) { + + printf "\t@echo uninstalling $(DESTDIR)$(bindir)/%s\n", end_name + printf "\t-@rm -f $(DESTDIR)$(bindir)/%s\n", end_name + + printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", imp_name + printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", imp_name + + } else { + printf "\t@echo uninstalling $(DESTDIR)$(libdir)/%s\n", end_name + removelinks("$(DESTDIR)$(libdir)") + if ( overwrite == "yes" && name == "ncurses" ) + { + ovr_name = sprintf("libcurses%s", suffix) + printf "\t-@rm -f $(DESTDIR)$(libdir)/%s\n", ovr_name + } } if ( rmSoLocs == "yes" ) { print "" diff --git a/mkinstalldirs b/mkinstalldirs index 8f0503e0..ffe7494c 100755 --- a/mkinstalldirs +++ b/mkinstalldirs @@ -23,7 +23,8 @@ for file in ${1+"$@"} ; do if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 case "$pathcomp" in - [a-zA-Z]: ) ;; # DOSISH systems + [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: ) + ;; # DOSISH systems * ) mkdir "$pathcomp" || errstatus=$? ;; esac fi diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in index 208b819d..bbc7622c 100644 --- a/ncurses/Makefile.in +++ b/ncurses/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.71 2000/10/14 22:55:35 tom Exp $ +# $Id: Makefile.in,v 1.84 2002/06/29 22:36:25 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996-2001 # # Makefile for ncurses source code. # @@ -55,9 +55,11 @@ CF_MFLAGS = @cf_cv_makeflags@ MODEL = @DFT_LWR_MODEL@ DESTDIR = @DESTDIR@ +top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ @@ -66,6 +68,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -79,14 +82,14 @@ CPP = @CPP@ CFLAGS = @CFLAGS@ INCDIR = $(srcdir)/../include -CPPFLAGS = -I../ncurses -I$(srcdir) @CPPFLAGS@ \ - -DHAVE_CONFIG_H +CPPFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) HOSTCC = @BUILD_CC@ -HOSTCCFLAGS = @CFLAGS@ $(CPPFLAGS) -HOSTLDFLAGS = @LDFLAGS@ @LIBS@ +HOSTCCFLAGS = -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) @BUILD_CFLAGS@ @BUILD_CPPFLAGS@ +HOSTLDFLAGS = @BUILD_LDFLAGS@ +HOSTLIBS = @BUILD_LIBS@ CFLAGS_LIBTOOL = $(CCFLAGS) CFLAGS_NORMAL = $(CCFLAGS) @@ -99,7 +102,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) @SHLIB_LIST@ TINFO_LIST = $(SHLIB_DIRS) @TINFO_LIST@ @@ -112,6 +115,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -120,17 +125,21 @@ LINT_LIBS = -lncurses @LIBS@ FALLBACK_LIST = @FALLBACK_LIST@ +TERMINFO_CAPS = $(top_srcdir)/include/@TERMINFO_CAPS@ + AUTO_SRC = \ ../include/nomacros.h \ - ./comp_captab.c \ - ./expanded.c \ - ./fallback.c \ + codes.c \ + comp_captab.c \ + expanded.c \ + fallback.c \ init_keytry.h \ - ./lib_keyname.c \ - ./lib_gen.c \ - ./codes.c \ - ./names.c \ - ./unctrl.c + keys.list \ + lib_gen.c \ + lib_keyname.c \ + link_test.c \ + names.c \ + unctrl.c TEST_DEPS = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@ TEST_ARGS = -L../lib -lncurses@DFT_ARG_SUFFIX@ @@ -139,6 +148,7 @@ TEST_LDFLAGS = @LD_MODEL@ $(TEST_ARGS) @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFL TEST_PROGS = \ captoinfo$x \ hardscroll$x \ + link_test$x \ hashmap$x \ lib_mvcur$x @@ -146,6 +156,7 @@ base = $(srcdir)/base serial = $(srcdir)/tty tinfo = $(srcdir)/tinfo trace = $(srcdir)/trace +wide = $(srcdir)/widechar ################################################################################ all \ @@ -153,53 +164,57 @@ libs :: $(AUTO_SRC) ../lib $(LIBRARIES) sources: $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ ../lib : ; mkdir $@ -./fallback.c : $(tinfo)/MKfallback.sh - sh $(tinfo)/MKfallback.sh $(FALLBACK_LIST) >$@ +fallback.c : $(tinfo)/MKfallback.sh + sh $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@ -./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h - sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h >$@ +lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@ ../include/nomacros.h : $(base)/MKlib_gen.sh ../include/curses.h - sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h | \ + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h | \ fgrep undef >$@ -init_keytry.h: make_keys$x $(tinfo)/keys.list - ./make_keys $(tinfo)/keys.list > $@ +init_keytry.h: make_keys$x keys.list + ./make_keys keys.list > $@ + +keys.list : $(tinfo)/MKkeys_list.sh + AWK=$(AWK) sh $(tinfo)/MKkeys_list.sh $(TERMINFO_CAPS) | sort >$@ make_keys$x : \ $(tinfo)/make_keys.c \ - ./names.c - $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) + names.c + $(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS) $(HOSTLIBS) make_hash$x : \ $(tinfo)/comp_hash.c \ ../include/hashsize.h - $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) + $(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS) $(HOSTLIBS) -./expanded.c : $(serial)/MKexpanded.sh +expanded.c : $(serial)/MKexpanded.sh sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@ -./comp_captab.c: \ +comp_captab.c: \ make_hash$x \ ../include/hashsize.h \ $(tinfo)/MKcaptab.awk - sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/Caps > $@ + sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ > $@ -./lib_keyname.c: $(tinfo)/keys.list $(base)/MKkeyname.awk - $(AWK) -f $(base)/MKkeyname.awk $(tinfo)/keys.list > $@ +lib_keyname.c: keys.list $(base)/MKkeyname.awk + $(AWK) -f $(base)/MKkeyname.awk keys.list > $@ -./names.c ./codes.c: $(tinfo)/MKnames.awk - $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/Caps - cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >./names.c - cat namehdr boolcodes numcodes strcodes codeftr >./codes.c +names.c codes.c: $(tinfo)/MKnames.awk + $(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/@TERMINFO_CAPS@ + cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >names.c + cat namehdr boolcodes numcodes strcodes codeftr >codes.c -rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes -./unctrl.c: $(base)/MKunctrl.awk +unctrl.c: $(base)/MKunctrl.awk echo | $(AWK) -f $(base)/MKunctrl.awk >$@ tags: @@ -209,7 +224,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace -rm -f $(TEST_PROGS) clean :: mostlyclean @@ -232,6 +247,9 @@ realclean :: distclean # These rules build test-programs for the modules that have test-drivers test_progs : $(TEST_PROGS) +link_test.c : $(base)/MKlib_gen.sh ../include/curses.h + sh $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" implemented <../include/curses.h >$@ + captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS) @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS) @@ -245,6 +263,10 @@ lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \ ../@DFT_OBJ_SUBDIR@/dump_entry.o @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS) +link_test$x : link_test.c $(TEST_DEPS) \ + ../@DFT_OBJ_SUBDIR@/link_test.o + @ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) ../@DFT_OBJ_SUBDIR@/link_test.o $(TEST_LDFLAGS) + ../@DFT_OBJ_SUBDIR@/dump_entry.o: cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o diff --git a/ncurses/README b/ncurses/README index aade721a..20c94d3c 100644 --- a/ncurses/README +++ b/ncurses/README @@ -1,2 +1,2 @@ -For discussion of the package internals, see hackguide.html in the misc +For discussion of the package internals, see hackguide.html in the doc/html directory. diff --git a/ncurses/README.IZ b/ncurses/README.IZ new file mode 100644 index 00000000..2952f685 --- /dev/null +++ b/ncurses/README.IZ @@ -0,0 +1,65 @@ +Here is the patch. I did no testing whatsoever with event watching +requests present (I need some applications which exersize this before +this, probably lynx ;-), but the code looks working "the normal way". + +I had no way to test that the poll() branch compiles/works... + +Here is the API: + +*) two new functions wgetch_events() wgetstrn_event() are introduced, + which allow an event-watch specification given as the last argument; + +*) if the last argument is NULL, they behave as wgetch() and + wgetstrn() (TESTED!); + +*) the event specification is a pointer to _nc_eventlist, which + contains bookkeeping elements (count and the summary of results), + and an array of pointers to _nc_event; + +*) each _nc_event is a typed union, with two types supported "as + shipped": _NC_EVENT_TIMEOUT_MSEC, _NC_EVENT_FILE. For + _NC_EVENT_FILE the fields are fd, flag, and the output field. + +*) The only supported flag "as shipped" is _NC_EVENT_FILE_READABLE. + If the file was found readable, the return field is set to this, + otherwise to 0; + +*) If these functions return KEY_EVENT, this means that the return + fields in both the _nc_eventlist and _nc_event structures make + sense. The field result_flags of _nc_eventlist may have a + combination of bits _NC_EVENT_TIMEOUT_MSEC and _NC_EVENT_FILE_READABLE + set; + +*) The timeout_msec field of _NC_EVENT_TIMEOUT_MSEC _nc_event's is + updated on return, even if the return is not KEY_EVENT. However, + the change in the value represents only the amount of time spent in + waiting for events, not the amount of time spent bookkeeping; + +*) the return KEY_EVENT of wgetstrn_event() means that the output + string includes the user input typed so far, but the user did not have + a chance to press ENTER (or whatever). This call should be + repeated (with "shifted" pointer to a buffer, of course) to + complete the input; + +*) The presence of this extension can be checked via inspecting + #ifdef NCURSES_EVENT_VERSION. This symbol is not defined on BeOS, + since there is no support for this on BeOS. + +Known issues: calls interrupted by KEY_EVENT reset the ESCDELAY +timer. This is not entirely new, since other synthetic events behave +the same (see "if (ch >= KEY_MIN)" branch of kgetch()). However, +KEY_EVENT may be generated in a continuous stream (say, when +downloading a file), thus this may be more important than with other +synthetic keys. An additional field in window structure which keeps +timestamp of the first raw key in the queue may be needed to +circumvent this. + +Another possible issue: KEY_EVENT has a preference over a user input, +so a stream of KEY_EVENT's can make input hard. Maybe use +result_flags as in input parameter too, which specifies whether the +user input should have higher precedence? + +Also: I took an opportunity to document kgetch() better. + +Enjoy, +Ilya diff --git a/ncurses/SigAction.h b/ncurses/SigAction.h index 9b5a31a8..53d12bfd 100644 --- a/ncurses/SigAction.h +++ b/ncurses/SigAction.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ ****************************************************************************/ /* - * $Id: SigAction.h,v 1.5 1999/06/19 23:00:54 tom Exp $ + * $Id: SigAction.h,v 1.6 2000/12/10 02:36:10 tom Exp $ * * This file exists to handle non-POSIX systems which don't have , * and usually no sigaction() nor @@ -105,12 +105,12 @@ typedef unsigned long sigset_t; #undef sigaddset #define sigaddset _nc_sigaddset -extern int sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact); -extern int sigprocmask (int how, sigset_t *mask, sigset_t *omask); -extern int sigemptyset (sigset_t *mask); -extern int sigsuspend (sigset_t *mask); -extern int sigdelset (sigset_t *mask, int sig); -extern int sigaddset (sigset_t *mask, int sig); +extern NCURSES_EXPORT(int) sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact); +extern NCURSES_EXPORT(int) sigprocmask (int how, sigset_t *mask, sigset_t *omask); +extern NCURSES_EXPORT(int) sigemptyset (sigset_t *mask); +extern NCURSES_EXPORT(int) sigsuspend (sigset_t *mask); +extern NCURSES_EXPORT(int) sigdelset (sigset_t *mask, int sig); +extern NCURSES_EXPORT(int) sigaddset (sigset_t *mask, int sig); #endif /* HAVE_SIGVEC */ #endif /* HAVE_SIGACTION */ diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk index aaeb4743..4bf83eaf 100644 --- a/ncurses/base/MKkeyname.awk +++ b/ncurses/base/MKkeyname.awk @@ -1,6 +1,6 @@ -# $Id: MKkeyname.awk,v 1.17 1999/02/18 11:18:06 tom Exp $ +# $Id: MKkeyname.awk,v 1.24 2002/09/01 19:43:34 tom Exp $ ############################################################################## -# Copyright (c) 1999 Free Software Foundation, Inc. # +# Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -29,10 +29,7 @@ BEGIN { print "/* generated by MKkeyname.awk */" print "" - print "#include " - print "#include " - print "#include " - print "#include " + print "#include " print "#include " print "" print "const struct kn _nc_key_names[] = {" @@ -45,30 +42,49 @@ BEGIN { END { printf "\t{ 0, 0 }};\n" print "" - print "NCURSES_CONST char *keyname(int c)" + print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)" print "{" + print "static char **table;" print "int i;" - print "static char name[20];" + print "char name[20];" print "char *p;" print "" + print "\tif (c == -1) return \"-1\";" + print "" print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)" print "\t\tif (_nc_key_names[i].code == c)" print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;" - print "\tif (c >= 256) return \"UNKNOWN KEY\";" - print "\tp = name;" - print "\tif (c >= 128) {" - print "\t\tstrcpy(p, \"M-\");" - print "\t\tp += 2;" - print "\t\tc -= 128;" + print "\tif (c < 0 || c >= 256) return 0;" + print "" + print "\tif (table == 0)" + print "\t\ttable = typeCalloc(char *, 256);" + print "\tif (table == 0)" + print "\t\treturn keyname(256);" + print "" + print "\tif (table[c] == 0) {" + print "\t\tp = name;" + print "\t\tif (c >= 128) {" + print "\t\t\tstrcpy(p, \"M-\");" + print "\t\t\tp += 2;" + print "\t\t\tc -= 128;" + print "\t\t}" + print "\t\tif (c < 32)" + print "\t\t\tsprintf(p, \"^%c\", c + '@');" + print "\t\telse if (c == 127)" + print "\t\t\tstrcpy(p, \"^?\");" + print "\t\telse" + print "\t\t\tsprintf(p, \"%c\", c);" + print "\t\ttable[c] = strdup(name);" print "\t}" - print "\tif (c < 0)" - print "\t\tsprintf(p, \"%d\", c);" - print "\telse if (c < 32)" - print "\t\tsprintf(p, \"^%c\", c + '@');" - print "\telse if (c == 127)" - print "\t\tstrcpy(p, \"^?\");" - print "\telse" - print "\t\tsprintf(p, \"%c\", c);" - print "\treturn (NCURSES_CONST char *)name;" + print "\treturn (NCURSES_CONST char *)table[c];" + print "}" + print "" + print "#if USE_WIDEC_SUPPORT" + print "NCURSES_EXPORT(NCURSES_CONST char *) key_name (wchar_t c)" + print "{" + print "\tNCURSES_CONST char *result = keyname((int)c);" + print "\tif (!strncmp(result, \"M-\", 2)) result = 0;" + print "\treturn result;" print "}" + print "#endif" } diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh index 33779400..7dcef086 100755 --- a/ncurses/base/MKlib_gen.sh +++ b/ncurses/base/MKlib_gen.sh @@ -2,7 +2,35 @@ # # MKlib_gen.sh -- generate sources from curses.h macro definitions # -# ($Id: MKlib_gen.sh,v 1.12 2000/07/29 16:30:11 tom Exp $) +# ($Id: MKlib_gen.sh,v 1.20 2002/09/28 15:02:11 tom Exp $) +# +############################################################################## +# Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## # # The XSI Curses standard requires all curses entry points to exist as # functions, even though many definitions would normally be shadowed @@ -26,23 +54,40 @@ # 7. sed: squeeze spaces, strip off gen_ prefix, create needed #undef # +# keep the editing independent of locale: +if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi + preprocessor="$1 -I../include" AWK="$2" -ED1=sed1$$.sed -ED2=sed2$$.sed -ED3=sed3$$.sed -AW1=awk1$$.awk -TMP=gen$$.c -trap "rm -f $ED1 $ED2 $ED3 $AW1 $TMP" 0 1 2 5 15 - -(cat < -#include +USE="$3" -DECLARATIONS +PID=$$ +ED1=sed1_${PID}.sed +ED2=sed2_${PID}.sed +ED3=sed3_${PID}.sed +ED4=sed4_${PID}.sed +AW1=awk1_${PID}.awk +AW2=awk2_${PID}.awk +TMP=gen__${PID}.c +trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 5 15 -EOF -cat >$ED1 <$ED1 <$ED1 <$ED1 <$ED2 <$ED2 <$ED3 <$ED3 <$ED4 <$ED4 <$AW1 <<\EOF1 BEGIN { skip=0; } - /^P_#if/ { +/^P_#if/ { print "\n" print $0 skip=0; - } - /^P_#endif/ { +} +/^P_#endif/ { print $0 skip=1; - } - $0 !~ /^P_/ { +} +$0 !~ /^P_/ { if (skip) print "\n" skip=1; - if ( $1 == "chtype" ) { + first=$1 + for (i = 1; i <= NF; i++) { + if ( $i != "NCURSES_CONST" ) { + first = i; + break; + } + } + second = first + 1; + if ( $first == "chtype" ) { returnType = "Char"; + } else if ( $first == "SCREEN" ) { + returnType = "SP"; + } else if ( $first == "WINDOW" ) { + returnType = "Win"; + } else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) { + returnType = "Attr"; + } else if ( $first == "bool" || $first == "NCURSES_BOOL" ) { + returnType = "Bool"; + } else if ( $second == "*" ) { + returnType = "Ptr"; } else { returnType = "Code"; } - print "M_" $2 + myfunc = second; + for (i = second; i <= NF; i++) { + if ($i != "*") { + myfunc = i; + break; + } + } + if (using == "generated") { + print "M_" $myfunc + } print $0; print "{"; argcount = 1; - if (NF == 5 && $4 == "void") + check = NF - 1; + if ($check == "void") argcount = 0; if (argcount != 0) { for (i = 1; i <= NF; i++) @@ -133,16 +237,27 @@ BEGIN { # suppress trace-code for functions that we cannot do properly here, # since they return data. dotrace = 1; - if ($2 == "innstr") + if ($myfunc ~ /innstr/) + dotrace = 0; + if ($myfunc ~ /innwstr/) dotrace = 0; + # workaround functions that we do not parse properly + if ($myfunc ~ /ripoffline/) { + dotrace = 0; + argcount = 2; + } + if ($myfunc ~ /wunctrl/) { + dotrace = 0; + } + call = "%%T((T_CALLED(\"" args = "" comma = "" num = 0; pointer = 0; argtype = "" - for (i = 1; i <= NF; i++) { + for (i = myfunc; i <= NF; i++) { ch = $i; if ( ch == "*" ) pointer = 1; @@ -181,7 +296,7 @@ BEGIN { } if (ch == ",") args = args comma "a" ++num; - else if (argcount != 0) + else if ( argcount != 0 && $check != "..." ) args = args comma "z" call = call ch if (pointer == 0 && argcount != 0 && argtype != "" ) @@ -209,11 +324,17 @@ BEGIN { else call = "%%return "; - call = call $2 "("; - for (i = 1; i < argcount; i++) - call = call "a" i ", "; - if (argcount != 0) + call = call $myfunc "("; + for (i = 1; i < argcount; i++) { + if (i != 1) + call = call ", "; + call = call "a" i; + } + if ( argcount != 0 && $check != "..." ) { + if (argcount != 1) + call = call ", "; call = call "z"; + } if (!match($0, "^void")) call = call ") "; if (dotrace) @@ -226,34 +347,54 @@ BEGIN { } EOF1 -sed -n -f $ED1 | sed -f $ED2 \ -| $AWK -f $AW1 ) \ -| sed \ - -e '/^\([a-z_][a-z_]*\) /s//\1 gen_/' >$TMP - $preprocessor $TMP 2>/dev/null \ -| $AWK ' +cat >$AW2 <" - print "" + print "/*" + print " * DO NOT EDIT THIS FILE BY HAND!" + printf " * It is generated by $0 %s.\n", "$USE" + if ( "$USE" == "generated" ) { + print " *" + print " * This is a file of trivial functions generated from macro" + print " * definitions in curses.h to satisfy the XSI Curses requirement" + print " * that every macro also exist as a callable function." + print " *" + print " * It will never be linked unless you call one of the entry" + print " * points with its normal macro definition disabled. In that" + print " * case, if you have no shared libraries, it will indirectly" + print " * pull most of the rest of the library into your link image." + } + print " */" + print "#include " + print "" } /^DECLARATIONS/ {start = 1; next;} - {if (start) print $0;} -' \ + {if (start) print \$0;} +END { + if ( "$USE" != "generated" ) { + print "int main(void) { return 0; }" + } + } +EOF1 + +cat >$TMP < +#include + +DECLARATIONS + +EOF + +sed -n -f $ED1 \ +| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \ +| sed -f $ED2 \ +| $AWK -f $AW1 using=$USE \ +| sed -e 's/^\([a-z_][a-z_]*[ *]*\)/\1 gen_/' -e 's/ / /g' >>$TMP + +$preprocessor $TMP 2>/dev/null \ +| sed -e 's/ / /g' -e 's/^ //' \ +| $AWK -f $AW2 \ | sed -f $ED3 \ | sed \ -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \ - -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' - + -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \ +| sed -f $ED4 diff --git a/ncurses/base/MKunctrl.awk b/ncurses/base/MKunctrl.awk index 3d5b2563..d8a6587e 100644 --- a/ncurses/base/MKunctrl.awk +++ b/ncurses/base/MKunctrl.awk @@ -1,6 +1,6 @@ -# $Id: MKunctrl.awk,v 1.7 2000/04/01 19:49:26 tom Exp $ +# $Id: MKunctrl.awk,v 1.9 2001/06/02 23:59:20 skimo Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -39,7 +39,7 @@ BEGIN { print "" } END { - print "NCURSES_CONST char *unctrl(register chtype ch)" + print "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (register chtype ch)" print "{" printf "static const char* const table[] = {" for ( ch = 0; ch < 256; ch++ ) { @@ -64,6 +64,6 @@ END { } print "};" print "" - print "\treturn (NCURSES_CONST char *)table[TextOf(ch)];" + print "\treturn (NCURSES_CONST char *)table[ChCharOf(ch)];" print "}" } diff --git a/ncurses/base/define_key.c b/ncurses/base/define_key.c index 52dc6927..7fc885f8 100644 --- a/ncurses/base/define_key.c +++ b/ncurses/base/define_key.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,28 +32,29 @@ #include -MODULE_ID("$Id: define_key.c,v 1.4 1999/02/21 13:03:55 tom Exp $") +MODULE_ID("$Id: define_key.c,v 1.6 2000/12/10 02:43:26 tom Exp $") -int -define_key(char *str, int keycode) +NCURSES_EXPORT(int) +define_key +(char *str, int keycode) { - int code = ERR; + int code = ERR; - T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode)); - if (keycode > 0) { - if (str != 0) { - define_key(str, 0); - } else if (has_key(keycode)) { - while (_nc_remove_key(&(SP->_keytry), keycode)) - code = OK; - } - if (str != 0) { - (void) _nc_add_to_try(&(SP->_keytry), str, keycode); - code = OK; - } - } else { - while (_nc_remove_string(&(SP->_keytry), str)) - code = OK; + T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode)); + if (keycode > 0) { + if (str != 0) { + define_key(str, 0); + } else if (has_key(keycode)) { + while (_nc_remove_key(&(SP->_keytry), keycode)) + code = OK; } - returnCode(code); + if (str != 0) { + (void) _nc_add_to_try(&(SP->_keytry), str, keycode); + code = OK; + } + } else { + while (_nc_remove_string(&(SP->_keytry), str)) + code = OK; + } + returnCode(code); } diff --git a/ncurses/base/keybound.c b/ncurses/base/keybound.c index c9aa0229..c8ca2856 100644 --- a/ncurses/base/keybound.c +++ b/ncurses/base/keybound.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,14 +32,15 @@ #include -MODULE_ID("$Id: keybound.c,v 1.1 1999/02/19 11:55:56 tom Exp $") +MODULE_ID("$Id: keybound.c,v 1.3 2000/12/10 02:43:26 tom Exp $") /* * Returns the count'th string definition which is associated with the * given keycode. The result is malloc'd, must be freed by the caller. */ -char *keybound(int code, int count) +NCURSES_EXPORT(char *) +keybound(int code, int count) { - return _nc_expand_try(SP->_key_ok, code, &count, 0); + return _nc_expand_try(SP->_key_ok, code, &count, 0); } diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c index a1385769..e3b4be29 100644 --- a/ncurses/base/keyok.c +++ b/ncurses/base/keyok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: keyok.c,v 1.3 1999/02/19 11:29:48 tom Exp $") +MODULE_ID("$Id: keyok.c,v 1.5 2000/12/10 02:43:26 tom Exp $") /* * Enable (or disable) ncurses' interpretation of a keycode by adding (or @@ -44,29 +44,30 @@ MODULE_ID("$Id: keyok.c,v 1.3 1999/02/19 11:29:48 tom Exp $") * corresponding tree. */ -int keyok(int c, bool flag) +NCURSES_EXPORT(int) +keyok(int c, bool flag) { - int code = ERR; - int count = 0; - char *s; + int code = ERR; + int count = 0; + char *s; - T((T_CALLED("keyok(%d,%d)"), c, flag)); - if (flag) { - while ((s = _nc_expand_try(SP->_key_ok, c, &count, 0)) != 0 - && _nc_remove_key(&(SP->_key_ok), c)) { - _nc_add_to_try(&(SP->_keytry), s, c); - free(s); - code = OK; - count = 0; - } - } else { - while ((s = _nc_expand_try(SP->_keytry, c, &count, 0)) != 0 - && _nc_remove_key(&(SP->_keytry), c)) { - _nc_add_to_try(&(SP->_key_ok), s, c); - free(s); - code = OK; - count = 0; - } + T((T_CALLED("keyok(%d,%d)"), c, flag)); + if (flag) { + while ((s = _nc_expand_try(SP->_key_ok, c, &count, 0)) != 0 + && _nc_remove_key(&(SP->_key_ok), c)) { + _nc_add_to_try(&(SP->_keytry), s, c); + free(s); + code = OK; + count = 0; } - returnCode(code); + } else { + while ((s = _nc_expand_try(SP->_keytry, c, &count, 0)) != 0 + && _nc_remove_key(&(SP->_keytry), c)) { + _nc_add_to_try(&(SP->_key_ok), s, c); + free(s); + code = OK; + count = 0; + } + } + returnCode(code); } diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c index 69c17c34..5b41fedf 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,11 +26,6 @@ * authorization. * ****************************************************************************/ -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - ****************************************************************************/ - /* ** lib_addch.c ** @@ -41,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.44 2000/05/20 21:13:11 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.68 2002/09/28 17:48:13 tom Exp $") /* * Ugly microtweaking alert. Everything from here to end of module is @@ -54,39 +49,35 @@ MODULE_ID("$Id: lib_addch.c,v 1.44 2000/05/20 21:13:11 tom Exp $") */ /* Return bit mask for clearing color pair number if given ch has color */ -#define COLOR_MASK(ch) (~(chtype)((ch)&A_COLOR?A_COLOR:0)) +#define COLOR_MASK(ch) (~(attr_t)((ch)&A_COLOR?A_COLOR:0)) -static inline chtype -render_char(WINDOW *win, chtype ch) +static inline NCURSES_CH_T +render_char(WINDOW *win, NCURSES_CH_T ch) /* compute a rendition of the given char correct for the current context */ { - chtype a = win->_attrs; + attr_t a = win->_attrs; - if (ch == ' ') { - /* color in attrs has precedence over bkgd */ - ch = a | (win->_bkgd & COLOR_MASK(a)); + if (ISBLANK(ch) && AttrOf(ch) == A_NORMAL) { + /* color in attrs has precedence over bkgrnd */ + ch = win->_nc_bkgd; + SetAttr(ch, a | (AttrOf(win->_nc_bkgd) & COLOR_MASK(a))); } else { - /* color in attrs has precedence over bkgd */ - a |= (win->_bkgd & A_ATTRIBUTES) & COLOR_MASK(a); + /* color in attrs has precedence over bkgrnd */ + a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a); /* color in ch has precedence */ - ch |= (a & COLOR_MASK(ch)); + AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); } - TR(TRACE_VIRTPUT, ("bkg = %lx, attrs = %lx -> ch = %lx", win->_bkgd, - win->_attrs, ch)); + TR(TRACE_VIRTPUT, ("bkg = %s, attrs = %s -> ch = %s", + _tracech_t2(1, CHREF(win->_nc_bkgd)), + _traceattr(win->_attrs), + _tracech_t2(3, CHREF(ch)))); return (ch); } -chtype -_nc_background(WINDOW *win) -/* make render_char() visible while still allowing us to inline it below */ -{ - return (win->_bkgd); -} - -chtype -_nc_render(WINDOW *win, chtype ch) +NCURSES_EXPORT(NCURSES_CH_T) +_nc_render(WINDOW *win, NCURSES_CH_T ch) /* make render_char() visible while still allowing us to inline it below */ { return render_char(win, ch); @@ -109,7 +100,7 @@ _nc_render(WINDOW *win, chtype ch) #endif static inline int -waddch_literal(WINDOW *win, chtype ch) +waddch_literal(WINDOW *win, NCURSES_CH_T ch) { int x; struct ldat *line; @@ -122,7 +113,7 @@ waddch_literal(WINDOW *win, chtype ch) * If we're trying to add a character at the lower-right corner more * than once, fail. (Moving the cursor will clear the flag). */ -#if 0 /* Solaris 2.6 allows updating the corner more than once */ +#if 0 /* Solaris 2.6 allows updating the corner more than once */ if (win->_flags & _WRAPPED) { if (x >= win->_maxx) return (ERR); @@ -137,9 +128,39 @@ waddch_literal(WINDOW *win, chtype ch) CHANGED_CELL(line, x); + /* + * Handle non-spacing characters + */ + if_WIDEC({ + if (wcwidth(CharOf(ch)) == 0) { + int i; + int y; + if ((x > 0 && ((y = win->_cury) >= 0)) + || ((y = win->_cury - 1) >= 0 && + (x = win->_maxx) > 0)) { + wchar_t *chars = (win->_line[y].text[x - 1].chars); + for (i = 0; i < CCHARW_MAX; ++i) { + if (chars[i] == 0) { + chars[i] = CharOf(ch); + break; + } + } + } + goto testwrapping; + } + }); line->text[x++] = ch; + /* + * Provide for multi-column characters + */ + if_WIDEC({ + if (wcwidth(CharOf(ch)) > 1) + AddAttr(line->text[x++], WA_NAC); + } + testwrapping: + ); - TR(TRACE_VIRTPUT, ("(%d, %d) = %s", win->_cury, x, _tracechtype(ch))); + TR(TRACE_VIRTPUT, ("(%d, %d) = %s", win->_cury, x, _tracech_t(CHREF(ch)))); if (x > win->_maxx) { /* * The _WRAPPED flag is useful only for telling an application that @@ -167,15 +188,15 @@ waddch_literal(WINDOW *win, chtype ch) } static inline int -waddch_nosync(WINDOW *win, const chtype ch) +waddch_nosync(WINDOW *win, const NCURSES_CH_T ch) /* the workhorse function -- add a character to the given window */ { int x, y; - int t = 0; + chtype t = 0; const char *s = 0; - if ((ch & A_ALTCHARSET) - || ((t = TextOf(ch)) > 127) + if ((AttrOf(ch) & A_ALTCHARSET) + || ((t = CharOf(ch)) > 127) || ((s = unctrl(t))[1] == 0)) return waddch_literal(win, ch); @@ -192,7 +213,8 @@ waddch_nosync(WINDOW *win, const chtype ch) */ if ((!win->_scroll && (y == win->_regbottom)) || (x <= win->_maxx)) { - chtype blank = (' ' | AttrOf(ch)); + NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR); + AddAttr(blank, AttrOf(ch)); while (win->_curx < x) { if (waddch_literal(win, blank) == ERR) return (ERR); @@ -234,9 +256,12 @@ waddch_nosync(WINDOW *win, const chtype ch) win->_flags &= ~_WRAPPED; break; default: - while (*s) - if (waddch_literal(win, (*s++) | AttrOf(ch)) == ERR) + while (*s) { + NCURSES_CH_T sch; + SetChar(sch, *s++, AttrOf(ch)); + if (waddch_literal(win, sch) == ERR) return ERR; + } return (OK); } @@ -246,8 +271,8 @@ waddch_nosync(WINDOW *win, const chtype ch) return (OK); } -int -_nc_waddch_nosync(WINDOW *win, const chtype c) +NCURSES_EXPORT(int) +_nc_waddch_nosync(WINDOW *win, const NCURSES_CH_T c) /* export copy of waddch_nosync() so the string-put functions can use it */ { return (waddch_nosync(win, c)); @@ -261,15 +286,17 @@ _nc_waddch_nosync(WINDOW *win, const chtype c) /* These are actual entry points */ -int +NCURSES_EXPORT(int) waddch(WINDOW *win, const chtype ch) { int code = ERR; + NCURSES_CH_T wch; + SetChar2(wch, ch); TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win, - _tracechtype(ch))); + _tracechtype(ch))); - if (win && (waddch_nosync(win, ch) != ERR)) { + if (win && (waddch_nosync(win, wch) != ERR)) { _nc_synchook(win); code = OK; } @@ -278,15 +305,54 @@ waddch(WINDOW *win, const chtype ch) return (code); } -int +NCURSES_EXPORT(int) wechochar(WINDOW *win, const chtype ch) { int code = ERR; + NCURSES_CH_T wch; + SetChar2(wch, ch); TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, - _tracechtype(ch))); + _tracechtype(ch))); + + if (win && (waddch_nosync(win, wch) != ERR)) { + bool save_immed = win->_immed; + win->_immed = TRUE; + _nc_synchook(win); + win->_immed = save_immed; + code = OK; + } + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(int) +wadd_wch(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, + _tracech_t(wch))); + + if (win && (waddch_nosync(win, *wch) != ERR)) { + _nc_synchook(win); + code = OK; + } + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +NCURSES_EXPORT(int) +wecho_wchar(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, + _tracech_t(wch))); - if (win && (waddch_nosync(win, ch) != ERR)) { + if (win && (waddch_nosync(win, *wch) != ERR)) { bool save_immed = win->_immed; win->_immed = TRUE; _nc_synchook(win); @@ -296,3 +362,4 @@ wechochar(WINDOW *win, const chtype ch) TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } +#endif /* USE_WIDEC_SUPPORT */ diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index 59a3bae8..d6f93455 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,26 +40,69 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.18 2000/07/29 16:42:41 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.34 2002/10/06 00:25:25 tom Exp $") -int -waddnstr(WINDOW *win, const char *const astr, int n) +#if USE_WIDEC_SUPPORT +#define CONV_DATA mbstate_t state; wchar_t cached; int clen = 0 +#define CONV_INIT memset (&state, '\0', sizeof (state)); cached = (wchar_t)WEOF +#define NEXT_CHAR(s,ch, n) \ + { \ + int len, i = 0; \ + memset(&ch, 0, sizeof(cchar_t)); \ + if (cached != (wchar_t) WEOF) { \ + ch.chars[i++] = cached; \ + cached = (wchar_t) WEOF; \ + n -= clen; \ + s += clen; \ + } \ + for (; i < CCHARW_MAX && n > 0; ++i) { \ + if ((len = mbrtowc(&ch.chars[i], s, n, &state)) < 0) { \ + code = ERR; \ + break; \ + } \ + if (i == 0 || wcwidth(ch.chars[i]) == 0) { \ + n -= len; \ + s += len; \ + } else { \ + cached = ch.chars[i]; \ + clen = len; \ + ch.chars[i] = L'\0'; \ + break; \ + } \ + } \ + if (code == ERR) \ + break; \ + } +#else +#define CONV_DATA +#define CONV_INIT +#define NEXT_CHAR(s,ch, n) \ + ch = *s++; \ + --n +#endif + +NCURSES_EXPORT(int) +waddnstr(WINDOW *win, const char *astr, int n) { unsigned const char *str = (unsigned const char *) astr; int code = ERR; + CONV_DATA; - T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbuf(astr), n)); + T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbufn(astr, n), n)); if (win && (str != 0)) { TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs))); - TR(TRACE_VIRTPUT, ("str is not null")); code = OK; if (n < 0) n = (int) strlen(astr); - while ((n-- > 0) && (*str != '\0')) { + TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); + CONV_INIT; + while ((n > 0) && (*str != '\0')) { + NCURSES_CH_T ch; TR(TRACE_VIRTPUT, ("*str = %#x", *str)); - if (_nc_waddch_nosync(win, (chtype) * str++) == ERR) { + NEXT_CHAR(str, ch, n); + if (_nc_waddch_nosync(win, ch) == ERR) { code = ERR; break; } @@ -70,8 +113,8 @@ waddnstr(WINDOW *win, const char *const astr, int n) returnCode(code); } -int -waddchnstr(WINDOW *win, const chtype * const astr, int n) +NCURSES_EXPORT(int) +waddchnstr(WINDOW *win, const chtype * astr, int n) { NCURSES_SIZE_T y = win->_cury; NCURSES_SIZE_T x = win->_curx; @@ -95,9 +138,116 @@ waddchnstr(WINDOW *win, const chtype * const astr, int n) returnCode(code); line = &(win->_line[y]); +#if USE_WIDEC_SUPPORT + { + int i; + for (i = 0; i < n; ++i) + SetChar(line->text[i + x], ChCharOf(astr[i]), ChAttrOf(astr[i])); + } +#else memcpy(line->text + x, astr, n * sizeof(*astr)); +#endif CHANGED_RANGE(line, x, x + n - 1); _nc_synchook(win); returnCode(code); } + +#if USE_WIDEC_SUPPORT + +int +_nc_wchstrlen(const cchar_t * s) +{ + int result = 0; + while (CharOf(s[result]) != L'\0') { + result++; + } + return result; +} + +NCURSES_EXPORT(int) +wadd_wchnstr(WINDOW *win, const cchar_t * const astr, int n) +{ + NCURSES_SIZE_T y = win->_cury; + NCURSES_SIZE_T x = win->_curx; + int code = OK; + struct ldat *line; + int i, start, end; + + T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n)); + + if (!win) + returnCode(ERR); + + if (n < 0) { + n = _nc_wchstrlen(astr); + } + if (n > win->_maxx - x + 1) + n = win->_maxx - x + 1; + if (n == 0) + returnCode(code); + + line = &(win->_line[y]); + start = x; + end = x + n - 1; + if (isnac(line->text[x])) { + line->text[x - 1] = win->_nc_bkgd; + --start; + } + for (i = 0; i < n && x <= win->_maxx; ++i) { + line->text[x++] = astr[i]; + if (wcwidth(CharOf(astr[i])) > 1) { + if (x <= win->_maxx) + AddAttr(line->text[x++], WA_NAC); + else + line->text[x - 1] = win->_nc_bkgd; + } + } + if (x <= win->_maxx && isnac(line->text[x])) { + line->text[x] = win->_nc_bkgd; + ++end; + } + CHANGED_RANGE(line, start, end); + + _nc_synchook(win); + returnCode(code); +} + +NCURSES_EXPORT(int) +waddnwstr(WINDOW *win, const wchar_t * str, int n) +{ + int code = ERR; + int i; + + T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbufn(str,n), n)); + + if (win && (str != 0)) { + TR(TRACE_VIRTPUT | TRACE_ATTRS, ("... current %s", _traceattr(win->_attrs))); + code = OK; + if (n < 0) + n = (int) wcslen(str); + + TR(TRACE_VIRTPUT, ("str is not null, length = %d", n)); + while ((n-- > 0) && (*str != L('\0'))) { + NCURSES_CH_T ch; + TR(TRACE_VIRTPUT, ("*str[0] = %#lx", *str)); + SetChar(ch, *str++, A_NORMAL); + i = 1; + while (i < CCHARW_MAX && n > 0 && (*str != L('\0')) + && wcwidth(*str) == 0) { + TR(TRACE_VIRTPUT, ("*str[%d] = %#lx", i, *str)); + ch.chars[i++] = *str++; + --n; + } + if (_nc_waddch_nosync(win, ch) == ERR) { + code = ERR; + break; + } + } + _nc_synchook(win); + } + TR(TRACE_VIRTPUT, ("waddnwstr returns %d", code)); + returnCode(code); +} + +#endif diff --git a/ncurses/base/lib_beep.c b/ncurses/base/lib_beep.c index 3428aaf6..c23d0a1d 100644 --- a/ncurses/base/lib_beep.c +++ b/ncurses/base/lib_beep.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* * beep.c * @@ -40,9 +39,9 @@ */ #include -#include /* beep, flash */ +#include /* beep, flash */ -MODULE_ID("$Id: lib_beep.c,v 1.7 1999/10/22 21:39:09 tom Exp $") +MODULE_ID("$Id: lib_beep.c,v 1.9 2000/12/10 02:43:26 tom Exp $") /* * beep() @@ -52,22 +51,23 @@ MODULE_ID("$Id: lib_beep.c,v 1.7 1999/10/22 21:39:09 tom Exp $") * */ -int beep(void) +NCURSES_EXPORT(int) +beep(void) { - int res = ERR; + int res = ERR; - T((T_CALLED("beep()"))); + T((T_CALLED("beep()"))); - /* FIXME: should make sure that we are not in altchar mode */ - if (bell) { - TPUTS_TRACE("bell"); - res = putp(bell); - _nc_flush(); - } else if (flash_screen) { - TPUTS_TRACE("flash_screen"); - res = putp(flash_screen); - _nc_flush(); - } + /* FIXME: should make sure that we are not in altchar mode */ + if (bell) { + TPUTS_TRACE("bell"); + res = putp(bell); + _nc_flush(); + } else if (flash_screen) { + TPUTS_TRACE("flash_screen"); + res = putp(flash_screen); + _nc_flush(); + } - returnCode(res); + returnCode(res); } diff --git a/ncurses/base/lib_bkgd.c b/ncurses/base/lib_bkgd.c index 410ee058..ca189a65 100644 --- a/ncurses/base/lib_bkgd.c +++ b/ncurses/base/lib_bkgd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2001-2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,54 +33,106 @@ #include -MODULE_ID("$Id: lib_bkgd.c,v 1.12 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_bkgd.c,v 1.29 2002/09/22 20:30:32 tom Exp $") -void wbkgdset(WINDOW *win, chtype ch) +/* + * Set the window's background information. + */ +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(void) +#else +static inline void +#endif +wbkgrndset(WINDOW *win, const ARG_CH_T ch) { - T((T_CALLED("wbkgdset(%p,%s)"), win, _tracechtype(ch))); - - if (win) { - chtype off = AttrOf(win->_bkgd); - chtype on = AttrOf(ch); - - toggle_attr_off(win->_attrs,off); - toggle_attr_on (win->_attrs,on); - - if (TextOf(ch)==0) - ch |= BLANK; - win->_bkgd = ch; - } - returnVoid; + T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch))); + + if (win) { + attr_t off = AttrOf(win->_nc_bkgd); + attr_t on = AttrOf(CHDEREF(ch)); + + toggle_attr_off(win->_attrs, off); + toggle_attr_on(win->_attrs, on); + + if (CharOf(CHDEREF(ch)) == L('\0')) + SetChar(win->_nc_bkgd, BLANK_TEXT, AttrOf(CHDEREF(ch))); + else + win->_nc_bkgd = CHDEREF(ch); +#if USE_WIDEC_SUPPORT + /* + * If we're compiled for wide-character support, _bkgrnd is the + * preferred location for the background information since it stores + * more than _bkgd. Update _bkgd each time we modify _bkgrnd, so the + * macro getbkgd() will work. + */ + { + cchar_t wch; + int tmp; + + wgetbkgrnd(win, &wch); + tmp = wctob(CharOf(wch)); + + win->_bkgd = ((tmp == EOF) ? ' ' : (chtype) tmp) | AttrOf(wch); + } +#endif + } + returnVoid; +} + +NCURSES_EXPORT(void) +wbkgdset(WINDOW *win, chtype ch) +{ + NCURSES_CH_T wch; + SetChar2(wch, ch); + wbkgrndset(win, CHREF(wch)); } -int wbkgd(WINDOW *win, const chtype ch) +/* + * Set the window's background information and apply it to each cell. + */ +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(int) +#else +static inline int +#undef wbkgrnd +#endif +wbkgrnd(WINDOW *win, const ARG_CH_T ch) { - int code = ERR; - int x, y; - chtype new_bkgd = ch; - - T((T_CALLED("wbkgd(%p,%s)"), win, _tracechtype(new_bkgd))); - - if (win) { - chtype old_bkgd = getbkgd(win); - - wbkgdset(win, new_bkgd); - wattrset(win, AttrOf(win->_bkgd)); - - for (y = 0; y <= win->_maxy; y++) { - for (x = 0; x <= win->_maxx; x++) { - if (win->_line[y].text[x] == old_bkgd) - win->_line[y].text[x] = win->_bkgd; - else - win->_line[y].text[x] = - _nc_render(win,(A_ALTCHARSET & - AttrOf(win->_line[y].text[x])) - | TextOf(win->_line[y].text[x])); - } + int code = ERR; + int x, y; + NCURSES_CH_T new_bkgd = CHDEREF(ch); + + T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch))); + + if (win) { + NCURSES_CH_T old_bkgrnd; + wgetbkgrnd(win, &old_bkgrnd); + + wbkgrndset(win, CHREF(new_bkgd)); + wattrset(win, AttrOf(win->_nc_bkgd)); + + for (y = 0; y <= win->_maxy; y++) { + for (x = 0; x <= win->_maxx; x++) { + if (CharEq(win->_line[y].text[x], old_bkgrnd)) + win->_line[y].text[x] = win->_nc_bkgd; + else { + NCURSES_CH_T wch = win->_line[y].text[x]; + RemAttr(wch, (~A_ALTCHARSET)); + win->_line[y].text[x] = _nc_render(win, wch); + } + } + } + touchwin(win); + _nc_synchook(win); + code = OK; } - touchwin(win); - _nc_synchook(win); - code = OK; - } - returnCode(code); + returnCode(code); +} + +NCURSES_EXPORT(int) +wbkgd(WINDOW *win, chtype ch) +{ + NCURSES_CH_T wch; + SetChar2(wch, ch); + return wbkgrnd(win, CHREF(wch)); } diff --git a/ncurses/base/lib_box.c b/ncurses/base/lib_box.c index 8a682585..50f43659 100644 --- a/ncurses/base/lib_box.c +++ b/ncurses/base/lib_box.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,79 +40,86 @@ #include -MODULE_ID("$Id: lib_box.c,v 1.11 2000/04/29 21:12:37 tom Exp $") +MODULE_ID("$Id: lib_box.c,v 1.21 2002/09/15 01:04:27 tom Exp $") -int +#if USE_WIDEC_SUPPORT +static inline chtype +_my_render(WINDOW *win, chtype ch) +{ + NCURSES_CH_T wch; + SetChar2(wch, ch); + wch = _nc_render(win, wch); + return CharOf(wch) | AttrOf(wch); +} +#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _my_render(win, (ch == 0) ? def : ch) +#else +#define RENDER_WITH_DEFAULT(ch,def) w ## ch = _nc_render(win, (ch == 0) ? def : ch) +#endif + +NCURSES_EXPORT(int) wborder(WINDOW *win, - chtype ls, chtype rs, chtype ts, chtype bs, - chtype tl, chtype tr, chtype bl, chtype br) + chtype ls, chtype rs, + chtype ts, chtype bs, + chtype tl, chtype tr, + chtype bl, chtype br) { NCURSES_SIZE_T i; NCURSES_SIZE_T endx, endy; + chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, - _tracechtype2(1, ls), - _tracechtype2(2, rs), - _tracechtype2(3, ts), - _tracechtype2(4, bs), - _tracechtype2(5, tl), - _tracechtype2(6, tr), - _tracechtype2(7, bl), - _tracechtype2(8, br))); + win, + _tracechtype2(1, ls), + _tracechtype2(2, rs), + _tracechtype2(3, ts), + _tracechtype2(4, bs), + _tracechtype2(5, tl), + _tracechtype2(6, tr), + _tracechtype2(7, bl), + _tracechtype2(8, br))); if (!win) returnCode(ERR); - if (ls == 0) - ls = ACS_VLINE; - if (rs == 0) - rs = ACS_VLINE; - if (ts == 0) - ts = ACS_HLINE; - if (bs == 0) - bs = ACS_HLINE; - if (tl == 0) - tl = ACS_ULCORNER; - if (tr == 0) - tr = ACS_URCORNER; - if (bl == 0) - bl = ACS_LLCORNER; - if (br == 0) - br = ACS_LRCORNER; - - ls = _nc_render(win, ls); - rs = _nc_render(win, rs); - ts = _nc_render(win, ts); - bs = _nc_render(win, bs); - tl = _nc_render(win, tl); - tr = _nc_render(win, tr); - bl = _nc_render(win, bl); - br = _nc_render(win, br); + RENDER_WITH_DEFAULT(ls, ACS_VLINE); + RENDER_WITH_DEFAULT(rs, ACS_VLINE); + RENDER_WITH_DEFAULT(ts, ACS_HLINE); + RENDER_WITH_DEFAULT(bs, ACS_HLINE); + RENDER_WITH_DEFAULT(tl, ACS_ULCORNER); + RENDER_WITH_DEFAULT(tr, ACS_URCORNER); + RENDER_WITH_DEFAULT(bl, ACS_LLCORNER); + RENDER_WITH_DEFAULT(br, ACS_LRCORNER); - T(("using %#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx", - ls, rs, ts, bs, tl, tr, bl, br)); + T(("using %s, %s, %s, %s, %s, %s, %s, %s", + _tracechtype2(1, wls), + _tracechtype2(2, wrs), + _tracechtype2(3, wts), + _tracechtype2(4, wbs), + _tracechtype2(5, wtl), + _tracechtype2(6, wtr), + _tracechtype2(7, wbl), + _tracechtype2(8, wbr))); endx = win->_maxx; endy = win->_maxy; for (i = 0; i <= endx; i++) { - win->_line[0].text[i] = ts; - win->_line[endy].text[i] = bs; + SetChar2(win->_line[0].text[i], wts); + SetChar2(win->_line[endy].text[i], wbs); } win->_line[endy].firstchar = win->_line[0].firstchar = 0; win->_line[endy].lastchar = win->_line[0].lastchar = endx; for (i = 0; i <= endy; i++) { - win->_line[i].text[0] = ls; - win->_line[i].text[endx] = rs; + SetChar2(win->_line[i].text[0], wls); + SetChar2(win->_line[i].text[endx], wrs); win->_line[i].firstchar = 0; win->_line[i].lastchar = endx; } - win->_line[0].text[0] = tl; - win->_line[0].text[endx] = tr; - win->_line[endy].text[0] = bl; - win->_line[endy].text[endx] = br; + SetChar2(win->_line[0].text[0], wtl); + SetChar2(win->_line[0].text[endx], wtr); + SetChar2(win->_line[endy].text[0], wbl); + SetChar2(win->_line[endy].text[endx], wbr); _nc_synchook(win); returnCode(OK); diff --git a/ncurses/base/lib_chgat.c b/ncurses/base/lib_chgat.c index 7690ae4a..54e66ed1 100644 --- a/ncurses/base/lib_chgat.c +++ b/ncurses/base/lib_chgat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,23 +40,23 @@ #include -MODULE_ID("$Id: lib_chgat.c,v 1.2 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_chgat.c,v 1.5 2001/06/03 00:05:02 skimo Exp $") -int wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED) +NCURSES_EXPORT(int) +wchgat +(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED) { - int i; + int i; T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color)); if (win) { - toggle_attr_on(attr,COLOR_PAIR(color)); + toggle_attr_on(attr, COLOR_PAIR(color)); - for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) - win->_line[win->_cury].text[i] - = TextOf(win->_line[win->_cury].text[i]) | attr; + for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) + SetAttr(win->_line[win->_cury].text[i], attr); - returnCode(OK); - } - else - returnCode(ERR); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_clear.c b/ncurses/base/lib_clear.c index 9c07cf08..e0b4edf9 100644 --- a/ncurses/base/lib_clear.c +++ b/ncurses/base/lib_clear.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,16 +40,17 @@ #include -MODULE_ID("$Id: lib_clear.c,v 1.5 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_clear.c,v 1.7 2000/12/10 02:43:26 tom Exp $") -int wclear(WINDOW *win) +NCURSES_EXPORT(int) +wclear(WINDOW *win) { -int code = ERR; + int code = ERR; - T((T_CALLED("wclear(%p)"), win)); + T((T_CALLED("wclear(%p)"), win)); - if ((code = werase(win))!=ERR) - win->_clear = TRUE; - - returnCode(code); + if ((code = werase(win)) != ERR) + win->_clear = TRUE; + + returnCode(code); } diff --git a/ncurses/base/lib_clearok.c b/ncurses/base/lib_clearok.c index cc904b1d..9b56bd1e 100644 --- a/ncurses/base/lib_clearok.c +++ b/ncurses/base/lib_clearok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_clearok.c ** @@ -41,16 +40,16 @@ #include -MODULE_ID("$Id: lib_clearok.c,v 1.2 1998/02/11 12:14:00 tom Exp $") +MODULE_ID("$Id: lib_clearok.c,v 1.4 2000/12/10 02:43:26 tom Exp $") -int clearok(WINDOW *win, bool flag) +NCURSES_EXPORT(int) +clearok(WINDOW *win, bool flag) { - T((T_CALLED("clearok(%p,%d)"), win, flag)); + T((T_CALLED("clearok(%p,%d)"), win, flag)); - if (win) { - win->_clear = flag; - returnCode(OK); - } - else - returnCode(ERR); + if (win) { + win->_clear = flag; + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_clrbot.c b/ncurses/base/lib_clrbot.c index d1e243f3..bc12960e 100644 --- a/ncurses/base/lib_clrbot.c +++ b/ncurses/base/lib_clrbot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_clrbot.c,v 1.15 2000/04/29 21:15:26 tom Exp $") +MODULE_ID("$Id: lib_clrbot.c,v 1.19 2001/12/19 01:05:59 tom Exp $") -int +NCURSES_EXPORT(int) wclrtobot(WINDOW *win) { int code = ERR; @@ -52,15 +52,15 @@ wclrtobot(WINDOW *win) if (win) { NCURSES_SIZE_T y; NCURSES_SIZE_T startx = win->_curx; - chtype blank = _nc_background(win); + NCURSES_CH_T blank = win->_nc_bkgd; T(("clearing from y = %d to y = %d with maxx = %d", - win->_cury, win->_maxy, win->_maxx)); + win->_cury, win->_maxy, win->_maxx)); for (y = win->_cury; y <= win->_maxy; y++) { struct ldat *line = &(win->_line[y]); - chtype *ptr = &(line->text[startx]); - chtype *end = &(line->text[win->_maxx]); + NCURSES_CH_T *ptr = &(line->text[startx]); + NCURSES_CH_T *end = &(line->text[win->_maxx]); CHANGED_TO_EOL(line, startx, win->_maxx); diff --git a/ncurses/base/lib_clreol.c b/ncurses/base/lib_clreol.c index a5d067cb..c46ebd93 100644 --- a/ncurses/base/lib_clreol.c +++ b/ncurses/base/lib_clreol.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_clreol.c,v 1.16 2000/04/29 21:14:54 tom Exp $") +MODULE_ID("$Id: lib_clreol.c,v 1.21 2001/12/19 01:06:04 tom Exp $") -int +NCURSES_EXPORT(int) wclrtoeol(WINDOW *win) { int code = ERR; @@ -50,8 +50,8 @@ wclrtoeol(WINDOW *win) T((T_CALLED("wclrtoeol(%p)"), win)); if (win) { - chtype blank; - chtype *ptr, *end; + NCURSES_CH_T blank; + NCURSES_CH_T *ptr, *end; struct ldat *line; NCURSES_SIZE_T y = win->_cury; NCURSES_SIZE_T x = win->_curx; @@ -60,7 +60,7 @@ wclrtoeol(WINDOW *win) * If we have just wrapped the cursor, the clear applies to the * new line, unless we are at the lower right corner. */ - if (win->_flags & _WRAPPED + if ((win->_flags & _WRAPPED) != 0 && y < win->_maxy) { win->_flags &= ~_WRAPPED; } @@ -69,12 +69,12 @@ wclrtoeol(WINDOW *win) * There's no point in clearing if we're not on a legal * position, either. */ - if (win->_flags & _WRAPPED + if ((win->_flags & _WRAPPED) != 0 || y > win->_maxy || x > win->_maxx) returnCode(ERR); - blank = _nc_background(win); + blank = win->_nc_bkgd; line = &win->_line[y]; CHANGED_TO_EOL(line, x, win->_maxx); diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index 492194ba..86c3fba3 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,15 +41,17 @@ #include #include -MODULE_ID("$Id: lib_color.c,v 1.53 2000/09/02 18:02:15 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.62 2002/09/28 20:40:05 tom Exp $") /* * These should be screen structure members. They need to be globals for * historical reasons. So we assign them in start_color() and also in * set_term()'s screen-switching logic. */ -int COLOR_PAIRS = 0; -int COLORS = 0; +NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; +NCURSES_EXPORT_VAR(int) COLORS = 0; + +#define DATA(r,g,b) {r,g,b, 0,0,0, 0} /* * Given a RGB range of 0..1000, we'll normally set the individual values @@ -61,27 +63,27 @@ int COLORS = 0; static const color_t cga_palette[] = { /* R G B */ - {RGB_OFF, RGB_OFF, RGB_OFF}, /* COLOR_BLACK */ - {RGB_ON, RGB_OFF, RGB_OFF}, /* COLOR_RED */ - {RGB_OFF, RGB_ON, RGB_OFF}, /* COLOR_GREEN */ - {RGB_ON, RGB_ON, RGB_OFF}, /* COLOR_YELLOW */ - {RGB_OFF, RGB_OFF, RGB_ON}, /* COLOR_BLUE */ - {RGB_ON, RGB_OFF, RGB_ON}, /* COLOR_MAGENTA */ - {RGB_OFF, RGB_ON, RGB_ON}, /* COLOR_CYAN */ - {RGB_ON, RGB_ON, RGB_ON}, /* COLOR_WHITE */ + DATA(RGB_OFF, RGB_OFF, RGB_OFF), /* COLOR_BLACK */ + DATA(RGB_ON, RGB_OFF, RGB_OFF), /* COLOR_RED */ + DATA(RGB_OFF, RGB_ON, RGB_OFF), /* COLOR_GREEN */ + DATA(RGB_ON, RGB_ON, RGB_OFF), /* COLOR_YELLOW */ + DATA(RGB_OFF, RGB_OFF, RGB_ON), /* COLOR_BLUE */ + DATA(RGB_ON, RGB_OFF, RGB_ON), /* COLOR_MAGENTA */ + DATA(RGB_OFF, RGB_ON, RGB_ON), /* COLOR_CYAN */ + DATA(RGB_ON, RGB_ON, RGB_ON), /* COLOR_WHITE */ }; static const color_t hls_palette[] = { - /* H L S */ - { 0, 0, 0}, /* COLOR_BLACK */ - { 120, 50, 100}, /* COLOR_RED */ - { 240, 50, 100}, /* COLOR_GREEN */ - { 180, 50, 100}, /* COLOR_YELLOW */ - { 330, 50, 100}, /* COLOR_BLUE */ - { 60, 50, 100}, /* COLOR_MAGENTA */ - { 300, 50, 100}, /* COLOR_CYAN */ - { 0, 50, 100}, /* COLOR_WHITE */ + /* H L S */ + DATA( 0, 0, 0), /* COLOR_BLACK */ + DATA( 120, 50, 100), /* COLOR_RED */ + DATA( 240, 50, 100), /* COLOR_GREEN */ + DATA( 180, 50, 100), /* COLOR_YELLOW */ + DATA( 330, 50, 100), /* COLOR_BLUE */ + DATA( 60, 50, 100), /* COLOR_MAGENTA */ + DATA( 300, 50, 100), /* COLOR_CYAN */ + DATA( 0, 50, 100), /* COLOR_WHITE */ }; /* *INDENT-ON* */ @@ -117,7 +119,7 @@ toggled_colors(int c) if (c < 16) { static const int table[] = {0, 4, 2, 6, 1, 5, 3, 7, - 8, 12, 10, 14, 9, 13, 11, 15}; + 8, 12, 10, 14, 9, 13, 11, 15}; c = table[c]; } return c; @@ -147,49 +149,12 @@ set_foreground_color(int fg, int (*outc) (int)) } } -static bool -set_original_colors(void) -{ - if (orig_pair != 0) { - TPUTS_TRACE("orig_pair"); - putp(orig_pair); - return TRUE; - } else if (orig_colors != NULL) { - TPUTS_TRACE("orig_colors"); - putp(orig_colors); - return TRUE; - } - return FALSE; -} - -int -start_color(void) +static void +init_color_table(void) { - int n; const color_t *tp; + int n; - T((T_CALLED("start_color()"))); - - if (set_original_colors() != TRUE) { - set_foreground_color(default_fg(), _nc_outch); - set_background_color(default_bg(), _nc_outch); - } - - if (VALID_NUMERIC(max_pairs)) - COLOR_PAIRS = SP->_pair_count = max_pairs; - else - returnCode(ERR); - if ((SP->_color_pairs = typeCalloc(unsigned short, max_pairs)) == 0) - returnCode(ERR); - SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg()); - if (VALID_NUMERIC(max_colors)) - COLORS = SP->_color_count = max_colors; - else - returnCode(ERR); - SP->_coloron = 1; - - if ((SP->_color_table = typeMalloc(color_t, COLORS)) == 0) - returnCode(ERR); tp = (hue_lightness_saturation) ? hls_palette : cga_palette; for (n = 0; n < COLORS; n++) { if (n < 8) { @@ -208,9 +173,83 @@ start_color(void) } } } +} + +/* + * Reset the color pair, e.g., to whatever color pair 0 is. + */ +static bool +reset_color_pair(void) +{ + bool result = FALSE; + + if (orig_pair != 0) { + TPUTS_TRACE("orig_pair"); + putp(orig_pair); + result = TRUE; + } + return result; +} + +/* + * Reset color pairs and definitions. Actually we do both more to accommodate + * badly-written terminal descriptions than for the relatively rare case where + * someone has changed the color definitions. + */ +bool +_nc_reset_colors(void) +{ + int result = FALSE; + + T((T_CALLED("_nc_reset_colors()"))); + if (SP->_color_defs > 0) + SP->_color_defs = -(SP->_color_defs); + + if (reset_color_pair()) + result = TRUE; + if (orig_colors != 0) { + TPUTS_TRACE("orig_colors"); + putp(orig_colors); + result = TRUE; + } + returnBool(result); +} + +NCURSES_EXPORT(int) +start_color(void) +{ + int result = ERR; + + T((T_CALLED("start_color()"))); + + if (!SP->_coloron) { + + if (reset_color_pair() != TRUE) { + set_foreground_color(default_fg(), _nc_outch); + set_background_color(default_bg(), _nc_outch); + } - T(("started color: COLORS = %d, COLOR_PAIRS = %d", COLORS, COLOR_PAIRS)); + if (max_pairs > 0 && max_colors > 0) { + COLOR_PAIRS = SP->_pair_count = max_pairs; + COLORS = SP->_color_count = max_colors; + if ((SP->_color_pairs = typeCalloc(unsigned short, + (unsigned) max_pairs)) != 0) { + if ((SP->_color_table = typeCalloc(color_t, max_colors)) != 0) { + SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg()); + init_color_table(); + + T(("started color: COLORS = %d, COLOR_PAIRS = %d", + COLORS, COLOR_PAIRS)); + + SP->_coloron = 1; + result = OK; + } else { + FreeAndNull(SP->_color_pairs); + } + } + } + } returnCode(OK); } @@ -256,7 +295,7 @@ rgb2hls(short r, short g, short b, short *h, short *l, short *s) * Extension (1997/1/18) - Allow negative f/b values to set default color * values. */ -int +NCURSES_EXPORT(int) init_pair(short pair, short f, short b) { unsigned result; @@ -299,10 +338,10 @@ init_pair(short pair, short f, short b) struct ldat *ptr = &(curscr->_line[y]); bool changed = FALSE; for (x = 0; x <= curscr->_maxx; x++) { - if ((ptr->text[x] & A_COLOR) == z) { + if ((AttrOf(ptr->text[x]) & A_COLOR) == z) { /* Set the old cell to zero to ensure it will be updated on the next doupdate() */ - ptr->text[x] = 0; + SetChar(ptr->text[x], 0, 0); CHANGED_CELL(ptr, x); changed = TRUE; } @@ -319,73 +358,79 @@ init_pair(short pair, short f, short b) const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette; T(("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", - pair, - tp[f].red, tp[f].green, tp[f].blue, - tp[b].red, tp[b].green, tp[b].blue)); + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); if (initialize_pair) { TPUTS_TRACE("initialize_pair"); putp(tparm(initialize_pair, - pair, - tp[f].red, tp[f].green, tp[f].blue, - tp[b].red, tp[b].green, tp[b].blue)); + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); } } returnCode(OK); } -int +#define okRGB(n) ((n) >= 0 && (n) < 1000) + +NCURSES_EXPORT(int) init_color(short color, short r, short g, short b) { + int result = ERR; + T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b)); - if (initialize_color == NULL) - returnCode(ERR); + if (initialize_color != NULL + && (color >= 0 && color < COLORS) + && (okRGB(r) && okRGB(g) && okRGB(b))) { - if (color < 0 || color >= COLORS) - returnCode(ERR); - if (r < 0 || r > 1000 || g < 0 || g > 1000 || b < 0 || b > 1000) - returnCode(ERR); + SP->_color_table[color].init = 1; + SP->_color_table[color].r = r; + SP->_color_table[color].g = g; + SP->_color_table[color].b = b; - if (hue_lightness_saturation) - rgb2hls(r, g, b, - &SP->_color_table[color].red, - &SP->_color_table[color].green, - &SP->_color_table[color].blue); - else { - SP->_color_table[color].red = r; - SP->_color_table[color].green = g; - SP->_color_table[color].blue = b; - } + if (hue_lightness_saturation) { + rgb2hls(r, g, b, + &SP->_color_table[color].red, + &SP->_color_table[color].green, + &SP->_color_table[color].blue); + } else { + SP->_color_table[color].red = r; + SP->_color_table[color].green = g; + SP->_color_table[color].blue = b; + } - if (initialize_color) { TPUTS_TRACE("initialize_color"); putp(tparm(initialize_color, color, r, g, b)); + SP->_color_defs = max(color + 1, SP->_color_defs); + result = OK; } - returnCode(OK); + returnCode(result); } -bool +NCURSES_EXPORT(bool) can_change_color(void) { T((T_CALLED("can_change_color()"))); returnCode((can_change != 0) ? TRUE : FALSE); } -bool +NCURSES_EXPORT(bool) has_colors(void) { T((T_CALLED("has_colors()"))); returnCode((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) - && (((set_foreground != NULL) - && (set_background != NULL)) - || ((set_a_foreground != NULL) - && (set_a_background != NULL)) - || set_color_pair)) ? TRUE : FALSE); + && (((set_foreground != NULL) + && (set_background != NULL)) + || ((set_a_foreground != NULL) + && (set_a_background != NULL)) + || set_color_pair)) ? TRUE : FALSE); } -int +NCURSES_EXPORT(int) color_content(short color, short *r, short *g, short *b) { T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b)); @@ -398,10 +443,11 @@ color_content(short color, short *r, short *g, short *b) *g = SP->_color_table[color].green; if (b) *b = SP->_color_table[color].blue; + T(("...color_content(%d,%d,%d,%d)", color, *r, *g, *b)); returnCode(OK); } -int +NCURSES_EXPORT(int) pair_content(short pair, short *f, short *b) { T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b)); @@ -413,10 +459,11 @@ pair_content(short pair, short *f, short *b) if (b) *b = (SP->_color_pairs[pair] & C_MASK); + T(("...pair_content(%d,%d,%d)", pair, *f, *b)); returnCode(OK); } -void +NCURSES_EXPORT(void) _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int)) { NCURSES_COLOR_T fg = C_MASK, bg = C_MASK; @@ -434,8 +481,9 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int)) } } - if (old_pair >= 0 && SP != 0) { - pair_content(old_pair, &old_fg, &old_bg); + if (old_pair >= 0 + && SP != 0 + && pair_content(old_pair, &old_fg, &old_bg) != ERR) { if ((fg == C_MASK && old_fg != C_MASK) || (bg == C_MASK && old_bg != C_MASK)) { #if NCURSES_EXT_FUNCS @@ -450,10 +498,10 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int)) tputs("\033[49m", 1, outc); } else #endif - set_original_colors(); + reset_color_pair(); } } else { - set_original_colors(); + reset_color_pair(); if (old_pair < 0) return; } @@ -471,7 +519,8 @@ _nc_do_color(int old_pair, int pair, bool reverse, int (*outc) (int)) bg = xx; } - TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, fg, bg)); + TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, + fg, bg)); if (fg != C_MASK) { set_foreground_color(fg, outc); diff --git a/ncurses/base/lib_colorset.c b/ncurses/base/lib_colorset.c index 3870e875..f480bc16 100644 --- a/ncurses/base/lib_colorset.c +++ b/ncurses/base/lib_colorset.c @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1998 * + * Author: Juergen Pfeifer, 1998 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /* @@ -40,10 +41,11 @@ #include #include -MODULE_ID("$Id: lib_colorset.c,v 1.6 2000/07/29 16:37:19 tom Exp $") +MODULE_ID("$Id: lib_colorset.c,v 1.8 2002/07/13 11:35:08 juergen Exp $") -int -wcolor_set(WINDOW *win, short color_pair_number, void *opts) +NCURSES_EXPORT(int) +wcolor_set +(WINDOW *win, short color_pair_number, void *opts) { T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number)); if (win diff --git a/ncurses/base/lib_delch.c b/ncurses/base/lib_delch.c index 0169d31a..0c30f2d9 100644 --- a/ncurses/base/lib_delch.c +++ b/ncurses/base/lib_delch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,29 +40,30 @@ #include -MODULE_ID("$Id: lib_delch.c,v 1.8 1998/06/28 00:28:17 tom Exp $") +MODULE_ID("$Id: lib_delch.c,v 1.12 2001/12/19 01:06:09 tom Exp $") -int wdelch(WINDOW *win) +NCURSES_EXPORT(int) +wdelch(WINDOW *win) { -int code = ERR; + int code = ERR; - T((T_CALLED("wdelch(%p)"), win)); + T((T_CALLED("wdelch(%p)"), win)); - if (win) { - chtype blank = _nc_background(win); - struct ldat *line = &(win->_line[win->_cury]); - chtype *end = &(line->text[win->_maxx]); - chtype *temp2 = &(line->text[win->_curx + 1]); - chtype *temp1 = temp2 - 1; + if (win) { + NCURSES_CH_T blank = win->_nc_bkgd; + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = &(line->text[win->_curx + 1]); + NCURSES_CH_T *temp1 = temp2 - 1; - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 < end) - *temp1++ = *temp2++; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 < end) + *temp1++ = *temp2++; - *temp1 = blank; + *temp1 = blank; - _nc_synchook(win); - code = OK; - } - returnCode(code); + _nc_synchook(win); + code = OK; + } + returnCode(code); } diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c index 7bab0c77..89d8e7c3 100644 --- a/ncurses/base/lib_delwin.c +++ b/ncurses/base/lib_delwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,33 +40,39 @@ #include -MODULE_ID("$Id: lib_delwin.c,v 1.9 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_delwin.c,v 1.13 2001/08/26 00:40:20 tom Exp $") -static bool have_children(WINDOW *win) +static bool +cannot_delete(WINDOW *win) { - WINDOWLIST *p; - for (p = _nc_windows; p != 0; p = p->next) { - if (p->win->_flags & _SUBWIN - && p->win->_parent == win) - return TRUE; + WINDOWLIST *p; + bool result = TRUE; + + for (p = _nc_windows; p != 0; p = p->next) { + if (&(p->win) == win) { + result = FALSE; + } else if ((p->win._flags & _SUBWIN) != 0 + && p->win._parent == win) { + result = TRUE; + break; } - return FALSE; + } + return result; } -int delwin(WINDOW *win) +NCURSES_EXPORT(int) +delwin(WINDOW *win) { - T((T_CALLED("delwin(%p)"), win)); - - if (win == 0 - || have_children(win)) - returnCode(ERR); + T((T_CALLED("delwin(%p)"), win)); - if (win->_flags & _SUBWIN) - touchwin(win->_parent); - else if (curscr != 0) - touchwin(curscr); + if (win == 0 + || cannot_delete(win)) + returnCode(ERR); - _nc_freewin(win); + if (win->_flags & _SUBWIN) + touchwin(win->_parent); + else if (curscr != 0) + touchwin(curscr); - returnCode(OK); + returnCode(_nc_freewin(win)); } diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c index 7c090244..24705c96 100644 --- a/ncurses/base/lib_dft_fgbg.c +++ b/ncurses/base/lib_dft_fgbg.c @@ -33,13 +33,13 @@ #include #include -MODULE_ID("$Id: lib_dft_fgbg.c,v 1.13 2000/07/07 16:50:27 tom Exp $") +MODULE_ID("$Id: lib_dft_fgbg.c,v 1.15 2000/12/10 02:43:27 tom Exp $") /* * Modify the behavior of color-pair 0 so that the library doesn't assume that * it is white on black. This is an extension to XSI curses. */ -int +NCURSES_EXPORT(int) use_default_colors(void) { T((T_CALLED("use_default_colors()"))); @@ -50,7 +50,7 @@ use_default_colors(void) * Modify the behavior of color-pair 0 so that the library assumes that it * is something specific, possibly not white on black. */ -int +NCURSES_EXPORT(int) assume_default_colors(int fg, int bg) { T((T_CALLED("assume_default_colors(%d,%d)"), fg, bg)); diff --git a/ncurses/base/lib_echo.c b/ncurses/base/lib_echo.c index 4ccf97ff..df44713d 100644 --- a/ncurses/base/lib_echo.c +++ b/ncurses/base/lib_echo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* * echo.c * @@ -43,18 +42,20 @@ #include -MODULE_ID("$Id: lib_echo.c,v 1.3 1998/10/12 13:15:33 Alexander.V.Lukyanov Exp $") +MODULE_ID("$Id: lib_echo.c,v 1.5 2000/12/10 02:43:27 tom Exp $") -int echo(void) +NCURSES_EXPORT(int) +echo(void) { - T((T_CALLED("echo()"))); - SP->_echo = TRUE; - returnCode(OK); + T((T_CALLED("echo()"))); + SP->_echo = TRUE; + returnCode(OK); } -int noecho(void) +NCURSES_EXPORT(int) +noecho(void) { - T((T_CALLED("noecho()"))); - SP->_echo = FALSE; - returnCode(OK); + T((T_CALLED("noecho()"))); + SP->_echo = FALSE; + returnCode(OK); } diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c index 31b6e516..66662871 100644 --- a/ncurses/base/lib_endwin.c +++ b/ncurses/base/lib_endwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_endwin.c ** @@ -42,20 +41,20 @@ #include #include -MODULE_ID("$Id: lib_endwin.c,v 1.17 1999/06/12 23:01:46 tom Exp $") +MODULE_ID("$Id: lib_endwin.c,v 1.19 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) endwin(void) { - T((T_CALLED("endwin()"))); + T((T_CALLED("endwin()"))); - if (SP) { - SP->_endwin = TRUE; - SP->_mouse_wrap(SP); - _nc_screen_wrap(); - _nc_mvcur_wrap(); /* wrap up cursor addressing */ - returnCode(reset_shell_mode()); - } + if (SP) { + SP->_endwin = TRUE; + SP->_mouse_wrap(SP); + _nc_screen_wrap(); + _nc_mvcur_wrap(); /* wrap up cursor addressing */ + returnCode(reset_shell_mode()); + } - returnCode(ERR); + returnCode(ERR); } diff --git a/ncurses/base/lib_erase.c b/ncurses/base/lib_erase.c index 1e4237bf..5e397312 100644 --- a/ncurses/base/lib_erase.c +++ b/ncurses/base/lib_erase.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_erase.c ** @@ -41,33 +40,34 @@ #include -MODULE_ID("$Id: lib_erase.c,v 1.11 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_erase.c,v 1.15 2001/12/19 01:06:13 tom Exp $") -int werase(WINDOW *win) +NCURSES_EXPORT(int) +werase(WINDOW *win) { -int code = ERR; -int y; -chtype blank; -chtype *sp, *end, *start; + int code = ERR; + int y; + NCURSES_CH_T blank; + NCURSES_CH_T *sp, *end, *start; - T((T_CALLED("werase(%p)"), win)); + T((T_CALLED("werase(%p)"), win)); - if (win) { - blank = _nc_background(win); - for (y = 0; y <= win->_maxy; y++) { + if (win) { + blank = win->_nc_bkgd; + for (y = 0; y <= win->_maxy; y++) { start = win->_line[y].text; end = &start[win->_maxx]; - + for (sp = start; sp <= end; sp++) - *sp = blank; - + *sp = blank; + win->_line[y].firstchar = 0; win->_line[y].lastchar = win->_maxx; - } - win->_curx = win->_cury = 0; - win->_flags &= ~_WRAPPED; - _nc_synchook(win); - code = OK; } - returnCode(code); + win->_curx = win->_cury = 0; + win->_flags &= ~_WRAPPED; + _nc_synchook(win); + code = OK; + } + returnCode(code); } diff --git a/ncurses/base/lib_flash.c b/ncurses/base/lib_flash.c index d0d607f6..a6b022a8 100644 --- a/ncurses/base/lib_flash.c +++ b/ncurses/base/lib_flash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* * flash.c * @@ -40,9 +39,9 @@ */ #include -#include /* beep, flash */ +#include /* beep, flash */ -MODULE_ID("$Id: lib_flash.c,v 1.4 1999/10/22 21:39:06 tom Exp $") +MODULE_ID("$Id: lib_flash.c,v 1.6 2000/12/10 02:43:27 tom Exp $") /* * flash() @@ -52,22 +51,23 @@ MODULE_ID("$Id: lib_flash.c,v 1.4 1999/10/22 21:39:06 tom Exp $") * */ -int flash(void) +NCURSES_EXPORT(int) +flash(void) { - int res = ERR; + int res = ERR; - T((T_CALLED("flash()"))); + T((T_CALLED("flash()"))); - /* FIXME: should make sure that we are not in altchar mode */ - if (flash_screen) { - TPUTS_TRACE("flash_screen"); - res = putp(flash_screen); - _nc_flush(); - } else if (bell) { - TPUTS_TRACE("bell"); - res = putp(bell); - _nc_flush(); - } + /* FIXME: should make sure that we are not in altchar mode */ + if (flash_screen) { + TPUTS_TRACE("flash_screen"); + res = putp(flash_screen); + _nc_flush(); + } else if (bell) { + TPUTS_TRACE("bell"); + res = putp(bell); + _nc_flush(); + } - returnCode(res); + returnCode(res); } diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index 28f0e5f9..bce0a73e 100644 --- a/ncurses/base/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,40 +39,17 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.16 1999/11/28 01:34:11 tom Exp $") - -static void -free_slk(SLK *p) -{ - if (p != 0) { - FreeIfNeeded(p->ent); - FreeIfNeeded(p->buffer); - free(p); - } -} - -static void -free_tries(struct tries *p) -{ - struct tries *q; - - while (p != 0) { - q = p->sibling; - if (p->child != 0) - free_tries(p->child); - free(p); - p = q; - } -} +MODULE_ID("$Id: lib_freeall.c,v 1.20 2002/07/28 00:35:25 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical * use for it as an extension). */ -void +NCURSES_EXPORT(void) _nc_freeall(void) { WINDOWLIST *p, *q; + char *s; #if NO_LEAKS _nc_free_tparm(); @@ -85,34 +62,29 @@ _nc_freeall(void) for (q = _nc_windows; q != 0; q = q->next) { if ((p != q) - && (q->win->_flags & _SUBWIN) - && (p->win == q->win->_parent)) { + && (q->win._flags & _SUBWIN) + && (&(p->win) == q->win._parent)) { found = TRUE; break; } } if (!found) { - delwin(p->win); + delwin(&(p->win)); break; } } } - - free_tries(SP->_keytry); - free_tries(SP->_key_ok); - free_slk(SP->_slk); - FreeIfNeeded(SP->_color_pairs); - FreeIfNeeded(SP->_color_table); -#if !BROKEN_LINKER - FreeAndNull(SP); -#endif + delscreen(SP); } if (cur_term != 0) { _nc_free_termtype(&(cur_term->type)); free(cur_term); } + + if ((s = _nc_home_terminfo()) != 0) + free(s); #ifdef TRACE (void) _nc_trace_buf(-1, 0); #endif @@ -124,7 +96,7 @@ _nc_freeall(void) #endif } -void +NCURSES_EXPORT(void) _nc_free_and_exit(int code) { _nc_freeall(); @@ -132,7 +104,7 @@ _nc_free_and_exit(int code) } #else -void +NCURSES_EXPORT(void) _nc_freeall(void) { } diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index f67bf9a3..757703d8 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,11 +40,18 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.50 2000/10/09 23:53:57 Ilya.Zakharevich Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.67 2002/09/07 17:17:59 tom Exp $") #include -int ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ +NCURSES_EXPORT_VAR(int) +ESCDELAY = 1000; /* max interval betw. chars in funkeys, in millisecs */ + +#ifdef NCURSES_WGETCH_EVENTS +#define TWAIT_MASK 7 +#else +#define TWAIT_MASK 3 +#endif static inline int fifo_peek(void) @@ -61,7 +68,7 @@ fifo_pull(void) { int ch; ch = SP->_fifo[head]; - TR(TRACE_IEVENT, ("pulling %d from %d", ch, head)); + TR(TRACE_IEVENT, ("pulling %s from %d", _tracechar(ch), head)); if (peek == head) { h_inc(); @@ -77,11 +84,13 @@ fifo_pull(void) } static inline int -fifo_push(void) +fifo_push(EVENTLIST_0th(_nc_eventlist * evl)) { int n; - unsigned int ch; + int ch = 0; + int mask; + (void) mask; if (tail == -1) return ERR; @@ -90,18 +99,37 @@ fifo_push(void) errno = 0; #endif +#ifdef NCURSES_WGETCH_EVENTS + if (evl +#if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE) + || (SP->_mouse_fd >= 0) +#endif + ) { + mask = _nc_timed_wait(TWAIT_MASK, -1, (int *) 0, evl); + } else + mask = 0; + + if (mask & 4) { + T(("fifo_push: ungetch KEY_EVENT")); + ungetch(KEY_EVENT); + return KEY_EVENT; + } +#elif USE_GPM_SUPPORT || defined(USE_EMX_MOUSE) + if (SP->_mouse_fd >= 0) + mask = _nc_timed_wait(TWAIT_MASK, -1, (int *) 0 EVENTLIST_2nd(evl)); +#endif + #if USE_GPM_SUPPORT || defined(USE_EMX_MOUSE) - if ((SP->_mouse_fd >= 0) - && (_nc_timed_wait(3, -1, (int *) 0) & 2)) { + if ((SP->_mouse_fd >= 0) && (mask & 2)) { SP->_mouse_event(SP); ch = KEY_MOUSE; n = 1; } else #endif - { + { /* Can block... */ unsigned char c2 = 0; n = read(SP->_ifd, &c2, 1); - ch = c2 & 0xff; + ch = c2; } #ifdef HIDE_EINTR @@ -129,7 +157,7 @@ fifo_push(void) if (head == -1) head = peek = tail; t_inc(); - TR(TRACE_IEVENT, ("pushed %#x at %d", ch, tail)); + TR(TRACE_IEVENT, ("pushed %s at %d", _tracechar(ch), tail)); #ifdef TRACE if (_nc_tracing & TRACE_IEVENT) _nc_fifo_dump(); @@ -140,26 +168,31 @@ fifo_push(void) static inline void fifo_clear(void) { - int i; - for (i = 0; i < FIFO_SIZE; i++) - SP->_fifo[i] = 0; + memset(SP->_fifo, 0, sizeof(SP->_fifo)); head = -1; tail = peek = 0; } -static int kgetch(WINDOW *); +static int kgetch(EVENTLIST_0th(_nc_eventlist * evl)); #define wgetch_should_refresh(win) (\ (is_wintouched(win) || (win->_flags & _HASMOVED)) \ && !(win->_flags & _ISPAD)) -int -wgetch(WINDOW *win) +NCURSES_EXPORT(int) +_nc_wgetch(WINDOW *win, + unsigned long *result, + int use_meta + EVENTLIST_2nd(_nc_eventlist * evl)) { int ch; +#ifdef NCURSES_WGETCH_EVENTS + long event_delay = -1; +#endif - T((T_CALLED("wgetch(%p)"), win)); + T((T_CALLED("_nc_wgetch(%p)"), win)); + *result = 0; if (!win) returnCode(ERR); @@ -167,10 +200,14 @@ wgetch(WINDOW *win) if (wgetch_should_refresh(win)) wrefresh(win); - ch = fifo_pull(); - T(("wgetch returning (pre-cooked): %#x = %s", ch, _trace_key(ch))); - returnCode(ch); + *result = fifo_pull(); + returnCode(OK); } +#ifdef NCURSES_WGETCH_EVENTS + if (evl && (evl->count == 0)) + evl = NULL; + event_delay = _nc_eventlist_timeout(evl); +#endif /* * Handle cooked mode. Grab a string from the screen, @@ -179,19 +216,35 @@ wgetch(WINDOW *win) */ if (head == -1 && !SP->_raw && !SP->_cbreak) { char buf[MAXCOLUMNS], *sp; + int rc; TR(TRACE_IEVENT, ("filling queue in cooked mode")); - wgetnstr(win, buf, MAXCOLUMNS); + rc = wgetnstr(win, buf, MAXCOLUMNS); /* ungetch in reverse order */ - ungetch('\n'); +#ifdef NCURSES_WGETCH_EVENTS + if (rc != KEY_EVENT) +#endif + ungetch('\n'); for (sp = buf + strlen(buf); sp > buf; sp--) ungetch(sp[-1]); - returnCode(fifo_pull()); +#ifdef NCURSES_WGETCH_EVENTS + /* Return it first */ + if (rc == KEY_EVENT) { + *result = rc; + returnCode(OK); + } +#endif + + *result = fifo_pull(); + returnCode(OK); } + if (win->_use_keypad != SP->_keypad_on) + _nc_keypad(win->_use_keypad); + if (wgetch_should_refresh(win)) wrefresh(win); @@ -204,11 +257,28 @@ wgetch(WINDOW *win) else delay = win->_delay; +#ifdef NCURSES_WGETCH_EVENTS + if (event_delay >= 0 && delay > event_delay) + delay = event_delay; +#endif + TR(TRACE_IEVENT, ("delay is %d milliseconds", delay)); - if (head == -1) /* fifo is empty */ - if (!_nc_timed_wait(3, delay, (int *) 0)) + if (head == -1) { /* fifo is empty */ + int rc = _nc_timed_wait(TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); + +#ifdef NCURSES_WGETCH_EVENTS + if (rc & 4) { + *result = KEY_EVENT; + returnCode(OK); + } +#endif + if (!rc) returnCode(ERR); + } /* else go on to read data available */ } @@ -225,26 +295,47 @@ wgetch(WINDOW *win) * increase the wait with mouseinterval(). */ int runcount = 0; + int rc; do { - ch = kgetch(win); + ch = kgetch(EVENTLIST_1st(evl)); if (ch == KEY_MOUSE) { ++runcount; if (SP->_mouse_inline(SP)) break; } + if (SP->_maxclick < 0) + break; } while (ch == KEY_MOUSE - && (_nc_timed_wait(3, SP->_maxclick, (int *) 0) - || !SP->_mouse_parse(runcount))); - if (runcount > 0 && ch != KEY_MOUSE) { - /* mouse event sequence ended by keystroke, push it */ + && (((rc = _nc_timed_wait(TWAIT_MASK, + SP->_maxclick, + (int *) 0 + EVENTLIST_2nd(evl))) != 0 + && !(rc & 4)) + || !SP->_mouse_parse(runcount))); +#ifdef NCURSES_WGETCH_EVENTS + if ((rc & 4) && !ch == KEY_EVENT) { ungetch(ch); - ch = KEY_MOUSE; + ch = KEY_EVENT; + } +#endif + if (runcount > 0 && ch != KEY_MOUSE) { +#ifdef NCURSES_WGETCH_EVENTS + /* mouse event sequence ended by an event, report event */ + if (ch == KEY_EVENT) { + ungetch(KEY_MOUSE); /* FIXME This interrupts a gesture... */ + } else +#endif + { + /* mouse event sequence ended by keystroke, store keystroke */ + ungetch(ch); + ch = KEY_MOUSE; + } } } else { if (head == -1) - fifo_push(); + fifo_push(EVENTLIST_1st(evl)); ch = fifo_pull(); } @@ -254,13 +345,11 @@ wgetch(WINDOW *win) _nc_update_screensize(); /* resizeterm can push KEY_RESIZE */ if (cooked_key_in_fifo()) { - ch = fifo_pull(); - T(("wgetch returning (pre-cooked): %#x = %s", ch, _trace_key(ch))); - returnCode(ch); + *result = fifo_pull(); + returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK); } } #endif - T(("wgetch returning ERR")); returnCode(ERR); } @@ -299,13 +388,48 @@ wgetch(WINDOW *win) * that display only 7-bit characters. Note that 'ch' may be a * function key at this point, so we mustn't strip _those_. */ - if ((ch < KEY_MIN) && (ch & 0x80)) - if (!SP->_use_meta) + if (!use_meta) + if ((ch < KEY_MIN) && (ch & 0x80)) ch &= 0x7f; - T(("wgetch returning : %#x = %s", ch, _trace_key(ch))); + T(("wgetch returning : %s", _tracechar(ch))); + + *result = ch; + returnCode(ch >= KEY_MIN ? KEY_CODE_YES : OK); +} + +#ifdef NCURSES_WGETCH_EVENTS +NCURSES_EXPORT(int) +wgetch_events(WINDOW *win, _nc_eventlist * evl) +{ + int code; + unsigned long value; + + T((T_CALLED("wgetch_events(%p,%p)"), win, evl)); + code = _nc_wgetch(win, + &value, + SP->_use_meta + EVENTLIST_2nd(evl)); + if (code != ERR) + code = value; + returnCode(code); +} +#endif + +NCURSES_EXPORT(int) +wgetch(WINDOW *win) +{ + int code; + unsigned long value; - returnCode(ch); + T((T_CALLED("wgetch(%p)"), win)); + code = _nc_wgetch(win, + &value, + SP->_use_meta + EVENTLIST_2nd((_nc_eventlist *) 0)); + if (code != ERR) + code = value; + returnCode(code); } /* @@ -318,50 +442,61 @@ wgetch(WINDOW *win) ** sequence is received by the time the alarm goes off, pass through ** the sequence gotten so far. ** -** This function must be called when there is no cooked keys in queue. +** This function must be called when there are no cooked keys in queue. ** (that is head==-1 || peek==head) ** */ static int -kgetch(WINDOW *win GCC_UNUSED) +kgetch(EVENTLIST_0th(_nc_eventlist * evl)) { struct tries *ptr; int ch = 0; int timeleft = ESCDELAY; - TR(TRACE_IEVENT, ("kgetch(%p) called", win)); + TR(TRACE_IEVENT, ("kgetch() called")); ptr = SP->_keytry; for (;;) { - if (!raw_key_in_fifo()) { - if (fifo_push() == ERR) { + if (cooked_key_in_fifo() && SP->_fifo[head] >= KEY_MIN) { + break; + } else if (!raw_key_in_fifo()) { + ch = fifo_push(EVENTLIST_1st(evl)); + if (ch == ERR) { peek = head; /* the keys stay uninterpreted */ return ERR; } +#ifdef NCURSES_WGETCH_EVENTS + else if (ch == KEY_EVENT) { + peek = head; /* the keys stay uninterpreted */ + return fifo_pull(); /* Remove KEY_EVENT from the queue */ + } +#endif } + ch = fifo_peek(); if (ch >= KEY_MIN) { + /* If not first in queue, somebody put this key there on purpose in + * emergency. Consider it higher priority than the unfinished + * keysequence we are parsing. + */ peek = head; /* assume the key is the last in fifo */ t_dec(); /* remove the key */ return ch; } - TR(TRACE_IEVENT, ("ch: %s", _trace_key((unsigned char) ch))); + TR(TRACE_IEVENT, ("ch: %s", _tracechar((unsigned char) ch))); while ((ptr != NULL) && (ptr->ch != (unsigned char) ch)) ptr = ptr->sibling; -#ifdef TRACE + if (ptr == NULL) { TR(TRACE_IEVENT, ("ptr is null")); - } else - TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d", - ptr, ptr->ch, ptr->value)); -#endif /* TRACE */ - - if (ptr == NULL) break; + } + TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d", + ptr, ptr->ch, ptr->value)); if (ptr->value != 0) { /* sequence terminated */ TR(TRACE_IEVENT, ("end of sequence")); @@ -375,8 +510,22 @@ kgetch(WINDOW *win GCC_UNUSED) ptr = ptr->child; if (!raw_key_in_fifo()) { + int rc; + TR(TRACE_IEVENT, ("waiting for rest of sequence")); - if (!_nc_timed_wait(3, timeleft, &timeleft)) { + rc = _nc_timed_wait(TWAIT_MASK, + timeleft, + &timeleft + EVENTLIST_2nd(evl)); +#ifdef NCURSES_WGETCH_EVENTS + if (rc & 4) { + TR(TRACE_IEVENT, ("interrupted by a user event")); + /* FIXME Should have preserved timeleft for reusal... */ + peek = head; /* Restart interpreting later */ + return KEY_EVENT; + } +#endif + if (!rc) { TR(TRACE_IEVENT, ("ran out of time")); break; } diff --git a/ncurses/base/lib_getstr.c b/ncurses/base/lib_getstr.c index 485c6e35..76170382 100644 --- a/ncurses/base/lib_getstr.c +++ b/ncurses/base/lib_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_getstr.c ** @@ -42,151 +41,175 @@ #include #include -MODULE_ID("$Id: lib_getstr.c,v 1.20 1998/12/20 00:16:01 tom Exp $") +MODULE_ID("$Id: lib_getstr.c,v 1.24 2002/09/01 17:31:12 tom Exp $") /* * This wipes out the last character, no matter whether it was a tab, control * or other character, and handles reverse wraparound. */ -static char *WipeOut(WINDOW *win, int y, int x, char *first, char *last, bool echoed) +static char * +WipeOut(WINDOW *win, int y, int x, char *first, char *last, bool echoed) { - if (last > first) { - *--last = '\0'; - if (echoed) { - int y1 = win->_cury; - int x1 = win->_curx; - - wmove(win, y, x); - waddstr(win, first); - getyx(win, y, x); - while (win->_cury < y1 - || (win->_cury == y1 && win->_curx < x1)) - waddch(win, ' '); - - wmove(win, y, x); - } + if (last > first) { + *--last = '\0'; + if (echoed) { + int y1 = win->_cury; + int x1 = win->_curx; + + wmove(win, y, x); + waddstr(win, first); + getyx(win, y, x); + while (win->_cury < y1 + || (win->_cury == y1 && win->_curx < x1)) + waddch(win, (chtype) ' '); + + wmove(win, y, x); } - return last; + } + return last; } -int wgetnstr(WINDOW *win, char *str, int maxlen) +NCURSES_EXPORT(int) +wgetnstr_events(WINDOW *win, + char *str, + int maxlen, + EVENTLIST_1st(_nc_eventlist * evl)) { -TTY buf; -bool oldnl, oldecho, oldraw, oldcbreak; -char erasec; -char killc; -char *oldstr; -int ch; -int y, x; + TTY buf; + bool oldnl, oldecho, oldraw, oldcbreak; + char erasec; + char killc; + char *oldstr; + int ch; + int y, x; - T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen)); - if (!win) - returnCode(ERR); + if (!win) + returnCode(ERR); - _nc_get_tty_mode(&buf); + _nc_get_tty_mode(&buf); - oldnl = SP->_nl; - oldecho = SP->_echo; - oldraw = SP->_raw; - oldcbreak = SP->_cbreak; - nl(); - noecho(); - noraw(); - cbreak(); + oldnl = SP->_nl; + oldecho = SP->_echo; + oldraw = SP->_raw; + oldcbreak = SP->_cbreak; + nl(); + noecho(); + noraw(); + cbreak(); - erasec = erasechar(); - killc = killchar(); + erasec = erasechar(); + killc = killchar(); - oldstr = str; - getyx(win, y, x); + oldstr = str; + getyx(win, y, x); - if (is_wintouched(win) || (win->_flags & _HASMOVED)) - wrefresh(win); + if (is_wintouched(win) || (win->_flags & _HASMOVED)) + wrefresh(win); - while ((ch = wgetch(win)) != ERR) { - /* - * Some terminals (the Wyse-50 is the most common) generate - * a \n from the down-arrow key. With this logic, it's the - * user's choice whether to set kcud=\n for wgetch(); - * terminating *getstr() with \n should work either way. - */ - if (ch == '\n' - || ch == '\r' - || ch == KEY_DOWN - || ch == KEY_ENTER) { - if (oldecho == TRUE - && win->_cury == win->_maxy - && win->_scroll) - wechochar(win, '\n'); - break; - } - if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) { - if (str > oldstr) { - str = WipeOut(win, y, x, oldstr, str, oldecho); - } - } else if (ch == killc) { - while (str > oldstr) { - str = WipeOut(win, y, x, oldstr, str, oldecho); - } - } else if (ch >= KEY_MIN - || (maxlen >= 0 && str - oldstr >= maxlen)) { - beep(); - } else { - *str++ = ch; - if (oldecho == TRUE) { - int oldy = win->_cury; - if (waddch(win, ch) == ERR) { - /* - * We can't really use the lower-right - * corner for input, since it'll mess - * up bookkeeping for erases. - */ - win->_flags &= ~_WRAPPED; - waddch(win, ' '); - str = WipeOut(win, y, x, oldstr, str, oldecho); - continue; - } else if (win->_flags & _WRAPPED) { - /* - * If the last waddch forced a wrap & - * scroll, adjust our reference point - * for erasures. - */ - if (win->_scroll - && oldy == win->_maxy - && win->_cury == win->_maxy) { - if (--y <= 0) { - y = 0; - } - } - win->_flags &= ~_WRAPPED; - } - wrefresh(win); + while ((ch = wgetch_events(win, evl)) != ERR) { + /* + * Some terminals (the Wyse-50 is the most common) generate + * a \n from the down-arrow key. With this logic, it's the + * user's choice whether to set kcud=\n for wgetch(); + * terminating *getstr() with \n should work either way. + */ + if (ch == '\n' + || ch == '\r' + || ch == KEY_DOWN + || ch == KEY_ENTER) { + if (oldecho == TRUE + && win->_cury == win->_maxy + && win->_scroll) + wechochar(win, (chtype) '\n'); + break; + } +#ifdef KEY_EVENT + if (ch == KEY_EVENT) + break; +#endif + if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) { + if (str > oldstr) { + str = WipeOut(win, y, x, oldstr, str, oldecho); + } + } else if (ch == killc) { + while (str > oldstr) { + str = WipeOut(win, y, x, oldstr, str, oldecho); + } + } else if (ch >= KEY_MIN + || (maxlen >= 0 && str - oldstr >= maxlen)) { + beep(); + } else { + *str++ = ch; + if (oldecho == TRUE) { + int oldy = win->_cury; + if (waddch(win, (chtype) ch) == ERR) { + /* + * We can't really use the lower-right + * corner for input, since it'll mess + * up bookkeeping for erases. + */ + win->_flags &= ~_WRAPPED; + waddch(win, (chtype) ' '); + str = WipeOut(win, y, x, oldstr, str, oldecho); + continue; + } else if (win->_flags & _WRAPPED) { + /* + * If the last waddch forced a wrap & + * scroll, adjust our reference point + * for erasures. + */ + if (win->_scroll + && oldy == win->_maxy + && win->_cury == win->_maxy) { + if (--y <= 0) { + y = 0; } + } + win->_flags &= ~_WRAPPED; } + wrefresh(win); + } } + } + + win->_curx = 0; + win->_flags &= ~_WRAPPED; + if (win->_cury < win->_maxy) + win->_cury++; + wrefresh(win); + + /* Restore with a single I/O call, to fix minor asymmetry between + * raw/noraw, etc. + */ + SP->_nl = oldnl; + SP->_echo = oldecho; + SP->_raw = oldraw; + SP->_cbreak = oldcbreak; + + _nc_set_tty_mode(&buf); + + *str = '\0'; + if (ch == ERR) + returnCode(ch); +#ifdef KEY_EVENT + if (ch == KEY_EVENT) + returnCode(ch); +#endif + + T(("wgetnstr returns %s", _nc_visbuf(oldstr))); + + returnCode(OK); +} - win->_curx = 0; - win->_flags &= ~_WRAPPED; - if (win->_cury < win->_maxy) - win->_cury++; - wrefresh(win); - - /* Restore with a single I/O call, to fix minor asymmetry between - * raw/noraw, etc. - */ - SP->_nl = oldnl; - SP->_echo = oldecho; - SP->_raw = oldraw; - SP->_cbreak = oldcbreak; - - _nc_set_tty_mode(&buf); - - *str = '\0'; - if (ch == ERR) - returnCode(ERR); - - T(("wgetnstr returns %s", _nc_visbuf(oldstr))); - - returnCode(OK); +#ifdef NCURSES_WGETCH_EVENTS +NCURSES_EXPORT(int) +wgetnstr(WINDOW *win, char *str, int maxlen) +{ + returnCode(wgetnstr_events(win, + str, + maxlen, + EVENTLIST_1st((_nc_eventlist *) 0))); } +#endif diff --git a/ncurses/base/lib_hline.c b/ncurses/base/lib_hline.c index fd32d35a..2cb6cc5c 100644 --- a/ncurses/base/lib_hline.c +++ b/ncurses/base/lib_hline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_hline.c,v 1.6 2000/07/04 14:08:09 Philippe.Blain Exp $") +MODULE_ID("$Id: lib_hline.c,v 1.10 2001/06/03 00:39:24 skimo Exp $") -int +NCURSES_EXPORT(int) whline(WINDOW *win, chtype ch, int n) { int code = ERR; @@ -53,6 +53,7 @@ whline(WINDOW *win, chtype ch, int n) if (win) { struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T wch; start = win->_curx; end = start + n - 1; @@ -62,11 +63,13 @@ whline(WINDOW *win, chtype ch, int n) CHANGED_RANGE(line, start, end); if (ch == 0) - ch = ACS_HLINE; - ch = _nc_render(win, ch); + SetChar(wch, ChCharOf(ACS_HLINE), ChAttrOf(ACS_HLINE)); + else + SetChar(wch, ChCharOf(ch), ChAttrOf(ch)); + wch = _nc_render(win, wch); while (end >= start) { - line->text[end] = ch; + line->text[end] = wch; end--; } diff --git a/ncurses/base/lib_immedok.c b/ncurses/base/lib_immedok.c index 5590ec9f..87988b66 100644 --- a/ncurses/base/lib_immedok.c +++ b/ncurses/base/lib_immedok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_immedok.c ** @@ -41,14 +40,15 @@ #include -MODULE_ID("$Id: lib_immedok.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: lib_immedok.c,v 1.4 2000/12/10 02:43:27 tom Exp $") -void immedok(WINDOW *win, bool flag) +NCURSES_EXPORT(void) +immedok(WINDOW *win, bool flag) { - T((T_CALLED("immedok(%p,%d)"), win, flag)); + T((T_CALLED("immedok(%p,%d)"), win, flag)); - if (win) - win->_immed = flag; + if (win) + win->_immed = flag; - returnVoid; + returnVoid; } diff --git a/ncurses/base/lib_inchstr.c b/ncurses/base/lib_inchstr.c index 4779ae09..6ff01687 100644 --- a/ncurses/base/lib_inchstr.c +++ b/ncurses/base/lib_inchstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_inchstr.c ** @@ -41,22 +40,25 @@ #include -MODULE_ID("$Id: lib_inchstr.c,v 1.7 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_inchstr.c,v 1.10 2001/06/02 23:37:58 skimo Exp $") -int winchnstr(WINDOW *win, chtype *str, int n) +NCURSES_EXPORT(int) +winchnstr(WINDOW *win, chtype * str, int n) { - int i = 0; + int i = 0; - T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n)); + T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n)); - if (!str) - returnCode(0); + if (!str) + returnCode(0); - if (win) { - for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++) - str[i] = win->_line[win->_cury].text[win->_curx + i]; - } - str[i] = (chtype)0; + if (win) { + for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++) + str[i] = + CharOf(win->_line[win->_cury].text[win->_curx + i]) | + AttrOf(win->_line[win->_cury].text[win->_curx + i]); + } + str[i] = (chtype) 0; - returnCode(i); + returnCode(i); } diff --git a/ncurses/base/lib_initscr.c b/ncurses/base/lib_initscr.c index 9a89a077..1b7750d5 100644 --- a/ncurses/base/lib_initscr.c +++ b/ncurses/base/lib_initscr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,40 +39,59 @@ */ #include -#include /* for MAX_ALIAS */ +#include /* for MAX_ALIAS */ #if HAVE_SYS_TERMIO_H -#include /* needed for ISC */ +#include /* needed for ISC */ #endif -MODULE_ID("$Id: lib_initscr.c,v 1.26 1998/12/19 23:10:09 tom Exp $") +MODULE_ID("$Id: lib_initscr.c,v 1.32 2002/10/12 15:24:34 tom Exp $") -WINDOW *initscr(void) +NCURSES_EXPORT(WINDOW *) +initscr(void) { -static bool initialized = FALSE; -NCURSES_CONST char *name; -int value; + static bool initialized = FALSE; + NCURSES_CONST char *name; + int value; - T((T_CALLED("initscr()"))); - /* Portable applications must not call initscr() more than once */ - if (!initialized) { - initialized = TRUE; + START_TRACE(); + T((T_CALLED("initscr()"))); + /* Portable applications must not call initscr() more than once */ + if (!initialized) { + initialized = TRUE; - if ((name = getenv("TERM")) == 0 - || *name == '\0') - name = "unknown"; - if (newterm(name, stdout, stdin) == 0) { - fprintf(stderr, "Error opening terminal: %s.\n", name); - exit(EXIT_FAILURE); - } - - /* allow user to set maximum escape delay from the environment */ - if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { - ESCDELAY = value; - } + if ((name = getenv("TERM")) == 0 + || *name == '\0') + name = "unknown"; +#ifdef __CYGWIN__ + /* + * 2002/9/21 + * Work around a bug in Cygwin. Full-screen subprocesses run from + * bash, in turn spawned from another full-screen process, will dump + * core when attempting to write to stdout. Opening /dev/tty + * explicitly seems to fix the problem. + */ + if (isatty(fileno(stdout))) { + FILE *fp = fopen("/dev/tty", "w"); + if (fp != 0 && isatty(fileno(fp))) { + fclose(stdout); + dup2(fileno(fp), STDOUT_FILENO); + stdout = fdopen(STDOUT_FILENO, "w"); + } + } +#endif + if (newterm(name, stdout, stdin) == 0) { + fprintf(stderr, "Error opening terminal: %s.\n", name); + exit(EXIT_FAILURE); + } - /* def_shell_mode - done in newterm/_nc_setupscreen */ - def_prog_mode(); + /* allow user to set maximum escape delay from the environment */ + if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { + ESCDELAY = value; } - returnWin(stdscr); + + /* def_shell_mode - done in newterm/_nc_setupscreen */ + def_prog_mode(); + } + returnWin(stdscr); } diff --git a/ncurses/base/lib_insch.c b/ncurses/base/lib_insch.c index ccc5ff5d..c3671e5d 100644 --- a/ncurses/base/lib_insch.c +++ b/ncurses/base/lib_insch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** lib_insch.c ** @@ -42,26 +40,29 @@ #include -MODULE_ID("$Id: lib_insch.c,v 1.10 1998/06/28 00:26:52 tom Exp $") +MODULE_ID("$Id: lib_insch.c,v 1.15 2001/06/09 23:47:38 skimo Exp $") -int winsch(WINDOW *win, chtype c) +NCURSES_EXPORT(int) +winsch(WINDOW *win, chtype c) { -int code = ERR; + int code = ERR; - T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c))); + T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c))); - if (win) { - struct ldat *line = &(win->_line[win->_cury]); - chtype *end = &(line->text[win->_curx]); - chtype *temp1 = &(line->text[win->_maxx]); - chtype *temp2 = temp1 - 1; + if (win) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - 1; + NCURSES_CH_T wch; + SetChar2(wch, c); - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 > end) - *temp1-- = *temp2--; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; - *temp1 = _nc_render(win, c); - code = OK; - } - returnCode(code); + *temp1 = _nc_render(win, wch); + code = OK; + } + returnCode(code); } diff --git a/ncurses/base/lib_insdel.c b/ncurses/base/lib_insdel.c index 48e108de..432bcace 100644 --- a/ncurses/base/lib_insdel.c +++ b/ncurses/base/lib_insdel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,21 +42,22 @@ #include -MODULE_ID("$Id: lib_insdel.c,v 1.8 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_insdel.c,v 1.11 2001/12/19 01:10:49 tom Exp $") -int +NCURSES_EXPORT(int) winsdelln(WINDOW *win, int n) { -int code = ERR; + int code = ERR; - T((T_CALLED("winsdel(%p,%d)"), win, n)); + T((T_CALLED("winsdel(%p,%d)"), win, n)); - if (win) { - if (n != 0) { - _nc_scroll_window(win, -n, win->_cury, win->_maxy, _nc_background(win)); + if (win) { + if (n != 0) { + _nc_scroll_window(win, -n, win->_cury, win->_maxy, + win->_nc_bkgd); _nc_synchook(win); - } - code = OK; } - returnCode(code); + code = OK; + } + returnCode(code); } diff --git a/ncurses/base/lib_insstr.c b/ncurses/base/lib_insstr.c index a2275f94..347b3561 100644 --- a/ncurses/base/lib_insstr.c +++ b/ncurses/base/lib_insstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,9 +41,9 @@ #include #include -MODULE_ID("$Id: lib_insstr.c,v 1.14 2000/04/29 21:16:41 tom Exp $") +MODULE_ID("$Id: lib_insstr.c,v 1.20 2002/09/28 16:22:34 tom Exp $") -int +NCURSES_EXPORT(int) winsnstr(WINDOW *win, const char *s, int n) { int code = ERR; @@ -52,17 +52,19 @@ winsnstr(WINDOW *win, const char *s, int n) const unsigned char *str = (const unsigned char *) s; const unsigned char *cp; - T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbuf(s), n)); + T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s,n), n)); if (win && str) { oy = win->_cury; ox = win->_curx; for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) { - if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') - _nc_waddch_nosync(win, (chtype) (*cp)); - else if (is7bits(*cp) && iscntrl(*cp)) { + if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') { + NCURSES_CH_T wch; + SetChar2(wch, *cp); + _nc_waddch_nosync(win, wch); + } else if (is7bits(*cp) && iscntrl(*cp)) { winsch(win, ' ' + (chtype) (*cp)); - winsch(win, '^'); + winsch(win, (chtype) '^'); win->_curx += 2; } else { winsch(win, (chtype) (*cp)); diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c index b3e1d030..157d2ec9 100644 --- a/ncurses/base/lib_instr.c +++ b/ncurses/base/lib_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_instr.c ** @@ -41,33 +40,34 @@ #include -MODULE_ID("$Id: lib_instr.c,v 1.8 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_instr.c,v 1.12 2002/10/05 23:23:05 tom Exp $") -int winnstr(WINDOW *win, char *str, int n) +NCURSES_EXPORT(int) +winnstr(WINDOW *win, char *str, int n) { - int i=0, row, col; + int i = 0, row, col; + + T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n)); - T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n)); + if (!str) + returnCode(0); - if (!str) - returnCode(0); - - if (win) { - getyx(win, row, col); + if (win) { + getyx(win, row, col); - if (n < 0) + if (n < 0) n = win->_maxx - win->_curx + 1; - for (; i < n;) { - str[i++] = TextOf(win->_line[row].text[col]); + for (; i < n;) { + str[i++] = CharOf(win->_line[row].text[col]); if (++col > win->_maxx) { - col = 0; - if (++row > win->_maxy) - break; + col = 0; + if (++row > win->_maxy) + break; } - } } - str[i] = '\0'; /* SVr4 does not seem to count the null */ - returnCode(i); + } + str[i] = '\0'; /* SVr4 does not seem to count the null */ + T(("winnstr returns %s", _nc_visbuf(str))); + returnCode(i); } - diff --git a/ncurses/base/lib_isendwin.c b/ncurses/base/lib_isendwin.c index 60015fca..b337d97a 100644 --- a/ncurses/base/lib_isendwin.c +++ b/ncurses/base/lib_isendwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_endwin.c ** @@ -41,11 +40,12 @@ #include -MODULE_ID("$Id: lib_isendwin.c,v 1.4 1998/04/11 22:52:32 tom Exp $") +MODULE_ID("$Id: lib_isendwin.c,v 1.6 2000/12/10 02:43:27 tom Exp $") -bool isendwin(void) +NCURSES_EXPORT(bool) +isendwin(void) { - if (SP == NULL) - return FALSE; - return SP->_endwin; + if (SP == NULL) + return FALSE; + return SP->_endwin; } diff --git a/ncurses/base/lib_leaveok.c b/ncurses/base/lib_leaveok.c index e83285d7..17d095d0 100644 --- a/ncurses/base/lib_leaveok.c +++ b/ncurses/base/lib_leaveok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_leaveok.c ** @@ -41,16 +40,16 @@ #include -MODULE_ID("$Id: lib_leaveok.c,v 1.3 1998/03/21 22:54:20 jtc Exp $") +MODULE_ID("$Id: lib_leaveok.c,v 1.5 2000/12/10 02:43:27 tom Exp $") -int leaveok(WINDOW *win, bool flag) +NCURSES_EXPORT(int) +leaveok(WINDOW *win, bool flag) { - T((T_CALLED("leaveok(%p,%d)"), win, flag)); + T((T_CALLED("leaveok(%p,%d)"), win, flag)); - if (win) { - win->_leaveok = flag; - returnCode(OK); - } - else - returnCode(ERR); + if (win) { + win->_leaveok = flag; + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 3b856350..0555f1fd 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -84,7 +84,7 @@ #endif #endif -MODULE_ID("$Id: lib_mouse.c,v 1.55 2000/10/10 00:07:28 Ilya.Zakharevich Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.61 2002/09/28 16:08:58 tom Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -327,17 +327,18 @@ _nc_mouse_init(void) } } +/* + * Query to see if there is a pending mouse event. This is called from + * fifo_push() in lib_getch.c + */ static bool _nc_mouse_event(SCREEN * sp GCC_UNUSED) -/* query to see if there is a pending mouse event */ { #if USE_GPM_SUPPORT /* GPM: query server for event, return TRUE if we find one */ Gpm_Event ev; - if (gpm_fd >= 0 - && (_nc_timed_wait(3, 0, (int *) 0) & 2) != 0 - && Gpm_GetEvent(&ev) == 1) { + if (Gpm_GetEvent(&ev) == 1) { eventp->id = 0; /* there's only one mouse... */ eventp->bstate = 0; @@ -373,8 +374,7 @@ _nc_mouse_event(SCREEN * sp GCC_UNUSED) #endif #ifdef USE_EMX_MOUSE - if (SP->_mouse_fd >= 0 - && (_nc_timed_wait(3, 0, (int *) 0) & 2) != 0) { + { char kbuf[3]; int i, res = read(M_FD(sp), &kbuf, 3); /* Eat the prefix */ @@ -655,7 +655,7 @@ _nc_mouse_parse(int runcount) /* first pass; merge press/release pairs */ do { merge = FALSE; - for (ep = runp; next = NEXT(ep), next != eventp; ep = next) { + for (ep = runp; (next = NEXT(ep)) != eventp; ep = next) { if (ep->x == next->x && ep->y == next->y && (ep->bstate & (BUTTON1_PRESSED | BUTTON2_PRESSED | BUTTON3_PRESSED)) && (!(ep->bstate & BUTTON1_PRESSED) @@ -720,7 +720,7 @@ _nc_mouse_parse(int runcount) MEVENT *follower; merge = FALSE; - for (ep = runp; next = NEXT(ep), next != eventp; ep = next) + for (ep = runp; (next = NEXT(ep)) != eventp; ep = next) if (ep->id != INVALID_EVENT) { if (next->id != INVALID_EVENT) continue; @@ -863,7 +863,7 @@ _nc_mouse_resume(SCREEN * sp GCC_UNUSED) * **************************************************************************/ -int +NCURSES_EXPORT(int) getmouse(MEVENT * aevent) /* grab a copy of the current mouse event */ { @@ -886,10 +886,12 @@ getmouse(MEVENT * aevent) returnCode(ERR); } -int +NCURSES_EXPORT(int) ungetmouse(MEVENT * aevent) /* enqueue a synthesized mouse event to be seen by the next wgetch() */ { + T((T_CALLED("ungetmouse(%p)"), aevent)); + /* stick the given event in the next-free slot */ *eventp = *aevent; @@ -897,10 +899,10 @@ ungetmouse(MEVENT * aevent) eventp = NEXT(eventp); /* push back the notification event on the keyboard queue */ - return ungetch(KEY_MOUSE); + returnCode(ungetch(KEY_MOUSE)); } -mmask_t +NCURSES_EXPORT(mmask_t) mousemask(mmask_t newmask, mmask_t * oldmask) /* set the mouse event mask */ { @@ -912,7 +914,7 @@ mousemask(mmask_t newmask, mmask_t * oldmask) *oldmask = eventmask; if (!newmask && !initialized) - returnCode(0); + returnBits(0); _nc_mouse_init(); if (mousetype != M_NONE) { @@ -930,29 +932,35 @@ mousemask(mmask_t newmask, mmask_t * oldmask) result = eventmask; } - returnCode(result); + returnBits(result); } -bool +NCURSES_EXPORT(bool) wenclose(const WINDOW *win, int y, int x) /* check to see if given window encloses given screen location */ { - if (win) { + bool result = FALSE; + + T((T_CALLED("wenclose(%p,%d,%d)"), win, y, x)); + + if (win != 0) { y -= win->_yoffset; - return ((win->_begy <= y && - win->_begx <= x && - (win->_begx + win->_maxx) >= x && - (win->_begy + win->_maxy) >= y) ? TRUE : FALSE); + result = ((win->_begy <= y && + win->_begx <= x && + (win->_begx + win->_maxx) >= x && + (win->_begy + win->_maxy) >= y) ? TRUE : FALSE); } - return FALSE; + returnBool(result); } -int +NCURSES_EXPORT(int) mouseinterval(int maxclick) /* set the maximum mouse interval within which to recognize a click */ { int oldval; + T((T_CALLED("mouseinterval(%d)"), maxclick)); + if (SP != 0) { oldval = SP->_maxclick; if (maxclick >= 0) @@ -961,22 +969,24 @@ mouseinterval(int maxclick) oldval = DEFAULT_MAXCLICK; } - return (oldval); + returnCode(oldval); } /* This may be used by other routines to ask for the existence of mouse support */ -int +NCURSES_EXPORT(int) _nc_has_mouse(void) { return (mousetype == M_NONE ? 0 : 1); } -bool +NCURSES_EXPORT(bool) wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen) { bool result = FALSE; + T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), win, pY, pX, to_screen)); + if (win && pY && pX) { int y = *pY; int x = *pX; @@ -998,7 +1008,7 @@ wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen) *pY = y; } } - return (result); + returnBool(result); } /* lib_mouse.c ends here */ diff --git a/ncurses/base/lib_move.c b/ncurses/base/lib_move.c index 68415d6e..e917eb78 100644 --- a/ncurses/base/lib_move.c +++ b/ncurses/base/lib_move.c @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_move.c,v 1.9 2000/04/29 21:11:19 tom Exp $") +MODULE_ID("$Id: lib_move.c,v 1.11 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) wmove(WINDOW *win, int y, int x) { T((T_CALLED("wmove(%p,%d,%d)"), win, y, x)); diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c index 9774d9f5..63d54ccd 100644 --- a/ncurses/base/lib_mvwin.c +++ b/ncurses/base/lib_mvwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** lib_mvwin.c ** @@ -42,68 +40,69 @@ #include -MODULE_ID("$Id: lib_mvwin.c,v 1.7 1998/02/11 12:13:55 tom Exp $") +MODULE_ID("$Id: lib_mvwin.c,v 1.12 2001/12/19 01:06:22 tom Exp $") -int mvwin(WINDOW *win, int by, int bx) +NCURSES_EXPORT(int) +mvwin(WINDOW *win, int by, int bx) { - T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx)); + T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx)); - if (!win || (win->_flags & _ISPAD)) - returnCode(ERR); + if (!win || (win->_flags & _ISPAD)) + returnCode(ERR); - /* Copying subwindows is allowed, but it is expensive... */ - if (win->_flags & _SUBWIN) { - int err = ERR; - WINDOW *parent = win->_parent; - if (parent) - { /* Now comes the complicated and costly part, you should really - * try to avoid to move subwindows. Because a subwindow shares - * the text buffers with its parent, one can't do a simple - * memmove of the text buffers. One has to create a copy, then - * to relocate the subwindow and then to do a copy. - */ - if ((by - parent->_begy == win->_pary) && - (bx - parent->_begx == win->_parx)) - err=OK; /* we don't actually move */ - else { - WINDOW* clone = dupwin(win); + /* Copying subwindows is allowed, but it is expensive... */ + if (win->_flags & _SUBWIN) { + int err = ERR; + WINDOW *parent = win->_parent; + if (parent) { /* Now comes the complicated and costly part, you should really + * try to avoid to move subwindows. Because a subwindow shares + * the text buffers with its parent, one can't do a simple + * memmove of the text buffers. One has to create a copy, then + * to relocate the subwindow and then to do a copy. + */ + if ((by - parent->_begy == win->_pary) && + (bx - parent->_begx == win->_parx)) + err = OK; /* we don't actually move */ + else { + WINDOW *clone = dupwin(win); if (clone) { - /* now we have the clone, so relocate win */ - - werase(win); /* Erase the original place */ - wbkgd(win,parent->_bkgd);/* fill with parents background */ - wsyncup(win); /* Tell the parent(s) */ - - err = mvderwin(win, - by - parent->_begy, - bx - parent->_begx); - if (err!=ERR) { - err = copywin(clone,win, - 0, 0, 0, 0, win->_maxy, win->_maxx, 0); - if (ERR!=err) - wsyncup(win); - } - if (ERR==delwin(clone)) - err=ERR; + /* now we have the clone, so relocate win */ + + werase(win); /* Erase the original place */ + /* fill with parents background */ + wbkgrnd(win, CHREF(parent->_nc_bkgd)); + wsyncup(win); /* Tell the parent(s) */ + + err = mvderwin(win, + by - parent->_begy, + bx - parent->_begx); + if (err != ERR) { + err = copywin(clone, win, + 0, 0, 0, 0, win->_maxy, win->_maxx, 0); + if (ERR != err) + wsyncup(win); + } + if (ERR == delwin(clone)) + err = ERR; } - } } - returnCode(err); } + returnCode(err); + } - if (by + win->_maxy > screen_lines - 1 - || bx + win->_maxx > screen_columns - 1 - || by < 0 - || bx < 0) - returnCode(ERR); + if (by + win->_maxy > screen_lines - 1 + || bx + win->_maxx > screen_columns - 1 + || by < 0 + || bx < 0) + returnCode(ERR); - /* - * Whether or not the window is moved, touch the window's contents so - * that a following call to 'wrefresh()' will paint the window at the - * new location. This ensures that if the caller has refreshed another - * window at the same location, that this one will be displayed. - */ - win->_begy = by; - win->_begx = bx; - returnCode(touchwin(win)); + /* + * Whether or not the window is moved, touch the window's contents so + * that a following call to 'wrefresh()' will paint the window at the + * new location. This ensures that if the caller has refreshed another + * window at the same location, that this one will be displayed. + */ + win->_begy = by; + win->_begx = bx; + returnCode(touchwin(win)); } diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index 7da4069b..8d6dd97e 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,7 +47,7 @@ #include /* clear_screen, cup & friends, cur_term */ #include -MODULE_ID("$Id: lib_newterm.c,v 1.48 2000/09/02 18:11:42 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.56 2002/10/12 15:24:08 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -64,18 +64,25 @@ MODULE_ID("$Id: lib_newterm.c,v 1.48 2000/09/02 18:11:42 tom Exp $") static inline int _nc_initscr(void) { + int result = ERR; + /* for extended XPG4 conformance requires cbreak() at this point */ /* (SVr4 curses does this anyway) */ - cbreak(); + if (cbreak() == OK) { + TTY buf; + buf = cur_term->Nttyb; #ifdef TERMIOS - cur_term->Nttyb.c_lflag &= ~(ECHO | ECHONL); - cur_term->Nttyb.c_iflag &= ~(ICRNL | INLCR | IGNCR); - cur_term->Nttyb.c_oflag &= ~(ONLCR); + buf.c_lflag &= ~(ECHO | ECHONL); + buf.c_iflag &= ~(ICRNL | INLCR | IGNCR); + buf.c_oflag &= ~(ONLCR); #else - cur_term->Nttyb.sg_flags &= ~(ECHO | CRMOD); + buf.sg_flags &= ~(ECHO | CRMOD); #endif - return _nc_set_tty_mode(&cur_term->Nttyb); + if ((result = _nc_set_tty_mode(&buf)) == OK) + cur_term->Nttyb = buf; + } + return result; } /* @@ -86,30 +93,27 @@ _nc_initscr(void) */ static int filter_mode = FALSE; -void +NCURSES_EXPORT(void) filter(void) { + T((T_CALLED("filter"))); filter_mode = TRUE; + returnVoid; } -SCREEN * +NCURSES_EXPORT(SCREEN *) newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) { int errret; int slk_format = _nc_slk_format; SCREEN *current; -#ifdef TRACE - int t = _nc_getenv_num("NCURSES_TRACE"); - - if (t >= 0) - trace(t); -#endif + START_TRACE(); T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp)); /* this loads the capability entry, then sets LINES and COLS */ if (setupterm(name, fileno(ofp), &errret) == ERR) - return 0; + returnSP(0); /* implement filter mode */ if (filter_mode) { @@ -138,8 +142,8 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) if (num_labels <= 0 || !SLK_STDFMT(slk_format)) if (slk_format) { if (ERR == _nc_ripoffline(-SLK_LINES(slk_format), - _nc_slk_initialize)) - return 0; + _nc_slk_initialize)) + returnSP(0); } /* this actually allocates the screen structure, and saves the * original terminal settings. @@ -148,7 +152,7 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) _nc_set_screen(0); if (_nc_setupscreen(LINES, COLS, ofp) == ERR) { _nc_set_screen(current); - return 0; + returnSP(0); } /* if the terminal type has real soft labels, set those up */ @@ -156,11 +160,10 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) _nc_slk_initialize(stdscr, COLS); SP->_ifd = fileno(ifp); - SP->_checkfd = fileno(ifp); typeahead(fileno(ifp)); #ifdef TERMIOS SP->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 && - !(cur_term->Ottyb.c_iflag & ISTRIP)); + !(cur_term->Ottyb.c_iflag & ISTRIP)); #else SP->_use_meta = FALSE; #endif @@ -171,8 +174,8 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) * will be useless. */ SP->_scrolling = ((scroll_forward && scroll_reverse) || - ((parm_rindex || parm_insert_line || insert_line) && - (parm_index || parm_delete_line || delete_line))); + ((parm_rindex || parm_insert_line || insert_line) && + (parm_index || parm_delete_line || delete_line))); baudrate(); /* sets a field in the SP structure */ @@ -191,26 +194,6 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) SP->_use_rmso = SGR0_TEST(exit_standout_mode); SP->_use_rmul = SGR0_TEST(exit_underline_mode); -#if USE_WIDEC_SUPPORT - /* - * XFree86 xterm can be configured to support UTF-8 based on environment - * variable settings. - */ - { - char *s; - s = getenv("LC_ALL"); - if (s == NULL || *s == '\0') { - s = getenv("LC_CTYPE"); - if (s == NULL || *s == '\0') { - s = getenv("LANG"); - } - } - if (s != NULL && *s != '\0' && strstr(s, "UTF-8") != NULL) { - SP->_outch = _nc_utf8_outch; - } - } -#endif - /* compute movement costs so we can do better move optimization */ _nc_mvcur_init(); @@ -222,6 +205,5 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp) _nc_signal_handler(TRUE); - T((T_RETURN("%p"), SP)); - return (SP); + returnSP(SP); } diff --git a/ncurses/base/lib_newwin.c b/ncurses/base/lib_newwin.c index ececa58a..aa8959ca 100644 --- a/ncurses/base/lib_newwin.c +++ b/ncurses/base/lib_newwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,49 +40,74 @@ #include -MODULE_ID("$Id: lib_newwin.c,v 1.24 2000/04/29 18:49:51 tom Exp $") +MODULE_ID("$Id: lib_newwin.c,v 1.34 2002/08/18 00:12:30 tom Exp $") -void +static WINDOW * +remove_window_from_screen(WINDOW *win) +{ + SCREEN **scan = &_nc_screen_chain; + + while (*scan) { + SCREEN *sp = *scan; + if (sp->_curscr == win) { + sp->_curscr = 0; + if (win == curscr) + curscr = 0; + } else if (sp->_stdscr == win) { + sp->_stdscr = 0; + if (win == stdscr) + stdscr = 0; + } else if (sp->_newscr == win) { + sp->_newscr = 0; + if (win == newscr) + newscr = 0; + } else { + scan = &(*scan)->_next_screen; + continue; + } + break; + } + + return 0; +} + +NCURSES_EXPORT(int) _nc_freewin(WINDOW *win) { WINDOWLIST *p, *q; int i; + int result = ERR; if (win != 0) { for (p = _nc_windows, q = 0; p != 0; q = p, p = p->next) { - if (p->win == win) { + if (&(p->win) == win) { + remove_window_from_screen(win); if (q == 0) _nc_windows = p->next; else q->next = p->next; - free(p); if (!(win->_flags & _SUBWIN)) { for (i = 0; i <= win->_maxy; i++) FreeIfNeeded(win->_line[i].text); } free(win->_line); - free(win); - - if (win == curscr) - curscr = 0; - if (win == stdscr) - stdscr = 0; - if (win == newscr) - newscr = 0; + free(p); + result = OK; T(("...deleted win=%p", win)); break; } } } + return result; } -WINDOW * +NCURSES_EXPORT(WINDOW *) newwin(int num_lines, int num_columns, int begy, int begx) { WINDOW *win; - chtype *ptr; + NCURSES_CH_T *ptr; int i; T((T_CALLED("newwin(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx)); @@ -102,22 +127,21 @@ newwin(int num_lines, int num_columns, int begy, int begx) returnWin(0); for (i = 0; i < num_lines; i++) { - win->_line[i].text = typeCalloc(chtype, (unsigned) num_columns); + win->_line[i].text = typeCalloc(NCURSES_CH_T, (unsigned) num_columns); if (win->_line[i].text == 0) { - _nc_freewin(win); + (void) _nc_freewin(win); returnWin(0); } - for (ptr = win->_line[i].text; ptr < win->_line[i].text + - num_columns;) - *ptr++ = ' '; + for (ptr = win->_line[i].text; + ptr < win->_line[i].text + num_columns; + ptr++) + SetChar(*ptr, BLANK_TEXT, BLANK_ATTR); } - T(("newwin: returned window is %p", win)); - returnWin(win); } -WINDOW * +NCURSES_EXPORT(WINDOW *) derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) { WINDOW *win; @@ -125,10 +149,10 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) int flags = _SUBWIN; T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns, - begy, begx)); + begy, begx)); /* - ** make sure window fits inside the original one + * make sure window fits inside the original one */ if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0) returnWin(0); @@ -146,25 +170,23 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) flags |= _ISPAD; if ((win = _nc_makenew(num_lines, num_columns, orig->_begy + begy, - orig->_begx + begx, flags)) == 0) + orig->_begx + begx, flags)) == 0) returnWin(0); win->_pary = begy; win->_parx = begx; win->_attrs = orig->_attrs; - win->_bkgd = orig->_bkgd; + win->_nc_bkgd = orig->_nc_bkgd; for (i = 0; i < num_lines; i++) win->_line[i].text = &orig->_line[begy++].text[begx]; win->_parent = orig; - T(("derwin: returned window is %p", win)); - returnWin(win); } -WINDOW * +NCURSES_EXPORT(WINDOW *) subwin(WINDOW *w, int l, int c, int y, int x) { T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x)); @@ -180,7 +202,7 @@ dimension_limit(int value) return (test == value && value > 0); } -WINDOW * +NCURSES_EXPORT(WINDOW *) _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags) { int i; @@ -196,8 +218,7 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags) if ((wp = typeCalloc(WINDOWLIST, 1)) == 0) return 0; - if ((win = typeCalloc(WINDOW, 1)) == 0) - return 0; + win = &(wp->win); if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) { free(win); @@ -214,10 +235,10 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags) win->_flags = flags; win->_attrs = A_NORMAL; - win->_bkgd = BLANK; + SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR); - win->_clear = is_pad ? FALSE : (num_lines == screen_lines && num_columns - == screen_columns); + win->_clear = is_pad ? FALSE : (num_lines == screen_lines + && num_columns == screen_columns); win->_idlok = FALSE; win->_idcok = TRUE; win->_scroll = FALSE; @@ -277,7 +298,6 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags) } wp->next = _nc_windows; - wp->win = win; _nc_windows = wp; T((T_CREATE("window %p"), win)); diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c index bfaffdef..32515da0 100644 --- a/ncurses/base/lib_nl.c +++ b/ncurses/base/lib_nl.c @@ -42,13 +42,13 @@ #include -MODULE_ID("$Id: lib_nl.c,v 1.6 2000/02/13 00:59:39 tom Exp $") +MODULE_ID("$Id: lib_nl.c,v 1.8 2000/12/10 02:43:27 tom Exp $") #ifdef __EMX__ #include #endif -int +NCURSES_EXPORT(int) nl(void) { T((T_CALLED("nl()"))); @@ -63,7 +63,7 @@ nl(void) returnCode(OK); } -int +NCURSES_EXPORT(int) nonl(void) { T((T_CALLED("nonl()"))); diff --git a/ncurses/base/lib_overlay.c b/ncurses/base/lib_overlay.c index db2dce1b..7840b450 100644 --- a/ncurses/base/lib_overlay.c +++ b/ncurses/base/lib_overlay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_overlay.c ** @@ -41,29 +40,54 @@ #include -MODULE_ID("$Id: lib_overlay.c,v 1.12 1998/02/11 12:13:59 tom Exp $") +MODULE_ID("$Id: lib_overlay.c,v 1.21 2002/09/21 23:03:32 tom Exp $") -static int overlap(const WINDOW *const s, WINDOW *const d, int const flag) +static int +overlap(const WINDOW *const s, WINDOW *const d, int const flag) { -int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol; - - T(("overlap : sby %d, sbx %d, smy %d, smx %d, dby %d, dbx %d, dmy %d, dmx %d", - s->_begy, s->_begx, s->_maxy, s->_maxx, - d->_begy, d->_begx, d->_maxy, d->_maxx)); - - if (!s || !d) - returnCode(ERR); - - sminrow = max(s->_begy, d->_begy) - s->_begy; - smincol = max(s->_begx, d->_begx) - s->_begx; - dminrow = max(s->_begy, d->_begy) - d->_begy; - dmincol = max(s->_begx, d->_begx) - d->_begx; - dmaxrow = min(s->_maxy+s->_begy, d->_maxy+d->_begy) - d->_begy; - dmaxcol = min(s->_maxx+s->_begx, d->_maxx+d->_begx) - d->_begx; - - return(copywin(s, d, - sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, - flag)); + int sx1, sy1, sx2, sy2; + int dx1, dy1, dx2, dy2; + int sminrow, smincol; + int dminrow, dmincol; + int dmaxrow, dmaxcol; + + T((T_CALLED("overlap(%p,%p,%d)"), s, d, flag)); + + if (s == 0 || d == 0) { + returnCode(ERR); + } else { + T(("src : begy %d, begx %d, maxy %d, maxx %d", + s->_begy, s->_begx, s->_maxy, s->_maxx)); + T(("dst : begy %d, begx %d, maxy %d, maxx %d", + d->_begy, d->_begx, d->_maxy, d->_maxx)); + + sx1 = s->_begx; + sy1 = s->_begy; + sx2 = sx1 + s->_maxx; + sy2 = sy1 + s->_maxy; + + dx1 = d->_begx; + dy1 = d->_begy; + dx2 = dx1 + d->_maxx; + dy2 = dy1 + d->_maxy; + + if (dx2 < sx1 || dx1 > sx2 || dy2 < sy1 || dy1 > sy2) { + returnCode(ERR); /* No intersection */ + } else { + sminrow = max(sy1, dy1) - sy1; + smincol = max(sx1, dx1) - sx1; + dminrow = max(sy1, dy1) - dy1; + dmincol = max(sx1, dx1) - dx1; + dmaxrow = min(sy2, dy2) - dy1; + dmaxcol = min(sx2, dx2) - dx1; + + returnCode(copywin(s, d, + sminrow, smincol, + dminrow, dmincol, + dmaxrow, dmaxcol, + flag)); + } + } } /* @@ -76,10 +100,11 @@ int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol; ** **/ -int overlay(const WINDOW *win1, WINDOW *win2) +NCURSES_EXPORT(int) +overlay(const WINDOW *win1, WINDOW *win2) { - T((T_CALLED("overlay(%p,%p)"), win1, win2)); - returnCode(overlap(win1, win2, TRUE)); + T((T_CALLED("overlay(%p,%p)"), win1, win2)); + returnCode(overlap(win1, win2, TRUE)); } /* @@ -92,70 +117,68 @@ int overlay(const WINDOW *win1, WINDOW *win2) ** **/ -int overwrite(const WINDOW *win1, WINDOW *win2) +NCURSES_EXPORT(int) +overwrite(const WINDOW *win1, WINDOW *win2) { - T((T_CALLED("overwrite(%p,%p)"), win1, win2)); - returnCode(overlap(win1, win2, FALSE)); + T((T_CALLED("overwrite(%p,%p)"), win1, win2)); + returnCode(overlap(win1, win2, FALSE)); } -int copywin(const WINDOW *src, WINDOW *dst, +NCURSES_EXPORT(int) +copywin(const WINDOW *src, WINDOW *dst, int sminrow, int smincol, - int dminrow, int dmincol, int dmaxrow, int dmaxcol, + int dminrow, int dmincol, + int dmaxrow, int dmaxcol, int over) { -int sx, sy, dx, dy; -bool touched; -chtype bk = AttrOf(dst->_bkgd); -chtype mask = ~(chtype)((bk&A_COLOR) ? A_COLOR : 0); - - T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"), - src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); - - if (!src || !dst) - returnCode(ERR); - - /* make sure rectangle exists in source */ - if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) || - (smincol + dmaxcol - dmincol) > (src->_maxx + 1)) { - returnCode(ERR); + int sx, sy, dx, dy; + bool touched; + attr_t bk = AttrOf(dst->_nc_bkgd); + attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0); + + T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"), + src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over)); + + if (!src || !dst) + returnCode(ERR); + + /* make sure rectangle exists in source */ + if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) || + (smincol + dmaxcol - dmincol) > (src->_maxx + 1)) { + returnCode(ERR); + } + + T(("rectangle exists in source")); + + /* make sure rectangle fits in destination */ + if (dmaxrow > dst->_maxy || dmaxcol > dst->_maxx) { + returnCode(ERR); + } + + T(("rectangle fits in destination")); + + for (dy = dminrow, sy = sminrow; dy <= dmaxrow; sy++, dy++) { + touched = FALSE; + for (dx = dmincol, sx = smincol; dx <= dmaxcol; sx++, dx++) { + if (over) { + if ((CharOf(src->_line[sy].text[sx]) != L(' ')) && + (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx]))) { + dst->_line[dy].text[dx] = src->_line[sy].text[sx]; + SetAttr(dst->_line[dy].text[dx], + (AttrOf(src->_line[sy].text[sx]) & mask) | bk); + touched = TRUE; + } + } else { + if (!CharEq(dst->_line[dy].text[dx], src->_line[sy].text[sx])) { + dst->_line[dy].text[dx] = src->_line[sy].text[sx]; + touched = TRUE; + } + } } - - T(("rectangle exists in source")); - - /* make sure rectangle fits in destination */ - if (dmaxrow > dst->_maxy || dmaxcol > dst->_maxx) { - returnCode(ERR); - } - - T(("rectangle fits in destination")); - - for (dy = dminrow, sy = sminrow; dy <= dmaxrow; sy++, dy++) { - touched = FALSE; - for(dx=dmincol, sx=smincol; dx <= dmaxcol; sx++, dx++) - { - if (over) - { - if ((TextOf(src->_line[sy].text[sx]) != ' ') && - (dst->_line[dy].text[dx]!=src->_line[sy].text[sx])) - { - dst->_line[dy].text[dx] = - (src->_line[sy].text[sx] & mask) | bk; - touched = TRUE; - } - } - else { - if (dst->_line[dy].text[dx] != src->_line[sy].text[sx]) - { - dst->_line[dy].text[dx] = src->_line[sy].text[sx]; - touched = TRUE; - } - } - } - if (touched) - { - touchline(dst,0,getmaxy(dst)); - } + if (touched) { + touchline(dst, dminrow, (dmaxrow - dminrow + 1)); } - T(("finished copywin")); - returnCode(OK); + } + T(("finished copywin")); + returnCode(OK); } diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c index af7dd3b5..97b2d357 100644 --- a/ncurses/base/lib_pad.c +++ b/ncurses/base/lib_pad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,13 +40,13 @@ #include -MODULE_ID("$Id: lib_pad.c,v 1.29 2000/04/29 21:19:44 tom Exp $") +MODULE_ID("$Id: lib_pad.c,v 1.38 2002/08/03 23:29:26 Philippe.Blain Exp $") -WINDOW * +NCURSES_EXPORT(WINDOW *) newpad(int l, int c) { WINDOW *win; - chtype *ptr; + NCURSES_CH_T *ptr; int i; T((T_CALLED("newpad(%d, %d)"), l, c)); @@ -59,19 +59,20 @@ newpad(int l, int c) for (i = 0; i < l; i++) { if_USE_SCROLL_HINTS(win->_line[i].oldindex = _NEWINDEX); - if ((win->_line[i].text = typeCalloc(chtype, ((size_t) c))) == 0) { - _nc_freewin(win); + if ((win->_line[i].text = typeCalloc(NCURSES_CH_T, ((size_t) c))) == 0) { + (void) _nc_freewin(win); returnWin(0); } - for (ptr = win->_line[i].text; ptr < win->_line[i].text + c;) - *ptr++ = ' '; + for (ptr = win->_line[i].text; ptr < win->_line[i].text + c; ptr++) + SetChar(*ptr, BLANK_TEXT, BLANK_ATTR); } returnWin(win); } -WINDOW * -subpad(WINDOW *orig, int l, int c, int begy, int begx) +NCURSES_EXPORT(WINDOW *) +subpad +(WINDOW *orig, int l, int c, int begy, int begx) { WINDOW *win = (WINDOW *) 0; @@ -85,33 +86,38 @@ subpad(WINDOW *orig, int l, int c, int begy, int begx) returnWin(win); } -int -prefresh(WINDOW *win, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol) +NCURSES_EXPORT(int) +prefresh +(WINDOW *win, int pminrow, int pmincol, + int sminrow, int smincol, int smaxrow, int smaxcol) { T((T_CALLED("prefresh()"))); if (pnoutrefresh(win, pminrow, pmincol, sminrow, smincol, smaxrow, - smaxcol) != ERR + smaxcol) != ERR && doupdate() != ERR) { returnCode(OK); } returnCode(ERR); } -int -pnoutrefresh(WINDOW *win, int pminrow, int pmincol, - int sminrow, int smincol, int smaxrow, int smaxcol) +NCURSES_EXPORT(int) +pnoutrefresh +(WINDOW *win, int pminrow, int pmincol, + int sminrow, int smincol, int smaxrow, int smaxcol) { - const int my_len = 2; /* parameterize the threshold for hardscroll */ NCURSES_SIZE_T i, j; NCURSES_SIZE_T m, n; NCURSES_SIZE_T pmaxrow; NCURSES_SIZE_T pmaxcol; + +#if USE_SCROLL_HINTS + const int my_len = 2; /* parameterize the threshold for hardscroll */ NCURSES_SIZE_T displaced; bool wide; +#endif T((T_CALLED("pnoutrefresh(%p, %d, %d, %d, %d, %d, %d)"), - win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); + win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)); if (win == 0) returnCode(ERR); @@ -147,20 +153,22 @@ pnoutrefresh(WINDOW *win, int pminrow, int pmincol, pmaxcol = pmincol + smaxcol - smincol; } - if (smaxrow > screen_lines - || smaxcol > screen_columns + if (smaxrow >= screen_lines + || smaxcol >= screen_columns || sminrow > smaxrow || smincol > smaxcol) returnCode(ERR); T(("pad being refreshed")); +#if USE_SCROLL_HINTS if (win->_pad._pad_y >= 0) { displaced = pminrow - win->_pad._pad_y - (sminrow - win->_pad._pad_top); T(("pad being shifted by %d line(s)", displaced)); } else displaced = 0; +#endif /* * For pure efficiency, we'd want to transfer scrolling information @@ -176,17 +184,30 @@ pnoutrefresh(WINDOW *win, int pminrow, int pmincol, * windows). Note that changing this formula will not break any code, * merely change the costs of various update cases. */ +#if USE_SCROLL_HINTS wide = (smincol < my_len && smaxcol > (newscr->_maxx - my_len)); +#endif for (i = pminrow, m = sminrow + win->_yoffset; - i <= pmaxrow && m <= newscr->_maxy; - i++, m++) { + i <= pmaxrow && m <= newscr->_maxy; + i++, m++) { register struct ldat *nline = &newscr->_line[m]; register struct ldat *oline = &win->_line[i]; - for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) { - if (oline->text[j] != nline->text[n]) { - nline->text[n] = oline->text[j]; + NCURSES_CH_T ch = oline->text[j]; +#if USE_WIDEC_SUPPORT + /* + * Special case for leftmost character of the displayed area. + * Only half of a double-width character may be visible. + */ + if (j == pmincol + && j > 0 + && isnac(ch)) { + SetChar(ch, L(' '), AttrOf(oline->text[j - 1])); + } +#endif + if (!CharEq(ch, nline->text[n])) { + nline->text[n] = ch; CHANGED_CELL(nline, n); } } @@ -227,7 +248,7 @@ pnoutrefresh(WINDOW *win, int pminrow, int pmincol, for (i = pminrow - 1; (i >= 0) && (win->_line[i].oldindex >= 0); i--) win->_line[i].oldindex = _NEWINDEX; for (i = pmaxrow + 1; (i <= win->_maxy) - && (win->_line[i].oldindex >= 0); i++) + && (win->_line[i].oldindex >= 0); i++) win->_line[i].oldindex = _NEWINDEX; #endif @@ -269,7 +290,7 @@ pnoutrefresh(WINDOW *win, int pminrow, int pmincol, returnCode(OK); } -int +NCURSES_EXPORT(int) pechochar(WINDOW *pad, const chtype ch) { T((T_CALLED("pechochar(%p, %s)"), pad, _tracechtype(ch))); @@ -282,11 +303,11 @@ pechochar(WINDOW *pad, const chtype ch) waddch(pad, ch); prefresh(pad, pad->_pad._pad_y, - pad->_pad._pad_x, - pad->_pad._pad_top, - pad->_pad._pad_left, - pad->_pad._pad_bottom, - pad->_pad._pad_right); + pad->_pad._pad_x, + pad->_pad._pad_top, + pad->_pad._pad_left, + pad->_pad._pad_bottom, + pad->_pad._pad_right); returnCode(OK); } diff --git a/ncurses/base/lib_printw.c b/ncurses/base/lib_printw.c index 8d28f288..d08a0b42 100644 --- a/ncurses/base/lib_printw.c +++ b/ncurses/base/lib_printw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,72 +39,104 @@ #include -MODULE_ID("$Id: lib_printw.c,v 1.7 1998/04/11 22:53:44 tom Exp $") +MODULE_ID("$Id: lib_printw.c,v 1.13 2002/10/05 22:52:21 tom Exp $") -int printw(NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +printw(NCURSES_CONST char *fmt,...) { - va_list argp; - int code; - - T(("printw(%s,...) called", _nc_visbuf(fmt))); + va_list argp; + int code; + +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("printw(%s%s)"), + _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif - va_start(argp, fmt); - code = vwprintw(stdscr, fmt, argp); - va_end(argp); + va_start(argp, fmt); + code = vwprintw(stdscr, fmt, argp); + va_end(argp); - return code; + returnCode(code); } -int wprintw(WINDOW *win, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +wprintw(WINDOW *win, NCURSES_CONST char *fmt,...) { - va_list argp; - int code; - - T(("wprintw(%p,%s,...) called", win, _nc_visbuf(fmt))); + va_list argp; + int code; + +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("wprintw(%p,%s%s)"), + win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif - va_start(argp, fmt); - code = vwprintw(win, fmt, argp); - va_end(argp); + va_start(argp, fmt); + code = vwprintw(win, fmt, argp); + va_end(argp); - return code; + returnCode(code); } -int mvprintw(int y, int x, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +mvprintw(int y, int x, NCURSES_CONST char *fmt,...) { - va_list argp; - int code = move(y, x); - - if (code != ERR) { - va_start(argp, fmt); - code = vwprintw(stdscr, fmt, argp); - va_end(argp); - } - return code; + va_list argp; + int code; + +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("mvprintw(%d,%d,%s%s)"), + y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif + + if ((code = move(y, x)) != ERR) { + va_start(argp, fmt); + code = vwprintw(stdscr, fmt, argp); + va_end(argp); + } + returnCode(code); } -int mvwprintw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +mvwprintw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...) { - va_list argp; - int code = wmove(win, y, x); - - if (code != ERR) { - va_start(argp, fmt); - code = vwprintw(win, fmt, argp); - va_end(argp); - } - return code; + va_list argp; + int code; + +#ifdef TRACE + va_start(argp, fmt); + T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"), + y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp))); + va_end(argp); +#endif + + if ((code = wmove(win, y, x)) != ERR) { + va_start(argp, fmt); + code = vwprintw(win, fmt, argp); + va_end(argp); + } + returnCode(code); } -int vwprintw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) +NCURSES_EXPORT(int) +vwprintw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { - char *buf = _nc_printf_string(fmt, argp); - int code = ERR; + char *buf; + int code = ERR; + + T((T_CALLED("vwprintw(%p,%s,%p)"), + win, _nc_visbuf(fmt), argp)); - if (buf != 0) { - code = waddstr(win, buf); + if ((buf = _nc_printf_string(fmt, argp)) != 0) { + code = waddstr(win, buf); #if USE_SAFE_SPRINTF - free(buf); + free(buf); #endif - } - return code; + } + returnCode(code); } diff --git a/ncurses/base/lib_redrawln.c b/ncurses/base/lib_redrawln.c index 10fda917..91a03711 100644 --- a/ncurses/base/lib_redrawln.c +++ b/ncurses/base/lib_redrawln.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,31 +39,37 @@ #include -MODULE_ID("$Id: lib_redrawln.c,v 1.7 1998/09/19 20:09:50 Alexander.V.Lukyanov Exp $") +MODULE_ID("$Id: lib_redrawln.c,v 1.10 2001/09/29 17:41:31 tom Exp $") -int wredrawln(WINDOW *win, int beg, int num) +NCURSES_EXPORT(int) +wredrawln(WINDOW *win, int beg, int num) { - int i; - int end; - size_t len = (win->_maxx + 1) * sizeof(chtype); + int i; + int end; + size_t len = (win->_maxx + 1); - T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num)); + T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num)); - if (beg < 0) - beg = 0; + if (beg < 0) + beg = 0; - if (touchline (win, beg, num) == ERR) - returnCode(ERR); + if (touchline(win, beg, num) == ERR) + returnCode(ERR); - end = beg + num; - if (end > win->_maxy + 1) - end = win->_maxy + 1; + end = beg + num; + if (end > curscr->_maxy + 1) + end = curscr->_maxy + 1; + if (end > win->_maxy + 1) + end = win->_maxy + 1; - for (i = beg; i < end; i++) - { - memset (curscr->_line[i+win->_begy].text+win->_begx, 0, len); - _nc_make_oldhash(i+win->_begy); - } + if (len > (size_t) (curscr->_maxx + 1)) + len = (size_t) (curscr->_maxx + 1); + len *= sizeof(curscr->_line[0].text[0]); - returnCode(OK); + for (i = beg; i < end; i++) { + memset(curscr->_line[i + win->_begy].text + win->_begx, 0, len); + _nc_make_oldhash(i + win->_begy); + } + + returnCode(OK); } diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c index 910664b0..e5908a39 100644 --- a/ncurses/base/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_refresh.c,v 1.25 2000/04/29 21:17:08 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.32 2002/05/26 00:17:04 tom Exp $") -int +NCURSES_EXPORT(int) wrefresh(WINDOW *win) { int code; @@ -67,7 +67,7 @@ wrefresh(WINDOW *win) returnCode(code); } -int +NCURSES_EXPORT(int) wnoutrefresh(WINDOW *win) { NCURSES_SIZE_T limit_x; @@ -75,7 +75,9 @@ wnoutrefresh(WINDOW *win) NCURSES_SIZE_T begx; NCURSES_SIZE_T begy; NCURSES_SIZE_T m, n; +#if USE_SCROLL_HINTS bool wide; +#endif T((T_CALLED("wnoutrefresh(%p)"), win)); #ifdef TRACE @@ -94,12 +96,13 @@ wnoutrefresh(WINDOW *win) begx = win->_begx; begy = win->_begy; - newscr->_bkgd = win->_bkgd; + newscr->_nc_bkgd = win->_nc_bkgd; newscr->_attrs = win->_attrs; /* merge in change information from all subwindows of this window */ wsyncdown(win); +#if USE_SCROLL_HINTS /* * For pure efficiency, we'd want to transfer scrolling information * from the window to newscr whenever the window is wide enough that @@ -115,6 +118,7 @@ wnoutrefresh(WINDOW *win) * merely change the costs of various update cases. */ wide = (begx <= 1 && win->_maxx >= (newscr->_maxx - 1)); +#endif win->_flags &= ~_HASMOVED; @@ -128,12 +132,12 @@ wnoutrefresh(WINDOW *win) /* limit(n) */ limit_x = win->_maxx; /* limit(j) */ - if (limit_x > win->_maxx) - limit_x = win->_maxx; + if (limit_x > newscr->_maxx - begx) + limit_x = newscr->_maxx - begx; for (i = 0, m = begy + win->_yoffset; - i <= win->_maxy && m <= newscr->_maxy; - i++, m++) { + i <= win->_maxy && m <= newscr->_maxy; + i++, m++) { register struct ldat *nline = &newscr->_line[m]; register struct ldat *oline = &win->_line[i]; @@ -144,7 +148,7 @@ wnoutrefresh(WINDOW *win) last = limit_x; for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) { - if (oline->text[j] != nline->text[n]) { + if (!CharEq(oline->text[j], nline->text[n])) { nline->text[n] = oline->text[j]; CHANGED_CELL(nline, n); } diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c index 831e3255..31da4b7c 100644 --- a/ncurses/base/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,9 +47,9 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_restart.c,v 1.3 2000/09/02 18:09:44 tom Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.5 2002/08/31 22:30:10 Philippe.Blain Exp $") -int +NCURSES_EXPORT(int) restartterm(NCURSES_CONST char *termp, int filenum, int *errret) { int saveecho = SP->_echo; @@ -59,7 +59,8 @@ restartterm(NCURSES_CONST char *termp, int filenum, int *errret) T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret)); - setupterm(termp, filenum, errret); + if (setupterm(termp, filenum, errret) != OK) + returnCode(ERR); if (saveecho) echo(); diff --git a/ncurses/base/lib_scanw.c b/ncurses/base/lib_scanw.c index cc66613f..b8a5a227 100644 --- a/ncurses/base/lib_scanw.c +++ b/ncurses/base/lib_scanw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** lib_scanw.c ** @@ -42,70 +40,67 @@ #include -MODULE_ID("$Id: lib_scanw.c,v 1.8 1998/04/11 22:54:18 tom Exp $") - -#if !HAVE_VSSCANF -#if defined(__QNX__) -extern int vsscanf(const char *str, const char *format, __va_list __arg); -#else -extern int vsscanf(const char *str, const char *format, ...); -#endif -#endif +MODULE_ID("$Id: lib_scanw.c,v 1.11 2001/06/30 23:39:41 tom Exp $") -int vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) +NCURSES_EXPORT(int) +vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp) { -char buf[BUFSIZ]; + char buf[BUFSIZ]; - if (wgetnstr(win, buf, sizeof(buf)-1) == ERR) - return(ERR); + if (wgetnstr(win, buf, sizeof(buf) - 1) == ERR) + return (ERR); - return(vsscanf(buf, fmt, argp)); + return (vsscanf(buf, fmt, argp)); } -int scanw(NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +scanw(NCURSES_CONST char *fmt,...) { -int code; -va_list ap; + int code; + va_list ap; - T(("scanw(\"%s\",...) called", fmt)); + T(("scanw(\"%s\",...) called", fmt)); - va_start(ap, fmt); - code = vwscanw(stdscr, fmt, ap); - va_end(ap); - return (code); + va_start(ap, fmt); + code = vwscanw(stdscr, fmt, ap); + va_end(ap); + return (code); } -int wscanw(WINDOW *win, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +wscanw(WINDOW *win, NCURSES_CONST char *fmt,...) { -int code; -va_list ap; + int code; + va_list ap; - T(("wscanw(%p,\"%s\",...) called", win, fmt)); + T(("wscanw(%p,\"%s\",...) called", win, fmt)); - va_start(ap, fmt); - code = vwscanw(win, fmt, ap); - va_end(ap); - return (code); + va_start(ap, fmt); + code = vwscanw(win, fmt, ap); + va_end(ap); + return (code); } -int mvscanw(int y, int x, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +mvscanw(int y, int x, NCURSES_CONST char *fmt,...) { -int code; -va_list ap; + int code; + va_list ap; - va_start(ap, fmt); - code = (move(y, x) == OK) ? vwscanw(stdscr, fmt, ap) : ERR; - va_end(ap); - return (code); + va_start(ap, fmt); + code = (move(y, x) == OK) ? vwscanw(stdscr, fmt, ap) : ERR; + va_end(ap); + return (code); } -int mvwscanw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt, ...) +NCURSES_EXPORT(int) +mvwscanw(WINDOW *win, int y, int x, NCURSES_CONST char *fmt,...) { -int code; -va_list ap; + int code; + va_list ap; - va_start(ap, fmt); - code = (wmove(win, y, x) == OK) ? vwscanw(win, fmt, ap) : ERR; - va_end(ap); - return (code); + va_start(ap, fmt); + code = (wmove(win, y, x) == OK) ? vwscanw(win, fmt, ap) : ERR; + va_end(ap); + return (code); } diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 3038393c..43f848d8 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,170 +29,177 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996 on * ****************************************************************************/ - #include -#include -#include -#include /* exit_ca_mode, non_rev_rmcup */ - -MODULE_ID("$Id: lib_screen.c,v 1.15 1999/07/24 20:05:29 tom Exp $") - -static time_t dumptime; +MODULE_ID("$Id: lib_screen.c,v 1.28 2002/09/14 23:30:41 tom Exp $") -WINDOW *getwin(FILE *filep) +NCURSES_EXPORT(WINDOW *) +getwin(FILE * filep) { - WINDOW tmp, *nwin; - int n; + WINDOW tmp, *nwin; + int n; - T((T_CALLED("getwin(%p)"), filep)); + T((T_CALLED("getwin(%p)"), filep)); - (void) fread(&tmp, sizeof(WINDOW), 1, filep); - if (ferror(filep)) - returnWin(0); + clearerr(filep); + (void) fread(&tmp, sizeof(WINDOW), 1, filep); + if (ferror(filep)) + returnWin(0); - if ((nwin = newwin(tmp._maxy+1, tmp._maxx+1, 0, 0)) == 0) - returnWin(0); + if (tmp._flags & _ISPAD) { + nwin = newpad(tmp._maxy + 1, tmp._maxx + 1); + } else { + nwin = newwin(tmp._maxy + 1, tmp._maxx + 1, 0, 0); + } - /* - * We deliberately do not restore the _parx, _pary, or _parent - * fields, because the window hierarchy within which they - * made sense is probably gone. - */ - nwin->_curx = tmp._curx; - nwin->_cury = tmp._cury; - nwin->_maxy = tmp._maxy; - nwin->_maxx = tmp._maxx; - nwin->_begy = tmp._begy; - nwin->_begx = tmp._begx; - nwin->_yoffset = tmp._yoffset; - nwin->_flags = tmp._flags & ~(_SUBWIN|_ISPAD); - - nwin->_attrs = tmp._attrs; - nwin->_bkgd = tmp._bkgd; - - nwin->_clear = tmp._clear; - nwin->_scroll = tmp._scroll; - nwin->_leaveok = tmp._leaveok; + /* + * We deliberately do not restore the _parx, _pary, or _parent + * fields, because the window hierarchy within which they + * made sense is probably gone. + */ + if (nwin != 0) { + nwin->_curx = tmp._curx; + nwin->_cury = tmp._cury; + nwin->_maxy = tmp._maxy; + nwin->_maxx = tmp._maxx; + nwin->_begy = tmp._begy; + nwin->_begx = tmp._begx; + nwin->_yoffset = tmp._yoffset; + nwin->_flags = tmp._flags & ~(_SUBWIN); + + nwin->_attrs = tmp._attrs; + nwin->_nc_bkgd = tmp._nc_bkgd; + + nwin->_notimeout = tmp._notimeout; + nwin->_clear = tmp._clear; + nwin->_leaveok = tmp._leaveok; + nwin->_idlok = tmp._idlok; + nwin->_idcok = tmp._idcok; + nwin->_immed = tmp._immed; + nwin->_scroll = tmp._scroll; + nwin->_sync = tmp._sync; nwin->_use_keypad = tmp._use_keypad; - nwin->_delay = tmp._delay; - nwin->_immed = tmp._immed; - nwin->_sync = tmp._sync; - - nwin->_regtop = tmp._regtop; - nwin->_regbottom = tmp._regbottom; - - for (n = 0; n < nwin->_maxy + 1; n++) - { - (void) fread(nwin->_line[n].text, - sizeof(chtype), (size_t)(nwin->_maxx + 1), filep); - if (ferror(filep)) - { - delwin(nwin); - returnWin(0); - } + nwin->_delay = tmp._delay; + + nwin->_regtop = tmp._regtop; + nwin->_regbottom = tmp._regbottom; + + if (tmp._flags & _ISPAD) + nwin->_pad = tmp._pad; + + for (n = 0; n <= nwin->_maxy; n++) { + clearerr(filep); + (void) fread(nwin->_line[n].text, + sizeof(NCURSES_CH_T), + (size_t) (nwin->_maxx + 1), + filep); + if (ferror(filep)) { + delwin(nwin); + returnWin(0); + } } touchwin(nwin); - - returnWin(nwin); + } + returnWin(nwin); } -int putwin(WINDOW *win, FILE *filep) +NCURSES_EXPORT(int) +putwin(WINDOW *win, FILE * filep) { - int code = ERR; - int n; + int code = ERR; + int n; + + T((T_CALLED("putwin(%p,%p)"), win, filep)); - T((T_CALLED("putwin(%p,%p)"), win, filep)); + if (win != 0) { + size_t len = (win->_maxx + 1); - if (win) { - (void) fwrite(win, sizeof(WINDOW), 1, filep); - if (ferror(filep)) - returnCode(code); + clearerr(filep); + if (fwrite(win, sizeof(WINDOW), 1, filep) != 1 + || ferror(filep)) + returnCode(code); - for (n = 0; n < win->_maxy + 1; n++) - { - (void) fwrite(win->_line[n].text, - sizeof(chtype), (size_t)(win->_maxx + 1), filep); - if (ferror(filep)) + for (n = 0; n <= win->_maxy; n++) { + if (fwrite(win->_line[n].text, + sizeof(NCURSES_CH_T), len, filep) != len + || ferror(filep)) { returnCode(code); } - code = OK; } - returnCode(code); + code = OK; + } + returnCode(code); } -int scr_restore(const char *file) +NCURSES_EXPORT(int) +scr_restore(const char *file) { - FILE *fp = 0; - - T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file))); - - if (_nc_access(file, R_OK) < 0 - || (fp = fopen(file, "rb")) == 0) - returnCode(ERR); - else - { - delwin(newscr); - newscr = getwin(fp); - (void) fclose(fp); - returnCode(OK); - } + FILE *fp = 0; + + T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file))); + + if (_nc_access(file, R_OK) < 0 + || (fp = fopen(file, "rb")) == 0) { + returnCode(ERR); + } else { + delwin(newscr); + SP->_newscr = newscr = getwin(fp); + (void) fclose(fp); + returnCode(OK); + } } -int scr_dump(const char *file) +NCURSES_EXPORT(int) +scr_dump(const char *file) { - FILE *fp = 0; - - T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file))); - - if (_nc_access(file, W_OK) < 0 - || (fp = fopen(file, "wb")) == 0) - returnCode(ERR); - else - { - (void) putwin(newscr, fp); - (void) fclose(fp); - dumptime = time((time_t *)0); - returnCode(OK); - } + FILE *fp = 0; + + T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file))); + + if (_nc_access(file, W_OK) < 0 + || (fp = fopen(file, "wb")) == 0) { + returnCode(ERR); + } else { + (void) putwin(newscr, fp); + (void) fclose(fp); + returnCode(OK); + } } -int scr_init(const char *file) +NCURSES_EXPORT(int) +scr_init(const char *file) { - FILE *fp = 0; - struct stat stb; - - T((T_CALLED("scr_init(%s)"), _nc_visbuf(file))); - - if (exit_ca_mode && non_rev_rmcup) - returnCode(ERR); - - if (_nc_access(file, R_OK) < 0 - || (fp = fopen(file, "rb")) == 0) - returnCode(ERR); - else if (fstat(STDOUT_FILENO, &stb) || stb.st_mtime > dumptime) - returnCode(ERR); - else - { - delwin(curscr); - curscr = getwin(fp); - (void) fclose(fp); - returnCode(OK); - } + FILE *fp = 0; + + T((T_CALLED("scr_init(%s)"), _nc_visbuf(file))); + + if (exit_ca_mode && non_rev_rmcup) + returnCode(ERR); + + if (_nc_access(file, R_OK) < 0 + || (fp = fopen(file, "rb")) == 0) { + returnCode(ERR); + } else { + delwin(curscr); + SP->_curscr = curscr = getwin(fp); + (void) fclose(fp); + returnCode(OK); + } } -int scr_set(const char *file) +NCURSES_EXPORT(int) +scr_set(const char *file) { T((T_CALLED("scr_set(%s)"), _nc_visbuf(file))); - if (scr_init(file) == ERR) + if (scr_init(file) == ERR) { returnCode(ERR); - else - { + } else { delwin(newscr); - newscr = dupwin(curscr); + SP->_newscr = newscr = dupwin(curscr); returnCode(OK); } } diff --git a/ncurses/base/lib_scroll.c b/ncurses/base/lib_scroll.c index c2e3831d..39c62d08 100644 --- a/ncurses/base/lib_scroll.c +++ b/ncurses/base/lib_scroll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * + * Author: Thomas E. Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * ****************************************************************************/ @@ -42,17 +43,26 @@ #include -MODULE_ID("$Id: lib_scroll.c,v 1.17 2000/04/29 21:10:51 tom Exp $") +MODULE_ID("$Id: lib_scroll.c,v 1.23 2001/12/19 01:06:55 tom Exp $") -void +NCURSES_EXPORT(void) _nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top, - NCURSES_SIZE_T const bottom, chtype blank) + NCURSES_SIZE_T const bottom, NCURSES_CH_T blank) { - int line, j; - size_t to_copy = (size_t) (sizeof(chtype) * (win->_maxx + 1)); + int limit; + int line; + int j; + size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1)); TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %d, %d)", win, n, top, bottom)); + if (top < 0 + || bottom < top + || bottom > win->_maxy) { + TR(TRACE_MOVE, ("nothing to scroll")); + return; + } + /* * This used to do a line-text pointer-shuffle instead of text copies. * That (a) doesn't work when the window is derived and doesn't have @@ -66,14 +76,26 @@ _nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top, /* shift n lines downwards */ if (n < 0) { - for (line = bottom; line >= top - n; line--) { - memcpy(win->_line[line].text, - win->_line[line + n].text, - to_copy); - if_USE_SCROLL_HINTS(win->_line[line].oldindex = win->_line[line - + n].oldindex); + limit = top - n; + if (limit > win->_maxy) + limit = win->_maxy; + for (line = bottom; line >= limit; line--) { + if (line + n >= 0) { + TR(TRACE_MOVE, ("...copying %d to %d", line + n, line)); + memcpy(win->_line[line].text, + win->_line[line + n].text, + to_copy); + if_USE_SCROLL_HINTS(win->_line[line].oldindex = + win->_line[line + n].oldindex); + } else { + TR(TRACE_MOVE, ("...filling %d", line)); + for (j = 0; j <= win->_maxx; j++) + win->_line[line].text[j] = blank; + if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); + } } - for (line = top; line < top - n; line++) { + for (line = top; line < limit; line++) { + TR(TRACE_MOVE, ("...filling %d", line)); for (j = 0; j <= win->_maxx; j++) win->_line[line].text[j] = blank; if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); @@ -82,14 +104,26 @@ _nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top, /* shift n lines upwards */ if (n > 0) { - for (line = top; line <= bottom - n; line++) { - memcpy(win->_line[line].text, - win->_line[line + n].text, - to_copy); - if_USE_SCROLL_HINTS(win->_line[line].oldindex = win->_line[line - + n].oldindex); + limit = bottom - n; + if (limit < 0) + limit = 0; + for (line = top; line <= limit; line++) { + if (line + n <= win->_maxy) { + TR(TRACE_MOVE, ("...copying %d to %d", line + n, line)); + memcpy(win->_line[line].text, + win->_line[line + n].text, + to_copy); + if_USE_SCROLL_HINTS(win->_line[line].oldindex = + win->_line[line + n].oldindex); + } else { + TR(TRACE_MOVE, ("...filling %d", line)); + for (j = 0; j <= win->_maxx; j++) + win->_line[line].text[j] = blank; + if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); + } } - for (line = bottom; line > bottom - n; line--) { + for (line = bottom; line > limit; line--) { + TR(TRACE_MOVE, ("...filling %d", line)); for (j = 0; j <= win->_maxx; j++) win->_line[line].text[j] = blank; if_USE_SCROLL_HINTS(win->_line[line].oldindex = _NEWINDEX); @@ -98,22 +132,20 @@ _nc_scroll_window(WINDOW *win, int const n, NCURSES_SIZE_T const top, touchline(win, top, bottom - top + 1); } -int +NCURSES_EXPORT(int) wscrl(WINDOW *win, int n) { T((T_CALLED("wscrl(%p,%d)"), win, n)); - if (!win || !win->_scroll) + if (!win || !win->_scroll) { + TR(TRACE_MOVE, ("...scrollok is false")); returnCode(ERR); + } if (n == 0) returnCode(OK); - if ((n > (win->_regbottom - win->_regtop)) || - (-n > (win->_regbottom - win->_regtop))) - returnCode(ERR); - - _nc_scroll_window(win, n, win->_regtop, win->_regbottom, _nc_background(win)); + _nc_scroll_window(win, n, win->_regtop, win->_regbottom, win->_nc_bkgd); _nc_synchook(win); returnCode(OK); diff --git a/ncurses/base/lib_scrollok.c b/ncurses/base/lib_scrollok.c index f24eb8eb..f6b30259 100644 --- a/ncurses/base/lib_scrollok.c +++ b/ncurses/base/lib_scrollok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_scrollok.c ** @@ -41,16 +40,16 @@ #include -MODULE_ID("$Id: lib_scrollok.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: lib_scrollok.c,v 1.4 2000/12/10 02:43:27 tom Exp $") -int scrollok(WINDOW *win, bool flag) +NCURSES_EXPORT(int) +scrollok(WINDOW *win, bool flag) { - T((T_CALLED("scrollok(%p,%d)"), win, flag)); + T((T_CALLED("scrollok(%p,%d)"), win, flag)); - if (win) { - win->_scroll = flag; - returnCode(OK); - } - else - returnCode(ERR); + if (win) { + win->_scroll = flag; + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_scrreg.c b/ncurses/base/lib_scrreg.c index b47c047f..c85d60f1 100644 --- a/ncurses/base/lib_scrreg.c +++ b/ncurses/base/lib_scrreg.c @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_scrreg.c,v 1.8 2000/04/29 21:13:04 tom Exp $") +MODULE_ID("$Id: lib_scrreg.c,v 1.10 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) wsetscrreg(WINDOW *win, int top, int bottom) { T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom)); diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index 15dd6d3f..ac24ce07 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,9 +43,9 @@ #include /* cur_term */ #include -MODULE_ID("$Id: lib_set_term.c,v 1.58 2000/10/04 22:05:48 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.71 2002/09/14 22:48:00 tom Exp $") -SCREEN * +NCURSES_EXPORT(SCREEN *) set_term(SCREEN * screenp) { SCREEN *oldSP; @@ -61,7 +61,7 @@ set_term(SCREEN * screenp) stdscr = SP->_stdscr; COLORS = SP->_color_count; COLOR_PAIRS = SP->_pair_count; - memcpy(acs_map, SP->_acs_map, sizeof(chtype) * ACS_LEN); + memcpy(acs_map, SP->_acs_map, sizeof(SP->_acs_map[0]) * ACS_LEN); T((T_RETURN("%p"), oldSP)); return (oldSP); @@ -80,7 +80,7 @@ _nc_free_keytry(struct tries *kt) /* * Free the storage associated with the given SCREEN sp. */ -void +NCURSES_EXPORT(void) delscreen(SCREEN * sp) { SCREEN **scan = &_nc_screen_chain; @@ -95,17 +95,29 @@ delscreen(SCREEN * sp) scan = &(*scan)->_next_screen; } - _nc_freewin(sp->_curscr); - _nc_freewin(sp->_newscr); - _nc_freewin(sp->_stdscr); + (void) _nc_freewin(sp->_curscr); + (void) _nc_freewin(sp->_newscr); + (void) _nc_freewin(sp->_stdscr); + + if (sp->_slk != 0) { + FreeIfNeeded(sp->_slk->ent); + FreeIfNeeded(sp->_slk->buffer); + free(sp->_slk); + sp->_slk = 0; + } + _nc_free_keytry(sp->_keytry); + sp->_keytry = 0; + _nc_free_keytry(sp->_key_ok); + sp->_key_ok = 0; FreeIfNeeded(sp->_color_table); FreeIfNeeded(sp->_color_pairs); FreeIfNeeded(sp->oldhash); FreeIfNeeded(sp->newhash); + FreeIfNeeded(sp->hashtab); del_curterm(sp->_term); @@ -141,7 +153,7 @@ delscreen(SCREEN * sp) static ripoff_t rippedoff[5]; static ripoff_t *rsp = rippedoff; -#define N_RIPS SIZEOF(rippedoff) +#define N_RIPS SIZEOF(SP->_rippedoff) static bool no_mouse_event(SCREEN * sp GCC_UNUSED) @@ -181,7 +193,7 @@ extract_fgbg(char *src, int *result) if (dst == 0) { dst = src; } else if (value >= 0) { - *result = value % max_colors; + *result = value; } while (*dst != 0 && *dst != ';') dst++; @@ -191,16 +203,17 @@ extract_fgbg(char *src, int *result) } #endif -int +NCURSES_EXPORT(int) _nc_setupscreen(short slines, short const scolumns, FILE * output) /* OS-independent screen initializations */ { int bottom_stolen = 0; size_t i; + T((T_CALLED("_nc_setupscreen(%d, %d, %p)"), slines, scolumns, output)); assert(SP == 0); /* has been reset in newterm() ! */ if (!_nc_alloc_screen()) - return ERR; + returnCode(ERR); SP->_next_screen = _nc_screen_chain; _nc_screen_chain = SP; @@ -224,7 +237,7 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) #if NCURSES_NO_PADDING SP->_no_padding = getenv("NCURSES_NO_PADDING") != 0; TR(TRACE_CHARPUT | TRACE_MOVE, ("padding will%s be used", - SP->_no_padding ? " not" : "")); + SP->_no_padding ? " not" : "")); #endif #if NCURSES_EXT_FUNCS @@ -258,6 +271,26 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) SP->_default_bg = C_MASK; #endif + /* + * Allow those assumed/default color assumptions to be overridden at + * runtime: + */ + if (getenv("NCURSES_ASSUMED_COLORS") != 0) { + char *p = getenv("NCURSES_ASSUMED_COLORS"); + int fg, bg; + char sep1, sep2; + int count = sscanf(p, "%d%c%d%c", &fg, &sep1, &bg, &sep2); + if (count >= 1) { + SP->_default_fg = (fg >= 0 && fg < max_colors) ? fg : C_MASK; + if (count >= 3) { + SP->_default_bg = (bg >= 0 && bg < max_colors) ? bg : C_MASK; + } + TR(TRACE_CHARPUT | TRACE_MOVE, + ("from environment assumed fg=%d, bg=%d", + SP->_default_fg, + SP->_default_bg)); + } + } #if USE_COLORFGBG /* * If rxvt's $COLORFGBG variable is set, use it to specify the assumed @@ -267,8 +300,29 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) */ if (getenv("COLORFGBG") != 0) { char *p = getenv("COLORFGBG"); + TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p)); p = extract_fgbg(p, &(SP->_default_fg)); p = extract_fgbg(p, &(SP->_default_bg)); + if (*p) /* assume rxvt was compiled with xpm support */ + p = extract_fgbg(p, &(SP->_default_bg)); + TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d", + SP->_default_fg, SP->_default_bg)); + if (SP->_default_fg >= max_colors) { + if (set_a_foreground != ABSENT_STRING + && !strcmp(set_a_foreground, "\033[3%p1%dm")) { + set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m"; + } else { + SP->_default_fg %= max_colors; + } + } + if (SP->_default_bg >= max_colors) { + if (set_a_background != ABSENT_STRING + && !strcmp(set_a_background, "\033[4%p1%dm")) { + set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m"; + } else { + SP->_default_bg %= max_colors; + } + } } #endif #endif /* NCURSES_EXT_FUNCS */ @@ -295,14 +349,14 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) if (magic_cookie_glitch > 0) { SP->_xmc_triggers = termattrs() & ( - A_ALTCHARSET | - A_BLINK | - A_BOLD | - A_REVERSE | - A_STANDOUT | - A_UNDERLINE + A_ALTCHARSET | + A_BLINK | + A_BOLD | + A_REVERSE | + A_STANDOUT | + A_UNDERLINE ); - SP->_xmc_suppress = SP->_xmc_triggers & (chtype) ~ (A_BOLD); + SP->_xmc_suppress = SP->_xmc_triggers & (chtype) ~(A_BOLD); T(("magic cookie attributes %s", _traceattr(SP->_xmc_suppress))); #if USE_XMC_SUPPORT @@ -318,7 +372,12 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) acs_chars = 0; #endif } + + /* initialize normal acs before wide, since we use mapping in the latter */ _nc_init_acs(); +#if USE_WIDEC_SUPPORT + _nc_init_wacs(); +#endif memcpy(SP->_acs_map, acs_map, sizeof(chtype) * ACS_LEN); _nc_idcok = TRUE; @@ -331,11 +390,11 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) T(("creating newscr")); if ((newscr = newwin(slines, scolumns, 0, 0)) == 0) - return ERR; + returnCode(ERR); T(("creating curscr")); if ((curscr = newwin(slines, scolumns, 0, 0)) == 0) - return ERR; + returnCode(ERR); SP->_newscr = newscr; SP->_curscr = curscr; @@ -346,68 +405,69 @@ _nc_setupscreen(short slines, short const scolumns, FILE * output) newscr->_clear = TRUE; curscr->_clear = FALSE; + def_shell_mode(); + def_prog_mode(); + for (i = 0, rsp = rippedoff; rsp->line && (i < N_RIPS); rsp++, i++) { + T(("ripping off line %d at %s", i, rsp->line < 0 ? "bottom" : "top")); + SP->_rippedoff[i] = rippedoff[i]; if (rsp->hook) { - WINDOW *w; int count = (rsp->line < 0) ? -rsp->line : rsp->line; - if (rsp->line < 0) { - w = newwin(count, scolumns, SP->_lines_avail - count, 0); - if (w) { - rsp->w = w; - rsp->hook(w, scolumns); - bottom_stolen += count; - } else - return ERR; - } else { - w = newwin(count, scolumns, 0, 0); - if (w) { - rsp->w = w; - rsp->hook(w, scolumns); - SP->_topstolen += count; - } else - return ERR; - } + SP->_rippedoff[i].w = newwin(count, + scolumns, + ((rsp->line < 0) + ? SP->_lines_avail - count + : 0), + 0); + if (SP->_rippedoff[i].w != 0) + SP->_rippedoff[i].hook(SP->_rippedoff[i].w, scolumns); + else + returnCode(ERR); + if (rsp->line < 0) + bottom_stolen += count; + else + SP->_topstolen += count; SP->_lines_avail -= count; } rsp->line = 0; } + SP->_rip_count = i; /* reset the stack */ rsp = rippedoff; T(("creating stdscr")); assert((SP->_lines_avail + SP->_topstolen + bottom_stolen) == slines); if ((stdscr = newwin(LINES = SP->_lines_avail, scolumns, 0, 0)) == 0) - return ERR; + returnCode(ERR); SP->_stdscr = stdscr; - def_shell_mode(); - def_prog_mode(); - - return OK; + returnCode(OK); } /* The internal implementation interprets line as the number of lines to rip off from the top or bottom. */ -int +NCURSES_EXPORT(int) _nc_ripoffline(int line, int (*init) (WINDOW *, int)) { - if (line == 0) - return (OK); + T((T_CALLED("_nc_ripoffline(%d, %p)"), line, init)); + + if (line != 0) { - if (rsp >= rippedoff + N_RIPS) - return (ERR); + if (rsp >= rippedoff + N_RIPS) + returnCode(ERR); - rsp->line = line; - rsp->hook = init; - rsp->w = 0; - rsp++; + rsp->line = line; + rsp->hook = init; + rsp->w = 0; + rsp++; + } - return (OK); + returnCode(OK); } -int +NCURSES_EXPORT(int) ripoffline(int line, int (*init) (WINDOW *, int)) { T((T_CALLED("ripoffline(%d,%p)"), line, init)); diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c index 21eae687..72fff96d 100644 --- a/ncurses/base/lib_slk.c +++ b/ncurses/base/lib_slk.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,15 +39,16 @@ #include #include -#include /* num_labels, label_*, plab_norm */ +#include /* num_labels, label_*, plab_norm */ -MODULE_ID("$Id: lib_slk.c,v 1.17 1999/10/30 23:00:16 tom Exp $") +MODULE_ID("$Id: lib_slk.c,v 1.24 2002/09/28 17:46:40 tom Exp $") /* * We'd like to move these into the screen context structure, but cannot, * because slk_init() is called before initscr()/newterm(). */ -int _nc_slk_format = 0; /* one more than format specified in slk_init() */ +NCURSES_EXPORT_VAR(int) +_nc_slk_format = 0; /* one more than format specified in slk_init() */ /* * Paint the info line for the PC style SLK emulation. @@ -56,26 +57,15 @@ int _nc_slk_format = 0; /* one more than format specified in slk_init() */ static void slk_paint_info(WINDOW *win) { - if (win && SP->slk_format==4) - { - int i; - - mvwhline (win,0,0,0,getmaxx(win)); - wmove (win,0,0); - - for (i = 0; i < SP->_slk->maxlab; i++) { - if (win && SP->slk_format==4) - { - mvwaddch(win,0,SP->_slk->ent[i].x,'F'); - if (i<9) - waddch(win,'1'+i); - else - { - waddch(win,'1'); - waddch(win,'0' + (i-9)); - } - } - } + if (win && SP->slk_format == 4) { + int i; + + mvwhline(win, 0, 0, 0, getmaxx(win)); + wmove(win, 0, 0); + + for (i = 0; i < SP->_slk->maxlab; i++) { + mvwprintw(win, 0, SP->_slk->ent[i].x, "F%d", i + 1); + } } } @@ -83,132 +73,129 @@ slk_paint_info(WINDOW *win) * Initialize soft labels. * Called from newterm() */ -int +NCURSES_EXPORT(int) _nc_slk_initialize(WINDOW *stwin, int cols) { -int i, x; -int res = OK; -char *p; - - T(("slk_initialize()")); - - if (SP->_slk) - { /* we did this already, so simply return */ - return(OK); - } - else - if ((SP->_slk = typeCalloc(SLK, 1)) == 0) - return(ERR); - - SP->_slk->ent = NULL; - SP->_slk->buffer = NULL; - SP->_slk->attr = A_STANDOUT; - - SP->_slk->maxlab = (num_labels > 0) ? - num_labels : MAX_SKEY(_nc_slk_format); - SP->_slk->maxlen = (num_labels > 0) ? - label_width * label_height : MAX_SKEY_LEN(_nc_slk_format); - SP->_slk->labcnt = (SP->_slk->maxlab < MAX_SKEY(_nc_slk_format)) ? - MAX_SKEY(_nc_slk_format) : SP->_slk->maxlab; - - SP->_slk->ent = typeCalloc(slk_ent, SP->_slk->labcnt); - if (SP->_slk->ent == NULL) - goto exception; - - p = SP->_slk->buffer = (char*) calloc(2*SP->_slk->labcnt,(1+SP->_slk->maxlen)); - if (SP->_slk->buffer == NULL) - goto exception; - - for (i = 0; i < SP->_slk->labcnt; i++) { - SP->_slk->ent[i].text = p; - p += (1 + SP->_slk->maxlen); - SP->_slk->ent[i].form_text = p; - p += (1 + SP->_slk->maxlen); - memset(SP->_slk->ent[i].form_text, ' ', (unsigned)(SP->_slk->maxlen)); - SP->_slk->ent[i].visible = (i < SP->_slk->maxlab); - } - if (_nc_slk_format >= 3) /* PC style */ - { - int gap = (cols - 3 * (3 + 4*SP->_slk->maxlen))/2; + int i, x; + int res = OK; + char *p; + unsigned max_length; + + T(("slk_initialize()")); + + if (SP->_slk) { /* we did this already, so simply return */ + return (OK); + } else if ((SP->_slk = typeCalloc(SLK, 1)) == 0) + return (ERR); + + SP->_slk->ent = NULL; + SP->_slk->buffer = NULL; + SP->_slk->attr = A_STANDOUT; + + SP->_slk->maxlab = ((num_labels > 0) + ? num_labels + : MAX_SKEY(_nc_slk_format)); + SP->_slk->maxlen = ((num_labels > 0) + ? label_width * label_height + : MAX_SKEY_LEN(_nc_slk_format)); + SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_slk_format)) + ? MAX_SKEY(_nc_slk_format) + : SP->_slk->maxlab); + + if (SP->_slk->maxlen <= 0 + || SP->_slk->labcnt <= 0 + || (SP->_slk->ent = typeCalloc(slk_ent, + (unsigned) SP->_slk->labcnt)) == NULL) + goto exception; + + max_length = SP->_slk->maxlen; + p = SP->_slk->buffer = (char *) calloc((unsigned) (2 * SP->_slk->labcnt), + (1 + max_length)); + if (SP->_slk->buffer == NULL) + goto exception; + + for (i = 0; i < SP->_slk->labcnt; i++) { + SP->_slk->ent[i].text = p; + p += (1 + max_length); + SP->_slk->ent[i].form_text = p; + p += (1 + max_length); + memset(SP->_slk->ent[i].form_text, ' ', max_length); + SP->_slk->ent[i].visible = (i < SP->_slk->maxlab); + } + if (_nc_slk_format >= 3) { /* PC style */ + int gap = (cols - 3 * (3 + 4 * max_length)) / 2; - if (gap < 1) - gap = 1; + if (gap < 1) + gap = 1; - for (i = x = 0; i < SP->_slk->maxlab; i++) { - SP->_slk->ent[i].x = x; - x += SP->_slk->maxlen; - x += (i==3 || i==7) ? gap : 1; - } - if (_nc_slk_format == 4) - slk_paint_info (stwin); - } - else { - if (_nc_slk_format == 2) { /* 4-4 */ - int gap = cols - (SP->_slk->maxlab * SP->_slk->maxlen) - 6; + for (i = x = 0; i < SP->_slk->maxlab; i++) { + SP->_slk->ent[i].x = x; + x += max_length; + x += (i == 3 || i == 7) ? gap : 1; + } + slk_paint_info(stwin); + } else { + if (_nc_slk_format == 2) { /* 4-4 */ + int gap = cols - (SP->_slk->maxlab * max_length) - 6; if (gap < 1) - gap = 1; + gap = 1; for (i = x = 0; i < SP->_slk->maxlab; i++) { - SP->_slk->ent[i].x = x; - x += SP->_slk->maxlen; - x += (i == 3) ? gap : 1; + SP->_slk->ent[i].x = x; + x += max_length; + x += (i == 3) ? gap : 1; } - } - else - { - if (_nc_slk_format == 1) { /* 1 -> 3-2-3 */ - int gap = (cols - (SP->_slk->maxlab * SP->_slk->maxlen) - 5) / 2; + } else { + if (_nc_slk_format == 1) { /* 1 -> 3-2-3 */ + int gap = (cols - (SP->_slk->maxlab * max_length) - 5) + / 2; if (gap < 1) - gap = 1; + gap = 1; for (i = x = 0; i < SP->_slk->maxlab; i++) { - SP->_slk->ent[i].x = x; - x += SP->_slk->maxlen; - x += (i == 2 || i == 4) ? gap : 1; + SP->_slk->ent[i].x = x; + x += max_length; + x += (i == 2 || i == 4) ? gap : 1; } - } - else + } else goto exception; - } } - SP->_slk->dirty = TRUE; - if ((SP->_slk->win = stwin) == NULL) - { - exception: - if (SP->_slk) - { - FreeIfNeeded(SP->_slk->buffer); - FreeIfNeeded(SP->_slk->ent); - free(SP->_slk); - SP->_slk = (SLK*)0; - res = (ERR); - } + } + SP->_slk->dirty = TRUE; + if ((SP->_slk->win = stwin) == NULL) { + exception: + if (SP->_slk) { + FreeIfNeeded(SP->_slk->buffer); + FreeIfNeeded(SP->_slk->ent); + free(SP->_slk); + SP->_slk = (SLK *) 0; + res = (ERR); } + } - /* We now reset the format so that the next newterm has again - * per default no SLK keys and may call slk_init again to - * define a new layout. (juergen 03-Mar-1999) - */ - SP->slk_format = _nc_slk_format; - _nc_slk_format = 0; - return(res); + /* We now reset the format so that the next newterm has again + * per default no SLK keys and may call slk_init again to + * define a new layout. (juergen 03-Mar-1999) + */ + SP->slk_format = _nc_slk_format; + _nc_slk_format = 0; + return (res); } - /* * Restore the soft labels on the screen. */ -int +NCURSES_EXPORT(int) slk_restore(void) { - T((T_CALLED("slk_restore()"))); + T((T_CALLED("slk_restore()"))); - if (SP->_slk == NULL) - return(ERR); - SP->_slk->hidden = FALSE; - SP->_slk->dirty = TRUE; - /* we have to repaint info line eventually */ - slk_paint_info(SP->_slk->win); + if (SP->_slk == NULL) + return (ERR); + SP->_slk->hidden = FALSE; + SP->_slk->dirty = TRUE; + /* we have to repaint info line eventually */ + slk_paint_info(SP->_slk->win); - returnCode(slk_refresh()); + returnCode(slk_refresh()); } diff --git a/ncurses/base/lib_slkatr_set.c b/ncurses/base/lib_slkatr_set.c index 0695d186..ec09fddf 100644 --- a/ncurses/base/lib_slkatr_set.c +++ b/ncurses/base/lib_slkatr_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1998 * + * Author: Juergen Pfeifer, 1998 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /* @@ -37,20 +38,19 @@ */ #include -MODULE_ID("$Id: lib_slkatr_set.c,v 1.3 1999/05/16 17:13:59 juergen Exp $") +MODULE_ID("$Id: lib_slkatr_set.c,v 1.6 2002/07/06 22:47:23 juergen Exp $") -int -slk_attr_set(const attr_t attr, short color_pair_number, void* opts) +NCURSES_EXPORT(int) +slk_attr_set +(const attr_t attr, short color_pair_number, void *opts) { - T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number)); + T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number)); - if (SP!=0 && SP->_slk!=0 && !opts && - color_pair_number>=0 && color_pair_number_slk->attr = attr; - toggle_attr_on(SP->_slk->attr,COLOR_PAIR(color_pair_number)); - returnCode(OK); - } - else - returnCode(ERR); + if (SP != 0 && SP->_slk != 0 && !opts && + color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) { + SP->_slk->attr = attr; + toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number)); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_slkatrof.c b/ncurses/base/lib_slkatrof.c index 5e4f5f55..c271c342 100644 --- a/ncurses/base/lib_slkatrof.c +++ b/ncurses/base/lib_slkatrof.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,18 +38,16 @@ */ #include -MODULE_ID("$Id: lib_slkatrof.c,v 1.4 1998/03/11 19:26:07 juergen Exp $") +MODULE_ID("$Id: lib_slkatrof.c,v 1.6 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) slk_attroff(const chtype attr) { - T((T_CALLED("slk_attroff(%s)"), _traceattr(attr))); + T((T_CALLED("slk_attroff(%s)"), _traceattr(attr))); - if (SP!=0 && SP->_slk!=0) - { - toggle_attr_off(SP->_slk->attr,attr); - returnCode(OK); - } - else - returnCode(ERR); + if (SP != 0 && SP->_slk != 0) { + toggle_attr_off(SP->_slk->attr, attr); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_slkatron.c b/ncurses/base/lib_slkatron.c index a2488652..d174b039 100644 --- a/ncurses/base/lib_slkatron.c +++ b/ncurses/base/lib_slkatron.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,18 +38,16 @@ */ #include -MODULE_ID("$Id: lib_slkatron.c,v 1.4 1998/03/11 19:26:07 juergen Exp $") +MODULE_ID("$Id: lib_slkatron.c,v 1.6 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) slk_attron(const chtype attr) { - T((T_CALLED("slk_attron(%s)"), _traceattr(attr))); + T((T_CALLED("slk_attron(%s)"), _traceattr(attr))); - if (SP!=0 && SP->_slk!=0) - { - toggle_attr_on(SP->_slk->attr,attr); - returnCode(OK); - } - else - returnCode(ERR); + if (SP != 0 && SP->_slk != 0) { + toggle_attr_on(SP->_slk->attr, attr); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_slkatrset.c b/ncurses/base/lib_slkatrset.c index 391c7ffe..cda74cad 100644 --- a/ncurses/base/lib_slkatrset.c +++ b/ncurses/base/lib_slkatrset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,18 +38,16 @@ */ #include -MODULE_ID("$Id: lib_slkatrset.c,v 1.4 1998/03/11 19:26:01 juergen Exp $") +MODULE_ID("$Id: lib_slkatrset.c,v 1.6 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) slk_attrset(const chtype attr) { - T((T_CALLED("slk_attrset(%s)"), _traceattr(attr))); + T((T_CALLED("slk_attrset(%s)"), _traceattr(attr))); - if (SP!=0 && SP->_slk!=0) - { - SP->_slk->attr = attr; - returnCode(OK); - } - else - returnCode(ERR); + if (SP != 0 && SP->_slk != 0) { + SP->_slk->attr = attr; + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_slkattr.c b/ncurses/base/lib_slkattr.c index a1324032..5044a08d 100644 --- a/ncurses/base/lib_slkattr.c +++ b/ncurses/base/lib_slkattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,17 +38,15 @@ */ #include -MODULE_ID("$Id: lib_slkattr.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkattr.c,v 1.5 2000/12/10 02:43:27 tom Exp $") -attr_t +NCURSES_EXPORT(attr_t) slk_attr(void) { - T((T_CALLED("slk_attr()"))); + T((T_CALLED("slk_attr()"))); - if (SP!=0 && SP->_slk!=0) - { - returnAttr(SP->_slk->attr); - } - else - returnAttr(0); + if (SP != 0 && SP->_slk != 0) { + returnAttr(SP->_slk->attr); + } else + returnAttr(0); } diff --git a/ncurses/base/lib_slkclear.c b/ncurses/base/lib_slkclear.c index ac6e414b..03e6721c 100644 --- a/ncurses/base/lib_slkclear.c +++ b/ncurses/base/lib_slkclear.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,25 +38,24 @@ */ #include -MODULE_ID("$Id: lib_slkclear.c,v 1.4 1999/03/03 23:44:22 juergen Exp $") +MODULE_ID("$Id: lib_slkclear.c,v 1.8 2001/12/19 01:07:01 tom Exp $") -int +NCURSES_EXPORT(int) slk_clear(void) { - T((T_CALLED("slk_clear()"))); + T((T_CALLED("slk_clear()"))); - if (SP == NULL || SP->_slk == NULL) - returnCode(ERR); - SP->_slk->hidden = TRUE; - /* For simulated SLK's it's looks much more natural to - inherit those attributes from the standard screen */ - SP->_slk->win->_bkgd = stdscr->_bkgd; - SP->_slk->win->_attrs = stdscr->_attrs; - if (SP->_slk->win == stdscr) { - returnCode(OK); - } - else { - werase(SP->_slk->win); - returnCode(wrefresh(SP->_slk->win)); - } + if (SP == NULL || SP->_slk == NULL) + returnCode(ERR); + SP->_slk->hidden = TRUE; + /* For simulated SLK's it's looks much more natural to + inherit those attributes from the standard screen */ + SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd; + SP->_slk->win->_attrs = stdscr->_attrs; + if (SP->_slk->win == stdscr) { + returnCode(OK); + } else { + werase(SP->_slk->win); + returnCode(wrefresh(SP->_slk->win)); + } } diff --git a/ncurses/base/lib_slkcolor.c b/ncurses/base/lib_slkcolor.c index 3728808f..b6032b4d 100644 --- a/ncurses/base/lib_slkcolor.c +++ b/ncurses/base/lib_slkcolor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Juergen Pfeifer 1998 * + * Author: Juergen Pfeifer, 1998 * + * Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en * ****************************************************************************/ /* @@ -35,20 +36,18 @@ */ #include -MODULE_ID("$Id: lib_slkcolor.c,v 1.5 1999/05/16 17:14:13 juergen Exp $") +MODULE_ID("$Id: lib_slkcolor.c,v 1.8 2002/07/06 22:49:22 juergen Exp $") -int +NCURSES_EXPORT(int) slk_color(short color_pair_number) { - T((T_CALLED("slk_color(%d)"), color_pair_number)); + T((T_CALLED("slk_color(%d)"), color_pair_number)); - if (SP!=0 && SP->_slk!=0 && - color_pair_number>=0 && color_pair_number_slk->attr))); - toggle_attr_on(SP->_slk->attr,COLOR_PAIR(color_pair_number)); - returnCode(OK); - } - else - returnCode(ERR); + if (SP != 0 && SP->_slk != 0 && + color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) { + T(("... current %ld", (long) PAIR_NUMBER(SP->_slk->attr))); + toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number)); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_slkinit.c b/ncurses/base/lib_slkinit.c index 70844260..f003b5f0 100644 --- a/ncurses/base/lib_slkinit.c +++ b/ncurses/base/lib_slkinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,14 +38,14 @@ */ #include -MODULE_ID("$Id: lib_slkinit.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkinit.c,v 1.5 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) slk_init(int format) { - T((T_CALLED("slk_init(%d)"), format)); - if (format < 0 || format > 3) - returnCode(ERR); - _nc_slk_format = 1 + format; - returnCode(OK); + T((T_CALLED("slk_init(%d)"), format)); + if (format < 0 || format > 3) + returnCode(ERR); + _nc_slk_format = 1 + format; + returnCode(OK); } diff --git a/ncurses/base/lib_slklab.c b/ncurses/base/lib_slklab.c index 03039ad6..0224e9b0 100644 --- a/ncurses/base/lib_slklab.c +++ b/ncurses/base/lib_slklab.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,14 +38,14 @@ */ #include -MODULE_ID("$Id: lib_slklab.c,v 1.4 1998/02/11 12:13:54 tom Exp $") +MODULE_ID("$Id: lib_slklab.c,v 1.6 2000/12/10 02:43:27 tom Exp $") -char* +NCURSES_EXPORT(char *) slk_label(int n) { - T((T_CALLED("slk_label(%d)"), n)); + T((T_CALLED("slk_label(%d)"), n)); - if (SP == NULL || SP->_slk == NULL || n < 1 || n > SP->_slk->labcnt) - returnPtr(0); - returnPtr(SP->_slk->ent[n-1].text); + if (SP == NULL || SP->_slk == NULL || n < 1 || n > SP->_slk->labcnt) + returnPtr(0); + returnPtr(SP->_slk->ent[n - 1].text); } diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c index ee3c91db..18e5b0c1 100644 --- a/ncurses/base/lib_slkrefr.c +++ b/ncurses/base/lib_slkrefr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,91 +36,85 @@ * Write SLK window to the (virtual) screen. */ #include -#include /* num_labels, label_*, plab_norm */ +#include /* num_labels, label_*, plab_norm */ -MODULE_ID("$Id: lib_slkrefr.c,v 1.8 1999/03/14 00:10:27 Alexander.V.Lukyanov Exp $") +MODULE_ID("$Id: lib_slkrefr.c,v 1.10 2000/12/10 02:43:27 tom Exp $") /* * Write the soft labels to the soft-key window. */ static void -slk_intern_refresh(SLK *slk) +slk_intern_refresh(SLK * slk) { -int i; -int fmt = SP->slk_format; + int i; + int fmt = SP->slk_format; - for (i = 0; i < slk->labcnt; i++) { - if (slk->dirty || slk->ent[i].dirty) { - if (slk->ent[i].visible) { - if (num_labels > 0 && SLK_STDFMT(fmt)) - { - if (i < num_labels) { - TPUTS_TRACE("plab_norm"); - putp(tparm(plab_norm, i+1, slk->ent[i].form_text)); - } - } - else - { - wmove(slk->win,SLK_LINES(fmt)-1,slk->ent[i].x); - if (SP && SP->_slk) - wattrset(slk->win,SP->_slk->attr); - waddnstr(slk->win,slk->ent[i].form_text, - MAX_SKEY_LEN(fmt)); - /* if we simulate SLK's, it's looking much more - natural to use the current ATTRIBUTE also - for the label window */ - wattrset(slk->win,stdscr->_attrs); - } - } - slk->ent[i].dirty = FALSE; + for (i = 0; i < slk->labcnt; i++) { + if (slk->dirty || slk->ent[i].dirty) { + if (slk->ent[i].visible) { + if (num_labels > 0 && SLK_STDFMT(fmt)) { + if (i < num_labels) { + TPUTS_TRACE("plab_norm"); + putp(tparm(plab_norm, i + 1, slk->ent[i].form_text)); + } + } else { + wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].x); + if (SP && SP->_slk) + wattrset(slk->win, SP->_slk->attr); + waddnstr(slk->win, slk->ent[i].form_text, + MAX_SKEY_LEN(fmt)); + /* if we simulate SLK's, it's looking much more + natural to use the current ATTRIBUTE also + for the label window */ + wattrset(slk->win, stdscr->_attrs); } + } + slk->ent[i].dirty = FALSE; } - slk->dirty = FALSE; + } + slk->dirty = FALSE; - if (num_labels > 0) { - if (slk->hidden) - { - TPUTS_TRACE("label_off"); - putp(label_off); - } - else - { - TPUTS_TRACE("label_on"); - putp(label_on); - } + if (num_labels > 0) { + if (slk->hidden) { + TPUTS_TRACE("label_off"); + putp(label_off); + } else { + TPUTS_TRACE("label_on"); + putp(label_on); } + } } /* * Refresh the soft labels. */ -int +NCURSES_EXPORT(int) slk_noutrefresh(void) { - T((T_CALLED("slk_noutrefresh()"))); + T((T_CALLED("slk_noutrefresh()"))); - if (SP == NULL || SP->_slk == NULL) - returnCode(ERR); - if (SP->_slk->hidden) - returnCode(OK); - slk_intern_refresh(SP->_slk); + if (SP == NULL || SP->_slk == NULL) + returnCode(ERR); + if (SP->_slk->hidden) + returnCode(OK); + slk_intern_refresh(SP->_slk); - returnCode(wnoutrefresh(SP->_slk->win)); + returnCode(wnoutrefresh(SP->_slk->win)); } /* * Refresh the soft labels. */ -int +NCURSES_EXPORT(int) slk_refresh(void) { - T((T_CALLED("slk_refresh()"))); + T((T_CALLED("slk_refresh()"))); - if (SP == NULL || SP->_slk == NULL) - returnCode(ERR); - if (SP->_slk->hidden) - returnCode(OK); - slk_intern_refresh(SP->_slk); + if (SP == NULL || SP->_slk == NULL) + returnCode(ERR); + if (SP->_slk->hidden) + returnCode(OK); + slk_intern_refresh(SP->_slk); - returnCode(wrefresh(SP->_slk->win)); + returnCode(wrefresh(SP->_slk->win)); } diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c index 27471add..d15002f1 100644 --- a/ncurses/base/lib_slkset.c +++ b/ncurses/base/lib_slkset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,58 +38,60 @@ #include #include -MODULE_ID("$Id: lib_slkset.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.7 2001/06/02 22:50:29 skimo Exp $") -int +NCURSES_EXPORT(int) slk_set(int i, const char *astr, int format) { -SLK *slk = SP->_slk; -size_t len; -const char *str = astr; -const char *p; + SLK *slk = SP->_slk; + size_t len; + const char *str = astr; + const char *p; - T((T_CALLED("slk_set(%d, \"%s\", %d)"), i, str, format)); + T((T_CALLED("slk_set(%d, \"%s\", %d)"), i, str, format)); - if (slk == NULL || i < 1 || i > slk->labcnt || format < 0 || format > 2) - returnCode(ERR); - if (str == NULL) - str = ""; + if (slk == NULL || i < 1 || i > slk->labcnt || format < 0 || format > 2) + returnCode(ERR); + if (str == NULL) + str = ""; - while (isspace(*str)) str++; /* skip over leading spaces */ - p = str; - while (isprint(*p)) p++; /* The first non-print stops */ + while (isspace(UChar(*str))) + str++; /* skip over leading spaces */ + p = str; + while (isprint(UChar(*p))) + p++; /* The first non-print stops */ - --i; /* Adjust numbering of labels */ + --i; /* Adjust numbering of labels */ - len = (size_t)(p - str); - if (len > (unsigned)slk->maxlen) - len = slk->maxlen; - if (len==0) - slk->ent[i].text[0] = 0; - else - (void) strncpy(slk->ent[i].text, str, len); - memset(slk->ent[i].form_text,' ', (unsigned)slk->maxlen); - slk->ent[i].text[slk->maxlen] = 0; - /* len = strlen(slk->ent[i].text); */ + len = (size_t) (p - str); + if (len > (unsigned) slk->maxlen) + len = slk->maxlen; + if (len == 0) + slk->ent[i].text[0] = 0; + else + (void) strncpy(slk->ent[i].text, str, len); + memset(slk->ent[i].form_text, ' ', (unsigned) slk->maxlen); + slk->ent[i].text[slk->maxlen] = 0; + /* len = strlen(slk->ent[i].text); */ - switch(format) { - case 0: /* left-justified */ - memcpy(slk->ent[i].form_text, - slk->ent[i].text, - len); - break; - case 1: /* centered */ - memcpy(slk->ent[i].form_text+(slk->maxlen - len)/2, - slk->ent[i].text, - len); - break; - case 2: /* right-justified */ - memcpy(slk->ent[i].form_text+ slk->maxlen - len, - slk->ent[i].text, - len); - break; - } - slk->ent[i].form_text[slk->maxlen] = 0; - slk->ent[i].dirty = TRUE; - returnCode(OK); + switch (format) { + case 0: /* left-justified */ + memcpy(slk->ent[i].form_text, + slk->ent[i].text, + len); + break; + case 1: /* centered */ + memcpy(slk->ent[i].form_text + (slk->maxlen - len) / 2, + slk->ent[i].text, + len); + break; + case 2: /* right-justified */ + memcpy(slk->ent[i].form_text + slk->maxlen - len, + slk->ent[i].text, + len); + break; + } + slk->ent[i].form_text[slk->maxlen] = 0; + slk->ent[i].dirty = TRUE; + returnCode(OK); } diff --git a/ncurses/base/lib_slktouch.c b/ncurses/base/lib_slktouch.c index c2829aed..5eb5df38 100644 --- a/ncurses/base/lib_slktouch.c +++ b/ncurses/base/lib_slktouch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,16 +38,16 @@ */ #include -MODULE_ID("$Id: lib_slktouch.c,v 1.3 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_slktouch.c,v 1.5 2000/12/10 02:43:27 tom Exp $") -int +NCURSES_EXPORT(int) slk_touch(void) { - T((T_CALLED("slk_touch()"))); + T((T_CALLED("slk_touch()"))); - if (SP == NULL || SP->_slk == NULL) - returnCode(ERR); - SP->_slk->dirty = TRUE; + if (SP == NULL || SP->_slk == NULL) + returnCode(ERR); + SP->_slk->dirty = TRUE; - returnCode(OK); + returnCode(OK); } diff --git a/ncurses/base/lib_touch.c b/ncurses/base/lib_touch.c index 7ce863d0..2ac21f2e 100644 --- a/ncurses/base/lib_touch.c +++ b/ncurses/base/lib_touch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,45 +43,49 @@ #include -MODULE_ID("$Id: lib_touch.c,v 1.6 1998/04/11 22:55:02 tom Exp $") +MODULE_ID("$Id: lib_touch.c,v 1.9 2000/12/10 02:43:27 tom Exp $") -bool is_linetouched(WINDOW *win, int line) +NCURSES_EXPORT(bool) +is_linetouched(WINDOW *win, int line) { - T((T_CALLED("is_linetouched(%p,%d)"), win, line)); + T((T_CALLED("is_linetouched(%p,%d)"), win, line)); - /* XSI doesn't define any error */ - if (!win || (line > win->_maxy) || (line < 0)) - returnCode(ERR); + /* XSI doesn't define any error */ + if (!win || (line > win->_maxy) || (line < 0)) + returnCode((bool) ERR); - returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE); + returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE); } -bool is_wintouched(WINDOW *win) +NCURSES_EXPORT(bool) +is_wintouched(WINDOW *win) { -int i; + int i; - T((T_CALLED("is_wintouched(%p)"), win)); + T((T_CALLED("is_wintouched(%p)"), win)); - if (win) - for (i = 0; i <= win->_maxy; i++) - if (win->_line[i].firstchar != _NOCHANGE) - returnCode(TRUE); - returnCode(FALSE); + if (win) + for (i = 0; i <= win->_maxy; i++) + if (win->_line[i].firstchar != _NOCHANGE) + returnCode(TRUE); + returnCode(FALSE); } -int wtouchln(WINDOW *win, int y, int n, int changed) +NCURSES_EXPORT(int) +wtouchln(WINDOW *win, int y, int n, int changed) { -int i; + int i; - T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed)); + T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed)); - if (!win || (n<0) || (y<0) || (y>win->_maxy)) - returnCode(ERR); + if (!win || (n < 0) || (y < 0) || (y > win->_maxy)) + returnCode(ERR); - for (i = y; i < y+n; i++) { - if (i>win->_maxy) break; - win->_line[i].firstchar = changed ? 0 : _NOCHANGE; - win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE; - } - returnCode(OK); + for (i = y; i < y + n; i++) { + if (i > win->_maxy) + break; + win->_line[i].firstchar = changed ? 0 : _NOCHANGE; + win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE; + } + returnCode(OK); } diff --git a/ncurses/base/lib_ungetch.c b/ncurses/base/lib_ungetch.c index 5fdfb47d..a6164df5 100644 --- a/ncurses/base/lib_ungetch.c +++ b/ncurses/base/lib_ungetch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,35 +40,40 @@ #include -MODULE_ID("$Id: lib_ungetch.c,v 1.2 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: lib_ungetch.c,v 1.8 2002/08/24 22:08:48 tom Exp $") #include #ifdef TRACE -void _nc_fifo_dump(void) +NCURSES_EXPORT(void) +_nc_fifo_dump(void) { -int i; - T(("head = %d, tail = %d, peek = %d", head, tail, peek)); - for (i = 0; i < 10; i++) - T(("char %d = %s", i, _trace_key(SP->_fifo[i]))); + int i; + T(("head = %d, tail = %d, peek = %d", head, tail, peek)); + for (i = 0; i < 10; i++) + T(("char %d = %s", i, _tracechar(SP->_fifo[i]))); } #endif /* TRACE */ -int ungetch(int ch) +NCURSES_EXPORT(int) +ungetch(int ch) { - if (tail == -1) - return ERR; - if (head == -1) { - head = 0; - t_inc() - peek = tail; /* no raw keys */ - } else - h_dec(); + T((T_CALLED("ungetch(%s)"), _tracechar(ch))); - SP->_fifo[head] = ch; - T(("ungetch %#x ok", ch)); + if (tail == -1) + returnCode(ERR); + if (head == -1) { + head = 0; + t_inc() + peek = tail; /* no raw keys */ + } else + h_dec(); + + SP->_fifo[head] = ch; + T(("ungetch %s ok", _tracechar(ch))); #ifdef TRACE - if (_nc_tracing & TRACE_IEVENT) _nc_fifo_dump(); + if (_nc_tracing & TRACE_IEVENT) + _nc_fifo_dump(); #endif - return OK; + returnCode(OK); } diff --git a/ncurses/base/lib_vline.c b/ncurses/base/lib_vline.c index e48b864f..c19570b6 100644 --- a/ncurses/base/lib_vline.c +++ b/ncurses/base/lib_vline.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,9 @@ #include -MODULE_ID("$Id: lib_vline.c,v 1.5 2000/04/29 21:14:11 tom Exp $") +MODULE_ID("$Id: lib_vline.c,v 1.9 2001/06/03 00:39:24 skimo Exp $") -int +NCURSES_EXPORT(int) wvline(WINDOW *win, chtype ch, int n) { int code = ERR; @@ -52,6 +52,7 @@ wvline(WINDOW *win, chtype ch, int n) T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n)); if (win) { + NCURSES_CH_T wch; row = win->_cury; col = win->_curx; end = row + n - 1; @@ -59,12 +60,14 @@ wvline(WINDOW *win, chtype ch, int n) end = win->_maxy; if (ch == 0) - ch = ACS_VLINE; - ch = _nc_render(win, ch); + SetChar(wch, ChCharOf(ACS_VLINE), ChAttrOf(ACS_VLINE)); + else + SetChar(wch, ChCharOf(ch), ChAttrOf(ch)); + wch = _nc_render(win, wch); while (end >= row) { struct ldat *line = &(win->_line[end]); - line->text[col] = ch; + line->text[col] = wch; CHANGED_CELL(line, col); end--; } diff --git a/ncurses/base/lib_wattroff.c b/ncurses/base/lib_wattroff.c index a6c9f0f1..2cfe6947 100644 --- a/ncurses/base/lib_wattroff.c +++ b/ncurses/base/lib_wattroff.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,15 +41,16 @@ #include #include -MODULE_ID("$Id: lib_wattroff.c,v 1.4 1998/05/10 12:02:11 tom Exp $") +MODULE_ID("$Id: lib_wattroff.c,v 1.7 2002/07/20 17:07:16 tom Exp $") -int wattr_off(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED) +NCURSES_EXPORT(int) +wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED) { - T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); - if (win) { - T(("... current %s", _traceattr(win->_attrs))); - toggle_attr_off(win->_attrs,at); - returnCode(OK); - } else - returnCode(ERR); + T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at))); + if (win) { + T(("... current %s", _traceattr(win->_attrs))); + toggle_attr_off(win->_attrs, at); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_wattron.c b/ncurses/base/lib_wattron.c index a951c576..5d1a6a9d 100644 --- a/ncurses/base/lib_wattron.c +++ b/ncurses/base/lib_wattron.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,15 +41,16 @@ #include #include -MODULE_ID("$Id: lib_wattron.c,v 1.4 1998/05/10 12:02:28 tom Exp $") +MODULE_ID("$Id: lib_wattron.c,v 1.7 2002/07/20 17:07:16 tom Exp $") -int wattr_on(WINDOW *win, NCURSES_CONST attr_t at, void *opts GCC_UNUSED) +NCURSES_EXPORT(int) +wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED) { - T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at))); - if (win) { - T(("... current %s", _traceattr(win->_attrs))); - toggle_attr_on(win->_attrs,at); - returnCode(OK); - } else - returnCode(ERR); + T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at))); + if (win) { + T(("... current %s", _traceattr(win->_attrs))); + toggle_attr_on(win->_attrs, at); + returnCode(OK); + } else + returnCode(ERR); } diff --git a/ncurses/base/lib_winch.c b/ncurses/base/lib_winch.c index 76522079..18da9c59 100644 --- a/ncurses/base/lib_winch.c +++ b/ncurses/base/lib_winch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,14 +39,15 @@ #include -MODULE_ID("$Id: lib_winch.c,v 1.2 2000/07/29 16:41:44 tom Exp $") +MODULE_ID("$Id: lib_winch.c,v 1.5 2001/06/02 23:42:08 skimo Exp $") -chtype +NCURSES_EXPORT(chtype) winch(WINDOW *win) { T((T_CALLED("winch(%p)"), win)); if (win != 0) { - returnChar(win->_line[win->_cury].text[win->_curx]); + returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) | + AttrOf(win->_line[win->_cury].text[win->_curx])); } else { returnChar(0); } diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c index 5eae9b1a..25101673 100644 --- a/ncurses/base/lib_window.c +++ b/ncurses/base/lib_window.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,183 +39,210 @@ #include -MODULE_ID("$Id: lib_window.c,v 1.13 1998/06/28 00:10:59 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.21 2002/09/14 23:28:02 tom Exp $") -void _nc_synchook(WINDOW *win) +NCURSES_EXPORT(void) +_nc_synchook(WINDOW *win) /* hook to be called after each window change */ { - if (win->_immed) wrefresh(win); - if (win->_sync) wsyncup(win); + if (win->_immed) + wrefresh(win); + if (win->_sync) + wsyncup(win); } -int mvderwin(WINDOW *win, int y, int x) +NCURSES_EXPORT(int) +mvderwin(WINDOW *win, int y, int x) /* move a derived window */ { - WINDOW *orig; - int i; - - T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x)); - - if (win && (orig = win->_parent)) - { - if (win->_parx==x && win->_pary==y) - returnCode(OK); - if (x<0 || y<0) + WINDOW *orig; + int i; + + T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x)); + + if (win && (orig = win->_parent)) { + if (win->_parx == x && win->_pary == y) + returnCode(OK); + if (x < 0 || y < 0) + returnCode(ERR); + if ((x + getmaxx(win) > getmaxx(orig)) || + (y + getmaxy(win) > getmaxy(orig))) + returnCode(ERR); + } else returnCode(ERR); - if ( (x+getmaxx(win) > getmaxx(orig)) || - (y+getmaxy(win) > getmaxy(orig)) ) - returnCode(ERR); - } - else - returnCode(ERR); - wsyncup(win); - win->_parx = x; - win->_pary = y; - for(i=0;i_line[i].text = &(orig->_line[y++].text[x]); - returnCode(OK); + wsyncup(win); + win->_parx = x; + win->_pary = y; + for (i = 0; i < getmaxy(win); i++) + win->_line[i].text = &(orig->_line[y++].text[x]); + returnCode(OK); } -int syncok(WINDOW *win, bool bf) +NCURSES_EXPORT(int) +syncok(WINDOW *win, bool bf) /* enable/disable automatic wsyncup() on each change to window */ { - T((T_CALLED("syncok(%p,%d)"), win, bf)); + T((T_CALLED("syncok(%p,%d)"), win, bf)); - if (win) { - win->_sync = bf; - returnCode(OK); - } else - returnCode(ERR); + if (win) { + win->_sync = bf; + returnCode(OK); + } else + returnCode(ERR); } -void wsyncup(WINDOW *win) +NCURSES_EXPORT(void) +wsyncup(WINDOW *win) /* mark changed every cell in win's ancestors that is changed in win */ /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */ { - WINDOW *wp; - - if (win && win->_parent) - for (wp = win; wp->_parent; wp = wp->_parent) - { - int y; - WINDOW *pp = wp->_parent; - - assert((wp->_pary <= pp->_maxy) && - ((wp->_pary+wp->_maxy) <= pp->_maxy)); - - for (y = 0; y <= wp->_maxy; y++) - { - int left = wp->_line[y].firstchar; - if (left >= 0) /* line is touched */ - { - struct ldat *line = &(pp->_line[wp->_pary + y]); - /* left & right character in parent window coordinates */ - int right = wp->_line[y].lastchar + wp->_parx; - left += wp->_parx; - - CHANGED_RANGE(line, left, right); - } - } - } + WINDOW *wp; + + T((T_CALLED("wsyncup(%p)"), win)); + if (win && win->_parent) { + for (wp = win; wp->_parent; wp = wp->_parent) { + int y; + WINDOW *pp = wp->_parent; + + assert((wp->_pary <= pp->_maxy) && + ((wp->_pary + wp->_maxy) <= pp->_maxy)); + + for (y = 0; y <= wp->_maxy; y++) { + int left = wp->_line[y].firstchar; + if (left >= 0) { /* line is touched */ + struct ldat *line = &(pp->_line[wp->_pary + y]); + /* left & right character in parent window coordinates */ + int right = wp->_line[y].lastchar + wp->_parx; + left += wp->_parx; + + CHANGED_RANGE(line, left, right); + } + } + } + } + returnVoid; } -void wsyncdown(WINDOW *win) +NCURSES_EXPORT(void) +wsyncdown(WINDOW *win) /* mark changed every cell in win that is changed in any of its ancestors */ /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */ { - if (win && win->_parent) - { - WINDOW *pp = win->_parent; - int y; - - /* This recursion guarantees, that the changes are propagated down- - wards from the root to our direct parent. */ - wsyncdown(pp); - - /* and now we only have to propagate the changes from our direct - parent, if there are any. */ - assert((win->_pary <= pp->_maxy) && - ((win->_pary + win->_maxy) <= pp->_maxy)); - - for (y = 0; y <= win->_maxy; y++) - { - if (pp->_line[win->_pary + y].firstchar >= 0) /* parent changed */ - { - struct ldat *line = &(win->_line[y]); - /* left and right character in child coordinates */ - int left = pp->_line[win->_pary + y].firstchar - win->_parx; - int right = pp->_line[win->_pary + y].lastchar - win->_parx; - /* The change maybe outside the childs range */ - if (left<0) - left = 0; - if (right > win->_maxx) - right = win->_maxx; - CHANGED_RANGE(line, left, right); + T((T_CALLED("wsyncdown(%p)"), win)); + + if (win && win->_parent) { + WINDOW *pp = win->_parent; + int y; + + /* This recursion guarantees, that the changes are propagated down- + wards from the root to our direct parent. */ + wsyncdown(pp); + + /* and now we only have to propagate the changes from our direct + parent, if there are any. */ + assert((win->_pary <= pp->_maxy) && + ((win->_pary + win->_maxy) <= pp->_maxy)); + + for (y = 0; y <= win->_maxy; y++) { + if (pp->_line[win->_pary + y].firstchar >= 0) { /* parent changed */ + struct ldat *line = &(win->_line[y]); + /* left and right character in child coordinates */ + int left = pp->_line[win->_pary + y].firstchar - win->_parx; + int right = pp->_line[win->_pary + y].lastchar - win->_parx; + /* The change maybe outside the childs range */ + if (left < 0) + left = 0; + if (right > win->_maxx) + right = win->_maxx; + CHANGED_RANGE(line, left, right); } } } + returnVoid; } -void wcursyncup(WINDOW *win) +NCURSES_EXPORT(void) +wcursyncup(WINDOW *win) /* sync the cursor in all derived windows to its value in the base window */ { - WINDOW *wp; - for( wp = win; wp && wp->_parent; wp = wp->_parent ) { - wmove( wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx ); - } + WINDOW *wp; + + T((T_CALLED("wcursyncup(%p)"), win)); + for (wp = win; wp && wp->_parent; wp = wp->_parent) { + wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx); + } + returnVoid; } -WINDOW *dupwin(WINDOW *win) +NCURSES_EXPORT(WINDOW *) +dupwin(WINDOW *win) /* make an exact duplicate of the given window */ { -WINDOW *nwin; -size_t linesize; -int i; - - T((T_CALLED("dupwin(%p)"), win)); - - if ((win==NULL) || - ((nwin = newwin(win->_maxy + 1, win->_maxx + 1, win->_begy, win->_begx)) == NULL)) - returnWin(0); - - nwin->_curx = win->_curx; - nwin->_cury = win->_cury; - nwin->_maxy = win->_maxy; - nwin->_maxx = win->_maxx; - nwin->_begy = win->_begy; - nwin->_begx = win->_begx; - nwin->_yoffset = win->_yoffset; - - nwin->_flags = win->_flags & ~_SUBWIN; - /* Due to the use of newwin(), the clone is not a subwindow. - * The text is really copied into the clone. - */ - - nwin->_attrs = win->_attrs; - nwin->_bkgd = win->_bkgd; - - nwin->_clear = win->_clear; - nwin->_scroll = win->_scroll; - nwin->_leaveok = win->_leaveok; - nwin->_use_keypad = win->_use_keypad; - nwin->_delay = win->_delay; - nwin->_immed = win->_immed; - nwin->_sync = win->_sync; - - nwin->_parx = 0; - nwin->_pary = 0; - nwin->_parent = (WINDOW*)0; - /* See above: the clone isn't a subwindow! */ - - nwin->_regtop = win->_regtop; - nwin->_regbottom = win->_regbottom; - - linesize = (win->_maxx + 1) * sizeof(chtype); - for (i = 0; i <= nwin->_maxy; i++) { + WINDOW *nwin = 0; + size_t linesize; + int i; + + T((T_CALLED("dupwin(%p)"), win)); + + if (win != 0) { + + if (win->_flags & _ISPAD) { + nwin = newpad(win->_maxy + 1, + win->_maxx + 1); + } else { + nwin = newwin(win->_maxy + 1, + win->_maxx + 1, + win->_begy, + win->_begx); + } + + if (nwin != 0) { + + nwin->_curx = win->_curx; + nwin->_cury = win->_cury; + nwin->_maxy = win->_maxy; + nwin->_maxx = win->_maxx; + nwin->_begy = win->_begy; + nwin->_begx = win->_begx; + nwin->_yoffset = win->_yoffset; + + nwin->_flags = win->_flags & ~_SUBWIN; + /* Due to the use of newwin(), the clone is not a subwindow. + * The text is really copied into the clone. + */ + + nwin->_attrs = win->_attrs; + nwin->_nc_bkgd = win->_nc_bkgd; + + nwin->_notimeout = win->_notimeout; + nwin->_clear = win->_clear; + nwin->_leaveok = win->_leaveok; + nwin->_scroll = win->_scroll; + nwin->_idlok = win->_idlok; + nwin->_idcok = win->_idcok; + nwin->_immed = win->_immed; + nwin->_sync = win->_sync; + nwin->_use_keypad = win->_use_keypad; + nwin->_delay = win->_delay; + + nwin->_parx = 0; + nwin->_pary = 0; + nwin->_parent = (WINDOW *) 0; + /* See above: the clone isn't a subwindow! */ + + nwin->_regtop = win->_regtop; + nwin->_regbottom = win->_regbottom; + + if (win->_flags & _ISPAD) + nwin->_pad = win->_pad; + + linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T); + for (i = 0; i <= nwin->_maxy; i++) { memcpy(nwin->_line[i].text, win->_line[i].text, linesize); - nwin->_line[i].firstchar = win->_line[i].firstchar; + nwin->_line[i].firstchar = win->_line[i].firstchar; nwin->_line[i].lastchar = win->_line[i].lastchar; + } } - - returnWin(nwin); + } + returnWin(nwin); } diff --git a/ncurses/base/memmove.c b/ncurses/base/memmove.c index 55a41063..4fafc4cd 100644 --- a/ncurses/base/memmove.c +++ b/ncurses/base/memmove.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ #include -MODULE_ID("$Id: memmove.c,v 1.2 1999/02/27 19:55:57 tom Exp $") +MODULE_ID("$Id: memmove.c,v 1.4 2000/12/10 02:43:28 tom Exp $") /**************************************************************************** * Author: Thomas E. Dickey 1998 * @@ -37,27 +37,33 @@ MODULE_ID("$Id: memmove.c,v 1.2 1999/02/27 19:55:57 tom Exp $") #if USE_MY_MEMMOVE #define DST ((char *)s1) #define SRC ((const char *)s2) -void * _nc_memmove(void * s1, const void * s2, size_t n) +NCURSES_EXPORT(void *) +_nc_memmove(void *s1, const void *s2, size_t n) { - if (n != 0) { - if ((DST+n > SRC) && (SRC+n > DST)) { - static char *bfr; - static size_t length; - register size_t j; - if (length < n) { - length = (n * 3) / 2; - bfr = typeRealloc(char,length,bfr); - } - for (j = 0; j < n; j++) - bfr[j] = SRC[j]; - SRC = bfr; - } - while (n-- != 0) - DST[n] = SRC[n]; + if (n != 0) { + if ((DST + n > SRC) && (SRC + n > DST)) { + static char *bfr; + static size_t length; + register size_t j; + if (length < n) { + length = (n * 3) / 2; + bfr = typeRealloc(char, length, bfr); + } + for (j = 0; j < n; j++) + bfr[j] = SRC[j]; + SRC = bfr; } - return s1; + while (n-- != 0) + DST[n] = SRC[n]; + } + return s1; } #else -extern void _nc_memmove(void); /* quiet's gcc warning */ -void _nc_memmove(void) { } /* nonempty for strict ANSI compilers */ +extern +NCURSES_EXPORT(void) +_nc_memmove(void); /* quiet's gcc warning */ +NCURSES_EXPORT(void) +_nc_memmove(void) +{ +} /* nonempty for strict ANSI compilers */ #endif /* USE_MY_MEMMOVE */ diff --git a/ncurses/base/nc_panel.c b/ncurses/base/nc_panel.c index 536aab38..59bfbbe8 100644 --- a/ncurses/base/nc_panel.c +++ b/ncurses/base/nc_panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,10 +32,10 @@ #include -MODULE_ID("$Id: nc_panel.c,v 1.2 1998/02/11 12:13:56 tom Exp $") +MODULE_ID("$Id: nc_panel.c,v 1.4 2000/12/10 02:43:28 tom Exp $") -struct panelhook* +NCURSES_EXPORT(struct panelhook *) _nc_panelhook(void) { - return (SP ? &(SP->_panelHook) : NULL); + return (SP ? &(SP->_panelHook) : NULL); } diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c index 86035502..9cc8081b 100644 --- a/ncurses/base/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996,1997 * + * Author: Thomas E. Dickey * ****************************************************************************/ /* @@ -41,7 +41,219 @@ #include #include -MODULE_ID("$Id: resizeterm.c,v 1.7 1998/09/19 19:27:43 Alexander.V.Lukyanov Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.14 2002/07/13 21:32:57 tom Exp $") + +#define stolen_lines (screen_lines - SP->_lines_avail) + +NCURSES_EXPORT(bool) +is_term_resized(int ToLines, int ToCols) +{ + return (ToLines != screen_lines + || ToCols != screen_columns); +} + +/* + * Return the number of levels of child-windows under the current window. + */ +static int +child_depth(WINDOW *cmp) +{ + int depth = 0; + + if (cmp != 0) { + WINDOWLIST *wp; + + for (wp = _nc_windows; wp != 0; wp = wp->next) { + WINDOW *tst = &(wp->win); + if (tst->_parent == cmp) { + depth = 1 + child_depth(tst); + break; + } + } + } + return depth; +} + +/* + * Return the number of levels of parent-windows above the current window. + */ +static int +parent_depth(WINDOW *cmp) +{ + int depth = 0; + + if (cmp != 0) { + WINDOW *tst; + while ((tst = cmp->_parent) != 0) { + ++depth; + cmp = tst; + } + } + return depth; +} + +/* + * FIXME: must adjust position so it's within the parent! + */ +static int +adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen) +{ + int result; + int bottom = screen_lines + SP->_topstolen - stolen; + int myLines = win->_maxy + 1; + int myCols = win->_maxx + 1; + + T((T_CALLED("adjust_window(%p,%d,%d) currently %dx%d at %d,%d"), + win, ToLines, ToCols, + getmaxy(win), getmaxx(win), + getbegy(win), getbegx(win))); + + if (win->_begy >= bottom) { + win->_begy += (ToLines - screen_lines); + } else { + if (myLines == screen_lines - stolen + && ToLines != screen_lines) + myLines = ToLines - stolen; + else if (myLines == screen_lines + && ToLines != screen_lines) + myLines = ToLines; + } + + if (myLines > ToLines) + myLines = ToLines; + + if (myCols > ToCols) + myCols = ToCols; + + if (myLines == screen_lines + && ToLines != screen_lines) + myCols = ToLines; + + if (myCols == screen_columns + && ToCols != screen_columns) + myCols = ToCols; + + result = wresize(win, myLines, myCols); + returnCode(result); +} + +/* + * If we're decreasing size, recursively search for windows that have no + * children, decrease those to fit, then decrease the containing window, etc. + */ +static int +decrease_size(int ToLines, int ToCols, int stolen) +{ + bool found; + int depth = 0; + WINDOWLIST *wp; + + T((T_CALLED("decrease_size(%d, %d)"), ToLines, ToCols)); + + do { + found = FALSE; + TR(TRACE_UPDATE, ("decreasing size of windows to %dx%d, depth=%d", + ToLines, ToCols, depth)); + for (wp = _nc_windows; wp != 0; wp = wp->next) { + WINDOW *win = &(wp->win); + + if (!(win->_flags & _ISPAD)) { + if (child_depth(win) == depth) { + if (adjust_window(win, ToLines, ToCols, stolen) != OK) + returnCode(ERR); + } + } + } + ++depth; + } while (found); + returnCode(OK); +} + +/* + * If we're increasing size, recursively search for windows that have no + * parent, increase those to fit, then increase the contained window, etc. + */ +static int +increase_size(int ToLines, int ToCols, int stolen) +{ + bool found; + int depth = 0; + WINDOWLIST *wp; + + T((T_CALLED("increase_size(%d, %d)"), ToLines, ToCols)); + + do { + found = FALSE; + TR(TRACE_UPDATE, ("increasing size of windows to %dx%d, depth=%d", + ToLines, ToCols, depth)); + for (wp = _nc_windows; wp != 0; wp = wp->next) { + WINDOW *win = &(wp->win); + + if (!(win->_flags & _ISPAD)) { + if (parent_depth(win) == depth) { + if (adjust_window(win, ToLines, ToCols, stolen) != OK) + returnCode(ERR); + } + } + } + ++depth; + } while (found); + returnCode(OK); +} + +/* + * This function reallocates NCURSES window structures, with no side-effects + * such as ungetch(). + */ +NCURSES_EXPORT(int) +resize_term(int ToLines, int ToCols) +{ + int result = OK; + int was_stolen = (screen_lines - SP->_lines_avail); + + T((T_CALLED("resize_term(%d,%d) old(%d,%d)"), + ToLines, ToCols, + screen_lines, screen_columns)); + + if (is_term_resized(ToLines, ToCols)) { + int myLines = screen_lines; + int myCols = screen_columns; + + if (ToLines > screen_lines) { + increase_size(myLines = ToLines, myCols, was_stolen); + } + + if (ToCols > screen_columns) { + increase_size(myLines, myCols = ToCols, was_stolen); + } + + if (ToLines < myLines || + ToCols < myCols) { + decrease_size(ToLines, ToCols, was_stolen); + } + + screen_lines = lines = ToLines; + screen_columns = columns = ToCols; + + SP->_lines_avail = lines - was_stolen; + + if (SP->oldhash) { + FreeAndNull(SP->oldhash); + } + if (SP->newhash) { + FreeAndNull(SP->newhash); + } + } + + /* + * Always update LINES, to allow for call from lib_doupdate.c which + * needs to have the count adjusted by the stolen (ripped off) lines. + */ + LINES = ToLines - was_stolen; + COLS = ToCols; + + returnCode(result); +} /* * This function reallocates NCURSES window structures. It is invoked in @@ -51,71 +263,26 @@ MODULE_ID("$Id: resizeterm.c,v 1.7 1998/09/19 19:27:43 Alexander.V.Lukyanov Exp * Because this performs memory allocation, it should not (in general) be * invoked directly from the signal handler. */ -int +NCURSES_EXPORT(int) resizeterm(int ToLines, int ToCols) { - int stolen = screen_lines - SP->_lines_avail; - int bottom = screen_lines + SP->_topstolen - stolen; + int result = OK; - T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"), - ToLines, ToCols, - screen_lines, screen_columns)); + SP->_sig_winch = FALSE; - SP->_sig_winch = FALSE; + T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"), + ToLines, ToCols, + screen_lines, screen_columns)); - if (ToLines != screen_lines - || ToCols != screen_columns) { - WINDOWLIST *wp; + if (is_term_resized(ToLines, ToCols)) { #if USE_SIGWINCH - ungetch(KEY_RESIZE); /* so application can know this */ - clearok(curscr, TRUE); /* screen contents are unknown */ + ungetch(KEY_RESIZE); /* so application can know this */ + clearok(curscr, TRUE); /* screen contents are unknown */ #endif - for (wp = _nc_windows; wp != 0; wp = wp->next) { - WINDOW *win = wp->win; - int myLines = win->_maxy + 1; - int myCols = win->_maxx + 1; - - /* pads aren't treated this way */ - if (win->_flags & _ISPAD) - continue; - - if (win->_begy >= bottom) { - win->_begy += (ToLines - screen_lines); - } else { - if (myLines == screen_lines - stolen - && ToLines != screen_lines) - myLines = ToLines - stolen; - else - if (myLines == screen_lines - && ToLines != screen_lines) - myLines = ToLines; - } - - if (myCols == screen_columns - && ToCols != screen_columns) - myCols = ToCols; - - if (wresize(win, myLines, myCols) != OK) - returnCode(ERR); - } - - screen_lines = lines = ToLines; - screen_columns = columns = ToCols; - - SP->_lines_avail = lines - stolen; - - if (SP->oldhash) { FreeAndNull(SP->oldhash); } - if (SP->newhash) { FreeAndNull(SP->newhash); } - } - - /* - * Always update LINES, to allow for call from lib_doupdate.c which - * needs to have the count adjusted by the stolen (ripped off) lines. - */ - LINES = ToLines - stolen; - COLS = ToCols; + result = resize_term(ToLines, ToCols); + } - returnCode(OK); + returnCode(result); } diff --git a/ncurses/base/safe_sprintf.c b/ncurses/base/safe_sprintf.c index e4d52527..cb48365f 100644 --- a/ncurses/base/safe_sprintf.c +++ b/ncurses/base/safe_sprintf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,11 +33,13 @@ #include #include -MODULE_ID("$Id: safe_sprintf.c,v 1.11 1999/09/11 18:03:27 tom Exp $") +MODULE_ID("$Id: safe_sprintf.c,v 1.14 2001/07/08 00:58:34 tom Exp $") #if USE_SAFE_SPRINTF -typedef enum { Flags, Width, Prec, Type, Format } PRINTF; +typedef enum { + Flags, Width, Prec, Type, Format +} PRINTF; #define VA_INTGR(type) ival = va_arg(ap, type) #define VA_FLOAT(type) fval = va_arg(ap, type) @@ -50,190 +52,193 @@ typedef enum { Flags, Width, Prec, Type, Format } PRINTF; static int _nc_printf_length(const char *fmt, va_list ap) { - size_t length = BUFSIZ; - char *buffer; - char *format; - int len = 0; - - if (fmt == 0 || *fmt == '\0') - return -1; - if ((format = typeMalloc(char, strlen(fmt)+1)) == 0) - return -1; - if ((buffer = typeMalloc(char, length)) == 0) { - free(format); - return -1; - } - - while (*fmt != '\0') { - if (*fmt == '%') { - static char dummy[] = ""; - PRINTF state = Flags; - char *pval = dummy; /* avoid const-cast */ - double fval = 0.0; - int done = FALSE; - int ival = 0; - int prec = -1; - int type = 0; - int used = 0; - int width = -1; - size_t f = 0; - - format[f++] = *fmt; - while (*++fmt != '\0' && len >= 0 && !done) { - format[f++] = *fmt; - - if (isdigit(*fmt)) { - int num = *fmt - '0'; - if (state == Flags && num != 0) - state = Width; - if (state == Width) { - if (width < 0) - width = 0; - width = (width * 10) + num; - } else if (state == Prec) { - if (prec < 0) - prec = 0; - prec = (prec * 10) + num; - } - } else if (*fmt == '*') { - VA_INTGR(int); - if (state == Flags) - state = Width; - if (state == Width) { - width = ival; - } else if (state == Prec) { - prec = ival; - } - sprintf(&format[--f], "%d", ival); - f = strlen(format); - } else if (isalpha(*fmt)) { - done = TRUE; - switch (*fmt) { - case 'Z': /* FALLTHRU */ - case 'h': /* FALLTHRU */ - case 'l': /* FALLTHRU */ - done = FALSE; - type = *fmt; - break; - case 'i': /* FALLTHRU */ - case 'd': /* FALLTHRU */ - case 'u': /* FALLTHRU */ - case 'x': /* FALLTHRU */ - case 'X': /* FALLTHRU */ - if (type == 'l') - VA_INTGR(long); - else if (type == 'Z') - VA_INTGR(size_t); - else - VA_INTGR(int); - used = 'i'; - break; - case 'f': /* FALLTHRU */ - case 'e': /* FALLTHRU */ - case 'E': /* FALLTHRU */ - case 'g': /* FALLTHRU */ - case 'G': /* FALLTHRU */ - VA_FLOAT(double); - used = 'f'; - break; - case 'c': - VA_INTGR(int); - used = 'i'; - break; - case 's': - VA_POINT(char *); - if (prec < 0) - prec = strlen(pval); - if (prec > (int)length) { - length = length + prec; - buffer = typeRealloc(char, length, buffer); - if (buffer == 0) { - free(format); - return -1; - } - } - used = 'p'; - break; - case 'p': - VA_POINT(void *); - used = 'p'; - break; - case 'n': - VA_POINT(int *); - used = 0; - break; - default: - break; - } - } else if (*fmt == '.') { - state = Prec; - } else if (*fmt == '%') { - done = TRUE; - used = 'p'; - } - } - format[f] = '\0'; - switch (used) { - case 'i': - sprintf(buffer, format, ival); - break; - case 'f': - sprintf(buffer, format, fval); - break; - default: - sprintf(buffer, format, pval); - break; + size_t length = BUFSIZ; + char *buffer; + char *format; + int len = 0; + + if (fmt == 0 || *fmt == '\0') + return -1; + if ((format = typeMalloc(char, strlen(fmt) + 1)) == 0) + return -1; + if ((buffer = typeMalloc(char, length)) == 0) { + free(format); + return -1; + } + + while (*fmt != '\0') { + if (*fmt == '%') { + static char dummy[] = ""; + PRINTF state = Flags; + char *pval = dummy; /* avoid const-cast */ + double fval = 0.0; + int done = FALSE; + int ival = 0; + int prec = -1; + int type = 0; + int used = 0; + int width = -1; + size_t f = 0; + + format[f++] = *fmt; + while (*++fmt != '\0' && len >= 0 && !done) { + format[f++] = *fmt; + + if (isdigit(UChar(*fmt))) { + int num = *fmt - '0'; + if (state == Flags && num != 0) + state = Width; + if (state == Width) { + if (width < 0) + width = 0; + width = (width * 10) + num; + } else if (state == Prec) { + if (prec < 0) + prec = 0; + prec = (prec * 10) + num; + } + } else if (*fmt == '*') { + VA_INTGR(int); + if (state == Flags) + state = Width; + if (state == Width) { + width = ival; + } else if (state == Prec) { + prec = ival; + } + sprintf(&format[--f], "%d", ival); + f = strlen(format); + } else if (isalpha(UChar(*fmt))) { + done = TRUE; + switch (*fmt) { + case 'Z': /* FALLTHRU */ + case 'h': /* FALLTHRU */ + case 'l': /* FALLTHRU */ + done = FALSE; + type = *fmt; + break; + case 'i': /* FALLTHRU */ + case 'd': /* FALLTHRU */ + case 'u': /* FALLTHRU */ + case 'x': /* FALLTHRU */ + case 'X': /* FALLTHRU */ + if (type == 'l') + VA_INTGR(long); + else if (type == 'Z') + VA_INTGR(size_t); + else + VA_INTGR(int); + used = 'i'; + break; + case 'f': /* FALLTHRU */ + case 'e': /* FALLTHRU */ + case 'E': /* FALLTHRU */ + case 'g': /* FALLTHRU */ + case 'G': /* FALLTHRU */ + VA_FLOAT(double); + used = 'f'; + break; + case 'c': + VA_INTGR(int); + used = 'i'; + break; + case 's': + VA_POINT(char *); + if (prec < 0) + prec = strlen(pval); + if (prec > (int) length) { + length = length + prec; + buffer = typeRealloc(char, length, buffer); + if (buffer == 0) { + free(format); + return -1; + } } - len += (int)strlen(buffer); - } else { - fmt++; - len++; + used = 'p'; + break; + case 'p': + VA_POINT(void *); + used = 'p'; + break; + case 'n': + VA_POINT(int *); + used = 0; + break; + default: + break; + } + } else if (*fmt == '.') { + state = Prec; + } else if (*fmt == '%') { + done = TRUE; + used = 'p'; } + } + format[f] = '\0'; + switch (used) { + case 'i': + sprintf(buffer, format, ival); + break; + case 'f': + sprintf(buffer, format, fval); + break; + default: + sprintf(buffer, format, pval); + break; + } + len += (int) strlen(buffer); + } else { + fmt++; + len++; } + } - free(buffer); - free(format); - return len; + free(buffer); + free(format); + return len; } #endif /* * Wrapper for vsprintf that allocates a buffer big enough to hold the result. */ -char * -_nc_printf_string(const char *fmt, va_list ap) +NCURSES_EXPORT(char *) +_nc_printf_string +(const char *fmt, va_list ap) { #if USE_SAFE_SPRINTF - char *buf = 0; - int len = _nc_printf_length(fmt, ap); - - if (len > 0) { - if ((buf = typeMalloc(char, len+1)) == 0) - return(0); - vsprintf(buf, fmt, ap); - } + char *buf = 0; + int len = _nc_printf_length(fmt, ap); + + if (len > 0) { + if ((buf = typeMalloc(char, len + 1)) == 0) + return (0); + vsprintf(buf, fmt, ap); + } #else - static int rows, cols; - static char *buf; - static size_t len; - - if (screen_lines > rows || screen_columns > cols) { - if (screen_lines > rows) rows = screen_lines; - if (screen_columns > cols) cols = screen_columns; - len = (rows * (cols + 1)) + 1; - buf = typeRealloc(char, len, buf); - if (buf == 0) { - return(0); - } + static int rows, cols; + static char *buf; + static size_t len; + + if (screen_lines > rows || screen_columns > cols) { + if (screen_lines > rows) + rows = screen_lines; + if (screen_columns > cols) + cols = screen_columns; + len = (rows * (cols + 1)) + 1; + buf = typeRealloc(char, len, buf); + if (buf == 0) { + return (0); } + } - if (buf != 0) { + if (buf != 0) { # if HAVE_VSNPRINTF - vsnprintf(buf, len, fmt, ap); /* GNU extension */ + vsnprintf(buf, len, fmt, ap); /* GNU extension */ # else - vsprintf(buf, fmt, ap); /* ANSI */ + vsprintf(buf, fmt, ap); /* ANSI */ # endif - } + } #endif - return buf; + return buf; } diff --git a/ncurses/base/sigaction.c b/ncurses/base/sigaction.c index ab1e569f..8ba8629a 100644 --- a/ncurses/base/sigaction.c +++ b/ncurses/base/sigaction.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,6 @@ #include -#include #include /* This file provides sigaction() emulation using sigvec() */ @@ -41,66 +40,78 @@ #if !HAVE_SIGACTION && HAVE_SIGVEC -MODULE_ID("$Id: sigaction.c,v 1.9 1999/06/19 23:05:16 tom Exp $") +MODULE_ID("$Id: sigaction.c,v 1.13 2002/05/18 19:56:26 tom Exp $") -int -sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact) +NCURSES_EXPORT(int) +sigaction +(int sig, sigaction_t * sigact, sigaction_t * osigact) { - return sigvec(sig, sigact, osigact); + return sigvec(sig, sigact, osigact); } -int -sigemptyset (sigset_t * mask) +NCURSES_EXPORT(int) +sigemptyset +(sigset_t * mask) { - *mask = 0; - return 0; + *mask = 0; + return 0; } -int -sigprocmask (int mode, sigset_t * mask, sigset_t * omask) +NCURSES_EXPORT(int) +sigprocmask +(int mode, sigset_t * mask, sigset_t * omask) { - sigset_t current = sigsetmask(0); + sigset_t current = sigsetmask(0); - if (omask) *omask = current; + if (omask) + *omask = current; - if (mode==SIG_BLOCK) - current |= *mask; - else if (mode==SIG_UNBLOCK) - current &= ~*mask; - else if (mode==SIG_SETMASK) - current = *mask; + if (mode == SIG_BLOCK) + current |= *mask; + else if (mode == SIG_UNBLOCK) + current &= ~*mask; + else if (mode == SIG_SETMASK) + current = *mask; - sigsetmask(current); - return 0; + sigsetmask(current); + return 0; } -int -sigsuspend (sigset_t * mask) +NCURSES_EXPORT(int) +sigsuspend(sigset_t * mask) { - return sigpause (*mask); + return sigpause(*mask); } -int -sigdelset (sigset_t * mask, int sig) +NCURSES_EXPORT(int) +sigdelset +(sigset_t * mask, int sig) { - *mask &= ~sigmask (sig); - return 0; + *mask &= ~sigmask(sig); + return 0; } -int -sigaddset (sigset_t * mask, int sig) +NCURSES_EXPORT(int) +sigaddset +(sigset_t * mask, int sig) { - *mask |= sigmask (sig); - return 0; + *mask |= sigmask(sig); + return 0; } -int -sigismember (sigset_t * mask, int sig) +NCURSES_EXPORT(int) +sigismember +(sigset_t * mask, int sig) { - return (*mask & sigmask (sig)) != 0; + return (*mask & sigmask(sig)) != 0; } #else -extern void _nc_sigaction(void); /* quiet's gcc warning */ -void _nc_sigaction(void) { } /* nonempty for strict ANSI compilers */ +extern +NCURSES_EXPORT(void) +_nc_sigaction(void); /* quiet's gcc warning */ +NCURSES_EXPORT(void) +_nc_sigaction(void) +{ +} /* nonempty for strict ANSI compilers */ #endif diff --git a/ncurses/base/tries.c b/ncurses/base/tries.c index 3c396529..fe7d93ed 100644 --- a/ncurses/base/tries.c +++ b/ncurses/base/tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,100 +39,106 @@ #include -MODULE_ID("$Id: tries.c,v 1.12 1999/03/01 23:23:59 tom Exp $") +MODULE_ID("$Id: tries.c,v 1.15 2001/12/16 00:50:40 tom Exp $") /* * Expand a keycode into the string that it corresponds to, returning null if * no match was found, otherwise allocating a string of the result. */ -char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len) +NCURSES_EXPORT(char *) +_nc_expand_try +(struct tries *tree, unsigned short code, int *count, size_t len) { - struct tries *ptr = tree; - char *result = 0; + struct tries *ptr = tree; + char *result = 0; - if (code != 0) { - while (ptr != 0) { - if ((result = _nc_expand_try(ptr->child, code, count, len + 1)) != 0) { - break; - } - if (ptr->value == code) { - *count -= 1; - if (*count == -1) { - result = typeCalloc(char, len+2); - break; - } - } - ptr = ptr->sibling; + if (code != 0) { + while (ptr != 0) { + if ((result = _nc_expand_try(ptr->child, code, count, len + 1)) + != 0) { + break; + } + if (ptr->value == code) { + *count -= 1; + if (*count == -1) { + result = typeCalloc(char, len + 2); + break; } + } + ptr = ptr->sibling; } - if (result != 0) { - if ((result[len] = ptr->ch) == 0) - *((unsigned char *)(result+len)) = 128; + } + if (result != 0) { + if ((result[len] = ptr->ch) == 0) + *((unsigned char *) (result + len)) = 128; #ifdef TRACE - if (len == 0) - _tracef("expand_key %s %s", _trace_key(code), _nc_visbuf(result)); + if (len == 0) + _tracef("expand_key %s %s", _tracechar(code), _nc_visbuf(result)); #endif - } - return result; + } + return result; } /* * Remove a code from the specified tree, freeing the unused nodes. Returns * true if the code was found/removed. */ -int _nc_remove_key(struct tries **tree, unsigned short code) +NCURSES_EXPORT(int) +_nc_remove_key +(struct tries **tree, unsigned short code) { - T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code)); + T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code)); - if (code == 0) - returnCode(FALSE); - - while (*tree != 0) { - if (_nc_remove_key(&(*tree)->child, code)) { - returnCode(TRUE); - } - if ((*tree)->value == code) { - if((*tree)->child) { - /* don't cut the whole sub-tree */ - (*tree)->value = 0; - } else { - struct tries *to_free = *tree; - *tree = (*tree)->sibling; - free(to_free); - } - returnCode(TRUE); - } - tree = &(*tree)->sibling; - } + if (code == 0) returnCode(FALSE); + + while (*tree != 0) { + if (_nc_remove_key(&(*tree)->child, code)) { + returnCode(TRUE); + } + if ((*tree)->value == code) { + if ((*tree)->child) { + /* don't cut the whole sub-tree */ + (*tree)->value = 0; + } else { + struct tries *to_free = *tree; + *tree = (*tree)->sibling; + free(to_free); + } + returnCode(TRUE); + } + tree = &(*tree)->sibling; + } + returnCode(FALSE); } /* * Remove a string from the specified tree, freeing the unused nodes. Returns * true if the string was found/removed. */ -int _nc_remove_string(struct tries **tree, char *string) +NCURSES_EXPORT(int) +_nc_remove_string(struct tries **tree, char *string) { - T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string))); + T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string))); - if (string == 0 || *string == 0) - returnCode(FALSE); - - while (*tree != 0) { - if ((unsigned char)(*tree)->ch == (unsigned char)*string) { - if (string[1] != 0) - returnCode(_nc_remove_string(&(*tree)->child, string+1)); - if((*tree)->child) { - /* don't cut the whole sub-tree */ - (*tree)->value = 0; - } else { - struct tries *to_free = *tree; - *tree = (*tree)->sibling; - free(to_free); - } - returnCode(TRUE); - } - tree = &(*tree)->sibling; - } + if (string == 0 || *string == 0) returnCode(FALSE); + + while (*tree != 0) { + if ((unsigned char) (*tree)->ch == (unsigned char) *string) { + if (string[1] != 0) + returnCode(_nc_remove_string(&(*tree)->child, string + 1)); + if ((*tree)->child) { + /* don't cut the whole sub-tree */ + (*tree)->value = 0; + } else { + struct tries *to_free = *tree; + *tree = (*tree)->sibling; + free(to_free); + } + returnCode(TRUE); + } + tree = &(*tree)->sibling; + } + returnCode(FALSE); } diff --git a/ncurses/base/version.c b/ncurses/base/version.c index a2fe4d86..b78c99d0 100644 --- a/ncurses/base/version.c +++ b/ncurses/base/version.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,16 +32,16 @@ #include -MODULE_ID("$Id: version.c,v 1.2 1999/12/04 21:27:23 tom Exp $") +MODULE_ID("$Id: version.c,v 1.4 2000/12/10 02:43:28 tom Exp $") -const char * +NCURSES_EXPORT(const char *) curses_version(void) { static char my_version[80]; T((T_CALLED("curses_version()"))); sprintf(my_version, "ncurses %s.%d", - NCURSES_VERSION, - NCURSES_VERSION_PATCH); + NCURSES_VERSION, + NCURSES_VERSION_PATCH); returnPtr(my_version); } diff --git a/ncurses/base/vsscanf.c b/ncurses/base/vsscanf.c index ac2bf9f2..12df4aa3 100644 --- a/ncurses/base/vsscanf.c +++ b/ncurses/base/vsscanf.c @@ -1,3 +1,35 @@ +/**************************************************************************** + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * State-machine fallback written by Thomas E. Dickey 2002 * + ****************************************************************************/ + /* * This function is needed to support vwscanw */ @@ -6,42 +38,319 @@ #if !HAVE_VSSCANF -MODULE_ID("$Id: vsscanf.c,v 1.10 1996/12/21 14:24:06 tom Exp $") +MODULE_ID("$Id: vsscanf.c,v 1.16 2002/09/07 17:27:56 tom Exp $") + +#if !(HAVE_VFSCANF || HAVE__DOSCAN) + +#include + +#define L_SQUARE '[' +#define R_SQUARE ']' + +typedef enum { + cUnknown + ,cError /* anything that isn't ANSI */ + ,cAssigned + ,cChar + ,cInt + ,cFloat + ,cDouble + ,cPointer + ,cLong + ,cShort + ,cRange + ,cString +} ChunkType; + +typedef enum { + oUnknown + ,oShort + ,oLong +} OtherType; + +typedef enum { + sUnknown + ,sPercent /* last was '%' beginning a format */ + ,sNormal /* ...somewhere in the middle */ + ,sLeft /* last was left square bracket beginning a range */ + ,sRange /* ...somewhere in the middle */ + ,sFinal /* last finished a format */ +} ScanState; + +static ChunkType +final_ch(int ch, OtherType other) +{ + ChunkType result = cUnknown; + + switch (ch) { + case 'c': + if (other == oUnknown) + result = cChar; + else + result = cError; + break; + case 'd': + case 'i': + case 'X': + case 'x': + switch (other) { + case oUnknown: + result = cInt; + break; + case oShort: + result = cShort; + break; + case oLong: + result = cLong; + break; + } + break; + case 'E': + case 'e': + case 'f': + case 'g': + switch (other) { + case oUnknown: + result = cFloat; + break; + case oShort: + result = cError; + break; + case oLong: + result = cDouble; + break; + } + break; + case 'n': + if (other == oUnknown) + result = cAssigned; + else + result = cError; + break; + case 'p': + if (other == oUnknown) + result = cPointer; + else + result = cError; + break; + case 's': + if (other == oUnknown) + result = cString; + else + result = cError; + break; + } + return result; +} + +static OtherType +other_ch(int ch) +{ + OtherType result = oUnknown; + switch (ch) { + case 'h': + result = oShort; + break; + case 'l': + result = oLong; + break; + } + return result; +} +#endif -#if defined(_IOREAD) && defined(_NFILE) /*VARARGS2*/ -int vsscanf(const char *str, const char *format, va_list ap) +NCURSES_EXPORT(int) +vsscanf(const char *str, const char *format, va_list ap) { - /* - * This code should work on anything descended from AT&T SVr1. - */ - FILE strbuf; +#if HAVE_VFSCANF || HAVE__DOSCAN + /* + * This code should work on anything descended from AT&T SVr1. + */ + FILE strbuf; - strbuf._flag = _IOREAD; - strbuf._ptr = strbuf._base = (unsigned char*)str; - strbuf._cnt = strlen(str); - strbuf._file = _NFILE; + strbuf._flag = _IOREAD; + strbuf._ptr = strbuf._base = (unsigned char *) str; + strbuf._cnt = strlen(str); + strbuf._file = _NFILE; #if HAVE_VFSCANF - return(vfscanf(&strbuf, format, ap)); + return (vfscanf(&strbuf, format, ap)); #else - return(_doscan(&strbuf, format, ap)); + return (_doscan(&strbuf, format, ap)); #endif -} #else -/*VARARGS2*/ -int vsscanf(const char *str, const char *format, va_list ap) -{ - /* - * You don't have a native vsscanf(3), and you don't have System-V - * compatible stdio internals. You're probably using a BSD - * older than 4.4 or a really old Linux. You lose. Upgrade - * to a current C library to win. - */ - return -1; /* not implemented */ -} + static int can_convert = -1; + + int assigned = 0; + int consumed = 0; + + T((T_CALLED("vsscanf(%s,%s,...)"), + _nc_visbuf2(1, str), + _nc_visbuf2(2, format))); + + /* + * This relies on having a working "%n" format conversion. Check if it + * works. Only very old C libraries do not support it. + * + * FIXME: move this check into the configure script. + */ + if (can_convert < 0) { + int check1; + int check2; + if (sscanf("123", "%d%n", &check1, &check2) > 0 + && check1 == 123 + && check2 == 3) { + can_convert = 1; + } else { + can_convert = 0; + } + } + + if (can_convert) { + size_t len_fmt = strlen(format) + 32; + char *my_fmt = malloc(len_fmt); + ChunkType chunk, ctest; + OtherType other, otest; + ScanState state; + unsigned n; + int eaten; + void *pointer; + + if (my_fmt != 0) { + /* + * Split the original format into chunks, adding a "%n" to the end + * of each (except of course if it used %n), and use that + * information to decide where to start scanning the next chunk. + * + * FIXME: does %n count bytes or characters? If the latter, this + * will require further work for multibyte strings. + */ + while (*format != '\0') { + /* find a chunk */ + state = sUnknown; + chunk = cUnknown; + other = cUnknown; + pointer = 0; + for (n = 0; format[n] != 0 && state != sFinal; ++n) { + my_fmt[n] = format[n]; + switch (state) { + case sUnknown: + if (format[n] == '%') + state = sPercent; + break; + case sPercent: + if (format[n] == '%') { + state = sUnknown; + } else if (format[n] == L_SQUARE) { + state = sLeft; + } else { + state = sNormal; + --n; + } + break; + case sLeft: + state = sRange; + if (format[n] == '^') { + ++n; + my_fmt[n] = format[n]; + } + break; + case sRange: + if (format[n] == R_SQUARE) { + state = sFinal; + chunk = cRange; + } + break; + case sNormal: + if (format[n] == '*') { + state = sUnknown; + } else { + if ((ctest = final_ch(format[n], other)) != cUnknown) { + state = sFinal; + chunk = ctest; + } else if ((otest = other_ch(format[n])) != oUnknown) { + other = otest; + } else if (isalpha(format[n])) { + state = sFinal; + chunk = cError; + } + } + break; + case sFinal: + break; + } + } + my_fmt[n] = '\0'; + format += n; + + if (chunk == cUnknown + || chunk == cError) { + if (assigned == 0) + assigned = EOF; + break; + } + + /* add %n, if the format was not that */ + if (chunk != cAssigned) { + strcat(my_fmt, "%n"); + } + + switch (chunk) { + case cAssigned: + strcat(my_fmt, "%n"); + pointer = &eaten; + break; + case cInt: + pointer = va_arg(ap, int *); + break; + case cShort: + pointer = va_arg(ap, short *); + break; + case cFloat: + pointer = va_arg(ap, float *); + break; + case cDouble: + pointer = va_arg(ap, double *); + break; + case cLong: + pointer = va_arg(ap, long *); + break; + case cPointer: + pointer = va_arg(ap, void *); + break; + case cChar: + case cRange: + case cString: + pointer = va_arg(ap, char *); + break; + case cError: + case cUnknown: + break; + } + /* do the conversion */ + T(("...converting chunk #%d type %d(%s,%s)", + assigned + 1, chunk, + _nc_visbuf2(1, str + consumed), + _nc_visbuf2(2, my_fmt))); + if (sscanf(str + consumed, my_fmt, pointer, &eaten) > 0) + consumed += eaten; + else + break; + ++assigned; + } + free(my_fmt); + } + } + returnCode(assigned); #endif +} #else -extern void _nc_vsscanf(void); /* quiet's gcc warning */ -void _nc_vsscanf(void) { } /* nonempty for strict ANSI compilers */ +extern +NCURSES_EXPORT(void) +_nc_vsscanf(void); /* quiet's gcc warning */ +NCURSES_EXPORT(void) +_nc_vsscanf(void) +{ +} /* nonempty for strict ANSI compilers */ #endif /* !HAVE_VSSCANF */ diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c index 8121ff15..a61742a5 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,38 +27,75 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996,1997 * + * Author: Thomas E. Dickey 1996-2002 * ****************************************************************************/ #include -MODULE_ID("$Id: wresize.c,v 1.16 2000/03/05 00:14:35 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.23 2002/09/28 15:15:51 tom Exp $") + +static int +cleanup_lines(struct ldat *data, int length) +{ + while (--length >= 0) + free(data->text); + free(data); + return ERR; +} + +/* + * If we have reallocated the ldat structs, we will have to repair pointers + * used in subwindows. + */ +static void +repair_subwindows(WINDOW *cmp) +{ + WINDOWLIST *wp; + struct ldat *pline = cmp->_line; + int row; + + for (wp = _nc_windows; wp != 0; wp = wp->next) { + WINDOW *tst = &(wp->win); + + if (tst->_parent == cmp) { + + if (tst->_pary > cmp->_maxy) + tst->_pary = cmp->_maxy; + if (tst->_parx > cmp->_maxx) + tst->_parx = cmp->_maxx; + + if (tst->_maxy + tst->_pary > cmp->_maxy) + tst->_maxy = cmp->_maxy - tst->_pary; + if (tst->_maxx + tst->_parx > cmp->_maxx) + tst->_maxx = cmp->_maxx - tst->_parx; + + for (row = 0; row <= tst->_maxy; ++row) { + tst->_line[row].text = &pline[tst->_pary + row].text[tst->_parx]; + } + repair_subwindows(tst); + } + } +} /* * Reallocate a curses WINDOW struct to either shrink or grow to the specified * new lines/columns. If it grows, the new character cells are filled with * blanks. The application is responsible for repainting the blank area. */ - -#define DOALLOC(p,t,n) typeRealloc(t, n, p) -#define ld_ALLOC(p,n) DOALLOC(p,struct ldat,n) -#define c_ALLOC(p,n) DOALLOC(p,chtype,n) - -int +NCURSES_EXPORT(int) wresize(WINDOW *win, int ToLines, int ToCols) { - register int row; - int size_x, size_y; + int col, row, size_x, size_y; struct ldat *pline; - chtype blank; + struct ldat *new_lines = 0; #ifdef TRACE T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols)); if (win) { TR(TRACE_UPDATE, ("...beg (%d, %d), max(%d,%d), reg(%d,%d)", - win->_begy, win->_begx, - win->_maxy, win->_maxx, - win->_regtop, win->_regbottom)); + win->_begy, win->_begx, + win->_maxy, win->_maxx, + win->_regtop, win->_regbottom)); if (_nc_tracing & TRACE_UPDATE) _tracedump("...before", win); } @@ -90,65 +127,82 @@ wresize(WINDOW *win, int ToLines, int ToCols) } /* - * If the number of lines has changed, adjust the size of the overall - * vector: + * Allocate new memory as needed. Do the allocations without modifying + * the original window, in case an allocation fails. Always allocate + * (at least temporarily) the array pointing to the individual lines. + */ + new_lines = typeCalloc(struct ldat, (unsigned) (ToLines + 1)); + if (new_lines == 0) + returnCode(ERR); + + /* + * For each line in the target, allocate or adjust pointers for the + * corresponding text, depending on whether this is a window or a + * subwindow. */ - if (ToLines != size_y) { + for (row = 0; row <= ToLines; ++row) { + int begin = (row > size_y) ? 0 : (size_x + 1); + int end = ToCols; + NCURSES_CH_T *s; + if (!(win->_flags & _SUBWIN)) { - for (row = ToLines + 1; row <= size_y; row++) - free((char *) (win->_line[row].text)); + if (row <= size_y) { + if (ToCols != size_x) { + if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0) + returnCode(cleanup_lines(new_lines, row)); + for (col = 0; col <= ToCols; ++col) { + s[col] = (col <= size_x + ? win->_line[row].text[col] + : win->_nc_bkgd); + } + } else { + s = win->_line[row].text; + } + } else { + if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0) + returnCode(cleanup_lines(new_lines, row)); + for (col = 0; col <= ToCols; ++col) + s[col] = win->_nc_bkgd; + } + } else { + s = &pline[win->_pary + row].text[win->_parx]; } - win->_line = ld_ALLOC(win->_line, ToLines + 1); - if (win->_line == 0) - returnCode(ERR); - - for (row = size_y + 1; row <= ToLines; row++) { - win->_line[row].text = 0; - win->_line[row].firstchar = 0; - win->_line[row].lastchar = ToCols; - if ((win->_flags & _SUBWIN)) { - win->_line[row].text = - &pline[win->_pary + row].text[win->_parx]; + if_USE_SCROLL_HINTS(new_lines[row].oldindex = row); + if (row <= size_y) { + new_lines[row].firstchar = win->_line[row].firstchar; + new_lines[row].lastchar = win->_line[row].lastchar; + } + if ((ToCols != size_x) || (row > size_y)) { + if (end >= begin) { /* growing */ + if (new_lines[row].firstchar < begin) + new_lines[row].firstchar = begin; + } else { /* shrinking */ + new_lines[row].firstchar = 0; } + new_lines[row].lastchar = ToCols; } + new_lines[row].text = s; } /* - * Adjust the width of the columns: + * Dispose of unwanted memory. */ - blank = _nc_background(win); - for (row = 0; row <= ToLines; row++) { - chtype *s = win->_line[row].text; - int begin = (s == 0) ? 0 : size_x + 1; - int end = ToCols; - - if_USE_SCROLL_HINTS(win->_line[row].oldindex = row); - - if (ToCols != size_x || s == 0) { - if (!(win->_flags & _SUBWIN)) { - win->_line[row].text = s = c_ALLOC(s, ToCols + 1); - if (win->_line[row].text == 0) - returnCode(ERR); - } else if (s == 0) { - win->_line[row].text = s = - &pline[win->_pary + row].text[win->_parx]; + if (!(win->_flags & _SUBWIN)) { + if (ToCols == size_x) { + for (row = ToLines + 1; row <= size_y; row++) { + free(win->_line[row].text); } - - if (end >= begin) { /* growing */ - if (win->_line[row].firstchar < begin) - win->_line[row].firstchar = begin; - win->_line[row].lastchar = ToCols; - do { - s[end] = blank; - } while (--end >= begin); - } else { /* shrinking */ - win->_line[row].firstchar = 0; - win->_line[row].lastchar = ToCols; + } else { + for (row = 0; row <= size_y; row++) { + free(win->_line[row].text); } } } + free(win->_line); + win->_line = new_lines; + /* * Finally, adjust the parameters showing screen size and cursor * position: @@ -167,11 +221,17 @@ wresize(WINDOW *win, int ToLines, int ToCols) if (win->_cury > win->_maxy) win->_cury = win->_maxy; + /* + * Check for subwindows of this one, and readjust pointers to our text, + * if needed. + */ + repair_subwindows(win); + #ifdef TRACE TR(TRACE_UPDATE, ("...beg (%d, %d), max(%d,%d), reg(%d,%d)", - win->_begy, win->_begx, - win->_maxy, win->_maxx, - win->_regtop, win->_regbottom)); + win->_begy, win->_begx, + win->_maxy, win->_maxx, + win->_regtop, win->_regbottom)); if (_nc_tracing & TRACE_UPDATE) _tracedump("...after:", win); #endif diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index d82e3aad..403cf50d 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,11 +29,12 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-2002 * ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.168 2000/10/08 01:24:59 tom Exp $ + * $Id: curses.priv.h,v 1.228 2002/10/12 15:49:10 tom Exp $ * * curses.priv.h * @@ -45,6 +46,8 @@ #ifndef CURSES_PRIV_H #define CURSES_PRIV_H 1 +#include + #ifdef __cplusplus extern "C" { #endif @@ -108,6 +111,9 @@ extern int errno; #define USE_FUNC_POLL 0 #endif +/* include signal.h before curses.h to work-around defect in glibc 2.1.3 */ +#include + /* Alessandro Rubini's GPM (general-purpose mouse) */ #if HAVE_LIBGPM && HAVE_GPM_H #define USE_GPM_SUPPORT 1 @@ -136,12 +142,15 @@ extern int errno; */ #if !NCURSES_EXT_FUNCS #undef HAVE_SIZECHANGE +#define HAVE_SIZECHANGE 0 #endif -#if HAVE_SIZECHANGE +#if HAVE_SIZECHANGE && defined(SIGWINCH) #define USE_SIZECHANGE 1 #else +#define USE_SIZECHANGE 0 #undef USE_SIGWINCH +#define USE_SIGWINCH 0 #endif /* @@ -152,7 +161,7 @@ extern int errno; #define use_terminfo_vars() 1 #else #define use_terminfo_vars() _nc_env_access() -extern int _nc_env_access(void); +extern NCURSES_EXPORT(int) _nc_env_access (void); #endif /* @@ -163,7 +172,7 @@ extern int _nc_env_access(void); #define memmove(d,s,n) bcopy(s,d,n) #elif USE_MY_MEMMOVE #define memmove(d,s,n) _nc_memmove(d,s,n) -extern void * _nc_memmove(void *, const void *, size_t); +extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); #endif /* @@ -212,6 +221,9 @@ struct tries { #define L_BRACE '{' #define R_BRACE '}' #define S_QUOTE '\'' +#define D_QUOTE '"' + +#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" /* * Structure for palette tables @@ -219,7 +231,9 @@ struct tries { typedef struct { - short red, green, blue; + short red, green, blue; /* what color_content() returns */ + short r, g, b; /* params to init_color() */ + int init; /* true if we called init_color() */ } color_t; @@ -231,7 +245,25 @@ color_t; #define WINDOWLIST struct _win_list +#if USE_WIDEC_SUPPORT +#define _nc_bkgd _bkgrnd +#else +#undef _XOPEN_SOURCE_EXTENDED +#define _nc_bkgd _bkgd +#define wgetbkgrnd(win, wch) *wch = win->_bkgd +#define wbkgrnd wbkgd +#endif + #include /* we'll use -Ipath directive to get the right one! */ +#include + +struct ldat +{ + NCURSES_CH_T *text; /* text of the line */ + NCURSES_SIZE_T firstchar; /* first changed character in the line */ + NCURSES_SIZE_T lastchar; /* last changed character in the line */ + NCURSES_SIZE_T oldindex; /* index of the line at last update */ +}; /* * Structure for soft labels. @@ -249,7 +281,7 @@ typedef struct typedef struct { char dirty; /* all labels have changed */ char hidden; /* soft labels are hidden */ - struct _win_st *win; + WINDOW *win; slk_ent *ent; char* buffer; /* buffer for labels */ short maxlab; /* number of available labels */ @@ -258,6 +290,18 @@ typedef struct { chtype attr; /* soft label attribute */ } SLK; +typedef struct { + unsigned long hashval; + int oldcount, newcount; + int oldindex, newindex; +} HASHMAP; + +typedef struct { + int line; /* lines to take, < 0 => from bottom*/ + int (*hook)(WINDOW *, int); /* callback for user */ + WINDOW *w; /* maybe we need this for cleanup */ +} ripoff_t; + struct screen { int _ifd; /* input file ptr for screen */ FILE *_ofp; /* output file ptr for screen */ @@ -267,8 +311,11 @@ struct screen { struct term *_term; /* terminal type information */ short _lines; /* screen lines */ short _columns; /* screen columns */ + short _lines_avail; /* lines available for stdscr */ short _topstolen; /* lines stolen from top */ + ripoff_t _rippedoff[5]; /* list of lines stolen */ + int _rip_count; /* ...and total lines stolen */ WINDOW *_curscr; /* current screen */ WINDOW *_newscr; /* virtual screen to be updated to */ @@ -276,17 +323,19 @@ struct screen { struct tries *_keytry; /* "Try" for use with keypad mode */ struct tries *_key_ok; /* Disabled keys via keyok(,FALSE) */ - int _tried; /* keypad mode was initialized */ + bool _tried; /* keypad mode was initialized */ + bool _keypad_on; /* keypad mode is currently on */ - unsigned int _fifo[FIFO_SIZE]; /* input push-back buffer */ + int _fifo[FIFO_SIZE]; /* input push-back buffer */ short _fifohead, /* head of fifo queue */ _fifotail, /* tail of fifo queue */ _fifopeek, /* where to peek for next char */ _fifohold; /* set if breakout marked */ int _endwin; /* are we out of window mode? */ - unsigned long _current_attr; /* terminal attribute current set */ + attr_t _current_attr; /* terminal attribute current set */ int _coloron; /* is color enabled? */ + int _color_defs; /* are colors modified */ int _cursor; /* visibility of the cursor */ int _cursrow; /* physical cursor row */ int _curscol; /* physical cursor column */ @@ -409,28 +458,34 @@ struct screen { /* hashes for old and new lines */ unsigned long *oldhash, *newhash; + HASHMAP *hashtab; + int hashtab_len; bool _cleanup; /* cleanup after int/quit signal */ int (*_outch)(int); /* output handler if not putc */ }; -extern SCREEN *_nc_screen_chain; +extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain; #if NCURSES_NOMACROS #include #endif +/* + * The margins are used in resizeterm() to retain the original layout after + * resizing. + */ WINDOWLIST { WINDOWLIST *next; - WINDOW *win; +#if HAVE_RESIZETERM + int l_margin; + int r_margin; + int t_margin; + int b_margin; +#endif + WINDOW win; }; -typedef struct { - int line; /* lines to take, < 0 => from bottom*/ - int (*hook)(struct _win_st *, int); /* callback for user */ - struct _win_st *w; /* maybe we need this for cleanup */ -} ripoff_t; - /* The terminfo source is assumed to be 7-bit ASCII */ #define is7bits(c) ((unsigned)(c) < 128) @@ -484,10 +539,89 @@ typedef struct { #define O_BINARY 0 #endif -#define TextOf(c) ((c) & (chtype)A_CHARTEXT) -#define AttrOf(c) ((c) & (chtype)A_ATTRIBUTES) - -#define BLANK (' '|A_NORMAL) +#define UChar(c) ((unsigned char)(c)) +#define ChCharOf(c) ((c) & (chtype)A_CHARTEXT) +#define ChAttrOf(c) ((c) & (chtype)A_ATTRIBUTES) + +#if USE_WIDEC_SUPPORT /* { */ +#define CharOf(c) ((c).chars[0]) +#define AttrOf(c) ((c).attr) +#define AddAttr(c,a) (c).attr |= a +#define RemAttr(c,a) (c).attr &= ~(a) +#define SetAttr(c,a) (c).attr = a +#define NewChar(ch) { ChAttrOf(ch), { ChCharOf(ch) } } +#define NewChar2(c,a) { a, { c } } +#define CharEq(a,b) (!memcmp(&a, &b, sizeof(a))) +#define SetChar(ch,c,a) do { \ + NCURSES_CH_T *_cp = &ch; \ + memset(_cp,0,sizeof(ch)); _cp->chars[0] = c; _cp->attr = a; \ + } while (0) +#define CHREF(wch) (&wch) +#define CHDEREF(wch) (*wch) +#define ARG_CH_T NCURSES_CH_T * +#define CARG_CH_T const NCURSES_CH_T * +#define PUTC_DATA char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \ + mbstate_t PUT_st; wchar_t PUTC_ch +#define PUTC(ch,b) do { if(!isnac(ch)) { \ + memset (&PUT_st, '\0', sizeof (PUT_st)); \ + PUTC_i = 0; \ + do { \ + PUTC_ch = PUTC_i < CCHARW_MAX ? \ + (ch).chars[PUTC_i] : L'\0'; \ + PUTC_n = wcrtomb(PUTC_buf, \ + (ch).chars[PUTC_i], &PUT_st); \ + if (PUTC_ch == L'\0') \ + --PUTC_n; \ + if (PUTC_n <= 0) \ + break; \ + fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b); \ + ++PUTC_i; \ + } while (PUTC_ch != L'\0'); \ + } } while (0) + +#define BLANK { WA_NORMAL, ' ' } +#define ISBLANK(ch) ((ch).chars[0] == L' ' && (ch).chars[1] == L'\0') + +#define WA_NAC 1 +#define isnac(ch) (AttrOf(ch) & WA_NAC) +#define if_WIDEC(code) code +#define Charable(ch) (!isnac(ch) && \ + (ch).chars[1] == L'\0' && \ + (wctob(CharOf(ch)) == (char)CharOf(ch))) + +#define L(ch) L ## ch +#else /* }{ */ +#define CharOf(c) ChCharOf(c) +#define AttrOf(c) ChAttrOf(c) +#define AddAttr(c,a) c |= a +#define RemAttr(c,a) c &= ~(a & A_ATTRIBUTES) +#define SetAttr(c,a) c = (c & ~A_ATTRIBUTES) | a +#define NewChar(ch) (ch) +#define NewChar2(c,a) (c | a) +#define CharEq(a,b) (a == b) +#define SetChar(ch,c,a) ch = c | a +#define CHREF(wch) wch +#define CHDEREF(wch) wch +#define ARG_CH_T NCURSES_CH_T +#define CARG_CH_T NCURSES_CH_T +#define PUTC_DATA int data = 0 +#define PUTC(a,b) do { data = CharOf(ch); putc(data,b); } while (0) + +#define BLANK (' '|A_NORMAL) +#define ISBLANK(ch) (CharOf(ch) == ' ') + +#define isnac(ch) (0) +#define if_WIDEC(code) /* nothing */ + +#define L(ch) ch +#endif /* } */ + +#define AttrOfD(ch) AttrOf(CHDEREF(ch)) +#define CharOfD(ch) CharOf(CHDEREF(ch)) +#define SetChar2(wch,ch) SetChar(wch,ChCharOf(ch),ChAttrOf(ch)) + +#define BLANK_ATTR A_NORMAL +#define BLANK_TEXT L(' ') #define CHANGED -1 @@ -529,52 +663,89 @@ typedef struct { * instrument the public functions so that the traces can be easily transformed * into regression scripts. */ -#define T_CALLED(fmt) "called " fmt -#define T_CREATE(fmt) "create " fmt -#define T_RETURN(fmt) "return " fmt +#define T_CALLED(fmt) "called {" fmt +#define T_CREATE(fmt) "create :" fmt +#define T_RETURN(fmt) "return }" fmt #ifdef TRACE + +#define START_TRACE() \ + if ((_nc_tracing & TRACE_MAXIMUM) == 0) { \ + int t = _nc_getenv_num("NCURSES_TRACE"); \ + if (t >= 0) \ + trace((unsigned) t); \ + } + #define TR(n, a) if (_nc_tracing & (n)) _tracef a #define T(a) TR(TRACE_CALLS, a) #define TPUTS_TRACE(s) _nc_tputs_trace = s; #define TRACE_RETURN(value,type) return _nc_retrace_##type(value) + #define returnAttr(code) TRACE_RETURN(code,attr_t) #define returnChar(code) TRACE_RETURN(code,chtype) +#define returnBool(code) TRACE_RETURN(code,bool) +#define returnBits(code) TRACE_RETURN(code,unsigned) #define returnCode(code) TRACE_RETURN(code,int) #define returnPtr(code) TRACE_RETURN(code,ptr) +#define returnSP(code) TRACE_RETURN(code,sp) #define returnVoid T((T_RETURN(""))); return #define returnWin(code) TRACE_RETURN(code,win) -extern WINDOW * _nc_retrace_win(WINDOW *); -extern attr_t _nc_retrace_attr_t(attr_t); -extern attr_t _nc_retrace_chtype(chtype); -extern char *_nc_retrace_ptr(char *); -extern const char *_nc_tputs_trace; -extern int _nc_retrace_int(int); -extern long _nc_outchars; -extern void _nc_fifo_dump(void); -#else + +extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (NCURSES_BOOL); +extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); +extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *); +extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t); +extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *); +extern NCURSES_EXPORT(char *) _nc_trace_ttymode(TTY *tty); +extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list); +extern NCURSES_EXPORT(chtype) _nc_retrace_chtype (chtype); +extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype); +extern NCURSES_EXPORT(int) _nc_retrace_int (int); +extern NCURSES_EXPORT(unsigned) _nc_retrace_unsigned (unsigned); +extern NCURSES_EXPORT(void) _nc_fifo_dump (void); +extern NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace; +extern NCURSES_EXPORT_VAR(long) _nc_outchars; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; + +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(const char *) _nc_viswbuf2 (int, const wchar_t *); +extern NCURSES_EXPORT(const char *) _nc_viswbufn (const wchar_t *, int); +extern NCURSES_EXPORT(const char *) _nc_viscbuf2 (int, const cchar_t *, int); +extern NCURSES_EXPORT(const char *) _nc_viscbuf (const cchar_t *, int); +#endif + +#else /* !TRACE */ + +#define START_TRACE() /* nothing */ + #define T(a) #define TR(n, a) #define TPUTS_TRACE(s) + #define returnAttr(code) return code +#define returnBits(code) return code +#define returnBool(code) return code #define returnChar(code) return code #define returnCode(code) return code #define returnPtr(code) return code +#define returnSP(code) return code #define returnVoid return #define returnWin(code) return code -#endif -extern unsigned _nc_tracing; -extern const char *_nc_visbuf2(int, const char *); +#endif /* TRACE/!TRACE */ -#define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch)) +extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); +extern NCURSES_EXPORT(const char *) _nc_visbufn (const char *, int); + +#define empty_module(name) \ +extern NCURSES_EXPORT(void) name (void); \ + NCURSES_EXPORT(void) name (void) { } #define ALL_BUT_COLOR ((chtype)~(A_COLOR)) #define IGNORE_COLOR_OFF FALSE #define NONBLANK_ATTR (A_BOLD|A_DIM|A_BLINK) #define XMC_CHANGES(c) ((c) & SP->_xmc_suppress) - #define toggle_attr_on(S,at) {\ if (PAIR_NUMBER(at) > 0)\ (S) = ((S) & ALL_BUT_COLOR) | (at);\ @@ -614,13 +785,12 @@ extern const char *_nc_visbuf2(int, const char *); : INFINITY))) #if USE_XMC_SUPPORT -#define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \ +#define UpdateAttrs(a) if (SP->_current_attr != (a)) { \ attr_t chg = SP->_current_attr; \ - vidattr(AttrOf(c)); \ + vidattr((a)); \ if (magic_cookie_glitch > 0 \ && XMC_CHANGES((chg ^ SP->_current_attr))) { \ - TR(TRACE_ATTRS, \ - ("%s @%d before glitch %d,%d", \ + T(("%s @%d before glitch %d,%d", \ __FILE__, __LINE__, \ SP->_cursrow, \ SP->_curscol)); \ @@ -628,35 +798,48 @@ extern const char *_nc_visbuf2(int, const char *); } \ } #else -#define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) \ - vidattr(AttrOf(c)) +#define UpdateAttrs(a) if (SP->_current_attr != (a)) \ + vidattr((a)); +#endif + +/* + * Macros to make additional parameter to implement wgetch_events() + */ +#ifdef NCURSES_WGETCH_EVENTS +#define EVENTLIST_0th(param) param +#define EVENTLIST_1st(param) param +#define EVENTLIST_2nd(param) , param +#else +#define EVENTLIST_0th(param) void +#define EVENTLIST_1st(param) /* nothing */ +#define EVENTLIST_2nd(param) /* nothing */ #endif #if NCURSES_EXPANDED && NCURSES_EXT_FUNCS #undef toggle_attr_on #define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at) -extern void _nc_toggle_attr_on(attr_t *, attr_t); +extern NCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *, attr_t); #undef toggle_attr_off #define toggle_attr_off(S,at) _nc_toggle_attr_off(&(S), at) -extern void _nc_toggle_attr_off(attr_t *, attr_t); +extern NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *, attr_t); #undef DelCharCost #define DelCharCost(count) _nc_DelCharCost(count) -extern int _nc_DelCharCost(int); +extern NCURSES_EXPORT(int) _nc_DelCharCost (int); #undef InsCharCost #define InsCharCost(count) _nc_InsCharCost(count) -extern int _nc_InsCharCost(int); +extern NCURSES_EXPORT(int) _nc_InsCharCost (int); #undef UpdateAttrs #define UpdateAttrs(c) _nc_UpdateAttrs(c) -extern void _nc_UpdateAttrs(chtype); +extern NCURSES_EXPORT(void) _nc_UpdateAttrs (chtype); #else -extern void _nc_expanded(void); +extern NCURSES_EXPORT(void) _nc_expanded (void); #endif @@ -666,37 +849,53 @@ extern void _nc_expanded(void); /* doupdate.c */ #if USE_XMC_SUPPORT -extern void _nc_do_xmc_glitch(attr_t); +extern NCURSES_EXPORT(void) _nc_do_xmc_glitch (attr_t); #endif /* hardscroll.c */ #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) -extern void _nc_linedump(void); +extern NCURSES_EXPORT(void) _nc_linedump (void); #endif /* lib_acs.c */ -extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */ -extern int _nc_msec_cost(const char *const, int); /* used by 'tack' program */ +extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ +extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */ + +/* lib_addstr.c */ +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *); +#endif + +/* lib_color.c */ +extern NCURSES_EXPORT(bool) _nc_reset_colors(void); + +/* lib_getch.c */ +extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *)); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ -extern void _nc_mvcur_init(void); -extern void _nc_mvcur_resume(void); -extern void _nc_mvcur_wrap(void); +extern NCURSES_EXPORT(void) _nc_mvcur_init (void); +extern NCURSES_EXPORT(void) _nc_mvcur_resume (void); +extern NCURSES_EXPORT(void) _nc_mvcur_wrap (void); -extern int _nc_scrolln(int, int, int, int); +extern NCURSES_EXPORT(int) _nc_scrolln (int, int, int, int); -extern void _nc_screen_init(void); -extern void _nc_screen_resume(void); -extern void _nc_screen_wrap(void); +extern NCURSES_EXPORT(void) _nc_screen_init (void); +extern NCURSES_EXPORT(void) _nc_screen_resume (void); +extern NCURSES_EXPORT(void) _nc_screen_wrap (void); /* lib_mouse.c */ -extern int _nc_has_mouse(void); +extern NCURSES_EXPORT(int) _nc_has_mouse (void); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ +/* lib_wacs.c */ +#if USE_WIDEC_SUPPORT +extern NCURSES_EXPORT(void) _nc_init_wacs(void); +#endif + typedef struct { char *s_head; char *s_tail; @@ -704,78 +903,93 @@ typedef struct { } string_desc; /* strings.c */ -extern string_desc *_nc_str_init(string_desc * dst, char *src, size_t len); -extern string_desc *_nc_str_null(string_desc * dst, size_t len); -extern string_desc *_nc_str_copy(string_desc * dst, string_desc * src); -extern bool _nc_safe_strcat(string_desc * dst, const char *src); -extern bool _nc_safe_strcpy(string_desc * dst, const char *src); +extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t); +extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t); +extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *); +extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *); +extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *); -extern void _nc_mvcur_init(void); -extern void _nc_mvcur_resume(void); -extern void _nc_mvcur_wrap(void); +extern NCURSES_EXPORT(void) _nc_mvcur_init (void); +extern NCURSES_EXPORT(void) _nc_mvcur_resume (void); +extern NCURSES_EXPORT(void) _nc_mvcur_wrap (void); -extern int _nc_scrolln(int, int, int, int); +extern NCURSES_EXPORT(int) _nc_scrolln (int, int, int, int); -extern void _nc_screen_init(void); -extern void _nc_screen_resume(void); -extern void _nc_screen_wrap(void); +extern NCURSES_EXPORT(void) _nc_screen_init (void); +extern NCURSES_EXPORT(void) _nc_screen_resume (void); +extern NCURSES_EXPORT(void) _nc_screen_wrap (void); #if !HAVE_STRSTR #define strstr _nc_strstr -extern char *_nc_strstr(const char *, const char *); +extern NCURSES_EXPORT(char *) _nc_strstr (const char *, const char *); #endif /* safe_sprintf.c */ -extern char * _nc_printf_string(const char *fmt, va_list ap); +extern NCURSES_EXPORT(char *) _nc_printf_string (const char *, va_list); /* tries.c */ -extern void _nc_add_to_try(struct tries **tree, const char *str, unsigned short code); -extern char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len); -extern int _nc_remove_key(struct tries **tree, unsigned short code); -extern int _nc_remove_string(struct tries **tree, char *string); +extern NCURSES_EXPORT(void) _nc_add_to_try (struct tries **, const char *, unsigned short); +extern NCURSES_EXPORT(char *) _nc_expand_try (struct tries *, unsigned short, int *, size_t); +extern NCURSES_EXPORT(int) _nc_remove_key (struct tries **, unsigned short); +extern NCURSES_EXPORT(int) _nc_remove_string (struct tries **, char *); /* elsewhere ... */ -extern WINDOW *_nc_makenew(int, int, int, int, int); -extern char *_nc_home_terminfo(void); -extern char *_nc_trace_buf(int, size_t); -extern chtype _nc_background(WINDOW *); -extern chtype _nc_render(WINDOW *, chtype); -extern int _nc_access(const char *, int); -extern int _nc_baudrate(int); -extern int _nc_getenv_num(const char *); -extern int _nc_keypad(bool); -extern int _nc_ospeed(int); -extern int _nc_outch(int); -extern int _nc_setupscreen(short, short const, FILE *); -extern int _nc_timed_wait(int, int, int *); -extern int _nc_waddch_nosync(WINDOW *, const chtype); -extern void _nc_do_color(int, int, bool, int (*)(int)); -extern void _nc_freeall(void); -extern void _nc_freewin(WINDOW *win); -extern void _nc_hash_map(void); -extern void _nc_init_keytry(void); -extern void _nc_keep_tic_dir(const char *); -extern void _nc_make_oldhash(int i); -extern void _nc_flush(void); -extern void _nc_outstr(const char *str); -extern void _nc_scroll_oldhash(int n, int top, int bot); -extern void _nc_scroll_optimize(void); -extern void _nc_scroll_window(WINDOW *, int const, short const, short const, chtype); -extern void _nc_set_buffer(FILE *, bool); -extern void _nc_signal_handler(bool); -extern void _nc_synchook(WINDOW *win); -extern void _nc_trace_tries(struct tries *tree); +extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int); +extern NCURSES_EXPORT(char *) _nc_home_terminfo (void); +extern NCURSES_EXPORT(char *) _nc_trace_buf (int, size_t); +extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T); +extern NCURSES_EXPORT(int) _nc_access (const char *, int); +extern NCURSES_EXPORT(int) _nc_baudrate (int); +extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *); +extern NCURSES_EXPORT(int) _nc_getenv_num (const char *); +extern NCURSES_EXPORT(int) _nc_keypad (bool); +extern NCURSES_EXPORT(int) _nc_ospeed (int); +extern NCURSES_EXPORT(int) _nc_outch (int); +extern NCURSES_EXPORT(int) _nc_setupscreen (short, short const, FILE *); +extern NCURSES_EXPORT(int) _nc_timed_wait(int, int, int * EVENTLIST_2nd(_nc_eventlist *)); +extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T); +extern NCURSES_EXPORT(void) _nc_do_color (int, int, bool, int (*)(int)); +extern NCURSES_EXPORT(void) _nc_flush (void); +extern NCURSES_EXPORT(void) _nc_freeall (void); +extern NCURSES_EXPORT(void) _nc_hash_map (void); +extern NCURSES_EXPORT(void) _nc_init_keytry (void); +extern NCURSES_EXPORT(void) _nc_keep_tic_dir (const char *); +extern NCURSES_EXPORT(void) _nc_make_oldhash (int i); +extern NCURSES_EXPORT(void) _nc_outstr (const char *str); +extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot); +extern NCURSES_EXPORT(void) _nc_scroll_optimize (void); +extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, short const, short const, NCURSES_CH_T); +extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, bool); +extern NCURSES_EXPORT(void) _nc_signal_handler (bool); +extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); +extern NCURSES_EXPORT(void) _nc_trace_tries (struct tries *); #if USE_SIZECHANGE -extern void _nc_update_screensize(void); +extern NCURSES_EXPORT(void) _nc_update_screensize (void); #endif -#if USE_WIDEC_SUPPORT -extern int _nc_utf8_outch(int); +#if HAVE_RESIZETERM +extern NCURSES_EXPORT(void) _nc_resize_margins (WINDOW *); +#else +#define _nc_resize_margins(wp) /* nothing */ +#endif + +#ifdef NCURSES_WGETCH_EVENTS +extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *); +#else +#define wgetch_events(win, evl) wgetch(win) +#define wgetnstr_events(win, str, maxlen, evl) wgetnstr(win, str, maxlen) +#endif + +/* + * Not everyone has vsscanf(), but we'd like to use it for scanw(). + */ +#if !HAVE_VSSCANF +extern int vsscanf(const char *str, const char *format, va_list __arg); #endif /* scroll indices */ -extern int *_nc_oldnums; +extern NCURSES_EXPORT_VAR(int *) _nc_oldnums; #define USE_SETBUF_0 0 @@ -791,27 +1005,26 @@ extern int *_nc_oldnums; */ #if BROKEN_LINKER #define SP _nc_screen() -extern SCREEN *_nc_screen(void); -extern int _nc_alloc_screen(void); -extern void _nc_set_screen(SCREEN *); +extern NCURSES_EXPORT(SCREEN *) _nc_screen (void); +extern NCURSES_EXPORT(int) _nc_alloc_screen (void); +extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *); #else /* current screen is private data; avoid possible linking conflicts too */ -extern SCREEN *SP; +extern NCURSES_EXPORT_VAR(SCREEN *) SP; #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0) #define _nc_set_screen(sp) SP = sp #endif /* - * We don't want to use the lines or columns capabilities internally, - * because if the application is running multiple screens under - * X windows, it's quite possible they could all have type xterm - * but have different sizes! So... + * We don't want to use the lines or columns capabilities internally, because + * if the application is running multiple screens under X, it's quite possible + * they could all have type xterm but have different sizes! So... */ #define screen_lines SP->_lines #define screen_columns SP->_columns -extern int _nc_slk_format; /* != 0 if slk_init() called */ -extern int _nc_slk_initialize(WINDOW *, int); +extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */ +extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); /* * Some constants related to SLK's @@ -829,7 +1042,13 @@ extern int _nc_slk_initialize(WINDOW *, int); #define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC) #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC) -extern int _nc_ripoffline(int line, int (*init)(WINDOW *,int)); +extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int)); + +/* + * Common error messages + */ +#define MSG_NO_MEMORY "Out of memory" +#define MSG_NO_INPUTS "Premature EOF" #ifdef __cplusplus } diff --git a/ncurses/fifo_defs.h b/ncurses/fifo_defs.h index f4dd7be3..67799577 100644 --- a/ncurses/fifo_defs.h +++ b/ncurses/fifo_defs.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ /* * Common macros for lib_getch.c, lib_ungetch.c * - * $Id: fifo_defs.h,v 1.2 1998/02/11 12:13:56 tom Exp $ + * $Id: fifo_defs.h,v 1.4 2002/03/16 20:47:50 tom Exp $ */ #ifndef FIFO_DEFS_H @@ -46,13 +46,13 @@ #define peek SP->_fifopeek #define h_inc() { head == FIFO_SIZE-1 ? head = 0 : head++; if (head == tail) head = -1, tail = 0;} -#define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} +#define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} #define t_inc() { tail == FIFO_SIZE-1 ? tail = 0 : tail++; if (tail == head) tail = -1;} -#define t_dec() { tail == 0 ? tail = FIFO_SIZE-1 : tail--; if (head == tail) fifo_clear();} +#define t_dec() { tail == 0 ? tail = FIFO_SIZE-1 : tail--; if (head == tail) fifo_clear();} #define p_inc() { peek == FIFO_SIZE-1 ? peek = 0 : peek++;} -#define cooked_key_in_fifo() (head!=-1 && peek!=head) -#define raw_key_in_fifo() (head!=-1 && peek!=tail) +#define cooked_key_in_fifo() ((head != -1) && (peek != head)) +#define raw_key_in_fifo() ((head != -1) && (peek != tail)) #undef HIDE_EINTR diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses index 280325ac..1a378196 100644 --- a/ncurses/llib-lncurses +++ b/ncurses/llib-lncurses @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996-2000 * + * Author: Thomas E. Dickey 1996-2001,2002 * ****************************************************************************/ /* LINTLIBRARY */ @@ -48,16 +48,6 @@ void _nc_linedump(void) /* ./tty/hashmap.c */ -#include - -typedef struct -{ - unsigned long hashval; - int oldcount, newcount; - int oldindex, newindex; -} - sym; - #undef _nc_hash_map void _nc_hash_map(void) { /* void */ } @@ -78,11 +68,6 @@ void _nc_scroll_oldhash( #include -#undef _nc_background -chtype _nc_background( - WINDOW *win) - { return(*(chtype *)0); } - #undef _nc_render chtype _nc_render( WINDOW *win, @@ -112,14 +97,14 @@ int wechochar( #undef waddnstr int waddnstr( WINDOW *win, - const char *const astr, + const char *astr, int n) { return(*(int *)0); } #undef waddchnstr int waddchnstr( WINDOW *win, - const chtype *const astr, + const chtype *astr, int n) { return(*(int *)0); } @@ -140,7 +125,7 @@ void wbkgdset( #undef wbkgd int wbkgd( WINDOW *win, - const chtype ch) + chtype ch) { return(*(int *)0); } /* ./base/lib_box.c */ @@ -181,7 +166,7 @@ int wclear( #undef clearok int clearok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_clrbot.c */ @@ -227,12 +212,12 @@ int init_color( { return(*(int *)0); } #undef can_change_color -bool can_change_color(void) - { return(*(bool *)0); } +NCURSES_BOOL can_change_color(void) + { return(*(NCURSES_BOOL *)0); } #undef has_colors -bool has_colors(void) - { return(*(bool *)0); } +NCURSES_BOOL has_colors(void) + { return(*(NCURSES_BOOL *)0); } #undef color_content int color_content( @@ -253,7 +238,7 @@ int pair_content( void _nc_do_color( int old_pair, int pair, - bool reverse, + NCURSES_BOOL reverse, int (*outc)( int p1)) { /* void */ } @@ -1027,11 +1012,11 @@ int wstandend( { return(*(int *)0); } #undef mouse_trafo -bool mouse_trafo( +NCURSES_BOOL mouse_trafo( int *a1, int *a2, - bool z) - { return(*(bool *)0); } + NCURSES_BOOL z) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_getch.c */ @@ -1040,6 +1025,13 @@ bool mouse_trafo( #undef ESCDELAY int ESCDELAY; +#undef _nc_wgetch +int _nc_wgetch( + WINDOW *win, + unsigned long *result, + int use_meta) + { return(*(int *)0); } + #undef wgetch int wgetch( WINDOW *win) @@ -1068,7 +1060,7 @@ int whline( #undef immedok void immedok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { /* void */ } /* ./base/lib_inchstr.c */ @@ -1123,15 +1115,15 @@ int winnstr( /* ./base/lib_isendwin.c */ #undef isendwin -bool isendwin(void) - { return(*(bool *)0); } +NCURSES_BOOL isendwin(void) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_leaveok.c */ #undef leaveok int leaveok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_mouse.c */ @@ -1153,11 +1145,11 @@ mmask_t mousemask( { return(*(mmask_t *)0); } #undef wenclose -bool wenclose( +NCURSES_BOOL wenclose( const WINDOW *win, int y, int x) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef mouseinterval int mouseinterval( @@ -1169,12 +1161,12 @@ int _nc_has_mouse(void) { return(*(int *)0); } #undef wmouse_trafo -bool wmouse_trafo( +NCURSES_BOOL wmouse_trafo( const WINDOW *win, int *pY, int *pX, - bool to_screen) - { return(*(bool *)0); } + NCURSES_BOOL to_screen) + { return(*(NCURSES_BOOL *)0); } /* ./base/lib_move.c */ @@ -1241,9 +1233,9 @@ SCREEN *newterm( /* ./base/lib_newwin.c */ #undef _nc_freewin -void _nc_freewin( +int _nc_freewin( WINDOW *win) - { /* void */ } + { return(*(int *)0); } #undef newwin WINDOW *newwin( @@ -1472,9 +1464,6 @@ int mvwscanw( /* ./base/lib_screen.c */ -#include -#include - #undef getwin WINDOW *getwin( FILE *filep) @@ -1528,7 +1517,7 @@ int wscrl( #undef scrollok int scrollok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_scrreg.c */ @@ -1681,15 +1670,15 @@ int slk_touch(void) /* ./base/lib_touch.c */ #undef is_linetouched -bool is_linetouched( +NCURSES_BOOL is_linetouched( WINDOW *win, int line) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef is_wintouched -bool is_wintouched( +NCURSES_BOOL is_wintouched( WINDOW *win) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef wtouchln int wtouchln( @@ -1717,6 +1706,12 @@ attr_t _nc_retrace_attr_t( attr_t code) { return(*(attr_t *)0); } +#undef _nc_altcharset_name +const char *_nc_altcharset_name( + attr_t attr, + chtype ch) + { return(*(const char **)0); } + #undef _tracechtype2 char *_tracechtype2( int bufnum, @@ -1750,12 +1745,11 @@ char *_tracemouse( /* ./tty/lib_tstp.c */ -#include #include #undef _nc_signal_handler void _nc_signal_handler( - bool enable) + NCURSES_BOOL enable) { /* void */ } /* ./base/lib_ungetch.c */ @@ -1773,14 +1767,14 @@ int ungetch( #undef vidputs int vidputs( - attr_t newmode, + chtype newmode, int (*outc)( int p1)) { return(*(int *)0); } #undef vidattr int vidattr( - attr_t newmode) + chtype newmode) { return(*(int *)0); } #undef termattrs @@ -1838,7 +1832,7 @@ int mvderwin( #undef syncok int syncok( WINDOW *win, - bool bf) + NCURSES_BOOL bf) { return(*(int *)0); } #undef wsyncup @@ -1914,6 +1908,18 @@ void _nc_do_xmc_glitch( attr_t previous) { /* void */ } +/* ./trace/varargs.c */ + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#undef _nc_varargs +char *_nc_varargs( + const char *fmt, + va_list ap) + { return(*(char **)0); } + /* ./base/memmove.c */ #undef _nc_memmove @@ -1982,7 +1988,7 @@ char *keybound( #undef keyok int keyok( int c, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./base/lib_dft_fgbg.c */ @@ -2015,6 +2021,18 @@ int mcprint( /* ./base/resizeterm.c */ +#undef is_term_resized +NCURSES_BOOL is_term_resized( + int ToLines, + int ToCols) + { return(*(NCURSES_BOOL *)0); } + +#undef resize_term +int resize_term( + int ToLines, + int ToCols) + { return(*(int *)0); } + #undef resizeterm int resizeterm( int ToLines, @@ -2067,6 +2085,11 @@ int wresize( /* ./tinfo/access.c */ +#undef _nc_rootname +char *_nc_rootname( + char *path) + { return(*(char **)0); } + #undef _nc_basename char *_nc_basename( char *path) @@ -2110,7 +2133,8 @@ char *_nc_save_str( #undef _nc_wrap_entry void _nc_wrap_entry( - ENTRY *const ep) + ENTRY *const ep, + NCURSES_BOOL copy_strings) { /* void */ } #undef _nc_merge_entry @@ -2137,15 +2161,15 @@ void _nc_copy_termtype( #undef _nc_captoinfo char *_nc_captoinfo( - const char *cap, - const char *s, + const char *cap, + const char *s, int const parametrized) { return(*(char **)0); } #undef _nc_infotocap char *_nc_infotocap( - const char *cap, - const char *str, + const char *cap, + const char *str, int const parametrized) { return(*(char **)0); } @@ -2173,18 +2197,18 @@ const struct alias _nc_infoalias_table[] = {0}; #undef _nc_get_table const struct name_table_entry *_nc_get_table( - bool termcap) + NCURSES_BOOL termcap) { return(*(const struct name_table_entry **)0); } #undef _nc_get_hash_table const struct name_table_entry *const *_nc_get_hash_table( - bool termcap) + NCURSES_BOOL termcap) { return(*(const struct name_table_entry **)0); } /* ./tinfo/comp_error.c */ #undef _nc_suppress_warnings -bool _nc_suppress_warnings; +NCURSES_BOOL _nc_suppress_warnings; #undef _nc_curr_line int _nc_curr_line; #undef _nc_curr_col @@ -2228,7 +2252,7 @@ void _nc_syserr_abort( #undef _nc_tic_expand char *_nc_tic_expand( const char *srcp, - bool tic_format, + NCURSES_BOOL tic_format, int numbers) { return(*(char **)0); } @@ -2265,24 +2289,24 @@ void _nc_free_entries( { /* void */ } #undef _nc_entry_match -bool _nc_entry_match( +NCURSES_BOOL _nc_entry_match( char *n1, char *n2) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_read_entry_source void _nc_read_entry_source( FILE *fp, char *buf, int literal, - bool silent, - bool (*hook)( + NCURSES_BOOL silent, + NCURSES_BOOL (*hook)( ENTRY *p1)) { /* void */ } #undef _nc_resolve_uses int _nc_resolve_uses( - bool fullresolve) + NCURSES_BOOL fullresolve) { return(*(int *)0); } /* ./tinfo/comp_scan.c */ @@ -2300,10 +2324,11 @@ long _nc_start_line; #undef _nc_curr_token struct token _nc_curr_token; #undef _nc_disable_period -bool _nc_disable_period; +NCURSES_BOOL _nc_disable_period; #undef _nc_get_token -int _nc_get_token(void) +int _nc_get_token( + NCURSES_BOOL silent) { return(*(int *)0); } #undef _nc_trans_string @@ -2351,11 +2376,11 @@ void _nc_free_termtype( { /* void */ } #undef _nc_user_definable -bool _nc_user_definable; +NCURSES_BOOL _nc_user_definable; #undef use_extended_names int use_extended_names( - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/getenv_num.c */ @@ -2400,8 +2425,8 @@ void _nc_init_acs(void) #include struct speed { - int s; - int sp; + int s; + int sp; }; #undef _nc_baudrate @@ -2449,12 +2474,12 @@ SCREEN *SP; /* ./tinfo/lib_has_cap.c */ #undef has_ic -bool has_ic(void) - { return(*(bool *)0); } +NCURSES_BOOL has_ic(void) + { return(*(NCURSES_BOOL *)0); } #undef has_il -bool has_il(void) - { return(*(bool *)0); } +NCURSES_BOOL has_il(void) + { return(*(NCURSES_BOOL *)0); } /* ./tinfo/lib_kernel.c */ @@ -2472,10 +2497,6 @@ int flushinp(void) /* ./lib_keyname.c */ -#include -#include -#include - #undef _nc_key_names const struct kn _nc_key_names[] = {0}; @@ -2492,6 +2513,8 @@ char *longname(void) /* ./tinfo/lib_napms.c */ +#include + #undef napms int napms( int ms) @@ -2502,13 +2525,13 @@ int napms( #undef idlok int idlok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef idcok void idcok( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { /* void */ } #undef halfdelay @@ -2519,13 +2542,13 @@ int halfdelay( #undef nodelay int nodelay( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef notimeout int notimeout( WINDOW *win, - bool f) + NCURSES_BOOL f) { return(*(int *)0); } #undef wtimeout @@ -2537,13 +2560,13 @@ void wtimeout( #undef keypad int keypad( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef meta int meta( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } #undef curs_set @@ -2563,7 +2586,7 @@ int has_key( #undef _nc_keypad int _nc_keypad( - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/lib_raw.c */ @@ -2595,7 +2618,7 @@ void noqiflush(void) #undef intrflush int intrflush( WINDOW *win, - bool flag) + NCURSES_BOOL flag) { return(*(int *)0); } /* ./tinfo/lib_setup.c */ @@ -2604,7 +2627,7 @@ int intrflush( #undef use_env void use_env( - bool f) + NCURSES_BOOL f) { /* void */ } #undef LINES @@ -2699,12 +2722,15 @@ char *tigetstr( typedef struct { union { - unsigned int num; + int num; char *str; } data; - bool num_type; + NCURSES_BOOL num_type; } stack_frame; +#undef _nc_tparm_err +int _nc_tparm_err; + #undef tparm char *tparm( char *string, @@ -2716,7 +2742,7 @@ char *tparm( #undef PC char PC; #undef ospeed -short ospeed; +NCURSES_OSPEED ospeed; #undef _nc_nulls_sent int _nc_nulls_sent; @@ -2761,17 +2787,6 @@ void trace( const unsigned int tracelevel) { /* void */ } -#undef _nc_visbuf2 -const char *_nc_visbuf2( - int bufnum, - const char *buf) - { return(*(const char **)0); } - -#undef _nc_visbuf -const char *_nc_visbuf( - const char *buf) - { return(*(const char **)0); } - #undef _tracef void _tracef( const char *fmt, @@ -2788,6 +2803,11 @@ char *_nc_retrace_ptr( char *code) { return(*(char **)0); } +#undef _nc_retrace_sp +SCREEN *_nc_retrace_sp( + SCREEN *code) + { return(*(SCREEN **)0); } + #undef _nc_retrace_win WINDOW *_nc_retrace_win( WINDOW *code) @@ -2800,6 +2820,11 @@ typedef struct { const char *name; } BITNAMES; +#undef _nc_trace_ttymode +char *_nc_trace_ttymode( + struct termios *tty) + { return(*(char **)0); } + #undef _nc_tracebits char *_nc_tracebits(void) { return(*(char **)0); } @@ -2808,7 +2833,7 @@ char *_nc_tracebits(void) #undef _tracechar char *_tracechar( - const unsigned char ch) + int ch) { return(*(char **)0); } /* ./tinfo/lib_ttyflags.c */ @@ -2891,7 +2916,7 @@ char *const strfnames[] = {0}; int _nc_parse_entry( struct entry *entryp, int literal, - bool silent) + NCURSES_BOOL silent) { return(*(int *)0); } #undef _nc_capcmp @@ -2932,16 +2957,18 @@ int _nc_read_entry( /* ./tinfo/read_termcap.c */ -#undef _nc_read_termcap -void _nc_read_termcap(void) - { /* void */ } +#undef _nc_read_termcap_entry +int _nc_read_termcap_entry( + const char *const tn, + TERMTYPE *const tp) + { return(*(int *)0); } /* ./tinfo/setbuf.c */ #undef _nc_set_buffer void _nc_set_buffer( FILE *ofp, - bool buffered) + NCURSES_BOOL buffered) { /* void */ } /* ./tinfo/strings.c */ @@ -2966,22 +2993,22 @@ string_desc *_nc_str_copy( { return(*(string_desc **)0); } #undef _nc_safe_strcat -bool _nc_safe_strcat( +NCURSES_BOOL _nc_safe_strcat( string_desc *dst, const char *src) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } #undef _nc_safe_strcpy -bool _nc_safe_strcpy( +NCURSES_BOOL _nc_safe_strcpy( string_desc *dst, const char *src) - { return(*(bool *)0); } + { return(*(NCURSES_BOOL *)0); } /* ./trace/trace_buf.c */ typedef struct { - char *text; - size_t size; + char *text; + size_t size; } LIST; #undef _nc_trace_buf @@ -3004,6 +3031,19 @@ char *unctrl( chtype ch) { return(*(char **)0); } +/* ./trace/visbuf.c */ + +#undef _nc_visbuf2 +const char *_nc_visbuf2( + int bufnum, + const char *buf) + { return(*(const char **)0); } + +#undef _nc_visbuf +const char *_nc_visbuf( + const char *buf) + { return(*(const char **)0); } + /* ./tinfo/write_entry.c */ #undef _nc_set_writedir diff --git a/ncurses/llib-lncursesw b/ncurses/llib-lncursesw new file mode 100644 index 00000000..7256eb98 --- /dev/null +++ b/ncurses/llib-lncursesw @@ -0,0 +1,3785 @@ +/**************************************************************************** + * Copyright (c) 2001,2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2001,2002 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./tty/hardscroll.c */ + +#include + +#undef _nc_oldnums +int *_nc_oldnums; + +#undef _nc_scroll_optimize +void _nc_scroll_optimize(void) + { /* void */ } + +#undef _nc_linedump +void _nc_linedump(void) + { /* void */ } + +/* ./tty/hashmap.c */ + +#undef _nc_hash_map +void _nc_hash_map(void) + { /* void */ } + +#undef _nc_make_oldhash +void _nc_make_oldhash( + int i) + { /* void */ } + +#undef _nc_scroll_oldhash +void _nc_scroll_oldhash( + int n, + int top, + int bot) + { /* void */ } + +/* ./base/lib_addch.c */ + +#include + +#undef _nc_render +cchar_t _nc_render( + WINDOW *win, + cchar_t ch) + { return(*(cchar_t *)0); } + +#undef _nc_waddch_nosync +int _nc_waddch_nosync( + WINDOW *win, + const cchar_t c) + { return(*(int *)0); } + +#undef waddch +int waddch( + WINDOW *win, + const chtype ch) + { return(*(int *)0); } + +#undef wechochar +int wechochar( + WINDOW *win, + const chtype ch) + { return(*(int *)0); } + +#undef wadd_wch +int wadd_wch( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +#undef wecho_wchar +int wecho_wchar( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +/* ./base/lib_addstr.c */ + +#undef waddnstr +int waddnstr( + WINDOW *win, + const char *astr, + int n) + { return(*(int *)0); } + +#undef waddchnstr +int waddchnstr( + WINDOW *win, + const chtype *astr, + int n) + { return(*(int *)0); } + +#undef _nc_wchstrlen +int _nc_wchstrlen( + const cchar_t *s) + { return(*(int *)0); } + +#undef wadd_wchnstr +int wadd_wchnstr( + WINDOW *win, + const cchar_t *const astr, + int n) + { return(*(int *)0); } + +#undef waddnwstr +int waddnwstr( + WINDOW *win, + const wchar_t *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_beep.c */ + +#undef beep +int beep(void) + { return(*(int *)0); } + +/* ./base/lib_bkgd.c */ + +#undef wbkgrndset +void wbkgrndset( + WINDOW *win, + const cchar_t *ch) + { /* void */ } + +#undef wbkgdset +void wbkgdset( + WINDOW *win, + chtype ch) + { /* void */ } + +#undef wbkgrnd +int wbkgrnd( + WINDOW *win, + const cchar_t *ch) + { return(*(int *)0); } + +#undef wbkgd +int wbkgd( + WINDOW *win, + chtype ch) + { return(*(int *)0); } + +/* ./base/lib_box.c */ + +#undef wborder +int wborder( + WINDOW *win, + chtype ls, + chtype rs, + chtype ts, + chtype bs, + chtype tl, + chtype tr, + chtype bl, + chtype br) + { return(*(int *)0); } + +/* ./base/lib_chgat.c */ + +#undef wchgat +int wchgat( + WINDOW *win, + int n, + attr_t attr, + short color, + const void *opts) + { return(*(int *)0); } + +/* ./base/lib_clear.c */ + +#undef wclear +int wclear( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_clearok.c */ + +#undef clearok +int clearok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_clrbot.c */ + +#undef wclrtobot +int wclrtobot( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_clreol.c */ + +#undef wclrtoeol +int wclrtoeol( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_color.c */ + +#include + +#undef COLOR_PAIRS +int COLOR_PAIRS; +#undef COLORS +int COLORS; + +#undef start_color +int start_color(void) + { return(*(int *)0); } + +#undef init_pair +int init_pair( + short pair, + short f, + short b) + { return(*(int *)0); } + +#undef init_color +int init_color( + short color, + short r, + short g, + short b) + { return(*(int *)0); } + +#undef can_change_color +NCURSES_BOOL can_change_color(void) + { return(*(NCURSES_BOOL *)0); } + +#undef has_colors +NCURSES_BOOL has_colors(void) + { return(*(NCURSES_BOOL *)0); } + +#undef color_content +int color_content( + short color, + short *r, + short *g, + short *b) + { return(*(int *)0); } + +#undef pair_content +int pair_content( + short pair, + short *f, + short *b) + { return(*(int *)0); } + +#undef _nc_do_color +void _nc_do_color( + int old_pair, + int pair, + NCURSES_BOOL reverse, + int (*outc)( + int p1)) + { /* void */ } + +/* ./base/lib_colorset.c */ + +#undef wcolor_set +int wcolor_set( + WINDOW *win, + short color_pair_number, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_delch.c */ + +#undef wdelch +int wdelch( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_delwin.c */ + +#undef delwin +int delwin( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_echo.c */ + +#undef echo +int echo(void) + { return(*(int *)0); } + +#undef noecho +int noecho(void) + { return(*(int *)0); } + +/* ./base/lib_endwin.c */ + +#undef endwin +int endwin(void) + { return(*(int *)0); } + +/* ./base/lib_erase.c */ + +#undef werase +int werase( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_flash.c */ + +#undef flash +int flash(void) + { return(*(int *)0); } + +/* ./lib_gen.c */ + +#undef addch +int addch( + const chtype z) + { return(*(int *)0); } + +#undef addchnstr +int addchnstr( + const chtype *a1, + int z) + { return(*(int *)0); } + +#undef addchstr +int addchstr( + const chtype *z) + { return(*(int *)0); } + +#undef addnstr +int addnstr( + const char *a1, + int z) + { return(*(int *)0); } + +#undef addstr +int addstr( + const char *z) + { return(*(int *)0); } + +#undef attroff +int attroff( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attron +int attron( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attrset +int attrset( + NCURSES_ATTR_T z) + { return(*(int *)0); } + +#undef attr_get +int attr_get( + attr_t *a1, + short *a2, + void *z) + { return(*(int *)0); } + +#undef attr_off +int attr_off( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef attr_on +int attr_on( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef attr_set +int attr_set( + attr_t a1, + short a2, + void *z) + { return(*(int *)0); } + +#undef bkgd +int bkgd( + chtype z) + { return(*(int *)0); } + +#undef bkgdset +void bkgdset( + chtype z) + { /* void */ } + +#undef border +int border( + chtype a1, + chtype a2, + chtype a3, + chtype a4, + chtype a5, + chtype a6, + chtype a7, + chtype z) + { return(*(int *)0); } + +#undef box +int box( + WINDOW *a1, + chtype a2, + chtype z) + { return(*(int *)0); } + +#undef chgat +int chgat( + int a1, + attr_t a2, + short a3, + const void *z) + { return(*(int *)0); } + +#undef clear +int clear(void) + { return(*(int *)0); } + +#undef clrtobot +int clrtobot(void) + { return(*(int *)0); } + +#undef clrtoeol +int clrtoeol(void) + { return(*(int *)0); } + +#undef color_set +int color_set( + short a1, + void *z) + { return(*(int *)0); } + +#undef COLOR_PAIR +int COLOR_PAIR( + int z) + { return(*(int *)0); } + +#undef delch +int delch(void) + { return(*(int *)0); } + +#undef deleteln +int deleteln(void) + { return(*(int *)0); } + +#undef echochar +int echochar( + const chtype z) + { return(*(int *)0); } + +#undef erase +int erase(void) + { return(*(int *)0); } + +#undef getbkgd +chtype getbkgd( + WINDOW *z) + { return(*(chtype *)0); } + +#undef getch +int getch(void) + { return(*(int *)0); } + +#undef getnstr +int getnstr( + char *a1, + int z) + { return(*(int *)0); } + +#undef getstr +int getstr( + char *z) + { return(*(int *)0); } + +#undef hline +int hline( + chtype a1, + int z) + { return(*(int *)0); } + +#undef inch +chtype inch(void) + { return(*(chtype *)0); } + +#undef inchnstr +int inchnstr( + chtype *a1, + int z) + { return(*(int *)0); } + +#undef inchstr +int inchstr( + chtype *z) + { return(*(int *)0); } + +#undef innstr +int innstr( + char *a1, + int z) + { return(*(int *)0); } + +#undef insch +int insch( + chtype z) + { return(*(int *)0); } + +#undef insdelln +int insdelln( + int z) + { return(*(int *)0); } + +#undef insertln +int insertln(void) + { return(*(int *)0); } + +#undef insnstr +int insnstr( + const char *a1, + int z) + { return(*(int *)0); } + +#undef insstr +int insstr( + const char *z) + { return(*(int *)0); } + +#undef instr +int instr( + char *z) + { return(*(int *)0); } + +#undef move +int move( + int a1, + int z) + { return(*(int *)0); } + +#undef mvaddch +int mvaddch( + int a1, + int a2, + const chtype z) + { return(*(int *)0); } + +#undef mvaddchnstr +int mvaddchnstr( + int a1, + int a2, + const chtype *a3, + int z) + { return(*(int *)0); } + +#undef mvaddchstr +int mvaddchstr( + int a1, + int a2, + const chtype *z) + { return(*(int *)0); } + +#undef mvaddnstr +int mvaddnstr( + int a1, + int a2, + const char *a3, + int z) + { return(*(int *)0); } + +#undef mvaddstr +int mvaddstr( + int a1, + int a2, + const char *z) + { return(*(int *)0); } + +#undef mvchgat +int mvchgat( + int a1, + int a2, + int a3, + attr_t a4, + short a5, + const void *z) + { return(*(int *)0); } + +#undef mvdelch +int mvdelch( + int a1, + int z) + { return(*(int *)0); } + +#undef mvgetch +int mvgetch( + int a1, + int z) + { return(*(int *)0); } + +#undef mvgetnstr +int mvgetnstr( + int a1, + int a2, + char *a3, + int z) + { return(*(int *)0); } + +#undef mvgetstr +int mvgetstr( + int a1, + int a2, + char *z) + { return(*(int *)0); } + +#undef mvhline +int mvhline( + int a1, + int a2, + chtype a3, + int z) + { return(*(int *)0); } + +#undef mvinch +chtype mvinch( + int a1, + int z) + { return(*(chtype *)0); } + +#undef mvinchnstr +int mvinchnstr( + int a1, + int a2, + chtype *a3, + int z) + { return(*(int *)0); } + +#undef mvinchstr +int mvinchstr( + int a1, + int a2, + chtype *z) + { return(*(int *)0); } + +#undef mvinnstr +int mvinnstr( + int a1, + int a2, + char *a3, + int z) + { return(*(int *)0); } + +#undef mvinsch +int mvinsch( + int a1, + int a2, + chtype z) + { return(*(int *)0); } + +#undef mvinsnstr +int mvinsnstr( + int a1, + int a2, + const char *a3, + int z) + { return(*(int *)0); } + +#undef mvinsstr +int mvinsstr( + int a1, + int a2, + const char *z) + { return(*(int *)0); } + +#undef mvinstr +int mvinstr( + int a1, + int a2, + char *z) + { return(*(int *)0); } + +#undef mvvline +int mvvline( + int a1, + int a2, + chtype a3, + int z) + { return(*(int *)0); } + +#undef mvwaddch +int mvwaddch( + WINDOW *a1, + int a2, + int a3, + const chtype z) + { return(*(int *)0); } + +#undef mvwaddchnstr +int mvwaddchnstr( + WINDOW *a1, + int a2, + int a3, + const chtype *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddchstr +int mvwaddchstr( + WINDOW *a1, + int a2, + int a3, + const chtype *z) + { return(*(int *)0); } + +#undef mvwaddnstr +int mvwaddnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddstr +int mvwaddstr( + WINDOW *a1, + int a2, + int a3, + const char *z) + { return(*(int *)0); } + +#undef mvwchgat +int mvwchgat( + WINDOW *a1, + int a2, + int a3, + int a4, + attr_t a5, + short a6, + const void *z) + { return(*(int *)0); } + +#undef mvwdelch +int mvwdelch( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef mvwgetch +int mvwgetch( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef mvwgetnstr +int mvwgetnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, + int z) + { return(*(int *)0); } + +#undef mvwgetstr +int mvwgetstr( + WINDOW *a1, + int a2, + int a3, + char *z) + { return(*(int *)0); } + +#undef mvwhline +int mvwhline( + WINDOW *a1, + int a2, + int a3, + chtype a4, + int z) + { return(*(int *)0); } + +#undef mvwinch +chtype mvwinch( + WINDOW *a1, + int a2, + int z) + { return(*(chtype *)0); } + +#undef mvwinchnstr +int mvwinchnstr( + WINDOW *a1, + int a2, + int a3, + chtype *a4, + int z) + { return(*(int *)0); } + +#undef mvwinchstr +int mvwinchstr( + WINDOW *a1, + int a2, + int a3, + chtype *z) + { return(*(int *)0); } + +#undef mvwinnstr +int mvwinnstr( + WINDOW *a1, + int a2, + int a3, + char *a4, + int z) + { return(*(int *)0); } + +#undef mvwinsch +int mvwinsch( + WINDOW *a1, + int a2, + int a3, + chtype z) + { return(*(int *)0); } + +#undef mvwinsnstr +int mvwinsnstr( + WINDOW *a1, + int a2, + int a3, + const char *a4, + int z) + { return(*(int *)0); } + +#undef mvwinsstr +int mvwinsstr( + WINDOW *a1, + int a2, + int a3, + const char *z) + { return(*(int *)0); } + +#undef mvwinstr +int mvwinstr( + WINDOW *a1, + int a2, + int a3, + char *z) + { return(*(int *)0); } + +#undef mvwvline +int mvwvline( + WINDOW *a1, + int a2, + int a3, + chtype a4, + int z) + { return(*(int *)0); } + +#undef PAIR_NUMBER +int PAIR_NUMBER( + int z) + { return(*(int *)0); } + +#undef redrawwin +int redrawwin( + WINDOW *z) + { return(*(int *)0); } + +#undef refresh +int refresh(void) + { return(*(int *)0); } + +#undef scrl +int scrl( + int z) + { return(*(int *)0); } + +#undef scroll +int scroll( + WINDOW *z) + { return(*(int *)0); } + +#undef setscrreg +int setscrreg( + int a1, + int z) + { return(*(int *)0); } + +#undef slk_attr_off +int slk_attr_off( + const attr_t a1, + void *z) + { return(*(int *)0); } + +#undef slk_attr_on +int slk_attr_on( + attr_t a1, + void *z) + { return(*(int *)0); } + +#undef standout +int standout(void) + { return(*(int *)0); } + +#undef standend +int standend(void) + { return(*(int *)0); } + +#undef timeout +void timeout( + int z) + { /* void */ } + +#undef touchline +int touchline( + WINDOW *a1, + int a2, + int z) + { return(*(int *)0); } + +#undef touchwin +int touchwin( + WINDOW *z) + { return(*(int *)0); } + +#undef untouchwin +int untouchwin( + WINDOW *z) + { return(*(int *)0); } + +#undef vline +int vline( + chtype a1, + int z) + { return(*(int *)0); } + +#undef vw_printw +int vw_printw( + WINDOW *a1, + char *a2, + va_list z) + { return(*(int *)0); } + +#undef vw_scanw +int vw_scanw( + WINDOW *a1, + char *a2, + va_list z) + { return(*(int *)0); } + +#undef waddchstr +int waddchstr( + WINDOW *a1, + const chtype *z) + { return(*(int *)0); } + +#undef waddstr +int waddstr( + WINDOW *a1, + const char *z) + { return(*(int *)0); } + +#undef wattron +int wattron( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattroff +int wattroff( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattrset +int wattrset( + WINDOW *a1, + int z) + { return(*(int *)0); } + +#undef wattr_get +int wattr_get( + WINDOW *a1, + attr_t *a2, + short *a3, + void *z) + { return(*(int *)0); } + +#undef wattr_set +int wattr_set( + WINDOW *a1, + attr_t a2, + short a3, + void *z) + { return(*(int *)0); } + +#undef wdeleteln +int wdeleteln( + WINDOW *z) + { return(*(int *)0); } + +#undef wgetstr +int wgetstr( + WINDOW *a1, + char *z) + { return(*(int *)0); } + +#undef winchstr +int winchstr( + WINDOW *a1, + chtype *z) + { return(*(int *)0); } + +#undef winsertln +int winsertln( + WINDOW *z) + { return(*(int *)0); } + +#undef winsstr +int winsstr( + WINDOW *a1, + const char *z) + { return(*(int *)0); } + +#undef winstr +int winstr( + WINDOW *a1, + char *z) + { return(*(int *)0); } + +#undef wstandout +int wstandout( + WINDOW *z) + { return(*(int *)0); } + +#undef wstandend +int wstandend( + WINDOW *z) + { return(*(int *)0); } + +#undef add_wch +int add_wch( + const cchar_t *z) + { return(*(int *)0); } + +#undef add_wchnstr +int add_wchnstr( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef add_wchstr +int add_wchstr( + const cchar_t *z) + { return(*(int *)0); } + +#undef addnwstr +int addnwstr( + const wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef addwstr +int addwstr( + const wchar_t *z) + { return(*(int *)0); } + +#undef bkgrnd +int bkgrnd( + const cchar_t *z) + { return(*(int *)0); } + +#undef bkgrndset +void bkgrndset( + const cchar_t *z) + { /* void */ } + +#undef border_set +int border_set( + const cchar_t *a1, + const cchar_t *a2, + const cchar_t *a3, + const cchar_t *a4, + const cchar_t *a5, + const cchar_t *a6, + const cchar_t *a7, + const cchar_t *z) + { return(*(int *)0); } + +#undef box_set +int box_set( + WINDOW *a1, + const cchar_t *a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef echo_wchar +int echo_wchar( + const cchar_t *z) + { return(*(int *)0); } + +#undef get_wch +int get_wch( + wint_t *z) + { return(*(int *)0); } + +#undef get_wstr +int get_wstr( + wint_t *z) + { return(*(int *)0); } + +#undef getbkgrnd +int getbkgrnd( + cchar_t *z) + { return(*(int *)0); } + +#undef getn_wstr +int getn_wstr( + wint_t *a1, + int z) + { return(*(int *)0); } + +#undef hline_set +int hline_set( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef in_wch +int in_wch( + cchar_t *z) + { return(*(int *)0); } + +#undef in_wchnstr +int in_wchnstr( + cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef in_wchstr +int in_wchstr( + cchar_t *z) + { return(*(int *)0); } + +#undef innwstr +int innwstr( + wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef ins_nwstr +int ins_nwstr( + const wchar_t *a1, + int z) + { return(*(int *)0); } + +#undef ins_wch +int ins_wch( + const cchar_t *z) + { return(*(int *)0); } + +#undef ins_wstr +int ins_wstr( + const wchar_t *z) + { return(*(int *)0); } + +#undef inwstr +int inwstr( + wchar_t *z) + { return(*(int *)0); } + +#undef mvadd_wch +int mvadd_wch( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvadd_wchnstr +int mvadd_wchnstr( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvadd_wchstr +int mvadd_wchstr( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvaddnwstr +int mvaddnwstr( + int a1, + int a2, + const wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvaddwstr +int mvaddwstr( + int a1, + int a2, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvget_wch +int mvget_wch( + int a1, + int a2, + wint_t *z) + { return(*(int *)0); } + +#undef mvget_wstr +int mvget_wstr( + int a1, + int a2, + wint_t *z) + { return(*(int *)0); } + +#undef mvgetn_wstr +int mvgetn_wstr( + int a1, + int a2, + wint_t *a3, + int z) + { return(*(int *)0); } + +#undef mvhline_set +int mvhline_set( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvin_wch +int mvin_wch( + int a1, + int a2, + cchar_t *z) + { return(*(int *)0); } + +#undef mvin_wchnstr +int mvin_wchnstr( + int a1, + int a2, + cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvin_wchstr +int mvin_wchstr( + int a1, + int a2, + cchar_t *z) + { return(*(int *)0); } + +#undef mvinnwstr +int mvinnwstr( + int a1, + int a2, + wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvins_nwstr +int mvins_nwstr( + int a1, + int a2, + const wchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvins_wch +int mvins_wch( + int a1, + int a2, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvins_wstr +int mvins_wstr( + int a1, + int a2, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvinwstr +int mvinwstr( + int a1, + int a2, + wchar_t *z) + { return(*(int *)0); } + +#undef mvvline_set +int mvvline_set( + int a1, + int a2, + const cchar_t *a3, + int z) + { return(*(int *)0); } + +#undef mvwadd_wch +int mvwadd_wch( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwadd_wchnstr +int mvwadd_wchnstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwadd_wchstr +int mvwadd_wchstr( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwaddnwstr +int mvwaddnwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwaddwstr +int mvwaddwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvwget_wch +int mvwget_wch( + WINDOW *a1, + int a2, + int a3, + wint_t *z) + { return(*(int *)0); } + +#undef mvwget_wstr +int mvwget_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *z) + { return(*(int *)0); } + +#undef mvwgetn_wstr +int mvwgetn_wstr( + WINDOW *a1, + int a2, + int a3, + wint_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwhline_set +int mvwhline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwin_wch +int mvwin_wch( + WINDOW *a1, + int a2, + int a3, + cchar_t *z) + { return(*(int *)0); } + +#undef mvwin_wchnstr +int mvwin_wchnstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwin_wchstr +int mvwin_wchstr( + WINDOW *a1, + int a2, + int a3, + cchar_t *z) + { return(*(int *)0); } + +#undef mvwinnwstr +int mvwinnwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwins_nwstr +int mvwins_nwstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *a4, + int z) + { return(*(int *)0); } + +#undef mvwins_wch +int mvwins_wch( + WINDOW *a1, + int a2, + int a3, + const cchar_t *z) + { return(*(int *)0); } + +#undef mvwins_wstr +int mvwins_wstr( + WINDOW *a1, + int a2, + int a3, + const wchar_t *z) + { return(*(int *)0); } + +#undef mvwinwstr +int mvwinwstr( + WINDOW *a1, + int a2, + int a3, + wchar_t *z) + { return(*(int *)0); } + +#undef mvwvline_set +int mvwvline_set( + WINDOW *a1, + int a2, + int a3, + const cchar_t *a4, + int z) + { return(*(int *)0); } + +#undef vline_set +int vline_set( + const cchar_t *a1, + int z) + { return(*(int *)0); } + +#undef wadd_wchstr +int wadd_wchstr( + WINDOW *a1, + const cchar_t *z) + { return(*(int *)0); } + +#undef waddwstr +int waddwstr( + WINDOW *a1, + const wchar_t *z) + { return(*(int *)0); } + +#undef wget_wstr +int wget_wstr( + WINDOW *a1, + wint_t *z) + { return(*(int *)0); } + +#undef win_wchstr +int win_wchstr( + WINDOW *a1, + cchar_t *z) + { return(*(int *)0); } + +#undef wins_wstr +int wins_wstr( + WINDOW *a1, + const wchar_t *z) + { return(*(int *)0); } + +#undef mouse_trafo +NCURSES_BOOL mouse_trafo( + int *a1, + int *a2, + NCURSES_BOOL z) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_getch.c */ + +#include + +#undef ESCDELAY +int ESCDELAY; + +#undef _nc_wgetch +int _nc_wgetch( + WINDOW *win, + unsigned long *result, + int use_meta) + { return(*(int *)0); } + +#undef wgetch +int wgetch( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_getstr.c */ + +#undef wgetnstr +int wgetnstr( + WINDOW *win, + char *str, + int maxlen) + { return(*(int *)0); } + +/* ./base/lib_hline.c */ + +#undef whline +int whline( + WINDOW *win, + chtype ch, + int n) + { return(*(int *)0); } + +/* ./base/lib_immedok.c */ + +#undef immedok +void immedok( + WINDOW *win, + NCURSES_BOOL flag) + { /* void */ } + +/* ./base/lib_inchstr.c */ + +#undef winchnstr +int winchnstr( + WINDOW *win, + chtype *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_initscr.c */ + +#undef initscr +WINDOW *initscr(void) + { return(*(WINDOW **)0); } + +/* ./base/lib_insch.c */ + +#undef winsch +int winsch( + WINDOW *win, + chtype c) + { return(*(int *)0); } + +/* ./base/lib_insdel.c */ + +#undef winsdelln +int winsdelln( + WINDOW *win, + int n) + { return(*(int *)0); } + +/* ./base/lib_insstr.c */ + +#undef winsnstr +int winsnstr( + WINDOW *win, + const char *s, + int n) + { return(*(int *)0); } + +/* ./base/lib_instr.c */ + +#undef winnstr +int winnstr( + WINDOW *win, + char *str, + int n) + { return(*(int *)0); } + +/* ./base/lib_isendwin.c */ + +#undef isendwin +NCURSES_BOOL isendwin(void) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_leaveok.c */ + +#undef leaveok +int leaveok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_mouse.c */ + +#undef getmouse +int getmouse( + MEVENT *aevent) + { return(*(int *)0); } + +#undef ungetmouse +int ungetmouse( + MEVENT *aevent) + { return(*(int *)0); } + +#undef mousemask +mmask_t mousemask( + mmask_t newmask, + mmask_t *oldmask) + { return(*(mmask_t *)0); } + +#undef wenclose +NCURSES_BOOL wenclose( + const WINDOW *win, + int y, + int x) + { return(*(NCURSES_BOOL *)0); } + +#undef mouseinterval +int mouseinterval( + int maxclick) + { return(*(int *)0); } + +#undef _nc_has_mouse +int _nc_has_mouse(void) + { return(*(int *)0); } + +#undef wmouse_trafo +NCURSES_BOOL wmouse_trafo( + const WINDOW *win, + int *pY, + int *pX, + NCURSES_BOOL to_screen) + { return(*(NCURSES_BOOL *)0); } + +/* ./base/lib_move.c */ + +#undef wmove +int wmove( + WINDOW *win, + int y, + int x) + { return(*(int *)0); } + +/* ./tty/lib_mvcur.c */ + +#undef _nc_msec_cost +int _nc_msec_cost( + const char *const cap, + int affcnt) + { return(*(int *)0); } + +#undef _nc_mvcur_resume +void _nc_mvcur_resume(void) + { /* void */ } + +#undef _nc_mvcur_init +void _nc_mvcur_init(void) + { /* void */ } + +#undef _nc_mvcur_wrap +void _nc_mvcur_wrap(void) + { /* void */ } + +#undef mvcur +int mvcur( + int yold, + int xold, + int ynew, + int xnew) + { return(*(int *)0); } + +#undef _nc_optimize_enable +int _nc_optimize_enable; + +/* ./base/lib_mvwin.c */ + +#undef mvwin +int mvwin( + WINDOW *win, + int by, + int bx) + { return(*(int *)0); } + +/* ./base/lib_newterm.c */ + +#undef filter +void filter(void) + { /* void */ } + +#undef newterm +SCREEN *newterm( + char *name, + FILE *ofp, + FILE *ifp) + { return(*(SCREEN **)0); } + +/* ./base/lib_newwin.c */ + +#undef _nc_freewin +int _nc_freewin( + WINDOW *win) + { return(*(int *)0); } + +#undef newwin +WINDOW *newwin( + int num_lines, + int num_columns, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef derwin +WINDOW *derwin( + WINDOW *orig, + int num_lines, + int num_columns, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef subwin +WINDOW *subwin( + WINDOW *w, + int l, + int c, + int y, + int x) + { return(*(WINDOW **)0); } + +#undef _nc_makenew +WINDOW *_nc_makenew( + int num_lines, + int num_columns, + int begy, + int begx, + int flags) + { return(*(WINDOW **)0); } + +/* ./base/lib_nl.c */ + +#undef nl +int nl(void) + { return(*(int *)0); } + +#undef nonl +int nonl(void) + { return(*(int *)0); } + +/* ./base/lib_overlay.c */ + +#undef overlay +int overlay( + const WINDOW *win1, + WINDOW *win2) + { return(*(int *)0); } + +#undef overwrite +int overwrite( + const WINDOW *win1, + WINDOW *win2) + { return(*(int *)0); } + +#undef copywin +int copywin( + const WINDOW *src, + WINDOW *dst, + int sminrow, + int smincol, + int dminrow, + int dmincol, + int dmaxrow, + int dmaxcol, + int over) + { return(*(int *)0); } + +/* ./base/lib_pad.c */ + +#undef newpad +WINDOW *newpad( + int l, + int c) + { return(*(WINDOW **)0); } + +#undef subpad +WINDOW *subpad( + WINDOW *orig, + int l, + int c, + int begy, + int begx) + { return(*(WINDOW **)0); } + +#undef prefresh +int prefresh( + WINDOW *win, + int pminrow, + int pmincol, + int sminrow, + int smincol, + int smaxrow, + int smaxcol) + { return(*(int *)0); } + +#undef pnoutrefresh +int pnoutrefresh( + WINDOW *win, + int pminrow, + int pmincol, + int sminrow, + int smincol, + int smaxrow, + int smaxcol) + { return(*(int *)0); } + +#undef pechochar +int pechochar( + WINDOW *pad, + const chtype ch) + { return(*(int *)0); } + +/* ./base/lib_printw.c */ + +#undef printw +int printw( + char *fmt, + ...) + { return(*(int *)0); } + +#undef wprintw +int wprintw( + WINDOW *win, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvprintw +int mvprintw( + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvwprintw +int mvwprintw( + WINDOW *win, + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef vwprintw +int vwprintw( + WINDOW *win, + char *fmt, + va_list argp) + { return(*(int *)0); } + +/* ./base/lib_redrawln.c */ + +#undef wredrawln +int wredrawln( + WINDOW *win, + int beg, + int num) + { return(*(int *)0); } + +/* ./base/lib_refresh.c */ + +#undef wrefresh +int wrefresh( + WINDOW *win) + { return(*(int *)0); } + +#undef wnoutrefresh +int wnoutrefresh( + WINDOW *win) + { return(*(int *)0); } + +/* ./base/lib_restart.c */ + +#undef restartterm +int restartterm( + char *termp, + int filenum, + int *errret) + { return(*(int *)0); } + +/* ./base/lib_scanw.c */ + +#undef vwscanw +int vwscanw( + WINDOW *win, + char *fmt, + va_list argp) + { return(*(int *)0); } + +#undef scanw +int scanw( + char *fmt, + ...) + { return(*(int *)0); } + +#undef wscanw +int wscanw( + WINDOW *win, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvscanw +int mvscanw( + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +#undef mvwscanw +int mvwscanw( + WINDOW *win, + int y, + int x, + char *fmt, + ...) + { return(*(int *)0); } + +/* ./base/lib_screen.c */ + +#undef getwin +WINDOW *getwin( + FILE *filep) + { return(*(WINDOW **)0); } + +#undef putwin +int putwin( + WINDOW *win, + FILE *filep) + { return(*(int *)0); } + +#undef scr_restore +int scr_restore( + const char *file) + { return(*(int *)0); } + +#undef scr_dump +int scr_dump( + const char *file) + { return(*(int *)0); } + +#undef scr_init +int scr_init( + const char *file) + { return(*(int *)0); } + +#undef scr_set +int scr_set( + const char *file) + { return(*(int *)0); } + +/* ./base/lib_scroll.c */ + +#undef _nc_scroll_window +void _nc_scroll_window( + WINDOW *win, + int const n, + short const top, + short const bottom, + cchar_t blank) + { /* void */ } + +#undef wscrl +int wscrl( + WINDOW *win, + int n) + { return(*(int *)0); } + +/* ./base/lib_scrollok.c */ + +#undef scrollok +int scrollok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_scrreg.c */ + +#undef wsetscrreg +int wsetscrreg( + WINDOW *win, + int top, + int bottom) + { return(*(int *)0); } + +/* ./base/lib_set_term.c */ + +#undef set_term +SCREEN *set_term( + SCREEN *screenp) + { return(*(SCREEN **)0); } + +#undef delscreen +void delscreen( + SCREEN *sp) + { /* void */ } + +#undef _nc_setupscreen +int _nc_setupscreen( + short slines, + short const scolumns, + FILE *output) + { return(*(int *)0); } + +#undef _nc_ripoffline +int _nc_ripoffline( + int line, + int (*init)( + WINDOW *p1, + int p2)) + { return(*(int *)0); } + +#undef ripoffline +int ripoffline( + int line, + int (*init)( + WINDOW *p1, + int p2)) + { return(*(int *)0); } + +/* ./base/lib_slk.c */ + +#undef _nc_slk_format +int _nc_slk_format; + +#undef _nc_slk_initialize +int _nc_slk_initialize( + WINDOW *stwin, + int cols) + { return(*(int *)0); } + +#undef slk_restore +int slk_restore(void) + { return(*(int *)0); } + +/* ./base/lib_slkatr_set.c */ + +#undef slk_attr_set +int slk_attr_set( + const attr_t attr, + short color_pair_number, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_slkatrof.c */ + +#undef slk_attroff +int slk_attroff( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkatron.c */ + +#undef slk_attron +int slk_attron( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkatrset.c */ + +#undef slk_attrset +int slk_attrset( + const chtype attr) + { return(*(int *)0); } + +/* ./base/lib_slkattr.c */ + +#undef slk_attr +attr_t slk_attr(void) + { return(*(attr_t *)0); } + +/* ./base/lib_slkclear.c */ + +#undef slk_clear +int slk_clear(void) + { return(*(int *)0); } + +/* ./base/lib_slkcolor.c */ + +#undef slk_color +int slk_color( + short color_pair_number) + { return(*(int *)0); } + +/* ./base/lib_slkinit.c */ + +#undef slk_init +int slk_init( + int format) + { return(*(int *)0); } + +/* ./base/lib_slklab.c */ + +#undef slk_label +char *slk_label( + int n) + { return(*(char **)0); } + +/* ./base/lib_slkrefr.c */ + +#undef slk_noutrefresh +int slk_noutrefresh(void) + { return(*(int *)0); } + +#undef slk_refresh +int slk_refresh(void) + { return(*(int *)0); } + +/* ./base/lib_slkset.c */ + +#undef slk_set +int slk_set( + int i, + const char *astr, + int format) + { return(*(int *)0); } + +/* ./base/lib_slktouch.c */ + +#undef slk_touch +int slk_touch(void) + { return(*(int *)0); } + +/* ./base/lib_touch.c */ + +#undef is_linetouched +NCURSES_BOOL is_linetouched( + WINDOW *win, + int line) + { return(*(NCURSES_BOOL *)0); } + +#undef is_wintouched +NCURSES_BOOL is_wintouched( + WINDOW *win) + { return(*(NCURSES_BOOL *)0); } + +#undef wtouchln +int wtouchln( + WINDOW *win, + int y, + int n, + int changed) + { return(*(int *)0); } + +/* ./trace/lib_traceatr.c */ + +#undef _traceattr2 +char *_traceattr2( + int bufnum, + attr_t newmode) + { return(*(char **)0); } + +#undef _traceattr +char *_traceattr( + attr_t newmode) + { return(*(char **)0); } + +#undef _nc_retrace_attr_t +attr_t _nc_retrace_attr_t( + attr_t code) + { return(*(attr_t *)0); } + +#undef _nc_altcharset_name +const char *_nc_altcharset_name( + attr_t attr, + chtype ch) + { return(*(const char **)0); } + +#undef _tracechtype2 +char *_tracechtype2( + int bufnum, + chtype ch) + { return(*(char **)0); } + +#undef _tracechtype +char *_tracechtype( + chtype ch) + { return(*(char **)0); } + +#undef _nc_retrace_chtype +attr_t _nc_retrace_chtype( + attr_t code) + { return(*(attr_t *)0); } + +#undef _tracecchar_t2 +char *_tracecchar_t2( + int bufnum, + const cchar_t *ch) + { return(*(char **)0); } + +#undef _tracecchar_t +char *_tracecchar_t( + const cchar_t *ch) + { return(*(char **)0); } + +/* ./trace/lib_tracedmp.c */ + +#undef _tracedump +void _tracedump( + const char *name, + WINDOW *win) + { /* void */ } + +/* ./trace/lib_tracemse.c */ + +#undef _tracemouse +char *_tracemouse( + MEVENT const *ep) + { return(*(char **)0); } + +/* ./tty/lib_tstp.c */ + +#include + +#undef _nc_signal_handler +void _nc_signal_handler( + NCURSES_BOOL enable) + { /* void */ } + +/* ./base/lib_ungetch.c */ + +#undef _nc_fifo_dump +void _nc_fifo_dump(void) + { /* void */ } + +#undef ungetch +int ungetch( + int ch) + { return(*(int *)0); } + +/* ./tty/lib_vidattr.c */ + +#undef vidputs +int vidputs( + chtype newmode, + int (*outc)( + int p1)) + { return(*(int *)0); } + +#undef vidattr +int vidattr( + chtype newmode) + { return(*(int *)0); } + +#undef termattrs +chtype termattrs(void) + { return(*(chtype *)0); } + +/* ./base/lib_vline.c */ + +#undef wvline +int wvline( + WINDOW *win, + chtype ch, + int n) + { return(*(int *)0); } + +/* ./base/lib_wattroff.c */ + +#undef wattr_off +int wattr_off( + WINDOW *win, + attr_t at, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_wattron.c */ + +#undef wattr_on +int wattr_on( + WINDOW *win, + attr_t at, + void *opts) + { return(*(int *)0); } + +/* ./base/lib_winch.c */ + +#undef winch +chtype winch( + WINDOW *win) + { return(*(chtype *)0); } + +/* ./base/lib_window.c */ + +#undef _nc_synchook +void _nc_synchook( + WINDOW *win) + { /* void */ } + +#undef mvderwin +int mvderwin( + WINDOW *win, + int y, + int x) + { return(*(int *)0); } + +#undef syncok +int syncok( + WINDOW *win, + NCURSES_BOOL bf) + { return(*(int *)0); } + +#undef wsyncup +void wsyncup( + WINDOW *win) + { /* void */ } + +#undef wsyncdown +void wsyncdown( + WINDOW *win) + { /* void */ } + +#undef wcursyncup +void wcursyncup( + WINDOW *win) + { /* void */ } + +#undef dupwin +WINDOW *dupwin( + WINDOW *win) + { return(*(WINDOW **)0); } + +/* ./base/nc_panel.c */ + +#undef _nc_panelhook +struct panelhook *_nc_panelhook(void) + { return(*(struct panelhook **)0); } + +/* ./base/safe_sprintf.c */ + +#undef _nc_printf_string +char *_nc_printf_string( + const char *fmt, + va_list ap) + { return(*(char **)0); } + +/* ./tty/tty_update.c */ + +#include +#include + +#undef doupdate +int doupdate(void) + { return(*(int *)0); } + +#undef _nc_outstr +void _nc_outstr( + const char *str) + { /* void */ } + +#undef _nc_scrolln +int _nc_scrolln( + int n, + int top, + int bot, + int maxy) + { return(*(int *)0); } + +#undef _nc_screen_resume +void _nc_screen_resume(void) + { /* void */ } + +#undef _nc_screen_init +void _nc_screen_init(void) + { /* void */ } + +#undef _nc_screen_wrap +void _nc_screen_wrap(void) + { /* void */ } + +#undef _nc_do_xmc_glitch +void _nc_do_xmc_glitch( + attr_t previous) + { /* void */ } + +/* ./trace/varargs.c */ + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#undef _nc_varargs +char *_nc_varargs( + const char *fmt, + va_list ap) + { return(*(char **)0); } + +/* ./base/memmove.c */ + +#undef _nc_memmove +void _nc_memmove(void) + { /* void */ } + +/* ./base/sigaction.c */ + +#undef _nc_sigaction +void _nc_sigaction(void) + { /* void */ } + +/* ./base/vsscanf.c */ + +#undef _nc_vsscanf +void _nc_vsscanf(void) + { /* void */ } + +/* ./widechar/lib_box_set.c */ + +#undef wborder_set +int wborder_set( + WINDOW *win, + const cchar_t *ls, + const cchar_t *rs, + const cchar_t *ts, + const cchar_t *bs, + const cchar_t *tl, + const cchar_t *tr, + const cchar_t *bl, + const cchar_t *br) + { return(*(int *)0); } + +/* ./widechar/lib_cchar.c */ + +#undef setcchar +int setcchar( + cchar_t *wcval, + const wchar_t *wch, + const attr_t attrs, + short color_pair, + const void *opts) + { return(*(int *)0); } + +#undef getcchar +int getcchar( + const cchar_t *wcval, + wchar_t *wch, + attr_t *attrs, + short *color_pair, + void *opts) + { return(*(int *)0); } + +/* ./widechar/lib_get_wch.c */ + +#undef wget_wch +int wget_wch( + WINDOW *win, + wint_t *result) + { return(*(int *)0); } + +/* ./widechar/lib_erasewchar.c */ + +#undef erasewchar +int erasewchar( + wchar_t *wch) + { return(*(int *)0); } + +#undef killwchar +int killwchar( + wchar_t *wch) + { return(*(int *)0); } + +/* ./widechar/lib_get_wstr.c */ + +#undef wgetn_wstr +int wgetn_wstr( + WINDOW *win, + wint_t *str, + int maxlen) + { return(*(int *)0); } + +/* ./widechar/lib_hline_set.c */ + +#undef whline_set +int whline_set( + WINDOW *win, + const cchar_t *ch, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_in_wch.c */ + +#undef win_wch +int win_wch( + WINDOW *win, + cchar_t *wcval) + { return(*(int *)0); } + +/* ./widechar/lib_in_wchnstr.c */ + +#undef win_wchnstr +int win_wchnstr( + WINDOW *win, + cchar_t *wchstr, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_ins_nwstr.c */ + +#undef wins_nwstr +int wins_nwstr( + WINDOW *win, + const wchar_t *wstr, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_ins_wch.c */ + +#undef wins_wch +int wins_wch( + WINDOW *win, + const cchar_t *wch) + { return(*(int *)0); } + +/* ./widechar/lib_inwstr.c */ + +#undef winnwstr +int winnwstr( + WINDOW *win, + wchar_t *wstr, + int n) + { return(*(int *)0); } + +#undef winwstr +int winwstr( + WINDOW *win, + wchar_t *wstr) + { return(*(int *)0); } + +/* ./widechar/lib_unget_wch.c */ + +#undef unget_wch +int unget_wch( + const wchar_t wch) + { return(*(int *)0); } + +/* ./widechar/lib_vid_attr.c */ + +#undef vid_puts +int vid_puts( + attr_t newmode, + short pair, + void *opts, + int (*outc)( + int p1)) + { return(*(int *)0); } + +#undef vid_attr +int vid_attr( + attr_t newmode, + short pair, + void *opts) + { return(*(int *)0); } + +#undef term_attrs +attr_t term_attrs(void) + { return(*(attr_t *)0); } + +/* ./widechar/lib_vline_set.c */ + +#undef wvline_set +int wvline_set( + WINDOW *win, + const cchar_t *ch, + int n) + { return(*(int *)0); } + +/* ./widechar/lib_wacs.c */ + +#undef _nc_wacs +cchar_t *_nc_wacs; + +#undef _nc_init_wacs +void _nc_init_wacs(void) + { /* void */ } + +/* ./widechar/lib_wunctrl.c */ + +#undef wunctrl +wchar_t *wunctrl( + cchar_t *wc) + { return(*(wchar_t **)0); } + +/* ./base/define_key.c */ + +#undef define_key +int define_key( + char *str, + int keycode) + { return(*(int *)0); } + +/* ./expanded.c */ + +#undef _nc_toggle_attr_on +void _nc_toggle_attr_on( + attr_t *S, + attr_t at) + { /* void */ } + +#undef _nc_toggle_attr_off +void _nc_toggle_attr_off( + attr_t *S, + attr_t at) + { /* void */ } + +#undef _nc_DelCharCost +int _nc_DelCharCost( + int count) + { return(*(int *)0); } + +#undef _nc_InsCharCost +int _nc_InsCharCost( + int count) + { return(*(int *)0); } + +#undef _nc_UpdateAttrs +void _nc_UpdateAttrs( + chtype c) + { /* void */ } + +/* ./base/keybound.c */ + +#undef keybound +char *keybound( + int code, + int count) + { return(*(char **)0); } + +/* ./base/keyok.c */ + +#undef keyok +int keyok( + int c, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./base/lib_dft_fgbg.c */ + +#undef use_default_colors +int use_default_colors(void) + { return(*(int *)0); } + +#undef assume_default_colors +int assume_default_colors( + int fg, + int bg) + { return(*(int *)0); } + +/* ./base/lib_freeall.c */ + +#include + +#undef _nc_freeall +void _nc_freeall(void) + { /* void */ } + +/* ./tinfo/lib_print.c */ + +#undef mcprint +int mcprint( + char *data, + int len) + { return(*(int *)0); } + +/* ./base/resizeterm.c */ + +#undef is_term_resized +NCURSES_BOOL is_term_resized( + int ToLines, + int ToCols) + { return(*(NCURSES_BOOL *)0); } + +#undef resize_term +int resize_term( + int ToLines, + int ToCols) + { return(*(int *)0); } + +#undef resizeterm +int resizeterm( + int ToLines, + int ToCols) + { return(*(int *)0); } + +/* ./trace/trace_xnames.c */ + +#undef _nc_trace_xnames +void _nc_trace_xnames( + TERMTYPE *tp) + { /* void */ } + +/* ./base/tries.c */ + +#undef _nc_expand_try +char *_nc_expand_try( + struct tries *tree, + unsigned short code, + int *count, + size_t len) + { return(*(char **)0); } + +#undef _nc_remove_key +int _nc_remove_key( + struct tries **tree, + unsigned short code) + { return(*(int *)0); } + +#undef _nc_remove_string +int _nc_remove_string( + struct tries **tree, + char *string) + { return(*(int *)0); } + +/* ./base/version.c */ + +#undef curses_version +const char *curses_version(void) + { return(*(const char **)0); } + +/* ./base/wresize.c */ + +#undef wresize +int wresize( + WINDOW *win, + int ToLines, + int ToCols) + { return(*(int *)0); } + +/* ./tinfo/access.c */ + +#undef _nc_rootname +char *_nc_rootname( + char *path) + { return(*(char **)0); } + +#undef _nc_basename +char *_nc_basename( + char *path) + { return(*(char **)0); } + +#undef _nc_access +int _nc_access( + const char *path, + int mode) + { return(*(int *)0); } + +#undef _nc_env_access +int _nc_env_access(void) + { return(*(int *)0); } + +/* ./tinfo/add_tries.c */ + +#undef _nc_add_to_try +void _nc_add_to_try( + struct tries **tree, + const char *str, + unsigned short code) + { /* void */ } + +/* ./tinfo/alloc_entry.c */ + +#undef _nc_init_entry +void _nc_init_entry( + TERMTYPE *const tp) + { /* void */ } + +#undef _nc_copy_entry +ENTRY *_nc_copy_entry( + ENTRY *oldp) + { return(*(ENTRY **)0); } + +#undef _nc_save_str +char *_nc_save_str( + const char *const string) + { return(*(char **)0); } + +#undef _nc_wrap_entry +void _nc_wrap_entry( + ENTRY *const ep, + NCURSES_BOOL copy_strings) + { /* void */ } + +#undef _nc_merge_entry +void _nc_merge_entry( + TERMTYPE *const to, + TERMTYPE *const from) + { /* void */ } + +/* ./tinfo/alloc_ttype.c */ + +#undef _nc_align_termtype +void _nc_align_termtype( + TERMTYPE *to, + TERMTYPE *from) + { /* void */ } + +#undef _nc_copy_termtype +void _nc_copy_termtype( + TERMTYPE *dst, + TERMTYPE *src) + { /* void */ } + +/* ./tinfo/captoinfo.c */ + +#undef _nc_captoinfo +char *_nc_captoinfo( + const char *cap, + const char *s, + int const parametrized) + { return(*(char **)0); } + +#undef _nc_infotocap +char *_nc_infotocap( + const char *cap, + const char *str, + int const parametrized) + { return(*(char **)0); } + +/* ./codes.c */ + +#undef boolcodes +char *const boolcodes[] = {0}; +#undef numcodes +char *const numcodes[] = {0}; +#undef strcodes +char *const strcodes[] = {0}; + +/* ./comp_captab.c */ + +#include + +#undef _nc_info_hash_table +const struct name_table_entry *const _nc_info_hash_table[995] = {0}; +#undef _nc_cap_hash_table +const struct name_table_entry *const _nc_cap_hash_table[995] = {0}; +#undef _nc_capalias_table +const struct alias _nc_capalias_table[] = {0}; +#undef _nc_infoalias_table +const struct alias _nc_infoalias_table[] = {0}; + +#undef _nc_get_table +const struct name_table_entry *_nc_get_table( + NCURSES_BOOL termcap) + { return(*(const struct name_table_entry **)0); } + +#undef _nc_get_hash_table +const struct name_table_entry *const *_nc_get_hash_table( + NCURSES_BOOL termcap) + { return(*(const struct name_table_entry **)0); } + +/* ./tinfo/comp_error.c */ + +#undef _nc_suppress_warnings +NCURSES_BOOL _nc_suppress_warnings; +#undef _nc_curr_line +int _nc_curr_line; +#undef _nc_curr_col +int _nc_curr_col; + +#undef _nc_set_source +void _nc_set_source( + const char *const name) + { /* void */ } + +#undef _nc_set_type +void _nc_set_type( + const char *const name) + { /* void */ } + +#undef _nc_get_type +void _nc_get_type( + char *name) + { /* void */ } + +#undef _nc_warning +void _nc_warning( + const char *const fmt, + ...) + { /* void */ } + +#undef _nc_err_abort +void _nc_err_abort( + const char *const fmt, + ...) + { /* void */ } + +#undef _nc_syserr_abort +void _nc_syserr_abort( + const char *const fmt, + ...) + { /* void */ } + +/* ./tinfo/comp_expand.c */ + +#undef _nc_tic_expand +char *_nc_tic_expand( + const char *srcp, + NCURSES_BOOL tic_format, + int numbers) + { return(*(char **)0); } + +/* ./tinfo/comp_hash.c */ + +#include + +#undef _nc_find_entry +struct name_table_entry const *_nc_find_entry( + const char *string, + const struct name_table_entry *const *hash_table) + { return(*(struct name_table_entry const **)0); } + +#undef _nc_find_type_entry +struct name_table_entry const *_nc_find_type_entry( + const char *string, + int type, + const struct name_table_entry *table) + { return(*(struct name_table_entry const **)0); } + +/* ./tinfo/comp_parse.c */ + +#undef _nc_check_termtype +void (*_nc_check_termtype)( + TERMTYPE *p1); +#undef _nc_head +ENTRY *_nc_head; +#undef _nc_tail +ENTRY *_nc_tail; + +#undef _nc_free_entries +void _nc_free_entries( + ENTRY *headp) + { /* void */ } + +#undef _nc_entry_match +NCURSES_BOOL _nc_entry_match( + char *n1, + char *n2) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_read_entry_source +void _nc_read_entry_source( + FILE *fp, + char *buf, + int literal, + NCURSES_BOOL silent, + NCURSES_BOOL (*hook)( + ENTRY *p1)) + { /* void */ } + +#undef _nc_resolve_uses +int _nc_resolve_uses( + NCURSES_BOOL fullresolve) + { return(*(int *)0); } + +/* ./tinfo/comp_scan.c */ + +#undef _nc_syntax +int _nc_syntax; +#undef _nc_curr_file_pos +long _nc_curr_file_pos; +#undef _nc_comment_start +long _nc_comment_start; +#undef _nc_comment_end +long _nc_comment_end; +#undef _nc_start_line +long _nc_start_line; +#undef _nc_curr_token +struct token _nc_curr_token; +#undef _nc_disable_period +NCURSES_BOOL _nc_disable_period; + +#undef _nc_get_token +int _nc_get_token( + NCURSES_BOOL silent) + { return(*(int *)0); } + +#undef _nc_trans_string +char _nc_trans_string( + char *ptr, + char *last) + { return(*(char *)0); } + +#undef _nc_push_token +void _nc_push_token( + int tokclass) + { /* void */ } + +#undef _nc_panic_mode +void _nc_panic_mode( + char ch) + { /* void */ } + +#undef _nc_reset_input +void _nc_reset_input( + FILE *fp, + char *buf) + { /* void */ } + +/* ./tinfo/doalloc.c */ + +#undef _nc_doalloc +void *_nc_doalloc( + void *oldp, + size_t amount) + { return(*(void **)0); } + +/* ./fallback.c */ + +#undef _nc_fallback +const TERMTYPE *_nc_fallback( + const char *name) + { return(*(const TERMTYPE **)0); } + +/* ./tinfo/free_ttype.c */ + +#undef _nc_free_termtype +void _nc_free_termtype( + TERMTYPE *ptr) + { /* void */ } + +#undef _nc_user_definable +NCURSES_BOOL _nc_user_definable; + +#undef use_extended_names +int use_extended_names( + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/getenv_num.c */ + +#undef _nc_getenv_num +int _nc_getenv_num( + const char *name) + { return(*(int *)0); } + +/* ./tinfo/home_terminfo.c */ + +#undef _nc_home_terminfo +char *_nc_home_terminfo(void) + { return(*(char **)0); } + +/* ./tinfo/init_keytry.c */ + +#if 0 + +#include + +#undef _nc_tinfo_fkeys +struct tinfo_fkeys _nc_tinfo_fkeys[]; + +#endif + +#undef _nc_init_keytry +void _nc_init_keytry(void) + { /* void */ } + +/* ./tinfo/lib_acs.c */ + +#undef acs_map +chtype acs_map[128 ]; + +#undef _nc_init_acs +void _nc_init_acs(void) + { /* void */ } + +/* ./tinfo/lib_baudrate.c */ + +#include + +struct speed { + int s; + int sp; +}; + +#undef _nc_baudrate +int _nc_baudrate( + int OSpeed) + { return(*(int *)0); } + +#undef _nc_ospeed +int _nc_ospeed( + int BaudRate) + { return(*(int *)0); } + +#undef baudrate +int baudrate(void) + { return(*(int *)0); } + +/* ./tinfo/lib_cur_term.c */ + +#undef cur_term +TERMINAL *cur_term; + +#undef set_curterm +TERMINAL *set_curterm( + TERMINAL *termp) + { return(*(TERMINAL **)0); } + +#undef del_curterm +int del_curterm( + TERMINAL *termp) + { return(*(int *)0); } + +/* ./tinfo/lib_data.c */ + +#undef stdscr +WINDOW *stdscr; +#undef curscr +WINDOW *curscr; +#undef newscr +WINDOW *newscr; +#undef _nc_screen_chain +SCREEN *_nc_screen_chain; +#undef SP +SCREEN *SP; + +/* ./tinfo/lib_has_cap.c */ + +#undef has_ic +NCURSES_BOOL has_ic(void) + { return(*(NCURSES_BOOL *)0); } + +#undef has_il +NCURSES_BOOL has_il(void) + { return(*(NCURSES_BOOL *)0); } + +/* ./tinfo/lib_kernel.c */ + +#undef erasechar +char erasechar(void) + { return(*(char *)0); } + +#undef killchar +char killchar(void) + { return(*(char *)0); } + +#undef flushinp +int flushinp(void) + { return(*(int *)0); } + +/* ./lib_keyname.c */ + +#undef _nc_key_names +const struct kn _nc_key_names[] = {0}; + +#undef keyname +char *keyname( + int c) + { return(*(char **)0); } + +#undef key_name +char *key_name( + wchar_t c) + { return(*(char **)0); } + +/* ./tinfo/lib_longname.c */ + +#undef longname +char *longname(void) + { return(*(char **)0); } + +/* ./tinfo/lib_napms.c */ + +#include + +#undef napms +int napms( + int ms) + { return(*(int *)0); } + +/* ./tinfo/lib_options.c */ + +#undef idlok +int idlok( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef idcok +void idcok( + WINDOW *win, + NCURSES_BOOL flag) + { /* void */ } + +#undef halfdelay +int halfdelay( + int t) + { return(*(int *)0); } + +#undef nodelay +int nodelay( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef notimeout +int notimeout( + WINDOW *win, + NCURSES_BOOL f) + { return(*(int *)0); } + +#undef wtimeout +void wtimeout( + WINDOW *win, + int delay) + { /* void */ } + +#undef keypad +int keypad( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef meta +int meta( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +#undef curs_set +int curs_set( + int vis) + { return(*(int *)0); } + +#undef typeahead +int typeahead( + int fd) + { return(*(int *)0); } + +#undef has_key +int has_key( + int keycode) + { return(*(int *)0); } + +#undef _nc_keypad +int _nc_keypad( + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/lib_raw.c */ + +#undef raw +int raw(void) + { return(*(int *)0); } + +#undef cbreak +int cbreak(void) + { return(*(int *)0); } + +#undef qiflush +void qiflush(void) + { /* void */ } + +#undef noraw +int noraw(void) + { return(*(int *)0); } + +#undef nocbreak +int nocbreak(void) + { return(*(int *)0); } + +#undef noqiflush +void noqiflush(void) + { /* void */ } + +#undef intrflush +int intrflush( + WINDOW *win, + NCURSES_BOOL flag) + { return(*(int *)0); } + +/* ./tinfo/lib_setup.c */ + +#include + +#undef use_env +void use_env( + NCURSES_BOOL f) + { /* void */ } + +#undef LINES +int LINES; +#undef COLS +int COLS; +#undef TABSIZE +int TABSIZE; + +#undef _nc_update_screensize +void _nc_update_screensize(void) + { /* void */ } + +#undef ttytype +char ttytype[256 ]; + +#undef setupterm +int setupterm( + char *tname, + int Filedes, + int *errret) + { return(*(int *)0); } + +/* ./tinfo/lib_termcap.c */ + +#undef UP +char *UP; +#undef BC +char *BC; + +#undef tgetent +int tgetent( + char *bufp, + const char *name) + { return(*(int *)0); } + +#if 0 + +#include + +#endif + +#undef tgetflag +int tgetflag( + char *id) + { return(*(int *)0); } + +#undef tgetnum +int tgetnum( + char *id) + { return(*(int *)0); } + +#undef tgetstr +char *tgetstr( + char *id, + char **area) + { return(*(char **)0); } + +/* ./tinfo/lib_termname.c */ + +#undef termname +char *termname(void) + { return(*(char **)0); } + +/* ./tinfo/lib_tgoto.c */ + +#undef tgoto +char *tgoto( + const char *string, + int x, + int y) + { return(*(char **)0); } + +/* ./tinfo/lib_ti.c */ + +#undef tigetflag +int tigetflag( + char *str) + { return(*(int *)0); } + +#undef tigetnum +int tigetnum( + char *str) + { return(*(int *)0); } + +#undef tigetstr +char *tigetstr( + char *str) + { return(*(char **)0); } + +/* ./tinfo/lib_tparm.c */ + +typedef struct { + union { + int num; + char *str; + } data; + NCURSES_BOOL num_type; +} stack_frame; + +#undef _nc_tparm_err +int _nc_tparm_err; + +#undef tparm +char *tparm( + char *string, + ...) + { return(*(char **)0); } + +/* ./tinfo/lib_tputs.c */ + +#undef PC +char PC; +#undef ospeed +short ospeed; +#undef _nc_nulls_sent +int _nc_nulls_sent; + +#undef delay_output +int delay_output( + int ms) + { return(*(int *)0); } + +#undef _nc_flush +void _nc_flush(void) + { /* void */ } + +#undef _nc_outch +int _nc_outch( + int ch) + { return(*(int *)0); } + +#undef putp +int putp( + const char *string) + { return(*(int *)0); } + +#undef tputs +int tputs( + const char *string, + int affcnt, + int (*outc)( + int p1)) + { return(*(int *)0); } + +/* ./trace/lib_trace.c */ + +#undef _nc_tracing +unsigned _nc_tracing; +#undef _nc_tputs_trace +const char *_nc_tputs_trace = {0}; +#undef _nc_outchars +long _nc_outchars; + +#undef trace +void trace( + const unsigned int tracelevel) + { /* void */ } + +#undef _tracef +void _tracef( + const char *fmt, + ...) + { /* void */ } + +#undef _nc_retrace_int +int _nc_retrace_int( + int code) + { return(*(int *)0); } + +#undef _nc_retrace_ptr +char *_nc_retrace_ptr( + char *code) + { return(*(char **)0); } + +#undef _nc_retrace_sp +SCREEN *_nc_retrace_sp( + SCREEN *code) + { return(*(SCREEN **)0); } + +#undef _nc_retrace_win +WINDOW *_nc_retrace_win( + WINDOW *code) + { return(*(WINDOW **)0); } + +/* ./trace/lib_tracebits.c */ + +typedef struct { + unsigned int val; + const char *name; +} BITNAMES; + +#undef _nc_trace_ttymode +char *_nc_trace_ttymode( + struct termios *tty) + { return(*(char **)0); } + +#undef _nc_tracebits +char *_nc_tracebits(void) + { return(*(char **)0); } + +/* ./trace/lib_tracechr.c */ + +#undef _tracechar +char *_tracechar( + int ch) + { return(*(char **)0); } + +/* ./tinfo/lib_ttyflags.c */ + +#undef _nc_get_tty_mode +int _nc_get_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef _nc_set_tty_mode +int _nc_set_tty_mode( + struct termios *buf) + { return(*(int *)0); } + +#undef def_shell_mode +int def_shell_mode(void) + { return(*(int *)0); } + +#undef def_prog_mode +int def_prog_mode(void) + { return(*(int *)0); } + +#undef reset_prog_mode +int reset_prog_mode(void) + { return(*(int *)0); } + +#undef reset_shell_mode +int reset_shell_mode(void) + { return(*(int *)0); } + +#undef savetty +int savetty(void) + { return(*(int *)0); } + +#undef resetty +int resetty(void) + { return(*(int *)0); } + +/* ./tty/lib_twait.c */ + +#undef _nc_timed_wait +int _nc_timed_wait( + int mode, + int milliseconds, + int *timeleft) + { return(*(int *)0); } + +/* ./tinfo/name_match.c */ + +#undef _nc_first_name +char *_nc_first_name( + const char *const sp) + { return(*(char **)0); } + +#undef _nc_name_match +int _nc_name_match( + const char *const namelst, + const char *const name, + const char *const delim) + { return(*(int *)0); } + +/* ./names.c */ + +#undef boolnames +char *const boolnames[] = {0}; +#undef boolfnames +char *const boolfnames[] = {0}; +#undef numnames +char *const numnames[] = {0}; +#undef numfnames +char *const numfnames[] = {0}; +#undef strnames +char *const strnames[] = {0}; +#undef strfnames +char *const strfnames[] = {0}; + +/* ./tinfo/parse_entry.c */ + +#undef _nc_parse_entry +int _nc_parse_entry( + struct entry *entryp, + int literal, + NCURSES_BOOL silent) + { return(*(int *)0); } + +#undef _nc_capcmp +int _nc_capcmp( + const char *s, + const char *t) + { return(*(int *)0); } + +typedef struct { + const char *from; + const char *to; +} assoc; + +/* ./tinfo/read_entry.c */ + +#undef _nc_tic_dir +const char *_nc_tic_dir( + const char *path) + { return(*(const char **)0); } + +#undef _nc_keep_tic_dir +void _nc_keep_tic_dir( + const char *path) + { /* void */ } + +#undef _nc_read_file_entry +int _nc_read_file_entry( + const char *const filename, + TERMTYPE *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry +int _nc_read_entry( + const char *const tn, + char *const filename, + TERMTYPE *const tp) + { return(*(int *)0); } + +/* ./tinfo/read_termcap.c */ + +#undef _nc_read_termcap_entry +int _nc_read_termcap_entry( + const char *const tn, + TERMTYPE *const tp) + { return(*(int *)0); } + +/* ./tinfo/setbuf.c */ + +#undef _nc_set_buffer +void _nc_set_buffer( + FILE *ofp, + NCURSES_BOOL buffered) + { /* void */ } + +/* ./tinfo/strings.c */ + +#undef _nc_str_init +string_desc *_nc_str_init( + string_desc *dst, + char *src, + size_t len) + { return(*(string_desc **)0); } + +#undef _nc_str_null +string_desc *_nc_str_null( + string_desc *dst, + size_t len) + { return(*(string_desc **)0); } + +#undef _nc_str_copy +string_desc *_nc_str_copy( + string_desc *dst, + string_desc *src) + { return(*(string_desc **)0); } + +#undef _nc_safe_strcat +NCURSES_BOOL _nc_safe_strcat( + string_desc *dst, + const char *src) + { return(*(NCURSES_BOOL *)0); } + +#undef _nc_safe_strcpy +NCURSES_BOOL _nc_safe_strcpy( + string_desc *dst, + const char *src) + { return(*(NCURSES_BOOL *)0); } + +/* ./trace/trace_buf.c */ + +typedef struct { + char *text; + size_t size; +} LIST; + +#undef _nc_trace_buf +char *_nc_trace_buf( + int bufnum, + size_t want) + { return(*(char **)0); } + +/* ./trace/trace_tries.c */ + +#undef _nc_trace_tries +void _nc_trace_tries( + struct tries *tree) + { /* void */ } + +/* ./unctrl.c */ + +#undef unctrl +char *unctrl( + chtype ch) + { return(*(char **)0); } + +/* ./trace/visbuf.c */ + +#undef _nc_visbuf2 +const char *_nc_visbuf2( + int bufnum, + const char *buf) + { return(*(const char **)0); } + +#undef _nc_visbuf +const char *_nc_visbuf( + const char *buf) + { return(*(const char **)0); } + +#undef _nc_viswbuf2 +const char *_nc_viswbuf2( + int bufnum, + const wchar_t *buf) + { return(*(const char **)0); } + +#undef _nc_viswbuf +const char *_nc_viswbuf( + const wchar_t *buf) + { return(*(const char **)0); } + +#undef _nc_viscbuf2 +const char *_nc_viscbuf2( + int bufnum, + const cchar_t *buf, + int len) + { return(*(const char **)0); } + +#undef _nc_viscbuf +const char *_nc_viscbuf( + const cchar_t *buf, + int len) + { return(*(const char **)0); } + +/* ./tinfo/write_entry.c */ + +#undef _nc_set_writedir +void _nc_set_writedir( + char *dir) + { /* void */ } + +#undef _nc_write_entry +void _nc_write_entry( + TERMTYPE *const tp) + { /* void */ } + +#undef _nc_tic_written +int _nc_tic_written(void) + { return(*(int *)0); } diff --git a/ncurses/modules b/ncurses/modules index eb84a07e..541df6f2 100644 --- a/ncurses/modules +++ b/ncurses/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.74 2000/10/03 08:51:18 tom Exp $ +# $Id: modules,v 1.90 2002/05/11 20:14:41 tom Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996-1998 +# Author: Thomas E. Dickey 1996-1998, etc. # @ base @@ -109,15 +109,36 @@ lib_wattroff lib $(base) lib_wattron lib $(base) lib_winch lib $(base) lib_window lib $(base) +link_test lib . ../include/curses.h nc_panel lib $(base) safe_sprintf lib $(base) tty_update lib $(serial) ../include/term.h +varargs lib $(trace) # Modules for porting memmove lib $(base) sigaction lib $(base) vsscanf lib $(base) +# XSI extensions to the base library (wide-character) +@ widechar +lib_box_set lib $(wide) +lib_cchar lib $(wide) +lib_get_wch lib $(wide) +lib_erasewchar lib $(wide) +lib_get_wstr lib $(wide) +lib_hline_set lib $(wide) +lib_in_wch lib $(wide) +lib_in_wchnstr lib $(wide) +lib_ins_nwstr lib $(wide) +lib_ins_wch lib $(wide) +lib_inwstr lib $(wide) +lib_unget_wch lib $(wide) +lib_vid_attr lib $(wide) ../include/term.h +lib_vline_set lib $(wide) +lib_wacs lib $(wide) +lib_wunctrl lib $(wide) + # Extensions to the base library @ ext_funcs define_key lib $(base) @@ -186,4 +207,5 @@ strings lib $(tinfo) trace_buf lib $(trace) trace_tries lib $(trace) unctrl lib . +visbuf lib $(trace) $(INCDIR)/tic.h write_entry lib $(tinfo) ../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h diff --git a/ncurses/tinfo/MKcaptab.awk b/ncurses/tinfo/MKcaptab.awk index 910af94b..ff9601ba 100644 --- a/ncurses/tinfo/MKcaptab.awk +++ b/ncurses/tinfo/MKcaptab.awk @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKcaptab.awk,v 1.11 1999/01/24 02:46:42 Jeffrey.C.Honig Exp $ +# $Id: MKcaptab.awk,v 1.12 2000/12/10 00:14:12 tom Exp $ AWK=${1-awk} DATA=${2-../include/Caps} @@ -11,6 +11,7 @@ cat <<'EOF' */ #include +#include #include #include @@ -58,12 +59,12 @@ cat <<'EOF' {(char *)NULL, (char *)NULL, (char *)NULL} }; -const struct name_table_entry *_nc_get_table(bool termcap) +NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool termcap) { return termcap ? _nc_cap_table: _nc_info_table ; } -const struct name_table_entry * const * _nc_get_hash_table(bool termcap) +NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_table (bool termcap) { return termcap ? _nc_cap_hash_table: _nc_info_hash_table ; } diff --git a/ncurses/tinfo/MKfallback.sh b/ncurses/tinfo/MKfallback.sh index 2a76f623..d1abcd2e 100755 --- a/ncurses/tinfo/MKfallback.sh +++ b/ncurses/tinfo/MKfallback.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: MKfallback.sh,v 1.9 1999/06/15 22:57:45 tom Exp $ +# $Id: MKfallback.sh,v 1.11 2001/12/02 01:55:30 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -8,6 +8,28 @@ # from an on-disk terminfo tree) tries to match the type with one of a # specified list of types generated in. # + +terminfo_dir=$1 +shift + +terminfo_src=$1 +shift + +if test $# != 0 ; then + tmp_info=tmp_info + echo creating temporary terminfo directory... >&2 + + TERMINFO=`pwd`/$tmp_info + export TERMINFO + + TERMINFO_DIRS=$TERMINFO:$terminfo_dir + export TERMINFO_DIRS + + tic $terminfo_src >&2 +else + tmp_info= +fi + cat <&2 + rm -rf $tmp_info +fi diff --git a/ncurses/tinfo/MKkeys_list.sh b/ncurses/tinfo/MKkeys_list.sh new file mode 100755 index 00000000..98d5b137 --- /dev/null +++ b/ncurses/tinfo/MKkeys_list.sh @@ -0,0 +1,62 @@ +#! /bin/sh +# $Id: MKkeys_list.sh,v 1.2 2001/06/16 16:50:35 tom Exp $ +############################################################################## +# Copyright (c) 2001 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# MKkey_defs.sh -- generate list of function-keys for terminfo database +# +# Author: Thomas E. Dickey 2001 +# +# Extract function-key names from the Caps file +# +: ${AWK-awk} +DATA=${1-../../include/Caps} + +data=data$$ +trap 'rm -f $data' 0 1 2 5 15 +sed -e 's/[ ]\+/ /g' < $DATA >$data + +cat < "namehdr" print "" > "namehdr" @@ -10,7 +10,7 @@ BEGIN { print "#include " > "namehdr" print "#define DCL(it) static IT data##it[]" > "namehdr" print "#else" > "namehdr" - print "#define DCL(it) IT it[]" > "namehdr" + print "#define DCL(it) NCURSES_EXPORT_VAR(IT) it[]" > "namehdr" print "#endif" > "namehdr" print "" > "namehdr" print "/*" > "boolnames" @@ -80,7 +80,7 @@ END { print "};" > "strcodes" print "" > "strcodes" print "#if BROKEN_LINKER" > "nameftr" - print "#define FIX(it) IT *_nc_##it(void) { return data##it; }" > "nameftr" + print "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return data##it; }" > "nameftr" print "FIX(boolnames)" > "nameftr" print "FIX(boolfnames)" > "nameftr" print "FIX(numnames)" > "nameftr" @@ -90,7 +90,7 @@ END { print "#endif /* BROKEN_LINKER */" > "nameftr" print "" > "codeftr" print "#if BROKEN_LINKER" > "codeftr" - print "#define FIX(it) IT *_nc_##it(void) { return data##it; }" > "codeftr" + print "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return data##it; }" > "codeftr" print "FIX(boolcodes)" > "codeftr" print "FIX(numcodes)" > "codeftr" print "FIX(strcodes)" > "codeftr" diff --git a/ncurses/tinfo/access.c b/ncurses/tinfo/access.c index 6fbe9217..f5240c12 100644 --- a/ncurses/tinfo/access.c +++ b/ncurses/tinfo/access.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,15 +27,44 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1998,2000 * + * Author: Thomas E. Dickey 1998,2000,2001 * ****************************************************************************/ #include #include +#include -MODULE_ID("$Id: access.c,v 1.4 2000/10/08 01:25:06 tom Exp $") +MODULE_ID("$Id: access.c,v 1.9 2001/06/23 22:11:49 tom Exp $") -char * +#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) + +NCURSES_EXPORT(char *) +_nc_rootname(char *path) +{ + char *result = _nc_basename(path); +#if !defined(MIXEDCASE_FILENAMES) || defined(PROG_EXT) + static char *temp; + char *s; + + temp = strdup(result); + result = temp; +#if !defined(MIXEDCASE_FILENAMES) + int n; + for (s = result; *s != '\0'; ++s) { + *s = LOWERCASE(*s); + } +#endif +#if defined(PROG_EXT) + if ((s = strrchr(result, '.')) != 0) { + if (!strcmp(s, PROG_EXT)) + *s = '\0'; + } +#endif +#endif + return result; +} + +NCURSES_EXPORT(char *) _nc_basename(char *path) { char *result = strrchr(path, '/'); @@ -50,7 +79,7 @@ _nc_basename(char *path) return result; } -int +NCURSES_EXPORT(int) _nc_access(const char *path, int mode) { if (access(path, mode) < 0) { @@ -78,7 +107,7 @@ _nc_access(const char *path, int mode) * Returns true if we allow application to use environment variables that are * used for searching lists of directories, etc. */ -int +NCURSES_EXPORT(int) _nc_env_access(void) { #if HAVE_ISSETUGID @@ -86,9 +115,9 @@ _nc_env_access(void) return FALSE; #elif HAVE_GETEUID && HAVE_GETEGID if (getuid() != geteuid() - || getgid() != getegid()) + || getgid() != getegid()) return FALSE; #endif - return getuid() != 0; /* ...finally, disallow root */ + return getuid() != 0 && geteuid() != 0; /* ...finally, disallow root */ } #endif diff --git a/ncurses/tinfo/add_tries.c b/ncurses/tinfo/add_tries.c index 601fb663..f83249cc 100644 --- a/ncurses/tinfo/add_tries.c +++ b/ncurses/tinfo/add_tries.c @@ -39,12 +39,12 @@ #include -MODULE_ID("$Id: add_tries.c,v 1.2 2000/03/18 22:23:56 tom Exp $") +MODULE_ID("$Id: add_tries.c,v 1.4 2000/12/10 02:55:07 tom Exp $") #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0' #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128)) -void +NCURSES_EXPORT(void) _nc_add_to_try(struct tries **tree, const char *str, unsigned short code) { static bool out_of_memory = FALSE; @@ -61,7 +61,7 @@ _nc_add_to_try(struct tries **tree, const char *str, unsigned short code) unsigned char cmp = *txt; while (!CMP_TRY(ptr->ch, cmp) - && ptr->sibling != 0) + && ptr->sibling != 0) ptr = ptr->sibling; if (CMP_TRY(ptr->ch, cmp)) { diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index 17489372..16f04f8d 100644 --- a/ncurses/tinfo/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,22 +47,25 @@ #include #include -MODULE_ID("$Id: alloc_entry.c,v 1.32 2000/03/12 00:16:31 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.37 2002/09/07 20:04:15 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 #define MAX_STRTAB 4096 /* documented maximum entry size */ -static char stringbuf[MAX_STRTAB]; /* buffer for string capabilities */ +static char *stringbuf; /* buffer for string capabilities */ static size_t next_free; /* next free character in stringbuf */ -void +NCURSES_EXPORT(void) _nc_init_entry(TERMTYPE * const tp) /* initialize a terminal type data block */ { int i; + if (stringbuf == 0) + stringbuf = malloc(MAX_STRTAB); + #if NCURSES_XNAMES tp->num_Booleans = BOOLCOUNT; tp->num_Numbers = NUMCOUNT; @@ -90,7 +93,7 @@ _nc_init_entry(TERMTYPE * const tp) next_free = 0; } -ENTRY * +NCURSES_EXPORT(ENTRY *) _nc_copy_entry(ENTRY * oldp) { ENTRY *newp = typeCalloc(ENTRY, 1); @@ -102,7 +105,7 @@ _nc_copy_entry(ENTRY * oldp) return newp; } -char * +NCURSES_EXPORT(char *) _nc_save_str(const char *const string) /* save a copy of string in the string buffer */ { @@ -118,14 +121,35 @@ _nc_save_str(const char *const string) return (stringbuf + old_next_free); } -void -_nc_wrap_entry(ENTRY * const ep) +NCURSES_EXPORT(void) +_nc_wrap_entry(ENTRY * const ep, bool copy_strings) /* copy the string parts to allocated storage, preserving pointers to it */ { int offsets[MAX_ENTRY_SIZE / 2], useoffsets[MAX_USES]; int i, n; TERMTYPE *tp = &(ep->tterm); + if (copy_strings) { + next_free = 0; /* clear static storage */ + + /* copy term_names, Strings, uses */ + tp->term_names = _nc_save_str(tp->term_names); + for_each_string(i, tp) { + if (tp->Strings[i] != ABSENT_STRING && + tp->Strings[i] != CANCELLED_STRING) { + tp->Strings[i] = _nc_save_str(tp->Strings[i]); + } + } + + for (i = 0; i < ep->nuses; i++) { + if (ep->uses[i].name == 0) { + ep->uses[i].name = _nc_save_str(ep->uses[i].name); + } + } + + free(tp->str_table); + } + n = tp->term_names - stringbuf; for_each_string(i, &(ep->tterm)) { if (tp->Strings[i] == ABSENT_STRING) @@ -144,7 +168,7 @@ _nc_wrap_entry(ENTRY * const ep) } if ((tp->str_table = typeMalloc(char, next_free)) == (char *) 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); (void) memcpy(tp->str_table, stringbuf, next_free); tp->term_names = tp->str_table + n; @@ -158,18 +182,20 @@ _nc_wrap_entry(ENTRY * const ep) } #if NCURSES_XNAMES - if ((n = NUM_EXT_NAMES(tp)) != 0) { - unsigned length = 0; - for (i = 0; i < n; i++) { - length += strlen(tp->ext_Names[i]) + 1; - offsets[i] = tp->ext_Names[i] - stringbuf; - } - if ((tp->ext_str_table = typeMalloc(char, length)) == 0) - _nc_err_abort("Out of memory"); - for (i = 0, length = 0; i < n; i++) { - tp->ext_Names[i] = tp->ext_str_table + length; - strcpy(tp->ext_Names[i], stringbuf + offsets[i]); - length += strlen(tp->ext_Names[i]) + 1; + if (!copy_strings) { + if ((n = NUM_EXT_NAMES(tp)) != 0) { + unsigned length = 0; + for (i = 0; i < n; i++) { + length += strlen(tp->ext_Names[i]) + 1; + offsets[i] = tp->ext_Names[i] - stringbuf; + } + if ((tp->ext_str_table = typeMalloc(char, length)) == 0) + _nc_err_abort(MSG_NO_MEMORY); + for (i = 0, length = 0; i < n; i++) { + tp->ext_Names[i] = tp->ext_str_table + length; + strcpy(tp->ext_Names[i], stringbuf + offsets[i]); + length += strlen(tp->ext_Names[i]) + 1; + } } } #endif @@ -182,8 +208,9 @@ _nc_wrap_entry(ENTRY * const ep) } } -void -_nc_merge_entry(TERMTYPE * const to, TERMTYPE * const from) +NCURSES_EXPORT(void) +_nc_merge_entry +(TERMTYPE * const to, TERMTYPE * const from) /* merge capabilities from `from' entry into `to' entry */ { int i; diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c index eac7c80f..bbc850e8 100644 --- a/ncurses/tinfo/alloc_ttype.c +++ b/ncurses/tinfo/alloc_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: alloc_ttype.c,v 1.10 2000/08/12 21:56:24 tom Exp $") +MODULE_ID("$Id: alloc_ttype.c,v 1.13 2002/09/28 15:28:43 tom Exp $") #if NCURSES_XNAMES /* @@ -291,7 +291,7 @@ _nc_ins_ext_name(TERMTYPE * tp, char *name, int token_type) int cmp = strcmp(name, tp->ext_Names[j]); if (cmp == 0) /* already present */ - return _nc_ext_data_index(tp, j, token_type); + return _nc_ext_data_index(tp, (int) j, token_type); if (cmp < 0) { break; } @@ -301,7 +301,7 @@ _nc_ins_ext_name(TERMTYPE * tp, char *name, int token_type) for (k = total - 1; k > j; k--) tp->ext_Names[k] = tp->ext_Names[k - 1]; tp->ext_Names[j] = name; - j = _nc_ext_data_index(tp, j, token_type); + j = _nc_ext_data_index(tp, (int) j, token_type); switch (token_type) { case BOOLEAN: @@ -370,8 +370,9 @@ adjust_cancels(TERMTYPE * to, TERMTYPE * from) } } -void -_nc_align_termtype(TERMTYPE * to, TERMTYPE * from) +NCURSES_EXPORT(void) +_nc_align_termtype +(TERMTYPE * to, TERMTYPE * from) { int na = NUM_EXT_NAMES(to); int nb = NUM_EXT_NAMES(from); @@ -455,8 +456,9 @@ _nc_align_termtype(TERMTYPE * to, TERMTYPE * from) } #endif -void -_nc_copy_termtype(TERMTYPE * dst, TERMTYPE * src) +NCURSES_EXPORT(void) +_nc_copy_termtype +(TERMTYPE * dst, TERMTYPE * src) { int i; diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c index da138268..e1b50b7b 100644 --- a/ncurses/tinfo/captoinfo.c +++ b/ncurses/tinfo/captoinfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ * * There is just one entry point: * - * char *captoinfo(n, s, parametrized) + * char *_nc_captoinfo(n, s, parametrized) * * Convert value s for termcap string capability named n into terminfo * format. @@ -92,7 +92,7 @@ #include #include -MODULE_ID("$Id: captoinfo.c,v 1.37 2000/04/01 20:07:34 tom Exp $") +MODULE_ID("$Id: captoinfo.c,v 1.43 2002/09/28 16:38:59 tom Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ @@ -115,7 +115,7 @@ init_string(void) if (my_string == 0) my_string = typeMalloc(char, my_length = 256); if (my_string == 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); *my_string = '\0'; return my_string; @@ -129,7 +129,7 @@ save_string(char *d, const char *const s) if (need > my_length) { my_string = (char *) realloc(my_string, my_length = (need + need)); if (my_string == 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); d = my_string + have; } (void) strcpy(d, s); @@ -137,10 +137,10 @@ save_string(char *d, const char *const s) } static inline char * -save_char(char *s, char c) +save_char(char *s, int c) { static char temp[2]; - temp[0] = c; + temp[0] = (char) c; return save_string(s, temp); } @@ -194,7 +194,7 @@ cvtchar(register const char *sp) case '2': case '3': len = 1; - while (isdigit(*sp)) { + while (isdigit(UChar(*sp))) { c = 8 * c + (*sp++ - '0'); len++; } @@ -268,13 +268,16 @@ getparm(int parm, int n) } } +/* + * Convert a termcap string to terminfo format. + * 'cap' is the relevant terminfo capability index. + * 's' is the string value of the capability. + * 'parametrized' tells what type of translations to do: + * % translations if 1 + * pad translations if >=0 + */ char * -_nc_captoinfo( -/* convert a termcap string to terminfo format */ - register const char *cap, /* relevant terminfo capability index */ - register const char *s, /* string value of the capability */ - int const parametrized /* do % translations if 1, pad translations if >=0 */ -) +_nc_captoinfo(const char *cap, const char *s, int const parametrized) { const char *capstart; @@ -291,9 +294,9 @@ _nc_captoinfo( capstart = 0; if (s == 0) s = ""; - if (parametrized >= 0 && isdigit(*s)) + if (parametrized >= 0 && isdigit(UChar(*s))) for (capstart = s;; s++) - if (!(isdigit(*s) || *s == '*' || *s == '.')) + if (!(isdigit(UChar(*s)) || *s == '*' || *s == '.')) break; while (*s != '\0') { @@ -349,7 +352,7 @@ _nc_captoinfo( break; case 'a': if ((*s == '=' || *s == '+' || *s == '-' - || *s == '*' || *s == '/') + || *s == '*' || *s == '/') && (s[1] == 'p' || s[1] == 'c') && s[2] != '\0') { int l; @@ -461,7 +464,7 @@ _nc_captoinfo( dp = save_char(dp, '%'); s--; _nc_warning("unknown %% code %s (%#x) in %s", - unctrl(*s), (*s) & 0xff, cap); + unctrl((chtype) *s), UChar(*s), cap); break; } break; @@ -542,7 +545,7 @@ _nc_captoinfo( if (capstart) { dp = save_string(dp, "$<"); for (s = capstart;; s++) - if (isdigit(*s) || *s == '*' || *s == '.') + if (isdigit(UChar(*s)) || *s == '*' || *s == '.') dp = save_char(dp, *s); else break; @@ -566,8 +569,8 @@ bcd_expression(const char *str) char ch1, ch2; if (sscanf(str, fmt, &ch1, &ch2) == 2 - && isdigit(ch1) - && isdigit(ch2) + && isdigit(UChar(ch1)) + && isdigit(UChar(ch2)) && (ch1 == ch2)) { len = 28; #ifndef NDEBUG @@ -594,7 +597,7 @@ save_tc_char(char *bufptr, int c1) bufptr = save_char(bufptr, c1); } else { if (c1 == (c1 & 0x1f)) /* iscntrl() returns T on 255 */ - (void) strcpy(temp, unctrl(c1)); + (void) strcpy(temp, unctrl((chtype) c1)); else (void) sprintf(temp, "\\%03o", c1); bufptr = save_string(bufptr, temp); @@ -629,13 +632,12 @@ save_tc_inequality(char *bufptr, int c1, int c2) * %m exclusive-or all parameters with 0177 (not in 4.4BSD) */ +/* + * Convert a terminfo string to termcap format. Parameters are as in + * _nc_captoinfo(). + */ char * -_nc_infotocap( -/* convert a terminfo string to termcap format */ - register const char *cap GCC_UNUSED, /* relevant termcap capability index */ - register const char *str, /* string value of the capability */ - int const parametrized /* do % translations if 1, pad translations if >=0 */ -) +_nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parametrized) { int seenone = 0, seentwo = 0, saw_m = 0, saw_n = 0; const char *padding; @@ -649,13 +651,13 @@ _nc_infotocap( padding = str + strlen(str) - 1; if (*padding == '>' && *--padding == '/') { --padding; - while (isdigit(*padding) || *padding == '.' || *padding == '*') + while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') padding--; if (*padding == '<' && *--padding == '$') trimmed = padding; padding += 2; - while (isdigit(*padding) || *padding == '.' || *padding == '*') + while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') bufptr = save_char(bufptr, *padding++); } @@ -667,8 +669,11 @@ _nc_infotocap( bufptr = save_char(bufptr, *++str); } else if (str[0] == '$' && str[1] == '<') { /* discard padding */ str += 2; - while (isdigit(*str) || *str == '.' || *str == '*' || *str == - '/' || *str == '>') + while (isdigit(UChar(*str)) + || *str == '.' + || *str == '*' + || *str == '/' + || *str == '>') str++; --str; } else if (str[0] == '%' && str[1] == '%') { /* escaped '%' */ @@ -692,7 +697,7 @@ _nc_infotocap( bufptr = save_string(bufptr, "%B"); } else if ((sscanf(str, "%%{%d}%%+%%c", &c1) == 1 || sscanf(str, "%%'%c'%%+%%c", &ch1) == 1) - && (cp = strchr(str, '+'))) { + && (cp = strchr(str, '+'))) { str = cp + 2; bufptr = save_string(bufptr, "%+"); @@ -732,7 +737,7 @@ _nc_infotocap( case '8': case '9': bufptr = save_char(bufptr, '%'); - while (isdigit(*str)) + while (isdigit(UChar(*str))) bufptr = save_char(bufptr, *str++); if (strchr("doxX.", *str)) { if (*str != 'd') /* termcap doesn't have octal, hex */ diff --git a/ncurses/tinfo/comp_error.c b/ncurses/tinfo/comp_error.c index 3767063d..ce1eaf56 100644 --- a/ncurses/tinfo/comp_error.c +++ b/ncurses/tinfo/comp_error.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* * comp_error.c -- Error message routines * @@ -41,92 +40,100 @@ #include -MODULE_ID("$Id: comp_error.c,v 1.17 1999/10/30 23:00:16 tom Exp $") +MODULE_ID("$Id: comp_error.c,v 1.25 2002/09/07 20:05:07 tom Exp $") -bool _nc_suppress_warnings = FALSE; -int _nc_curr_line = 0; /* current line # in input */ -int _nc_curr_col = 0; /* current column # in input */ +NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE; +NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */ +NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */ static const char *sourcename; -static char termtype[MAX_NAME_SIZE+1]; +static char *termtype; -void _nc_set_source(const char *const name) +NCURSES_EXPORT(void) +_nc_set_source(const char *const name) { - sourcename = name; + sourcename = name; } -void _nc_set_type(const char *const name) +NCURSES_EXPORT(void) +_nc_set_type(const char *const name) { + if (termtype == 0) + termtype = typeMalloc(char, MAX_NAME_SIZE + 1); + if (termtype != 0) { + termtype[0] = '\0'; if (name) - strncpy( termtype, name, MAX_NAME_SIZE ); - else - termtype[0] = '\0'; + strncat(termtype, name, MAX_NAME_SIZE); + } } -void _nc_get_type(char *name) +NCURSES_EXPORT(void) +_nc_get_type(char *name) { - strcpy( name, termtype ); + strcpy(name, termtype != 0 ? termtype : ""); } -static inline void where_is_problem(void) +static inline void +where_is_problem(void) { - fprintf (stderr, "\"%s\"", sourcename); - if (_nc_curr_line >= 0) - fprintf (stderr, ", line %d", _nc_curr_line); - if (_nc_curr_col >= 0) - fprintf (stderr, ", col %d", _nc_curr_col); - if (termtype[0]) - fprintf (stderr, ", terminal '%s'", termtype); - fputc(':', stderr); - fputc(' ', stderr); + fprintf(stderr, "\"%s\"", sourcename); + if (_nc_curr_line >= 0) + fprintf(stderr, ", line %d", _nc_curr_line); + if (_nc_curr_col >= 0) + fprintf(stderr, ", col %d", _nc_curr_col); + if (termtype != 0 && termtype[0] != '\0') + fprintf(stderr, ", terminal '%s'", termtype); + fputc(':', stderr); + fputc(' ', stderr); } -void _nc_warning(const char *const fmt, ...) +NCURSES_EXPORT(void) +_nc_warning(const char *const fmt,...) { -va_list argp; + va_list argp; - if (_nc_suppress_warnings) - return; + if (_nc_suppress_warnings) + return; - where_is_problem(); - va_start(argp,fmt); - vfprintf (stderr, fmt, argp); - fprintf (stderr, "\n"); - va_end(argp); + where_is_problem(); + va_start(argp, fmt); + vfprintf(stderr, fmt, argp); + fprintf(stderr, "\n"); + va_end(argp); } - -void _nc_err_abort(const char *const fmt, ...) +NCURSES_EXPORT(void) +_nc_err_abort(const char *const fmt,...) { -va_list argp; - - where_is_problem(); - va_start(argp,fmt); - vfprintf (stderr, fmt, argp); - fprintf (stderr, "\n"); - va_end(argp); - exit(EXIT_FAILURE); + va_list argp; + + where_is_problem(); + va_start(argp, fmt); + vfprintf(stderr, fmt, argp); + fprintf(stderr, "\n"); + va_end(argp); + exit(EXIT_FAILURE); } - -void _nc_syserr_abort(const char *const fmt, ...) +NCURSES_EXPORT(void) +_nc_syserr_abort(const char *const fmt,...) { -va_list argp; + va_list argp; - where_is_problem(); - va_start(argp,fmt); - vfprintf (stderr, fmt, argp); - fprintf (stderr, "\n"); - va_end(argp); + where_is_problem(); + va_start(argp, fmt); + vfprintf(stderr, fmt, argp); + fprintf(stderr, "\n"); + va_end(argp); - /* If we're debugging, try to show where the problem occurred - this - * will dump core. - */ + /* If we're debugging, try to show where the problem occurred - this + * will dump core. + */ #if defined(TRACE) || !defined(NDEBUG) - abort(); + abort(); #else - /* Dumping core in production code is not a good idea. - */ - exit(EXIT_FAILURE); + /* Dumping core in production code is not a good idea. + */ + exit(EXIT_FAILURE); #endif } diff --git a/ncurses/tinfo/comp_expand.c b/ncurses/tinfo/comp_expand.c index eb552fad..7ba438af 100644 --- a/ncurses/tinfo/comp_expand.c +++ b/ncurses/tinfo/comp_expand.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,155 +35,150 @@ #include #include -MODULE_ID("$Id: comp_expand.c,v 1.11 1999/03/07 00:51:07 tom Exp $") +MODULE_ID("$Id: comp_expand.c,v 1.17 2001/09/22 19:16:52 tom Exp $") -static int trailing_spaces(const char *src) +static int +trailing_spaces(const char *src) { - while (*src == ' ') - src++; - return *src == 0; + while (*src == ' ') + src++; + return *src == 0; } /* this deals with differences over whether 0x7f and 0x80..0x9f are controls */ -#define CHAR_OF(s) (*(unsigned const char *)(s)) -#define REALCTL(s) (CHAR_OF(s) < 127 && iscntrl(CHAR_OF(s))) -#define REALPRINT(s) (CHAR_OF(s) < 127 && isprint(CHAR_OF(s))) +#define REALCTL(s) (UChar(*(s)) < 127 && iscntrl(UChar(*(s)))) +#define REALPRINT(s) (UChar(*(s)) < 127 && isprint(UChar(*(s)))) -char *_nc_tic_expand(const char *srcp, bool tic_format, int numbers) +NCURSES_EXPORT(char *) +_nc_tic_expand +(const char *srcp, bool tic_format, int numbers) { -static char * buffer; -static size_t length; + static char *buffer; + static size_t length; -int bufp; -const char *ptr, *str = VALID_STRING(srcp) ? srcp : ""; -bool islong = (strlen(str) > 3); -size_t need = (2 + strlen(str)) * 4; -int ch; + int bufp; + const char *str = VALID_STRING(srcp) ? srcp : ""; + bool islong = (strlen(str) > 3); + size_t need = (2 + strlen(str)) * 4; + int ch; - if (buffer == 0 || need > length) { - if ((buffer = typeRealloc(char, length = need, buffer)) == 0) - return 0; - } + if (buffer == 0 || need > length) { + if ((buffer = typeRealloc(char, length = need, buffer)) == 0) + return 0; + } - bufp = 0; - ptr = str; - while ((ch = (*str & 0xff)) != 0) { - if (ch == '%' && REALPRINT(str+1)) { - buffer[bufp++] = *str++; - /* - * Though the character literals are more compact, most - * terminal descriptions use numbers and are not easy - * to read in character-literal form. - */ - switch (numbers) { - case -1: - if (str[0] == S_QUOTE - && str[1] != '\\' - && REALPRINT(str+1) - && str[2] == S_QUOTE) { - sprintf(buffer+bufp, "{%d}", str[1]); - bufp += strlen(buffer+bufp); - str += 2; - } else { - buffer[bufp++] = *str; - } - break; - /* - * If we have a "%{number}", try to translate it into - * a "%'char'" form, since that will run a little faster - * when we're interpreting it. Also, having one form - * for the constant makes it simpler to compare terminal - * descriptions. - */ - case 1: - if (str[0] == L_BRACE - && isdigit(str[1])) { - char *dst = 0; - long value = strtol(str+1, &dst, 0); - if (dst != 0 - && *dst == R_BRACE - && value < 127 - && value != '\\' /* FIXME */ - && isprint((int)value)) { - ch = (int)value; - buffer[bufp++] = S_QUOTE; - if (ch == '\\' - || ch == S_QUOTE) - buffer[bufp++] = '\\'; - buffer[bufp++] = ch; - buffer[bufp++] = S_QUOTE; - str = dst; - } else { - buffer[bufp++] = *str; - } - } else { - buffer[bufp++] = *str; - } - break; - default: - buffer[bufp++] = *str; - break; - } - } - else if (ch == 128) { - buffer[bufp++] = '\\'; - buffer[bufp++] = '0'; - } - else if (ch == '\033') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'E'; - } - else if (ch == '\\' && tic_format && (str == srcp || str[-1] != '^')) { - buffer[bufp++] = '\\'; - buffer[bufp++] = '\\'; - } - else if (ch == ' ' && tic_format && (str == srcp || trailing_spaces(str))) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 's'; + bufp = 0; + while ((ch = UChar(*str)) != 0) { + if (ch == '%' && REALPRINT(str + 1)) { + buffer[bufp++] = *str++; + /* + * Though the character literals are more compact, most + * terminal descriptions use numbers and are not easy + * to read in character-literal form. + */ + switch (numbers) { + case -1: + if (str[0] == S_QUOTE + && str[1] != '\\' + && REALPRINT(str + 1) + && str[2] == S_QUOTE) { + sprintf(buffer + bufp, "{%d}", str[1]); + bufp += strlen(buffer + bufp); + str += 2; + } else { + buffer[bufp++] = *str; } - else if ((ch == ',' || ch == ':' || ch == '^') && tic_format) { - buffer[bufp++] = '\\'; + break; + /* + * If we have a "%{number}", try to translate it into + * a "%'char'" form, since that will run a little faster + * when we're interpreting it. Also, having one form + * for the constant makes it simpler to compare terminal + * descriptions. + */ + case 1: + if (str[0] == L_BRACE + && isdigit(UChar(str[1]))) { + char *dst = 0; + long value = strtol(str + 1, &dst, 0); + if (dst != 0 + && *dst == R_BRACE + && value < 127 + && value != '\\' /* FIXME */ + && isprint((int) value)) { + ch = (int) value; + buffer[bufp++] = S_QUOTE; + if (ch == '\\' + || ch == S_QUOTE) + buffer[bufp++] = '\\'; buffer[bufp++] = ch; + buffer[bufp++] = S_QUOTE; + str = dst; + } else { + buffer[bufp++] = *str; + } + } else { + buffer[bufp++] = *str; } - else if (REALPRINT(str) && (ch != ',' && ch != ':' && !(ch == '!' && !tic_format) && ch != '^')) - buffer[bufp++] = ch; -#if 0 /* FIXME: this would be more readable (in fact the whole 'islong' logic should be removed) */ - else if (ch == '\b') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'b'; - } - else if (ch == '\f') { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'f'; - } - else if (ch == '\t' && islong) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 't'; - } + break; + default: + buffer[bufp++] = *str; + break; + } + } else if (ch == 128) { + buffer[bufp++] = '\\'; + buffer[bufp++] = '0'; + } else if (ch == '\033') { + buffer[bufp++] = '\\'; + buffer[bufp++] = 'E'; + } else if (ch == '\\' && tic_format && (str == srcp || str[-1] != '^')) { + buffer[bufp++] = '\\'; + buffer[bufp++] = '\\'; + } else if (ch == ' ' && tic_format && (str == srcp || + trailing_spaces(str))) { + buffer[bufp++] = '\\'; + buffer[bufp++] = 's'; + } else if ((ch == ',' || ch == ':' || ch == '^') && tic_format) { + buffer[bufp++] = '\\'; + buffer[bufp++] = ch; + } else if (REALPRINT(str) + && (ch != ',' + && ch != ':' + && !(ch == '!' && !tic_format) + && ch != '^')) + buffer[bufp++] = ch; +#if 0 /* FIXME: this would be more readable (in fact the whole 'islong' logic should be removed) */ + else if (ch == '\b') { + buffer[bufp++] = '\\'; + buffer[bufp++] = 'b'; + } else if (ch == '\f') { + buffer[bufp++] = '\\'; + buffer[bufp++] = 'f'; + } else if (ch == '\t' && islong) { + buffer[bufp++] = '\\'; + buffer[bufp++] = 't'; + } #endif - else if (ch == '\r' && (islong || (strlen(srcp) > 2 && str[1] == '\0'))) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'r'; - } - else if (ch == '\n' && islong) { - buffer[bufp++] = '\\'; - buffer[bufp++] = 'n'; - } + else if (ch == '\r' && (islong || (strlen(srcp) > 2 && str[1] == '\0'))) { + buffer[bufp++] = '\\'; + buffer[bufp++] = 'r'; + } else if (ch == '\n' && islong) { + buffer[bufp++] = '\\'; + buffer[bufp++] = 'n'; + } #define UnCtl(c) ((c) + '@') - else if (REALCTL(str) && ch != '\\' && (!islong || isdigit(str[1]))) - { - (void) sprintf(&buffer[bufp], "^%c", UnCtl(ch)); - bufp += 2; - } - else - { - (void) sprintf(&buffer[bufp], "\\%03o", ch); - bufp += 4; - } - - str++; + else if (REALCTL(str) && ch != '\\' + && (!islong || isdigit(UChar(str[1])))) { + (void) sprintf(&buffer[bufp], "^%c", UnCtl(ch)); + bufp += 2; + } else { + (void) sprintf(&buffer[bufp], "\\%03o", ch); + bufp += 4; } - buffer[bufp] = '\0'; - return(buffer); + str++; + } + + buffer[bufp] = '\0'; + return (buffer); } diff --git a/ncurses/tinfo/comp_hash.c b/ncurses/tinfo/comp_hash.c index 7e0bdd05..9f2ee710 100644 --- a/ncurses/tinfo/comp_hash.c +++ b/ncurses/tinfo/comp_hash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* * comp_hash.c --- Routines to deal with the hashtable of capability * names. @@ -46,12 +45,12 @@ #ifdef MAIN_PROGRAM #include #undef DEBUG -#define DEBUG(level, params) /*nothing*/ +#define DEBUG(level, params) /*nothing */ #endif -MODULE_ID("$Id: comp_hash.c,v 1.21 1999/06/26 21:25:11 tom Exp $") +MODULE_ID("$Id: comp_hash.c,v 1.25 2001/06/02 22:50:42 skimo Exp $") -static int hash_function(const char *); +static int hash_function(const char *); /* * _nc_make_hash_table() @@ -65,32 +64,33 @@ static int hash_function(const char *); #ifdef MAIN_PROGRAM #undef MODULE_ID -#define MODULE_ID(id) /*nothing*/ +#define MODULE_ID(id) /*nothing */ #include -static void _nc_make_hash_table(struct name_table_entry *table, - struct name_table_entry **hash_table) +static void +_nc_make_hash_table(struct name_table_entry *table, + struct name_table_entry **hash_table) { -int i; -int hashvalue; -int collisions = 0; + int i; + int hashvalue; + int collisions = 0; - for (i = 0; i < CAPTABSIZE; i++) { - hashvalue = hash_function(table[i].nte_name); + for (i = 0; i < CAPTABSIZE; i++) { + hashvalue = hash_function(table[i].nte_name); - if (hash_table[hashvalue] != (struct name_table_entry *) 0) - collisions++; + if (hash_table[hashvalue] != (struct name_table_entry *) 0) + collisions++; - if (hash_table[hashvalue] != 0) - table[i].nte_link = (short)(hash_table[hashvalue] - table); - hash_table[hashvalue] = &table[i]; - } + if (hash_table[hashvalue] != 0) + table[i].nte_link = (short) (hash_table[hashvalue] - table); + hash_table[hashvalue] = &table[i]; + } - DEBUG(4, ("Hash table complete: %d collisions out of %d entries", collisions, CAPTABSIZE)); + DEBUG(4, ("Hash table complete: %d collisions out of %d entries", + collisions, CAPTABSIZE)); } #endif - /* * int hash_function(string) * @@ -105,19 +105,18 @@ static int hash_function(const char *string) { -long sum = 0; + long sum = 0; - DEBUG(9, ("hashing %s", string)); - while (*string) { - sum += (long)(*string + (*(string + 1) << 8)); - string++; - } + DEBUG(9, ("hashing %s", string)); + while (*string) { + sum += (long) (*string + (*(string + 1) << 8)); + string++; + } - DEBUG(9, ("sum is %ld", sum)); - return (int)(sum % HASHTABSIZE); + DEBUG(9, ("sum is %ld", sum)); + return (int) (sum % HASHTABSIZE); } - /* * struct name_table_entry * * find_entry(string) @@ -128,23 +127,24 @@ long sum = 0; */ #ifndef MAIN_PROGRAM -struct name_table_entry const * -_nc_find_entry(const char *string, const struct name_table_entry *const *hash_table) +NCURSES_EXPORT(struct name_table_entry const *) +_nc_find_entry +(const char *string, const struct name_table_entry *const *hash_table) { -int hashvalue; -struct name_table_entry const *ptr; + int hashvalue; + struct name_table_entry const *ptr; - hashvalue = hash_function(string); + hashvalue = hash_function(string); - if ((ptr = hash_table[hashvalue]) != 0) { - while (strcmp(ptr->nte_name, string) != 0) { - if (ptr->nte_link < 0) - return 0; - ptr = ptr->nte_link + hash_table[HASHTABSIZE]; - } + if ((ptr = hash_table[hashvalue]) != 0) { + while (strcmp(ptr->nte_name, string) != 0) { + if (ptr->nte_link < 0) + return 0; + ptr = ptr->nte_link + hash_table[HASHTABSIZE]; } + } - return (ptr); + return (ptr); } /* @@ -158,19 +158,20 @@ struct name_table_entry const *ptr; * in the table or 0 if not found. */ -struct name_table_entry const * -_nc_find_type_entry(const char *string, - int type, - const struct name_table_entry *table) +NCURSES_EXPORT(struct name_table_entry const *) +_nc_find_type_entry +(const char *string, + int type, + const struct name_table_entry *table) { -struct name_table_entry const *ptr; + struct name_table_entry const *ptr; - for (ptr = table; ptr < table + CAPTABSIZE; ptr++) { - if (ptr->nte_type == type && strcmp(string, ptr->nte_name) == 0) - return(ptr); - } + for (ptr = table; ptr < table + CAPTABSIZE; ptr++) { + if (ptr->nte_type == type && strcmp(string, ptr->nte_name) == 0) + return (ptr); + } - return ((struct name_table_entry *)NULL); + return ((struct name_table_entry *) NULL); } #endif @@ -187,139 +188,144 @@ struct name_table_entry const *ptr; #define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ -static char **parse_columns(char *buffer) +static char ** +parse_columns(char *buffer) { - static char **list; - - int col = 0; - - if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) - return(0); - - if (*buffer != '#') { - while (*buffer != '\0') { - char *s; - for (s = buffer; (*s != '\0') && !isspace(*s); s++) - /*EMPTY*/; - if (s != buffer) { - char mark = *s; - *s = '\0'; - if ((s - buffer) > 1 - && (*buffer == '"') - && (s[-1] == '"')) { /* strip the quotes */ - buffer++; - s[-1] = '\0'; - } - list[col] = buffer; - col++; - if (mark == '\0') - break; - while (*++s && isspace(*s)) - /*EMPTY*/; - buffer = s; - } else - break; + static char **list; + + int col = 0; + + if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) + return (0); + + if (*buffer != '#') { + while (*buffer != '\0') { + char *s; + for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) + /*EMPTY */ ; + if (s != buffer) { + char mark = *s; + *s = '\0'; + if ((s - buffer) > 1 + && (*buffer == '"') + && (s[-1] == '"')) { /* strip the quotes */ + buffer++; + s[-1] = '\0'; } + list[col] = buffer; + col++; + if (mark == '\0') + break; + while (*++s && isspace(UChar(*s))) + /*EMPTY */ ; + buffer = s; + } else + break; } - return col ? list : 0; + } + return col ? list : 0; } -int main(int argc, char **argv) +int +main(int argc, char **argv) { - struct name_table_entry *name_table = typeCalloc(struct name_table_entry, CAPTABSIZE); - struct name_table_entry **hash_table = typeCalloc(struct name_table_entry *, HASHTABSIZE); - const char *root_name = ""; - int column = 0; - int n; - char buffer[BUFSIZ]; - - static const char * typenames[] = { "BOOLEAN", "NUMBER", "STRING" }; - - short BoolCount = 0; - short NumCount = 0; - short StrCount = 0; - - /* The first argument is the column-number (starting with 0). - * The second is the root name of the tables to generate. - */ - if (argc <= 2 - || (column = atoi(argv[1])) <= 0 - || (column >= MAX_COLUMNS) - || *(root_name = argv[2]) == 0) { - fprintf(stderr, "usage: make_hash column root_name\n"); - exit(EXIT_FAILURE); + struct name_table_entry *name_table = typeCalloc(struct + name_table_entry, CAPTABSIZE); + struct name_table_entry **hash_table = typeCalloc(struct name_table_entry + *, HASHTABSIZE); + const char *root_name = ""; + int column = 0; + int n; + char buffer[BUFSIZ]; + + static const char *typenames[] = + {"BOOLEAN", "NUMBER", "STRING"}; + + short BoolCount = 0; + short NumCount = 0; + short StrCount = 0; + + /* The first argument is the column-number (starting with 0). + * The second is the root name of the tables to generate. + */ + if (argc <= 2 + || (column = atoi(argv[1])) <= 0 + || (column >= MAX_COLUMNS) + || *(root_name = argv[2]) == 0) { + fprintf(stderr, "usage: make_hash column root_name\n"); + exit(EXIT_FAILURE); + } + + /* + * Read the table into our arrays. + */ + for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) { + char **list, *nlp = strchr(buffer, '\n'); + if (nlp) + *nlp = '\0'; + list = parse_columns(buffer); + if (list == 0) /* blank or comment */ + continue; + name_table[n].nte_link = -1; /* end-of-hash */ + name_table[n].nte_name = strdup(list[column]); + if (!strcmp(list[2], "bool")) { + name_table[n].nte_type = BOOLEAN; + name_table[n].nte_index = BoolCount++; + } else if (!strcmp(list[2], "num")) { + name_table[n].nte_type = NUMBER; + name_table[n].nte_index = NumCount++; + } else if (!strcmp(list[2], "str")) { + name_table[n].nte_type = STRING; + name_table[n].nte_index = StrCount++; + } else { + fprintf(stderr, "Unknown type: %s\n", list[2]); + exit(EXIT_FAILURE); } - - /* - * Read the table into our arrays. - */ - for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin); ) { - char **list, *nlp = strchr(buffer, '\n'); - if (nlp) - *nlp = '\0'; - list = parse_columns(buffer); - if (list == 0) /* blank or comment */ - continue; - name_table[n].nte_link = -1; /* end-of-hash */ - name_table[n].nte_name = strdup(list[column]); - if (!strcmp(list[2], "bool")) { - name_table[n].nte_type = BOOLEAN; - name_table[n].nte_index = BoolCount++; - } else if (!strcmp(list[2], "num")) { - name_table[n].nte_type = NUMBER; - name_table[n].nte_index = NumCount++; - } else if (!strcmp(list[2], "str")) { - name_table[n].nte_type = STRING; - name_table[n].nte_index = StrCount++; - } else { - fprintf(stderr, "Unknown type: %s\n", list[2]); - exit(EXIT_FAILURE); - } - n++; + n++; + } + _nc_make_hash_table(name_table, hash_table); + + /* + * Write the compiled tables to standard output + */ + printf("static struct name_table_entry const _nc_%s_table[] =\n", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + sprintf(buffer, "\"%s\"", + name_table[n].nte_name); + printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", + buffer, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + } + printf("};\n\n"); + + printf("const struct name_table_entry * const _nc_%s_hash_table[%d] =\n", + root_name, + HASHTABSIZE + 1); + printf("{\n"); + for (n = 0; n < HASHTABSIZE; n++) { + if (hash_table[n] != 0) { + sprintf(buffer, "_nc_%s_table + %3ld", + root_name, + (long) (hash_table[n] - name_table)); + } else { + strcpy(buffer, "0"); } - _nc_make_hash_table(name_table, hash_table); - - /* - * Write the compiled tables to standard output - */ - printf("static struct name_table_entry const _nc_%s_table[] =\n", - root_name); - printf("{\n"); - for (n = 0; n < CAPTABSIZE; n++) { - sprintf(buffer, "\"%s\"", - name_table[n].nte_name); - printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", - buffer, - typenames[name_table[n].nte_type], - name_table[n].nte_index, - name_table[n].nte_link, - n < CAPTABSIZE - 1 ? ',' : ' '); - } - printf("};\n\n"); - - printf("const struct name_table_entry * const _nc_%s_hash_table[%d] =\n", - root_name, - HASHTABSIZE+1); - printf("{\n"); - for (n = 0; n < HASHTABSIZE; n++) { - if (hash_table[n] != 0) { - sprintf(buffer, "_nc_%s_table + %3ld", - root_name, - (long) (hash_table[n] - name_table)); - } else { - strcpy(buffer, "0"); - } - printf("\t%s,\n", buffer); - } - printf("\t_nc_%s_table\t/* base-of-table */\n", root_name); - printf("};\n\n"); - - printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", - BoolCount, NumCount, StrCount); - printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); - printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); - printf("#endif\n\n"); - - return EXIT_SUCCESS; + printf("\t%s,\n", buffer); + } + printf("\t_nc_%s_table\t/* base-of-table */\n", root_name); + printf("};\n\n"); + + printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", + BoolCount, NumCount, StrCount); + printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); + printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); + printf("#endif\n\n"); + + return EXIT_SUCCESS; } #endif diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index ecb2f583..a5dc70ce 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -52,10 +52,10 @@ #include #include -MODULE_ID("$Id: comp_parse.c,v 1.42 2000/10/14 17:50:45 Bernhard.Rosenkraenzer Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.53 2002/09/07 20:01:28 tom Exp $") static void sanity_check(TERMTYPE *); -void (*_nc_check_termtype) (TERMTYPE *) = sanity_check; +NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check; /**************************************************************************** * @@ -78,7 +78,8 @@ void (*_nc_check_termtype) (TERMTYPE *) = sanity_check; * _nc_head _nc_tail */ -ENTRY *_nc_head = 0, *_nc_tail = 0; +NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0; +NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0; static void enqueue(ENTRY * ep) @@ -87,7 +88,7 @@ enqueue(ENTRY * ep) ENTRY *newp = _nc_copy_entry(ep); if (newp == 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); newp->last = _nc_tail; _nc_tail = newp; @@ -97,7 +98,7 @@ enqueue(ENTRY * ep) newp->last->next = newp; } -void +NCURSES_EXPORT(void) _nc_free_entries(ENTRY * headp) /* free the allocated storage consumed by list entries */ { @@ -136,7 +137,7 @@ force_bar(char *dst, char *src) return src; } -bool +NCURSES_EXPORT(bool) _nc_entry_match(char *n1, char *n2) /* do any of the aliases in a pair of terminal names match? */ { @@ -161,10 +162,10 @@ _nc_entry_match(char *n1, char *n2) * ****************************************************************************/ -void +NCURSES_EXPORT(void) _nc_read_entry_source(FILE * fp, char *buf, - int literal, bool silent, - bool(*hook) (ENTRY *)) + int literal, bool silent, + bool(*hook) (ENTRY *)) /* slurp all entries in the given file into core */ { ENTRY thisentry; @@ -179,7 +180,7 @@ _nc_read_entry_source(FILE * fp, char *buf, memset(&thisentry, 0, sizeof(thisentry)); if (_nc_parse_entry(&thisentry, literal, silent) == ERR) break; - if (!isalnum(thisentry.tterm.term_names[0])) + if (!isalnum(UChar(thisentry.tterm.term_names[0]))) _nc_err_abort("terminal names must start with letter or digit"); /* @@ -209,7 +210,7 @@ _nc_read_entry_source(FILE * fp, char *buf, _nc_suppress_warnings = oldsuppress; } -int +NCURSES_EXPORT(int) _nc_resolve_uses(bool fullresolve) /* try to resolve all use capabilities */ { @@ -226,17 +227,18 @@ _nc_resolve_uses(bool fullresolve) for_entry_list(qp) { int matchcount = 0; - for_entry_list(rp) + for_entry_list(rp) { if (qp > rp - && _nc_entry_match(qp->tterm.term_names, rp->tterm.term_names)) { - matchcount++; - if (matchcount == 1) { - (void) fprintf(stderr, "Name collision between %s", - _nc_first_name(qp->tterm.term_names)); - multiples++; + && _nc_entry_match(qp->tterm.term_names, rp->tterm.term_names)) { + matchcount++; + if (matchcount == 1) { + (void) fprintf(stderr, "Name collision between %s", + _nc_first_name(qp->tterm.term_names)); + multiples++; + } + if (matchcount >= 1) + (void) fprintf(stderr, " %s", _nc_first_name(rp->tterm.term_names)); } - if (matchcount >= 1) - (void) fprintf(stderr, " %s", _nc_first_name(rp->tterm.term_names)); } if (matchcount >= 1) (void) putc('\n', stderr); @@ -264,14 +266,15 @@ _nc_resolve_uses(bool fullresolve) _nc_set_type(child); /* first, try to resolve from in-core records */ - for_entry_list(rp) + for_entry_list(rp) { if (rp != qp - && _nc_name_match(rp->tterm.term_names, lookfor, "|")) { - DEBUG(2, ("%s: resolving use=%s (in core)", - child, lookfor)); + && _nc_name_match(rp->tterm.term_names, lookfor, "|")) { + DEBUG(2, ("%s: resolving use=%s (in core)", + child, lookfor)); - qp->uses[i].link = rp; - foundit = TRUE; + qp->uses[i].link = rp; + foundit = TRUE; + } } /* if that didn't work, try to merge in a compiled entry */ @@ -282,11 +285,11 @@ _nc_resolve_uses(bool fullresolve) memset(&thisterm, 0, sizeof(thisterm)); if (_nc_read_entry(lookfor, filename, &thisterm) == 1) { DEBUG(2, ("%s: resolving use=%s (compiled)", - child, lookfor)); + child, lookfor)); rp = typeMalloc(ENTRY, 1); if (rp == 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); rp->tterm = thisterm; rp->nuses = 0; rp->next = lastread; @@ -317,8 +320,8 @@ _nc_resolve_uses(bool fullresolve) DEBUG(2, ("NAME RESOLUTION COMPLETED OK")); /* - * OK, at this point all (char *) references in `name' mwmbers - * have been successfully converred to (ENTRY *) pointers in + * OK, at this point all (char *) references in `name' members + * have been successfully converted to (ENTRY *) pointers in * `link' members. Time to do the actual merges. */ if (fullresolve) { @@ -330,7 +333,7 @@ _nc_resolve_uses(bool fullresolve) for_entry_list(qp) { if (qp->nuses > 0) { DEBUG(2, ("%s: attempting merge", - _nc_first_name(qp->tterm.term_names))); + _nc_first_name(qp->tterm.term_names))); /* * If any of the use entries we're looking for is * incomplete, punt. We'll catch this entry on a @@ -339,7 +342,7 @@ _nc_resolve_uses(bool fullresolve) for (i = 0; i < qp->nuses; i++) if (qp->uses[i].link->nuses) { DEBUG(2, ("%s: use entry %d unresolved", - _nc_first_name(qp->tterm.term_names), i)); + _nc_first_name(qp->tterm.term_names), i)); goto incomplete; } @@ -357,7 +360,7 @@ _nc_resolve_uses(bool fullresolve) */ for (; qp->nuses; qp->nuses--) _nc_merge_entry(&merged, - &qp->uses[qp->nuses - 1].link->tterm); + &qp->uses[qp->nuses - 1].link->tterm); /* * Now merge in the original entry. @@ -371,6 +374,7 @@ _nc_resolve_uses(bool fullresolve) FreeIfNeeded(qp->tterm.Numbers); FreeIfNeeded(qp->tterm.Strings); qp->tterm = merged; + _nc_wrap_entry(qp, TRUE); /* * We know every entry is resolvable because name resolution @@ -392,15 +396,18 @@ _nc_resolve_uses(bool fullresolve) * entry there should be no cancellation markers. */ for_entry_list(qp) { - for_each_boolean(j, &(qp->tterm)) - if (qp->tterm.Booleans[j] == CANCELLED_BOOLEAN) - qp->tterm.Booleans[j] = ABSENT_BOOLEAN; - for_each_number(j, &(qp->tterm)) + for_each_boolean(j, &(qp->tterm)) { + if ((int) qp->tterm.Booleans[j] == CANCELLED_BOOLEAN) + qp->tterm.Booleans[j] = ABSENT_BOOLEAN; + } + for_each_number(j, &(qp->tterm)) { if (qp->tterm.Numbers[j] == CANCELLED_NUMERIC) - qp->tterm.Numbers[j] = ABSENT_NUMERIC; - for_each_string(j, &(qp->tterm)) + qp->tterm.Numbers[j] = ABSENT_NUMERIC; + } + for_each_string(j, &(qp->tterm)) { if (qp->tterm.Strings[j] == CANCELLED_STRING) - qp->tterm.Strings[j] = ABSENT_STRING; + qp->tterm.Strings[j] = ABSENT_STRING; + } } } @@ -444,20 +451,28 @@ sanity_check(TERMTYPE * tp) bool terminal_entry = !strchr(tp->term_names, '+'); if (terminal_entry && (PRESENT(set_attributes) - || PRESENT(enter_standout_mode) - || PRESENT(enter_underline_mode) - || PRESENT(enter_blink_mode) - || PRESENT(enter_bold_mode) - || PRESENT(enter_dim_mode) - || PRESENT(enter_secure_mode) - || PRESENT(enter_protected_mode) - || PRESENT(enter_reverse_mode))) + || PRESENT(enter_standout_mode) + || PRESENT(enter_underline_mode) + || PRESENT(enter_blink_mode) + || PRESENT(enter_bold_mode) + || PRESENT(enter_dim_mode) + || PRESENT(enter_secure_mode) + || PRESENT(enter_protected_mode) + || PRESENT(enter_reverse_mode))) _nc_warning("no exit_attribute_mode"); #endif /* __UNUSED__ */ - PAIRED(enter_standout_mode, exit_standout_mode) - PAIRED(enter_underline_mode, exit_underline_mode) + PAIRED(enter_standout_mode, exit_standout_mode); + PAIRED(enter_underline_mode, exit_underline_mode); } + /* we do this check/fix in postprocess_termcap(), but some packagers + * prefer to bypass it... + */ + if (acs_chars == 0 + && enter_alt_charset_mode != 0 + && exit_alt_charset_mode != 0) + acs_chars = strdup(VT_ACSC); + /* listed in structure-member order of first argument */ PAIRED(enter_alt_charset_mode, exit_alt_charset_mode); ANDMISSING(enter_alt_charset_mode, acs_chars); @@ -479,6 +494,8 @@ sanity_check(TERMTYPE * tp) PAIRED(enter_xon_mode, exit_xon_mode); PAIRED(enter_am_mode, exit_am_mode); ANDMISSING(label_off, label_on); +#ifdef remove_clock PAIRED(display_clock, remove_clock); +#endif ANDMISSING(set_color_pair, initialize_pair); } diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index e1118f6f..2c82b4b9 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.47 2000/09/24 01:15:17 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.61 2002/09/07 20:04:09 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -60,14 +60,22 @@ MODULE_ID("$Id: comp_scan.c,v 1.47 2000/09/24 01:15:17 tom Exp $") #define iswhite(ch) (ch == ' ' || ch == '\t') -int _nc_syntax = 0; /* termcap or terminfo? */ -long _nc_curr_file_pos = 0; /* file offset of current line */ -long _nc_comment_start = 0; /* start of comment range before name */ -long _nc_comment_end = 0; /* end of comment range before name */ -long _nc_start_line = 0; /* start line of current entry */ - -struct token _nc_curr_token = -{0, 0, 0}; +NCURSES_EXPORT_VAR(int) +_nc_syntax = 0; /* termcap or terminfo? */ +NCURSES_EXPORT_VAR(long) +_nc_curr_file_pos = 0; /* file offset of current line */ +NCURSES_EXPORT_VAR(long) +_nc_comment_start = 0; /* start of comment range before name */ +NCURSES_EXPORT_VAR(long) +_nc_comment_end = 0; /* end of comment range before name */ +NCURSES_EXPORT_VAR(long) +_nc_start_line = 0; /* start line of current entry */ + +NCURSES_EXPORT_VAR(struct token) +_nc_curr_token = +{ + 0, 0, 0 +}; /***************************************************************************** * @@ -78,10 +86,11 @@ struct token _nc_curr_token = static bool first_column; /* See 'next_char()' below */ static char separator; /* capability separator */ static int pushtype; /* type of pushback token */ -static char pushname[MAX_NAME_SIZE + 1]; +static char *pushname; #if NCURSES_EXT_FUNCS -bool _nc_disable_period = FALSE; /* used by tic -a option */ +NCURSES_EXPORT_VAR(bool) +_nc_disable_period = FALSE; /* used by tic -a option */ #endif static int last_char(void); @@ -133,30 +142,32 @@ eat_escaped_newline(int ch) * */ -int -_nc_get_token(void) +NCURSES_EXPORT(int) +_nc_get_token(bool silent) { static const char terminfo_punct[] = "@%&*!#"; - long number; - int type; - int ch; + static char *buffer; + char *numchk; - char numbuf[80]; - unsigned found; - static char buffer[MAX_ENTRY_SIZE]; char *ptr; + char numbuf[80]; + int ch; int dot_flag = FALSE; + int type; + long number; long token_start; + unsigned found; if (pushtype != NO_PUSHBACK) { int retval = pushtype; - _nc_set_type(pushname); + _nc_set_type(pushname != 0 ? pushname : ""); DEBUG(3, ("pushed-back token: `%s', class %d", _nc_curr_token.tk_name, pushtype)); pushtype = NO_PUSHBACK; - pushname[0] = '\0'; + if (pushname != 0) + pushname[0] = '\0'; /* currtok wasn't altered by _nc_push_token() */ return (retval); @@ -202,12 +213,16 @@ _nc_get_token(void) && !(ch == '.' && _nc_disable_period) #endif && !strchr(terminfo_punct, (char) ch)) { - _nc_warning("Illegal character (expected alphanumeric or %s) - %s", - terminfo_punct, unctrl(ch)); + if (!silent) + _nc_warning("Illegal character (expected alphanumeric or %s) - %s", + terminfo_punct, unctrl((chtype) ch)); _nc_panic_mode(separator); goto start_token; } + if (buffer == 0) + buffer = typeMalloc(char, MAX_ENTRY_SIZE); + ptr = buffer; *(ptr++) = ch; @@ -221,7 +236,7 @@ _nc_get_token(void) _nc_syntax = ERR; while ((ch = next_char()) != '\n') { if (ch == EOF) - _nc_err_abort("premature EOF"); + _nc_err_abort(MSG_NO_MEMORY); else if (ch == ':' && last_char() != ',') { _nc_syntax = SYN_TERMCAP; separator = ':'; @@ -230,13 +245,11 @@ _nc_get_token(void) _nc_syntax = SYN_TERMINFO; separator = ','; /* - * Fall-through here is not an accident. - * The idea is that if we see a comma, we - * figure this is terminfo unless we - * subsequently run into a colon -- but - * we don't stop looking for that colon until - * hitting a newline. This allows commas to - * be embedded in description fields of + * Fall-through here is not an accident. The idea is that + * if we see a comma, we figure this is terminfo unless we + * subsequently run into a colon -- but we don't stop + * looking for that colon until hitting a newline. This + * allows commas to be embedded in description fields of * either syntax. */ /* FALLTHRU */ @@ -248,11 +261,10 @@ _nc_get_token(void) ptr[0] = '\0'; if (_nc_syntax == ERR) { /* - * Grrr...what we ought to do here is barf, - * complaining that the entry is malformed. - * But because a couple of name fields in the - * 8.2 termcap file end with |\, we just have - * to assume it's termcap syntax. + * Grrr...what we ought to do here is barf, complaining that + * the entry is malformed. But because a couple of name fields + * in the 8.2 termcap file end with |\, we just have to assume + * it's termcap syntax. */ _nc_syntax = SYN_TERMCAP; separator = ':'; @@ -264,8 +276,8 @@ _nc_get_token(void) } /* - * This is the soonest we have the terminal name - * fetched. Set up for following warning messages. + * This is the soonest we have the terminal name fetched. Set up + * for following warning messages. */ ptr = strchr(buffer, '|'); if (ptr == (char *) NULL) @@ -276,11 +288,11 @@ _nc_get_token(void) *ptr = ch; /* - * Compute the boundary between the aliases and the - * description field for syntax-checking purposes. + * Compute the boundary between the aliases and the description + * field for syntax-checking purposes. */ desc = strrchr(buffer, '|'); - if (desc) { + if (!silent && desc) { if (*desc == '\0') _nc_warning("empty longname field"); else if (strchr(desc, ' ') == (char *) NULL) @@ -290,20 +302,22 @@ _nc_get_token(void) desc = buffer + strlen(buffer); /* - * Whitespace in a name field other than the long name - * can confuse rdist and some termcap tools. Slashes - * are a no-no. Other special characters can be - * dangerous due to shell expansion. + * Whitespace in a name field other than the long name can confuse + * rdist and some termcap tools. Slashes are a no-no. Other + * special characters can be dangerous due to shell expansion. */ for (ptr = buffer; ptr < desc; ptr++) { - if (isspace(*ptr)) { - _nc_warning("whitespace in name or alias field"); + if (isspace(UChar(*ptr))) { + if (!silent) + _nc_warning("whitespace in name or alias field"); break; } else if (*ptr == '/') { - _nc_warning("slashes aren't allowed in names or aliases"); + if (!silent) + _nc_warning("slashes aren't allowed in names or aliases"); break; } else if (strchr("$[]!*?", *ptr)) { - _nc_warning("dubious character `%c' in name or alias field", *ptr); + if (!silent) + _nc_warning("dubious character `%c' in name or alias field", *ptr); break; } } @@ -336,9 +350,9 @@ _nc_get_token(void) type = BOOLEAN; break; case '@': - if ((ch = next_char()) != separator) + if ((ch = next_char()) != separator && !silent) _nc_warning("Missing separator after `%s', have %s", - buffer, unctrl(ch)); + buffer, unctrl((chtype) ch)); _nc_curr_token.tk_name = buffer; type = CANCEL; break; @@ -352,18 +366,20 @@ _nc_get_token(void) } numbuf[found] = '\0'; number = strtol(numbuf, &numchk, 0); - if (numchk == numbuf) - _nc_warning("no value given for `%s'", buffer); - if ((*numchk != '\0') || (ch != separator)) - _nc_warning("Missing separator"); + if (!silent) { + if (numchk == numbuf) + _nc_warning("no value given for `%s'", buffer); + if ((*numchk != '\0') || (ch != separator)) + _nc_warning("Missing separator"); + } _nc_curr_token.tk_name = buffer; _nc_curr_token.tk_valnumber = number; type = NUMBER; break; case '=': - ch = _nc_trans_string(ptr, buffer + sizeof(buffer)); - if (ch != separator) + ch = _nc_trans_string(ptr, buffer + MAX_ENTRY_SIZE); + if (!silent && ch != separator) _nc_warning("Missing separator"); _nc_curr_token.tk_name = buffer; _nc_curr_token.tk_valstring = ptr; @@ -376,7 +392,8 @@ _nc_get_token(void) default: /* just to get rid of the compiler warning */ type = UNDEF; - _nc_warning("Illegal character - %s", unctrl(ch)); + if (!silent) + _nc_warning("Illegal character - %s", unctrl((chtype) ch)); } } /* end else (first_column == FALSE) */ } /* end else (ch != EOF) */ @@ -428,9 +445,12 @@ _nc_get_token(void) #endif if (dot_flag == TRUE) /* if commented out, use the next one */ - type = _nc_get_token(); + type = _nc_get_token(silent); - DEBUG(3, ("token: `%s', class %d", _nc_curr_token.tk_name, type)); + DEBUG(3, ("token: `%s', class %d", + _nc_curr_token.tk_name != 0 ? _nc_curr_token.tk_name : + "", + type)); return (type); } @@ -454,11 +474,11 @@ _nc_get_token(void) * */ -char +NCURSES_EXPORT(char) _nc_trans_string(char *ptr, char *last) { int count = 0; - int number; + int number = 0; int i, c; chtype ch, last_ch = '\0'; bool ignored = FALSE; @@ -472,7 +492,7 @@ _nc_trans_string(char *ptr, char *last) if (ch == '^' && last_ch != '%') { ch = c = next_char(); if (c == EOF) - _nc_err_abort("Premature EOF"); + _nc_err_abort(MSG_NO_INPUTS); if (!(is7bits(ch) && isprint(ch))) { _nc_warning("Illegal ^ character - %s", unctrl(ch)); @@ -489,14 +509,14 @@ _nc_trans_string(char *ptr, char *last) } else if (ch == '\\') { ch = c = next_char(); if (c == EOF) - _nc_err_abort("Premature EOF"); + _nc_err_abort(MSG_NO_INPUTS); if (ch >= '0' && ch <= '7') { number = ch - '0'; for (i = 0; i < 2; i++) { ch = c = next_char(); if (c == EOF) - _nc_err_abort("Premature EOF"); + _nc_err_abort(MSG_NO_INPUTS); if (c < '0' || c > '7') { if (isdigit(c)) { @@ -608,16 +628,18 @@ _nc_trans_string(char *ptr, char *last) * get_token() call. */ -void +NCURSES_EXPORT(void) _nc_push_token(int tokclass) { /* - * This implementation is kind of bogus, it will fail if we ever do - * more than one pushback at a time between get_token() calls. It - * relies on the fact that curr_tok is static storage that nothing - * but get_token() touches. + * This implementation is kind of bogus, it will fail if we ever do more + * than one pushback at a time between get_token() calls. It relies on the + * fact that _nc_curr_token is static storage that nothing but + * _nc_get_token() touches. */ pushtype = tokclass; + if (pushname == 0) + pushname = typeMalloc(char, MAX_NAME_SIZE + 1); _nc_get_type(pushname); DEBUG(3, ("pushing token: `%s', class %d", @@ -627,7 +649,7 @@ _nc_push_token(int tokclass) /* * Panic mode error recovery - skip everything until a "ch" is found. */ -void +NCURSES_EXPORT(void) _nc_panic_mode(char ch) { int c; @@ -661,11 +683,12 @@ static FILE *yyin; /* scanner's input file descriptor */ * non-null. */ -void +NCURSES_EXPORT(void) _nc_reset_input(FILE * fp, char *buf) { pushtype = NO_PUSHBACK; - pushname[0] = '\0'; + if (pushname != 0) + pushname[0] = '\0'; yyin = fp; bufstart = bufptr = buf; _nc_curr_file_pos = 0L; @@ -684,7 +707,7 @@ last_char(void) { size_t len = strlen(bufptr); while (len--) { - if (!isspace(bufptr[len])) + if (!isspace(UChar(bufptr[len]))) return bufptr[len]; } return 0; @@ -708,6 +731,10 @@ static int next_char(void) { if (!yyin) { + /* + * An string with an embedded null will truncate the input. This is + * intentional (we don't read binary files here). + */ if (*bufptr == '\0') return (EOF); if (*bufptr == '\n') { @@ -716,52 +743,61 @@ next_char(void) } } else if (!bufptr || !*bufptr) { /* - * In theory this could be recoded to do its I/O one - * character at a time, saving the buffer space. In - * practice, this turns out to be quite hard to get - * completely right. Try it and see. If you succeed, - * don't forget to hack push_back() correspondingly. + * In theory this could be recoded to do its I/O one character at a + * time, saving the buffer space. In practice, this turns out to be + * quite hard to get completely right. Try it and see. If you + * succeed, don't forget to hack push_back() correspondingly. */ - static char line[LEXBUFSIZ]; + static char *result; + static size_t allocated; + size_t used; size_t len; do { - _nc_curr_file_pos = ftell(yyin); - - if ((bufstart = fgets(line, LEXBUFSIZ, yyin)) != NULL) { - _nc_curr_line++; - _nc_curr_col = 0; - } - bufptr = bufstart; - } while - (bufstart != NULL && line[0] == '#'); - - if (bufstart == NULL || *bufstart == 0) - return (EOF); - - while (iswhite(*bufptr)) - bufptr++; - - /* - * Treat a trailing the same as a so we can read - * files on OS/2, etc. - */ - if ((len = strlen(bufptr)) > 1) { - if (bufptr[len - 1] == '\n' - && bufptr[len - 2] == '\r') { - len--; - bufptr[len - 1] = '\n'; - bufptr[len] = '\0'; - } - } + bufstart = 0; + used = 0; + do { + if (used + (LEXBUFSIZ / 4) >= allocated) { + allocated += (allocated + LEXBUFSIZ); + result = typeRealloc(char, allocated, result); + if (result == 0) + return (EOF); + } + if (used == 0) + _nc_curr_file_pos = ftell(yyin); + + if (fgets(result + used, allocated - used, yyin) != NULL) { + bufstart = result; + if (used == 0) { + _nc_curr_line++; + _nc_curr_col = 0; + } + } else { + if (used != 0) + strcat(result, "\n"); + } + if ((bufptr = bufstart) != 0) { + used = strlen(bufptr); + while (iswhite(*bufptr)) + bufptr++; - /* - * If we don't have a trailing newline, it's because the line is simply - * too long. Give up. (FIXME: We could instead reallocate the line - * buffer and allow arbitrary-length lines). - */ - if (len == 0 || (bufptr[len - 1] != '\n')) - return (EOF); + /* + * Treat a trailing the same as a so we + * can read files on OS/2, etc. + */ + if ((len = strlen(bufptr)) > 1) { + if (bufptr[len - 1] == '\n' + && bufptr[len - 2] == '\r') { + len--; + bufptr[len - 1] = '\n'; + bufptr[len] = '\0'; + } + } + } else { + return (EOF); + } + } while (bufptr[len - 1] != '\n'); /* complete a line */ + } while (result[0] == '#'); /* ignore comments */ } first_column = (bufptr == bufstart); @@ -793,5 +829,3 @@ end_of_stream(void) return ((yyin ? feof(yyin) : (bufptr && *bufptr == '\0')) ? TRUE : FALSE); } - -/* comp_scan.c ends here */ diff --git a/ncurses/tinfo/doalloc.c b/ncurses/tinfo/doalloc.c index 84471fb6..fe2a009d 100644 --- a/ncurses/tinfo/doalloc.c +++ b/ncurses/tinfo/doalloc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,7 +30,6 @@ * Author: Thomas E. Dickey 1998 * ****************************************************************************/ - /* * Wrapper for malloc/realloc. Standard implementations allow realloc with * a null pointer, but older libraries may not (e.g., SunOS). @@ -40,31 +39,33 @@ #include -MODULE_ID("$Id: doalloc.c,v 1.5 1999/03/14 12:25:27 tom Exp $") +MODULE_ID("$Id: doalloc.c,v 1.8 2002/08/31 21:48:11 Philippe.Blain Exp $") -void *_nc_doalloc(void *oldp, size_t amount) +NCURSES_EXPORT(void *) +_nc_doalloc(void *oldp, size_t amount) { - void *newp; + void *newp; - if (oldp != 0) { - if ((newp = realloc(oldp, amount)) == 0) { - free(oldp); - errno = ENOMEM; /* just in case 'free' reset */ - } - } else { - newp = typeMalloc(char, amount); + if (oldp != 0) { + if ((newp = realloc(oldp, amount)) == 0) { + free(oldp); + errno = ENOMEM; /* just in case 'free' reset */ } - return newp; + } else { + newp = malloc(amount); + } + return newp; } #if !HAVE_STRDUP -char *_nc_strdup(const char *src) +NCURSES_EXPORT(char *) +_nc_strdup(const char *src) { char *dst; if (src != 0) { dst = typeMalloc(char, strlen(src) + 1); if (dst != 0) { - (void)strcpy(dst, src); + (void) strcpy(dst, src); } } else { dst = 0; diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c index aba1aeb9..b8b9c592 100644 --- a/ncurses/tinfo/free_ttype.c +++ b/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,7 +30,6 @@ * Author: Thomas E. Dickey 1999 * ****************************************************************************/ - /* * free_ttype.c -- allocation functions for TERMTYPE * @@ -44,12 +43,12 @@ #include #include -MODULE_ID("$Id: free_ttype.c,v 1.5 2000/07/08 00:43:58 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.8 2002/09/01 20:29:03 tom Exp $") -void _nc_free_termtype(TERMTYPE *ptr) +NCURSES_EXPORT(void) +_nc_free_termtype(TERMTYPE * ptr) { FreeIfNeeded(ptr->str_table); - FreeIfNeeded(ptr->term_names); FreeIfNeeded(ptr->Booleans); FreeIfNeeded(ptr->Numbers); FreeIfNeeded(ptr->Strings); @@ -61,9 +60,10 @@ void _nc_free_termtype(TERMTYPE *ptr) } #if NCURSES_XNAMES -bool _nc_user_definable = TRUE; +NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE; -int use_extended_names(bool flag) +NCURSES_EXPORT(int) +use_extended_names(bool flag) { int oldflag = _nc_user_definable; _nc_user_definable = flag; diff --git a/ncurses/tinfo/getenv_num.c b/ncurses/tinfo/getenv_num.c index 62944048..a90cc08d 100644 --- a/ncurses/tinfo/getenv_num.c +++ b/ncurses/tinfo/getenv_num.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,21 +36,21 @@ #include -MODULE_ID("$Id: getenv_num.c,v 1.1 1998/09/19 21:30:23 tom Exp $") +MODULE_ID("$Id: getenv_num.c,v 1.3 2000/12/10 02:55:07 tom Exp $") -int +NCURSES_EXPORT(int) _nc_getenv_num(const char *name) { - char *dst = 0; - char *src = getenv(name); - long value; + char *dst = 0; + char *src = getenv(name); + long value; - if ((src == 0) - || (value = strtol(src, &dst, 0)) < 0 - || (dst == src) - || (*dst != '\0') - || (int)value < value) - value = -1; + if ((src == 0) + || (value = strtol(src, &dst, 0)) < 0 + || (dst == src) + || (*dst != '\0') + || (int) value < value) + value = -1; - return (int) value; + return (int) value; } diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index 69b8a96f..ad2f5f6e 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,13 +37,13 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.3 2000/10/04 02:31:53 tom Exp $"); +MODULE_ID("$Id: home_terminfo.c,v 1.7 2002/09/07 20:04:51 tom Exp $") #define my_length (strlen(home) + sizeof(PRIVATE_INFO)) /* ncurses extension...fall back on user's private directory */ -char * +NCURSES_EXPORT(char *) _nc_home_terminfo(void) { char *home; @@ -55,7 +55,7 @@ _nc_home_terminfo(void) && my_length <= PATH_MAX) { temp = typeMalloc(char, my_length); if (temp == 0) - _nc_err_abort("Out of memory"); + _nc_err_abort(MSG_NO_MEMORY); (void) sprintf(temp, PRIVATE_INFO, home); } } diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c index 1134480f..cf840e8e 100644 --- a/ncurses/tinfo/init_keytry.c +++ b/ncurses/tinfo/init_keytry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,11 +28,11 @@ #include -#include /* keypad_xmit, keypad_local, meta_on, meta_off */ +#include /* keypad_xmit, keypad_local, meta_on, meta_off */ /* cursor_visible,cursor_normal,cursor_invisible */ -#include /* struct tinfo_fkeys */ +#include /* struct tinfo_fkeys */ -MODULE_ID("$Id: init_keytry.c,v 1.3 2000/03/12 02:55:50 Todd.C.Miller Exp $") +MODULE_ID("$Id: init_keytry.c,v 1.5 2000/12/10 02:55:07 tom Exp $") /* ** _nc_init_keytry() @@ -52,27 +52,29 @@ MODULE_ID("$Id: init_keytry.c,v 1.3 2000/03/12 02:55:50 Todd.C.Miller Exp $") #endif*/ #if BROKEN_LINKER -struct tinfo_fkeys *_nc_tinfo_fkeysf(void) +struct tinfo_fkeys * +_nc_tinfo_fkeysf(void) { - return _nc_tinfo_fkeys; + return _nc_tinfo_fkeys; } #endif -void _nc_init_keytry(void) +NCURSES_EXPORT(void) +_nc_init_keytry(void) { - size_t n; + size_t n; - /* The SP->_keytry value is initialized in newterm(), where the SP - * structure is created, because we can not tell where keypad() or - * mouse_activate() (which will call keyok()) are first called. - */ + /* The SP->_keytry value is initialized in newterm(), where the SP + * structure is created, because we can not tell where keypad() or + * mouse_activate() (which will call keyok()) are first called. + */ - for (n = 0; _nc_tinfo_fkeys[n].code; n++) - if (_nc_tinfo_fkeys[n].offset < STRCOUNT) - _nc_add_to_try(&(SP->_keytry), - CUR Strings[_nc_tinfo_fkeys[n].offset], - _nc_tinfo_fkeys[n].code); + for (n = 0; _nc_tinfo_fkeys[n].code; n++) + if (_nc_tinfo_fkeys[n].offset < STRCOUNT) + _nc_add_to_try(&(SP->_keytry), + CUR Strings[_nc_tinfo_fkeys[n].offset], + _nc_tinfo_fkeys[n].code); #ifdef TRACE - _nc_trace_tries(SP->_keytry); + _nc_trace_tries(SP->_keytry); #endif } diff --git a/ncurses/tinfo/keys.list b/ncurses/tinfo/keys.list deleted file mode 100644 index c11300bd..00000000 --- a/ncurses/tinfo/keys.list +++ /dev/null @@ -1,158 +0,0 @@ -# $Id: keys.list,v 1.5 1997/10/25 21:05:24 tom Exp $ -# The first column is the #define symbol that is in curses.h -# The second column is the term.h symbol, for terminfo -# Not all keycodes have corresponding terminfo capabilities. -KEY_A1 key_a1 -KEY_A3 key_a3 -KEY_B2 key_b2 -KEY_BACKSPACE key_backspace -KEY_BEG key_beg -KEY_BREAK -KEY_BTAB key_btab -KEY_C1 key_c1 -KEY_C3 key_c3 -KEY_CANCEL key_cancel -KEY_CATAB key_catab -KEY_CLEAR key_clear -KEY_CLOSE key_close -KEY_COMMAND key_command -KEY_COPY key_copy -KEY_CREATE key_create -KEY_CTAB key_ctab -KEY_DC key_dc -KEY_DL key_dl -KEY_DOWN key_down -KEY_EIC key_eic -KEY_END key_end -KEY_ENTER key_enter -KEY_EOL key_eol -KEY_EOS key_eos -KEY_EXIT key_exit -KEY_F(0) key_f0 -KEY_F(1) key_f1 -KEY_F(10) key_f10 -KEY_F(11) key_f11 -KEY_F(12) key_f12 -KEY_F(13) key_f13 -KEY_F(14) key_f14 -KEY_F(15) key_f15 -KEY_F(16) key_f16 -KEY_F(17) key_f17 -KEY_F(18) key_f18 -KEY_F(19) key_f19 -KEY_F(2) key_f2 -KEY_F(20) key_f20 -KEY_F(21) key_f21 -KEY_F(22) key_f22 -KEY_F(23) key_f23 -KEY_F(24) key_f24 -KEY_F(25) key_f25 -KEY_F(26) key_f26 -KEY_F(27) key_f27 -KEY_F(28) key_f28 -KEY_F(29) key_f29 -KEY_F(3) key_f3 -KEY_F(30) key_f30 -KEY_F(31) key_f31 -KEY_F(32) key_f32 -KEY_F(33) key_f33 -KEY_F(34) key_f34 -KEY_F(35) key_f35 -KEY_F(36) key_f36 -KEY_F(37) key_f37 -KEY_F(38) key_f38 -KEY_F(39) key_f39 -KEY_F(4) key_f4 -KEY_F(40) key_f40 -KEY_F(41) key_f41 -KEY_F(42) key_f42 -KEY_F(43) key_f43 -KEY_F(44) key_f44 -KEY_F(45) key_f45 -KEY_F(46) key_f46 -KEY_F(47) key_f47 -KEY_F(48) key_f48 -KEY_F(49) key_f49 -KEY_F(5) key_f5 -KEY_F(50) key_f50 -KEY_F(51) key_f51 -KEY_F(52) key_f52 -KEY_F(53) key_f53 -KEY_F(54) key_f54 -KEY_F(55) key_f55 -KEY_F(56) key_f56 -KEY_F(57) key_f57 -KEY_F(58) key_f58 -KEY_F(59) key_f59 -KEY_F(6) key_f6 -KEY_F(60) key_f60 -KEY_F(61) key_f61 -KEY_F(62) key_f62 -KEY_F(63) key_f63 -KEY_F(7) key_f7 -KEY_F(8) key_f8 -KEY_F(9) key_f9 -KEY_FIND key_find -KEY_HELP key_help -KEY_HOME key_home -KEY_IC key_ic -KEY_IL key_il -KEY_LEFT key_left -KEY_LL key_ll -KEY_MARK key_mark -KEY_MESSAGE key_message -KEY_MOUSE key_mouse -KEY_MOVE key_move -KEY_NEXT key_next -KEY_NPAGE key_npage -KEY_OPEN key_open -KEY_OPTIONS key_options -KEY_PPAGE key_ppage -KEY_PREVIOUS key_previous -KEY_PRINT key_print -KEY_REDO key_redo -KEY_REFERENCE key_reference -KEY_REFRESH key_refresh -KEY_REPLACE key_replace -KEY_RESET -KEY_RESIZE -KEY_RESTART key_restart -KEY_RESUME key_resume -KEY_RIGHT key_right -KEY_SAVE key_save -KEY_SBEG key_sbeg -KEY_SCANCEL key_scancel -KEY_SCOMMAND key_scommand -KEY_SCOPY key_scopy -KEY_SCREATE key_screate -KEY_SDC key_sdc -KEY_SDL key_sdl -KEY_SELECT key_select -KEY_SEND key_send -KEY_SEOL key_seol -KEY_SEXIT key_sexit -KEY_SF key_sf -KEY_SFIND key_sfind -KEY_SHELP key_shelp -KEY_SHOME key_shome -KEY_SIC key_sic -KEY_SLEFT key_sleft -KEY_SMESSAGE key_smessage -KEY_SMOVE key_smove -KEY_SNEXT key_snext -KEY_SOPTIONS key_soptions -KEY_SPREVIOUS key_sprevious -KEY_SPRINT key_sprint -KEY_SR key_sr -KEY_SREDO key_sredo -KEY_SREPLACE key_sreplace -KEY_SRESET -KEY_SRIGHT key_sright -KEY_SRSUME key_srsume -KEY_SSAVE key_ssave -KEY_SSUSPEND key_ssuspend -KEY_STAB key_stab -KEY_SUNDO key_sundo -KEY_SUSPEND key_suspend -KEY_UNDO key_undo -KEY_UP key_up diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 6f077915..ba35ab70 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,109 +31,147 @@ * and: Eric S. Raymond * ****************************************************************************/ - - #include -#include /* ena_acs, acs_chars */ +#include /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.16 1999/10/30 23:00:16 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.22 2002/09/01 19:26:57 tom Exp $") -chtype acs_map[ACS_LEN] = { 0 }; - -void _nc_init_acs(void) +#if BROKEN_LINKER +NCURSES_EXPORT_VAR(chtype *) +_nc_acs_map(void) +{ + static chtype *the_map = 0; + if (the_map == 0) + the_map = typeCalloc(chtype, ACS_LEN); + return the_map; +} +#else +NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = { - T(("initializing ACS map")); + 0 +}; +#endif - /* - * Initializations for a UNIX-like multi-terminal environment. Use - * ASCII chars and count on the terminfo description to do better. - */ - ACS_ULCORNER = '+'; /* should be upper left corner */ - ACS_LLCORNER = '+'; /* should be lower left corner */ - ACS_URCORNER = '+'; /* should be upper right corner */ - ACS_LRCORNER = '+'; /* should be lower right corner */ - ACS_RTEE = '+'; /* should be tee pointing left */ - ACS_LTEE = '+'; /* should be tee pointing right */ - ACS_BTEE = '+'; /* should be tee pointing up */ - ACS_TTEE = '+'; /* should be tee pointing down */ - ACS_HLINE = '-'; /* should be horizontal line */ - ACS_VLINE = '|'; /* should be vertical line */ - ACS_PLUS = '+'; /* should be large plus or crossover */ - ACS_S1 = '~'; /* should be scan line 1 */ - ACS_S9 = '_'; /* should be scan line 9 */ - ACS_DIAMOND = '+'; /* should be diamond */ - ACS_CKBOARD = ':'; /* should be checker board (stipple) */ - ACS_DEGREE = '\''; /* should be degree symbol */ - ACS_PLMINUS = '#'; /* should be plus/minus */ - ACS_BULLET = 'o'; /* should be bullet */ - ACS_LARROW = '<'; /* should be arrow pointing left */ - ACS_RARROW = '>'; /* should be arrow pointing right */ - ACS_DARROW = 'v'; /* should be arrow pointing down */ - ACS_UARROW = '^'; /* should be arrow pointing up */ - ACS_BOARD = '#'; /* should be board of squares */ - ACS_LANTERN = '#'; /* should be lantern symbol */ - ACS_BLOCK = '#'; /* should be solid square block */ - /* these defaults were invented for ncurses */ - ACS_S3 = '-'; /* should be scan line 3 */ - ACS_S7 = '-'; /* should be scan line 7 */ - ACS_LEQUAL = '<'; /* should be less-than-or-equal-to */ - ACS_GEQUAL = '>'; /* should be greater-than-or-equal-to */ - ACS_PI = '*'; /* should be greek pi */ - ACS_NEQUAL = '!'; /* should be not-equal */ - ACS_STERLING = 'f'; /* should be pound-sterling symbol */ +NCURSES_EXPORT(void) +_nc_init_acs(void) +{ + T(("initializing ACS map")); +#if !BROKEN_LINKER + memset(acs_map, 0, sizeof(acs_map)); +#endif - if (ena_acs != NULL) - { - TPUTS_TRACE("ena_acs"); - putp(ena_acs); - } + /* + * Initializations for a UNIX-like multi-terminal environment. Use + * ASCII chars and count on the terminfo description to do better. + */ + ACS_ULCORNER = '+'; /* should be upper left corner */ + ACS_LLCORNER = '+'; /* should be lower left corner */ + ACS_URCORNER = '+'; /* should be upper right corner */ + ACS_LRCORNER = '+'; /* should be lower right corner */ + ACS_RTEE = '+'; /* should be tee pointing left */ + ACS_LTEE = '+'; /* should be tee pointing right */ + ACS_BTEE = '+'; /* should be tee pointing up */ + ACS_TTEE = '+'; /* should be tee pointing down */ + ACS_HLINE = '-'; /* should be horizontal line */ + ACS_VLINE = '|'; /* should be vertical line */ + ACS_PLUS = '+'; /* should be large plus or crossover */ + ACS_S1 = '~'; /* should be scan line 1 */ + ACS_S9 = '_'; /* should be scan line 9 */ + ACS_DIAMOND = '+'; /* should be diamond */ + ACS_CKBOARD = ':'; /* should be checker board (stipple) */ + ACS_DEGREE = '\''; /* should be degree symbol */ + ACS_PLMINUS = '#'; /* should be plus/minus */ + ACS_BULLET = 'o'; /* should be bullet */ + ACS_LARROW = '<'; /* should be arrow pointing left */ + ACS_RARROW = '>'; /* should be arrow pointing right */ + ACS_DARROW = 'v'; /* should be arrow pointing down */ + ACS_UARROW = '^'; /* should be arrow pointing up */ + ACS_BOARD = '#'; /* should be board of squares */ + ACS_LANTERN = '#'; /* should be lantern symbol */ + ACS_BLOCK = '#'; /* should be solid square block */ + /* these defaults were invented for ncurses */ + ACS_S3 = '-'; /* should be scan line 3 */ + ACS_S7 = '-'; /* should be scan line 7 */ + ACS_LEQUAL = '<'; /* should be less-than-or-equal-to */ + ACS_GEQUAL = '>'; /* should be greater-than-or-equal-to */ + ACS_PI = '*'; /* should be greek pi */ + ACS_NEQUAL = '!'; /* should be not-equal */ + ACS_STERLING = 'f'; /* should be pound-sterling symbol */ + if (ena_acs != NULL) { + TPUTS_TRACE("ena_acs"); + putp(ena_acs); + } #define ALTCHAR(c) ((chtype)(((unsigned char)(c)) | A_ALTCHARSET)) - if (acs_chars != NULL) { - size_t i = 0; - size_t length = strlen(acs_chars); + if (acs_chars != NULL) { + size_t i = 0; + size_t length = strlen(acs_chars); - while (i < length) - switch (acs_chars[i]) { - case 'l':case 'm':case 'k':case 'j': - case 'u':case 't':case 'v':case 'w': - case 'q':case 'x':case 'n':case 'o': - case 's':case '`':case 'a':case 'f': - case 'g':case '~':case ',':case '+': - case '.':case '-':case 'h':case 'i': - case '0':case 'p':case 'r':case 'y': - case 'z':case '{':case '|':case '}': - acs_map[(unsigned int)acs_chars[i]] = - ALTCHAR(acs_chars[i+1]); - i++; - /* FALLTHRU */ - default: - i++; - break; - } - } + while (i < length) + switch (acs_chars[i]) { + case 'l': + case 'm': + case 'k': + case 'j': + case 'u': + case 't': + case 'v': + case 'w': + case 'q': + case 'x': + case 'n': + case 'o': + case 's': + case '`': + case 'a': + case 'f': + case 'g': + case '~': + case ',': + case '+': + case '.': + case '-': + case 'h': + case 'i': + case '0': + case 'p': + case 'r': + case 'y': + case 'z': + case '{': + case '|': + case '}': + acs_map[(unsigned int) acs_chars[i]] = + ALTCHAR(acs_chars[i + 1]); + i++; + /* FALLTHRU */ + default: + i++; + break; + } + } #ifdef TRACE - /* Show the equivalent mapping, noting if it does not match the - * given attribute, whether by re-ordering or duplication. - */ - if (_nc_tracing & TRACE_CALLS) { - size_t n, m; - char show[SIZEOF(acs_map) + 1]; - for (n = 1, m = 0; n < SIZEOF(acs_map); n++) { - if (acs_map[n] != 0) { - show[m++] = (char)n; - show[m++] = TextOf(acs_map[n]); - } - } - show[m] = 0; - _tracef("%s acs_chars %s", - (acs_chars == NULL) - ? "NULL" - : (strcmp(acs_chars, show) - ? "DIFF" - : "SAME"), - _nc_visbuf(show)); + /* Show the equivalent mapping, noting if it does not match the + * given attribute, whether by re-ordering or duplication. + */ + if (_nc_tracing & TRACE_CALLS) { + size_t n, m; + char show[ACS_LEN + 1]; + for (n = 1, m = 0; n < ACS_LEN; n++) { + if (acs_map[n] != 0) { + show[m++] = (char) n; + show[m++] = ChCharOf(acs_map[n]); + } } + show[m] = 0; + _tracef("%s acs_chars %s", + (acs_chars == NULL) + ? "NULL" + : (strcmp(acs_chars, show) + ? "DIFF" + : "SAME"), + _nc_visbuf(show)); + } #endif /* TRACE */ } diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index 0d7fa27b..52389241 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,7 +40,43 @@ #include /* cur_term, pad_char */ #include /* ospeed */ -MODULE_ID("$Id: lib_baudrate.c,v 1.17 2000/10/08 00:59:08 tom Exp $") +/* + * These systems use similar header files, which define B1200 as 1200, etc., + * but can be overridden by defining USE_OLD_TTY so B1200 is 9, which makes all + * of the indices up to B115200 fit nicely in a 'short', allowing us to retain + * ospeed's type for compatibility. + */ +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#undef B0 +#undef B50 +#undef B75 +#undef B110 +#undef B134 +#undef B150 +#undef B200 +#undef B300 +#undef B600 +#undef B1200 +#undef B1800 +#undef B2400 +#undef B4800 +#undef B9600 +#undef B19200 +#undef EXTA +#undef B38400 +#undef EXTB +#undef B57600 +#undef B115200 +#undef B230400 +#undef B460800 +#undef B921600 +#define USE_OLD_TTY +#include +#else +#undef USE_OLD_TTY +#endif /* USE_OLD_TTY */ + +MODULE_ID("$Id: lib_baudrate.c,v 1.22 2002/01/19 23:07:53 Andrey.A.Chernov Exp $") /* * int @@ -51,8 +87,8 @@ MODULE_ID("$Id: lib_baudrate.c,v 1.17 2000/10/08 00:59:08 tom Exp $") */ struct speed { - int s; /* value for 'ospeed' is an index */ - int sp; /* the actual speed */ + int s; /* value for 'ospeed' is an index */ + int sp; /* the actual speed */ }; static struct speed const speeds[] = @@ -97,9 +133,12 @@ static struct speed const speeds[] = #ifdef B460800 {B460800, 460800}, #endif +#ifdef B921600 + {B921600, 921600}, +#endif }; -int +NCURSES_EXPORT(int) _nc_baudrate(int OSpeed) { static int last_OSpeed; @@ -125,7 +164,7 @@ _nc_baudrate(int OSpeed) return (result); } -int +NCURSES_EXPORT(int) _nc_ospeed(int BaudRate) { int result = 1; @@ -142,7 +181,7 @@ _nc_ospeed(int BaudRate) return (result); } -int +NCURSES_EXPORT(int) baudrate(void) { int result; @@ -162,15 +201,20 @@ baudrate(void) ret = 9600; ospeed = _nc_ospeed(ret); returnCode(ret); - } else + } #endif +#ifdef USE_OLD_TTY + result = cfgetospeed(&cur_term->Nttyb); + ospeed = _nc_ospeed(result); +#else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = cfgetospeed(&cur_term->Nttyb); + ospeed = cfgetospeed(&cur_term->Nttyb); #else - ospeed = cur_term->Nttyb.sg_ospeed; + ospeed = cur_term->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); +#endif if (cur_term != 0) cur_term->_baudrate = result; diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 7d0aa127..8f269e59 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,34 +37,36 @@ */ #include -#include /* TTY, cur_term */ -#include /* ospeed */ +#include /* TTY, cur_term */ +#include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.9 1999/10/30 23:00:16 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.11 2000/12/10 02:55:07 tom Exp $") -TERMINAL *cur_term = 0; +NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; -TERMINAL *set_curterm(TERMINAL *termp) +NCURSES_EXPORT(TERMINAL *) +set_curterm(TERMINAL * termp) { - TERMINAL *oldterm = cur_term; + TERMINAL *oldterm = cur_term; - if ((cur_term = termp) != 0) { - ospeed = _nc_ospeed(cur_term->_baudrate); - PC = (pad_char != NULL) ? pad_char[0] : 0; - } - return oldterm; + if ((cur_term = termp) != 0) { + ospeed = _nc_ospeed(cur_term->_baudrate); + PC = (pad_char != NULL) ? pad_char[0] : 0; + } + return oldterm; } -int del_curterm(TERMINAL *termp) +NCURSES_EXPORT(int) +del_curterm(TERMINAL * termp) { - T((T_CALLED("del_curterm(%p)"), termp)); + T((T_CALLED("del_curterm(%p)"), termp)); - if (termp != 0) { - _nc_free_termtype(&(termp->type)); - free(termp); - if (termp == cur_term) - cur_term = 0; - returnCode(OK); - } - returnCode(ERR); + if (termp != 0) { + _nc_free_termtype(&(termp->type)); + free(termp); + if (termp == cur_term) + cur_term = 0; + returnCode(OK); + } + returnCode(ERR); } diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index d2d0d3ff..87d60edf 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,17 +40,20 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.14 1999/01/31 01:34:33 Ilya.Zakharevich Exp $") +MODULE_ID("$Id: lib_data.c,v 1.16 2000/12/10 02:55:07 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when * constructing a dll (reported by J.J.G.Ripoll). */ -WINDOW *stdscr = 0; -WINDOW *curscr = 0; -WINDOW *newscr = 0; +NCURSES_EXPORT_VAR(WINDOW *) +stdscr = 0; +NCURSES_EXPORT_VAR(WINDOW *) +curscr = 0; +NCURSES_EXPORT_VAR(WINDOW *) +newscr = 0; -SCREEN *_nc_screen_chain = 0; +NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain = 0; /* * The variable 'SP' will be defined as a function on systems that cannot link @@ -63,22 +66,26 @@ SCREEN *_nc_screen_chain = 0; * module coupling that increases the size of the executable. */ #if BROKEN_LINKER -static SCREEN *my_screen; + static SCREEN *my_screen; -SCREEN *_nc_screen(void) +NCURSES_EXPORT(SCREEN *) +_nc_screen(void) { - return my_screen; + return my_screen; } -int _nc_alloc_screen(void) +NCURSES_EXPORT(int) +_nc_alloc_screen(void) { - return ((my_screen = typeCalloc(SCREEN, 1)) != 0); + return ((my_screen = typeCalloc(SCREEN, 1)) != 0); } -void _nc_set_screen(SCREEN *sp) +NCURSES_EXPORT(void) +_nc_set_screen(SCREEN * sp) { - my_screen = sp; + my_screen = sp; } + #else -SCREEN *SP = NULL; /* Some linkers require initialized data... */ +NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index 7121fc75..6fb7b3a9 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_has_cap.c ** @@ -43,21 +42,23 @@ #include -MODULE_ID("$Id: lib_has_cap.c,v 1.1 1998/10/23 15:32:21 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.3 2000/12/10 02:55:07 tom Exp $") -bool has_ic(void) +NCURSES_EXPORT(bool) +has_ic(void) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + T((T_CALLED("has_ic()"))); + returnCode(cur_term && + (insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)); } -bool has_il(void) +NCURSES_EXPORT(bool) +has_il(void) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + T((T_CALLED("has_il()"))); + returnCode(cur_term + && (insert_line || parm_insert_line) + && (delete_line || parm_delete_line)); } diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 3c8c88ee..b4d3c7f4 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,9 +29,9 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 2002 * ****************************************************************************/ - /* * lib_kernel.c * @@ -46,9 +46,30 @@ */ #include -#include /* cur_term */ +#include /* cur_term */ + +MODULE_ID("$Id: lib_kernel.c,v 1.22 2002/05/11 20:32:18 tom Exp $") -MODULE_ID("$Id: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $") +static int +_nc_vdisable(void) +{ + int value; +#if defined(_POSIX_VDISABLE) && defined(HAVE_UNISTD_H) + value = _POSIX_VDISABLE; +#endif +#if defined(_PC_VDISABLE) + if (value == -1) { + value = fpathconf(0, _PC_VDISABLE); + if (value == -1) { + value = 0377; + } + } +#elif defined(VDISABLE) + if (value == -1) + value = VDISABLE; +#endif + return value; +} /* * erasechar() @@ -57,23 +78,24 @@ MODULE_ID("$Id: lib_kernel.c,v 1.19 1998/12/20 00:18:45 tom Exp $") * */ -char +NCURSES_EXPORT(char) erasechar(void) { - T((T_CALLED("erasechar()"))); + int result = ERR; + T((T_CALLED("erasechar()"))); - if (cur_term != 0) { + if (cur_term != 0) { #ifdef TERMIOS - returnCode(cur_term->Ottyb.c_cc[VERASE]); + result = cur_term->Ottyb.c_cc[VERASE]; + if (result == _nc_vdisable()) + result = ERR; #else - returnCode(cur_term->Ottyb.sg_erase); + result = cur_term->Ottyb.sg_erase; #endif - } - returnCode(ERR); + } + returnCode(result); } - - /* * killchar() * @@ -81,23 +103,24 @@ erasechar(void) * */ -char +NCURSES_EXPORT(char) killchar(void) { - T((T_CALLED("killchar()"))); + int result = ERR; + T((T_CALLED("killchar()"))); - if (cur_term != 0) { + if (cur_term != 0) { #ifdef TERMIOS - returnCode(cur_term->Ottyb.c_cc[VKILL]); + result = cur_term->Ottyb.c_cc[VKILL]; + if (result == _nc_vdisable()) + result = ERR; #else - returnCode(cur_term->Ottyb.sg_kill); + result = cur_term->Ottyb.sg_kill; #endif - } - returnCode(ERR); + } + returnCode(result); } - - /* * flushinp() * @@ -105,26 +128,27 @@ killchar(void) * */ -int flushinp(void) +NCURSES_EXPORT(int) +flushinp(void) { - T((T_CALLED("flushinp()"))); + T((T_CALLED("flushinp()"))); - if (cur_term != 0) { + if (cur_term != 0) { #ifdef TERMIOS - tcflush(cur_term->Filedes, TCIFLUSH); + tcflush(cur_term->Filedes, TCIFLUSH); #else - errno = 0; - do { - ioctl(cur_term->Filedes, TIOCFLUSH, 0); - } while - (errno == EINTR); + errno = 0; + do { + ioctl(cur_term->Filedes, TIOCFLUSH, 0); + } while + (errno == EINTR); #endif - if (SP) { - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; - } - returnCode(OK); + if (SP) { + SP->_fifohead = -1; + SP->_fifotail = 0; + SP->_fifopeek = 0; } - returnCode(ERR); + returnCode(OK); + } + returnCode(ERR); } diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 766e56c0..1301ee51 100644 --- a/ncurses/tinfo/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - /* ** lib_longname.c ** @@ -41,18 +40,18 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.7 1999/01/03 01:47:45 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $") -char * +NCURSES_EXPORT(char *) longname(void) { -char *ptr; + char *ptr; - T((T_CALLED("longname()"))); + T((T_CALLED("longname()"))); - for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) - if (*ptr == '|') - returnPtr(ptr + 1); + for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) + if (*ptr == '|') + returnPtr(ptr + 1); - returnPtr(ttytype); + returnPtr(ttytype); } diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c index 1bd5c647..f4975ad5 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -45,22 +45,11 @@ #if HAVE_SYS_TIME_H #include /* needed for MacOS X DP3 */ #endif -#elif USE_FUNC_POLL -#if HAVE_SYS_TIME_H -#include -#endif -#elif HAVE_SELECT -#if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT -#include -#endif -#if HAVE_SYS_SELECT_H -#include -#endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.9 2000/04/29 23:42:56 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.13 2002/09/01 17:46:11 tom Exp $") -int +NCURSES_EXPORT(int) napms(int ms) { T((T_CALLED("napms(%d)"), ms)); @@ -72,18 +61,9 @@ napms(int ms) ts.tv_nsec = (ms % 1000) * 1000000; nanosleep(&ts, NULL); } -#elif USE_FUNC_POLL - { - struct pollfd fds[1]; - poll(fds, 0, ms); - } -#elif HAVE_SELECT - { - struct timeval tval; - tval.tv_sec = ms / 1000; - tval.tv_usec = (ms % 1000) * 1000; - select(0, NULL, NULL, NULL, &tval); - } +#else + _nc_timed_wait(0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif + returnCode(OK); } diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index fc3dc42b..05bd4768 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,9 +42,9 @@ #include -MODULE_ID("$Id: lib_options.c,v 1.40 2000/09/02 18:02:05 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.46 2002/02/02 19:40:54 tom Exp $") -int +NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { T((T_CALLED("idlok(%p,%d)"), win, flag)); @@ -56,7 +56,7 @@ idlok(WINDOW *win, bool flag) returnCode(ERR); } -void +NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { T((T_CALLED("idcok(%p,%d)"), win, flag)); @@ -67,7 +67,7 @@ idcok(WINDOW *win, bool flag) returnVoid; } -int +NCURSES_EXPORT(int) halfdelay(int t) { T((T_CALLED("halfdelay(%d)"), t)); @@ -80,7 +80,7 @@ halfdelay(int t) returnCode(OK); } -int +NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { T((T_CALLED("nodelay(%p,%d)"), win, flag)); @@ -95,7 +95,7 @@ nodelay(WINDOW *win, bool flag) returnCode(ERR); } -int +NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { T((T_CALLED("notimout(%p,%d)"), win, f)); @@ -107,7 +107,7 @@ notimeout(WINDOW *win, bool f) returnCode(ERR); } -void +NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { T((T_CALLED("wtimeout(%p,%d)"), win, delay)); @@ -115,9 +115,10 @@ wtimeout(WINDOW *win, int delay) if (win) { win->_delay = delay; } + returnVoid; } -int +NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { T((T_CALLED("keypad(%p,%d)"), win, flag)); @@ -129,7 +130,7 @@ keypad(WINDOW *win, bool flag) returnCode(ERR); } -int +NCURSES_EXPORT(int) meta(WINDOW *win GCC_UNUSED, bool flag) { /* Ok, we stay relaxed and don't signal an error if win is NULL */ @@ -149,7 +150,7 @@ meta(WINDOW *win GCC_UNUSED, bool flag) /* curs_set() moved here to narrow the kernel interface */ -int +NCURSES_EXPORT(int) curs_set(int vis) { int cursor = SP->_cursor; @@ -191,7 +192,7 @@ curs_set(int vis) returnCode(cursor == -1 ? 1 : cursor); } -int +NCURSES_EXPORT(int) typeahead(int fd) { T((T_CALLED("typeahead(%d)"), fd)); @@ -216,10 +217,10 @@ has_key_internal(int keycode, struct tries *tp) return (TRUE); else return (has_key_internal(keycode, tp->child) - || has_key_internal(keycode, tp->sibling)); + || has_key_internal(keycode, tp->sibling)); } -int +NCURSES_EXPORT(int) has_key(int keycode) { T((T_CALLED("has_key(%d)"), keycode)); @@ -234,7 +235,7 @@ has_key(int keycode) * flush, then the next wgetch may get the escape sequence that corresponds to * the terminal state _before_ switching modes. */ -int +NCURSES_EXPORT(int) _nc_keypad(bool flag) { if (flag && keypad_xmit) { @@ -251,5 +252,6 @@ _nc_keypad(bool flag) _nc_init_keytry(); SP->_tried = TRUE; } + SP->_keypad_on = flag; return (OK); } diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index 63ac648b..3a98bc96 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,49 +31,45 @@ * and: Eric S. Raymond * ****************************************************************************/ - #include #include -MODULE_ID("$Id: lib_print.c,v 1.11 1999/02/27 19:59:05 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.15 2002/08/17 23:41:34 tom Exp $") -int mcprint(char *data, int len) +NCURSES_EXPORT(int) +mcprint(char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ { - char *mybuf, *switchon; - size_t onsize, offsize, res; + char *mybuf, *switchon; + size_t onsize, offsize, res; errno = 0; - if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) - { + if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; - return(ERR); + return (ERR); } - if (prtr_non) - { + if (prtr_non) { switchon = tparm(prtr_non, len); onsize = strlen(switchon); offsize = 0; - } - else - { + } else { switchon = prtr_on; onsize = strlen(prtr_on); offsize = strlen(prtr_off); } - if ((mybuf = typeMalloc(char, onsize + len + offsize + 1)) == (char *)0) - { + if (switchon == 0 + || (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) { errno = ENOMEM; - return(ERR); + return (ERR); } (void) strcpy(mybuf, switchon); - memcpy(mybuf + onsize, data, len); + memcpy(mybuf + onsize, data, (unsigned) len); if (offsize) - (void) strcpy(mybuf + onsize + len, prtr_off); + (void) strcpy(mybuf + onsize + len, prtr_off); /* * We're relying on the atomicity of UNIX writes here. The @@ -92,5 +88,5 @@ int mcprint(char *data, int len) (void) sleep(0); free(mybuf); - return(res); + return (res); } diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index 6df95714..aa09f52c 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1998 on * ****************************************************************************/ /* @@ -48,7 +49,7 @@ #include #include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.8 2000/09/02 18:08:48 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.13 2002/07/06 22:00:45 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -60,6 +61,9 @@ MODULE_ID("$Id: lib_raw.c,v 1.8 2000/09/02 18:08:48 tom Exp $") #ifdef __EMX__ #include +#define _nc_setmode(mode) setmode(SP->_ifd, mode) +#else +#define _nc_setmode(mode) /* nothing */ #endif #define COOKED_INPUT (IXON|BRKINT|PARMRK) @@ -72,165 +76,221 @@ MODULE_ID("$Id: lib_raw.c,v 1.8 2000/09/02 18:08:48 tom Exp $") #define AFTER(s) #endif /* TRACE */ -int +NCURSES_EXPORT(int) raw(void) { + int result = ERR; + T((T_CALLED("raw()"))); - if (SP != 0 && cur_term != 0) { - SP->_raw = TRUE; - SP->_cbreak = 1; + if (SP != 0 && cur_term != 0) { + TTY buf; -#ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); -#endif + BEFORE("raw"); + _nc_setmode(O_BINARY); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("raw"); - cur_term->Nttyb.c_lflag &= ~(ICANON | ISIG | IEXTEN); - cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("raw"); + buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); + buf.c_iflag &= ~(COOKED_INPUT); + buf.c_cc[VMIN] = 1; + buf.c_cc[VTIME] = 0; #else - cur_term->Nttyb.sg_flags |= RAW; + buf.sg_flags |= RAW; #endif - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_raw = TRUE; + SP->_cbreak = 1; + cur_term->Nttyb = buf; + } + AFTER("raw"); } - returnCode(ERR); + returnCode(result); } -int +NCURSES_EXPORT(int) cbreak(void) { + int result = ERR; + T((T_CALLED("cbreak()"))); - SP->_cbreak = 1; + if (SP != 0 && cur_term != 0) { + TTY buf; -#ifdef __EMX__ - setmode(SP->_ifd, O_BINARY); -#endif + BEFORE("cbreak"); + _nc_setmode(O_BINARY); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("cbreak"); - cur_term->Nttyb.c_lflag &= ~ICANON; - cur_term->Nttyb.c_iflag &= ~ICRNL; - cur_term->Nttyb.c_lflag |= ISIG; - cur_term->Nttyb.c_cc[VMIN] = 1; - cur_term->Nttyb.c_cc[VTIME] = 0; - AFTER("cbreak"); + buf.c_lflag &= ~ICANON; + buf.c_iflag &= ~ICRNL; + buf.c_lflag |= ISIG; + buf.c_cc[VMIN] = 1; + buf.c_cc[VTIME] = 0; #else - cur_term->Nttyb.sg_flags |= CBREAK; + buf.sg_flags |= CBREAK; #endif - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_cbreak = 1; + cur_term->Nttyb = buf; + } + AFTER("cbreak"); + } + returnCode(result); } -void +/* + * Note: + * this implementation may be wrong. See the comment under intrflush(). + */ +NCURSES_EXPORT(void) qiflush(void) { + int result = ERR; + T((T_CALLED("qiflush()"))); - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ + if (cur_term != 0) { + TTY buf; + BEFORE("qiflush"); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("qiflush"); - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - AFTER("qiflush"); - (void) _nc_set_tty_mode(&cur_term->Nttyb); - returnVoid; + buf.c_lflag &= ~(NOFLSH); + result = _nc_set_tty_mode(&buf); +#else + /* FIXME */ #endif + if (result == OK) + cur_term->Nttyb = buf; + AFTER("qiflush"); + } + returnVoid; } -int +NCURSES_EXPORT(int) noraw(void) { + int result = ERR; + T((T_CALLED("noraw()"))); - SP->_raw = FALSE; - SP->_cbreak = 0; + if (SP != 0 && cur_term != 0) { + TTY buf; -#ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); -#endif + BEFORE("noraw"); + _nc_setmode(O_TEXT); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("noraw"); - cur_term->Nttyb.c_lflag |= ISIG | ICANON | - (cur_term->Ottyb.c_lflag & IEXTEN); - cur_term->Nttyb.c_iflag |= COOKED_INPUT; - AFTER("noraw"); + buf.c_lflag |= ISIG | ICANON | + (cur_term->Ottyb.c_lflag & IEXTEN); + buf.c_iflag |= COOKED_INPUT; #else - cur_term->Nttyb.sg_flags &= ~(RAW | CBREAK); + buf.sg_flags &= ~(RAW | CBREAK); #endif - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_raw = FALSE; + SP->_cbreak = 0; + cur_term->Nttyb = buf; + } + AFTER("noraw"); + } + returnCode(result); } -int +NCURSES_EXPORT(int) nocbreak(void) { + int result = ERR; + T((T_CALLED("nocbreak()"))); - SP->_cbreak = 0; + if (SP != 0 && cur_term != 0) { + TTY buf; -#ifdef __EMX__ - setmode(SP->_ifd, O_TEXT); -#endif + BEFORE("nocbreak"); + _nc_setmode(O_TEXT); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("nocbreak"); - cur_term->Nttyb.c_lflag |= ICANON; - cur_term->Nttyb.c_iflag |= ICRNL; - AFTER("nocbreak"); + buf.c_lflag |= ICANON; + buf.c_iflag |= ICRNL; #else - cur_term->Nttyb.sg_flags &= ~CBREAK; + buf.sg_flags &= ~CBREAK; #endif - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_cbreak = 0; + cur_term->Nttyb = buf; + } + AFTER("nocbreak"); + } + returnCode(result); } -void +/* + * Note: + * this implementation may be wrong. See the comment under intrflush(). + */ +NCURSES_EXPORT(void) noqiflush(void) { + int result = ERR; + T((T_CALLED("noqiflush()"))); - /* - * Note: this implementation may be wrong. See the comment under - * intrflush(). - */ + if (cur_term != 0) { + TTY buf; + BEFORE("noqiflush"); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("noqiflush"); - cur_term->Nttyb.c_lflag |= NOFLSH; - AFTER("noqiflush"); - (void) _nc_set_tty_mode(&cur_term->Nttyb); - returnVoid; + buf.c_lflag |= NOFLSH; + result = _nc_set_tty_mode(&buf); +#else + /* FIXME */ #endif + if (result == OK) { + cur_term->Nttyb = buf; + } + AFTER("noqiflush"); + } + returnVoid; } -int +/* + * This call does the same thing as the qiflush()/noqiflush() pair. We know + * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand, + * the match (in the SVr4 man pages) between the language describing NOFLSH in + * termio(7) and the language describing qiflush()/noqiflush() in + * curs_inopts(3x) is too exact to be coincidence. + */ +NCURSES_EXPORT(int) intrflush(WINDOW *win GCC_UNUSED, bool flag) { + int result = ERR; + T((T_CALLED("intrflush(%d)"), flag)); - /* - * This call does the same thing as the qiflush()/noqiflush() pair. We - * know for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the - * other hand, the match (in the SVr4 man pages) between the language - * describing NOFLSH in termio(7) and the language describing - * qiflush()/noqiflush() in curs_inopts(3x) is too exact to be coincidence. - */ + if (cur_term != 0) { + TTY buf; + BEFORE("intrflush"); + buf = cur_term->Nttyb; #ifdef TERMIOS - BEFORE("intrflush"); - if (flag) - cur_term->Nttyb.c_lflag &= ~(NOFLSH); - else - cur_term->Nttyb.c_lflag |= (NOFLSH); - AFTER("intrflush"); - returnCode(_nc_set_tty_mode(&cur_term->Nttyb)); + if (flag) + buf.c_lflag &= ~(NOFLSH); + else + buf.c_lflag |= (NOFLSH); + result = _nc_set_tty_mode(&buf); #else - returnCode(ERR); + /* FIXME */ #endif + if (result == OK) { + cur_term->Nttyb = buf; + } + AFTER("intrflush"); + } + returnCode(result); } diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 1fd0d48f..6a69493b 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,7 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_setup.c,v 1.60 2000/09/02 18:13:12 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.70 2002/10/12 21:50:18 tom Exp $") /**************************************************************************** * @@ -94,13 +94,17 @@ static int _use_env = TRUE; static void do_prototype(void); -void +NCURSES_EXPORT(void) use_env(bool f) { + T((T_CALLED("use_env()"))); _use_env = f; + returnVoid; } -int LINES = 0, COLS = 0, TABSIZE = 0; +NCURSES_EXPORT_VAR(int) LINES = 0; +NCURSES_EXPORT_VAR(int) COLS = 0; +NCURSES_EXPORT_VAR(int) TABSIZE = 0; static void _nc_get_screensize(int *linep, int *colp) @@ -133,7 +137,7 @@ _nc_get_screensize(int *linep, int *colp) *colp = screendata[0]; *linep = screendata[1]; T(("EMX screen size: environment LINES = %d COLUMNS = %d", - *linep, *colp)); + *linep, *colp)); } #endif #if HAVE_SIZECHANGE @@ -165,15 +169,18 @@ _nc_get_screensize(int *linep, int *colp) #endif /* HAVE_SIZECHANGE */ /* if we can't get dynamic info about the size, use static */ - if (*linep <= 0 || *colp <= 0) - if (lines > 0 && columns > 0) { - *linep = (int) lines; - *colp = (int) columns; - } + if (*linep <= 0) { + *linep = (int) lines; + } + if (*colp <= 0) { + *colp = (int) columns; + } /* the ultimate fallback, assume fixed 24x80 size */ - if (*linep <= 0 || *colp <= 0) { + if (*linep <= 0) { *linep = 24; + } + if (*colp <= 0) { *colp = 80; } @@ -196,7 +203,7 @@ _nc_get_screensize(int *linep, int *colp) } #if USE_SIZECHANGE -void +NCURSES_EXPORT(void) _nc_update_screensize(void) { int my_lines, my_cols; @@ -229,7 +236,7 @@ _nc_update_screensize(void) exit(EXIT_FAILURE);\ } -#if USE_DATABASE +#if USE_DATABASE || USE_TERMCAP static int grab_entry(const char *const tn, TERMTYPE * const tp) /* return 1 if entry found, 0 if not found, -1 if database not accessible */ @@ -243,6 +250,7 @@ grab_entry(const char *const tn, TERMTYPE * const tp) if (strchr(tn, '/')) return 0; +#if USE_DATABASE if ((status = _nc_read_entry(tn, filename, tp)) != 1) { #if !PURE_TERMINFO @@ -256,6 +264,9 @@ grab_entry(const char *const tn, TERMTYPE * const tp) #endif /* PURE_TERMINFO */ } +#else + status = _nc_read_termcap_entry(tn, tp); +#endif /* * If we have an entry, force all of the cancelled strings to null @@ -265,18 +276,20 @@ grab_entry(const char *const tn, TERMTYPE * const tp) */ if (status == 1) { int n; - for_each_boolean(n, tp) + for_each_boolean(n, tp) { if (!VALID_BOOLEAN(tp->Booleans[n])) - tp->Booleans[n] = FALSE; - for_each_string(n, tp) + tp->Booleans[n] = FALSE; + } + for_each_string(n, tp) { if (tp->Strings[n] == CANCELLED_STRING) - tp->Strings[n] = ABSENT_STRING; + tp->Strings[n] = ABSENT_STRING; + } } return (status); } #endif -char ttytype[NAMESIZE] = ""; +NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; /* * setupterm(termname, Filedes, errret) @@ -286,12 +299,13 @@ char ttytype[NAMESIZE] = ""; * */ -int +NCURSES_EXPORT(int) setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) { struct term *term_ptr; int status; + START_TRACE(); T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); if (tname == 0) { @@ -302,7 +316,7 @@ setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) } if (strlen(tname) > MAX_NAME_SIZE) { ret_error(-1, "TERM environment must be <= %d characters.\n", - MAX_NAME_SIZE); + MAX_NAME_SIZE); } T(("your terminal name is %s", tname)); @@ -312,7 +326,7 @@ setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) if (term_ptr == 0) { ret_error0(-1, "Not enough memory to create terminal structure.\n"); } -#if USE_DATABASE +#if USE_DATABASE || USE_TERMCAP status = grab_entry(tname, &term_ptr->type); #else status = 0; @@ -361,14 +375,23 @@ setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) ttytype[NAMESIZE - 1] = '\0'; /* - * Allow output redirection. This is what SVr3 does. - * If stdout is directed to a file, screen updates go - * to standard error. + * Allow output redirection. This is what SVr3 does. If stdout is + * directed to a file, screen updates go to standard error. */ if (Filedes == STDOUT_FILENO && !isatty(Filedes)) Filedes = STDERR_FILENO; cur_term->Filedes = Filedes; + /* + * If an application calls setupterm() rather than initscr() or newterm(), + * we will not have the def_prog_mode() call in _nc_setupscreen(). Do it + * now anyway, so we can initialize the baudrate. + */ + if (isatty(Filedes)) { + def_prog_mode(); + baudrate(); + } + _nc_get_screensize(&LINES, &COLS); if (errret) diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index ecec2865..c03a601f 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,25 +29,80 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * * + * some of the code in here was contributed by: * + * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * ****************************************************************************/ +#define __INTERNAL_CAPS_VISIBLE #include #include #include +#include -#define __INTERNAL_CAPS_VISIBLE #include -MODULE_ID("$Id: lib_termcap.c,v 1.37 2000/09/16 20:30:16 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.43 2002/05/25 12:24:13 tom Exp $") + +#define CSI 233 +#define ESC 033 /* ^[ */ +#define L_BRACK '[' +#define SHIFT_OUT 017 /* ^N */ -/* - some of the code in here was contributed by: - Magnus Bengtsson, d6mbeng@dtek.chalmers.se -*/ +NCURSES_EXPORT_VAR(char *) UP = 0; +NCURSES_EXPORT_VAR(char *) BC = 0; -char *UP = 0; -char *BC = 0; +static char *fix_me = 0; + +static char * +set_attribute_9(int flag) +{ + const char *result; + + if ((result = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, flag)) == 0) + result = ""; + return strdup(result); +} + +static int +is_csi(char *s) +{ + if (UChar(s[0]) == CSI) + return 1; + else if (s[0] == ESC && s[1] == L_BRACK) + return 2; + return 0; +} + +static char * +skip_zero(char *s) +{ + if (s[0] == '0') { + if (s[1] == ';') + s += 2; + else if (isalpha(UChar(s[1]))) + s += 1; + } + return s; +} + +static bool +similar_sgr(char *a, char *b) +{ + int csi_a = is_csi(a); + int csi_b = is_csi(b); + + if (csi_a != 0 && csi_b != 0 && csi_a == csi_b) { + a += csi_a; + b += csi_b; + if (*a != *b) { + a = skip_zero(a); + b = skip_zero(b); + } + } + return strcmp(a, b) == 0; +} /*************************************************************************** * @@ -64,7 +119,7 @@ char *BC = 0; * ***************************************************************************/ -int +NCURSES_EXPORT(int) tgetent(char *bufp GCC_UNUSED, const char *name) { int errcode; @@ -73,6 +128,11 @@ tgetent(char *bufp GCC_UNUSED, const char *name) setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode); + PC = 0; + UP = 0; + BC = 0; + fix_me = 0; + if (errcode == 1) { if (cursor_left) @@ -87,6 +147,68 @@ tgetent(char *bufp GCC_UNUSED, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; + /* + * While 'sgr0' is the "same" as termcap 'me', there is a compatibility + * issue. The sgr/sgr0 capabilities include setting/clearing alternate + * character set mode. A termcap application cannot use sgr, so sgr0 + * strings that reset alternate character set mode will be + * misinterpreted. Here, we remove those from the more common + * ISO/ANSI/VT100 entries, which have sgr0 agreeing with sgr. + */ + if (exit_attribute_mode != 0 + && set_attributes != 0) { + char *on = set_attribute_9(1); + char *off = set_attribute_9(0); + char *tmp; + size_t i, j, k; + + if (similar_sgr(off, exit_attribute_mode) + && !similar_sgr(off, on)) { + TR(TRACE_DATABASE, ("adjusting sgr0 : %s", _nc_visbuf(off))); + FreeIfNeeded(fix_me); + fix_me = off; + for (i = 0; off[i] != '\0'; ++i) { + if (on[i] != off[i]) { + j = strlen(off); + k = strlen(on); + while (j != 0 + && k != 0 + && off[j - 1] == on[k - 1]) { + --j, --k; + } + while (off[j] != '\0') { + off[i++] = off[j++]; + } + off[i] = '\0'; + break; + } + } + /* SGR 10 would reset to normal font */ + if ((i = is_csi(off)) != 0 + && off[strlen(off) - 1] == 'm') { + tmp = skip_zero(off + i); + if (tmp[0] == '1' + && skip_zero(tmp + 1) != tmp + 1) { + i = tmp - off; + if (off[i - 1] == ';') + i--; + j = skip_zero(tmp + 1) - off; + while (off[j] != '\0') { + off[i++] = off[j++]; + } + off[i] = '\0'; + } + } + TR(TRACE_DATABASE, ("...adjusted me : %s", _nc_visbuf(fix_me))); + if (!strcmp(fix_me, exit_attribute_mode)) { + TR(TRACE_DATABASE, ("...same result, discard")); + free(fix_me); + fix_me = 0; + } + } + free(on); + } + (void) baudrate(); /* sets ospeed as a side-effect */ /* LINT_PREPRO @@ -108,7 +230,7 @@ tgetent(char *bufp GCC_UNUSED, const char *name) * ***************************************************************************/ -int +NCURSES_EXPORT(int) tgetflag(NCURSES_CONST char *id) { int i; @@ -136,7 +258,7 @@ tgetflag(NCURSES_CONST char *id) * ***************************************************************************/ -int +NCURSES_EXPORT(int) tgetnum(NCURSES_CONST char *id) { int i; @@ -165,10 +287,11 @@ tgetnum(NCURSES_CONST char *id) * ***************************************************************************/ -char * +NCURSES_EXPORT(char *) tgetstr(NCURSES_CONST char *id, char **area) { int i; + char *result = NULL; T((T_CALLED("tgetstr(%s,%p)"), id, area)); if (cur_term != 0) { @@ -176,17 +299,24 @@ tgetstr(NCURSES_CONST char *id, char **area) for_each_string(i, tp) { const char *capname = ExtStrname(tp, i, strcodes); if (!strncmp(id, capname, 2)) { - TR(TRACE_DATABASE,("found match : %s", _nc_visbuf(tp->Strings[i]))); + result = tp->Strings[i]; + TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); /* setupterm forces canceled strings to null */ - if (area != 0 - && *area != 0 - && VALID_STRING(tp->Strings[i])) { - (void) strcpy(*area, tp->Strings[i]); - *area += strlen(*area) + 1; + if (VALID_STRING(result)) { + if (result == exit_attribute_mode + && fix_me != 0) { + result = fix_me; + TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); + } + if (area != 0 + && *area != 0) { + (void) strcpy(*area, result); + *area += strlen(*area) + 1; + } } - returnPtr(tp->Strings[i]); + break; } } } - returnPtr(NULL); + returnPtr(result); } diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c index e7057383..57ce807a 100644 --- a/ncurses/tinfo/lib_termname.c +++ b/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,20 +27,22 @@ ****************************************************************************/ #include -#include /* for MAX_ALIAS */ +#include /* for MAX_ALIAS */ -MODULE_ID("$Id: lib_termname.c,v 1.2 1999/07/24 21:02:40 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.7 2001/08/04 19:29:38 tom Exp $") -char *termname(void) +NCURSES_EXPORT(char *) +termname(void) { -char *name = getenv("TERM"); -static char ret[MAX_ALIAS+1]; + char *name = getenv("TERM"); + static char ret[MAX_ALIAS + 1]; - T(("termname() called")); + T((T_CALLED("termname()"))); - if (name != 0) { - (void) strncpy(ret, name, sizeof(ret) - 1); - name = ret; - } - return name; + if (name != 0) { + ret[0] = '\0'; + (void) strncat(ret, name, sizeof(ret) - 1); + name = ret; + } + returnPtr(name); } diff --git a/ncurses/tinfo/lib_tgoto.c b/ncurses/tinfo/lib_tgoto.c index 73557eb7..77fc6cea 100644 --- a/ncurses/tinfo/lib_tgoto.c +++ b/ncurses/tinfo/lib_tgoto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000 Free Software Foundation, Inc. * + * Copyright (c) 2000-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include #include -MODULE_ID("$Id: lib_tgoto.c,v 1.2 2000/09/24 00:19:14 tom Exp $") +MODULE_ID("$Id: lib_tgoto.c,v 1.10 2002/08/31 22:14:47 Philippe.Blain Exp $") #if !PURE_TERMINFO static bool @@ -43,20 +43,24 @@ is_termcap(const char *string) { bool result = TRUE; - while ((*string != '\0') && result) { - if (*string == '%') { - switch (*++string) { - case 'p': + if (string == 0 || *string == '\0') { + result = FALSE; /* tparm() handles empty strings */ + } else { + while ((*string != '\0') && result) { + if (*string == '%') { + switch (*++string) { + case 'p': + result = FALSE; + break; + case '\0': + string--; + break; + } + } else if (string[0] == '$' && string[1] == '<') { result = FALSE; - break; - case '\0': - string--; - break; } - } else if (string[0] == '$' && string[1] == '<') { - result = FALSE; + string++; } - string++; } return result; } @@ -84,13 +88,13 @@ tgoto_internal(const char *string, int x, int y) while (*string != 0) { if ((used + need) > length) { length += (used + need); - if ((result = _nc_doalloc(result, length)) == 0) { + if ((result = typeRealloc(char, length, result)) == 0) { length = 0; break; } } if (*string == '%') { - char *fmt = 0; + const char *fmt = 0; switch (*++string) { case '\0': @@ -108,7 +112,7 @@ tgoto_internal(const char *string, int x, int y) *value %= 1000; break; case '+': - *value += (*++string & 0xff); + *value += UChar(*++string); /* FALLTHRU */ case '.': /* @@ -168,11 +172,13 @@ tgoto_internal(const char *string, int x, int y) } string++; } - if (need_BC) { - strcpy(result + used, BC); - used += strlen(BC); + if (result != 0) { + if (need_BC) { + strcpy(result + used, BC); + used += strlen(BC); + } + result[used] = '\0'; } - result[used] = '\0'; return result; } #endif @@ -181,7 +187,7 @@ tgoto_internal(const char *string, int x, int y) * Retained solely for upward compatibility. Note the intentional reversing of * the last two arguments when invoking tparm(). */ -char * +NCURSES_EXPORT(char *) tgoto(const char *string, int x, int y) { char *result; diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index def5ba6d..8ef86658 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -36,9 +36,9 @@ #include #include -MODULE_ID("$Id: lib_ti.c,v 1.20 2000/02/13 01:01:26 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.22 2000/12/10 02:55:08 tom Exp $") -int +NCURSES_EXPORT(int) tigetflag(NCURSES_CONST char *str) { int i; @@ -59,7 +59,7 @@ tigetflag(NCURSES_CONST char *str) returnCode(ABSENT_BOOLEAN); } -int +NCURSES_EXPORT(int) tigetnum(NCURSES_CONST char *str) { int i; @@ -81,7 +81,7 @@ tigetnum(NCURSES_CONST char *str) returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ } -char * +NCURSES_EXPORT(char *) tigetstr(NCURSES_CONST char *str) { int i; diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index 52352c9a..6df1e2d0 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey, 1996 on * ****************************************************************************/ /* @@ -42,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_tparm.c,v 1.48 2000/10/14 17:45:00 Sergei.Ivanov Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.62 2002/10/05 19:33:24 Frank.Henigman Exp $") /* * char * @@ -108,14 +109,17 @@ MODULE_ID("$Id: lib_tparm.c,v 1.48 2000/10/14 17:45:00 Sergei.Ivanov Exp $") typedef struct { union { - unsigned int num; + int num; char *str; } data; bool num_type; } stack_frame; +NCURSES_EXPORT_VAR(int) _nc_tparm_err = 0; + static stack_frame stack[STACKSIZE]; static int stack_ptr; +static const char *tparam_base = ""; #ifdef TRACE static const char *tname; @@ -126,7 +130,7 @@ static size_t out_size; static size_t out_used; #if NO_LEAKS -void +NCURSES_EXPORT(void) _nc_free_tparm(void) { if (out_buff != 0) { @@ -137,21 +141,16 @@ _nc_free_tparm(void) } #endif -static void -really_get_space(size_t need) -{ - out_size = need * 2; - out_buff = typeRealloc(char, out_size, out_buff); - if (out_buff == 0) - _nc_err_abort("Out of memory"); -} - static inline void get_space(size_t need) { need += out_used; - if (need > out_size) - really_get_space(need); + if (need > out_size) { + out_size = need * 2; + out_buff = typeRealloc(char, out_size, out_buff); + if (out_buff == 0) + _nc_err_abort(MSG_NO_MEMORY); + } } static inline void @@ -173,7 +172,7 @@ save_number(const char *fmt, int number, int len) if (len < 30) len = 30; /* actually log10(MAX_INT)+1 */ - get_space(len + 1); + get_space((unsigned) len + 1); (void) sprintf(out_buff + out_used, fmt, number); out_used += strlen(out_buff + out_used); @@ -195,6 +194,9 @@ npush(int x) stack[stack_ptr].num_type = TRUE; stack[stack_ptr].data.num = x; stack_ptr++; + } else { + DEBUG(2, ("npush: stack overflow: %s", _nc_visbuf(tparam_base))); + _nc_tparm_err++; } } @@ -206,6 +208,9 @@ npop(void) stack_ptr--; if (stack[stack_ptr].num_type) result = stack[stack_ptr].data.num; + } else { + DEBUG(2, ("npop: stack underflow: %s", _nc_visbuf(tparam_base))); + _nc_tparm_err++; } return result; } @@ -217,6 +222,9 @@ spush(char *x) stack[stack_ptr].num_type = FALSE; stack[stack_ptr].data.str = x; stack_ptr++; + } else { + DEBUG(2, ("spush: stack overflow: %s", _nc_visbuf(tparam_base))); + _nc_tparm_err++; } } @@ -229,6 +237,9 @@ spop(void) stack_ptr--; if (!stack[stack_ptr].num_type && stack[stack_ptr].data.str != 0) result = stack[stack_ptr].data.str; + } else { + DEBUG(2, ("spop: stack underflow: %s", _nc_visbuf(tparam_base))); + _nc_tparm_err++; } return result; } @@ -241,8 +252,8 @@ parse_format(const char *s, char *format, int *len) bool dot = FALSE; bool err = FALSE; char *fmt = format; - int prec = 0; - int width = 0; + int my_width = 0; + int my_prec = 0; int value = 0; *len = 0; @@ -262,9 +273,9 @@ parse_format(const char *s, char *format, int *len) *format++ = *s++; if (dot) { err = TRUE; - } else { + } else { /* value before '.' is the width */ dot = TRUE; - prec = value; + my_width = value; } value = 0; break; @@ -286,7 +297,7 @@ parse_format(const char *s, char *format, int *len) } break; default: - if (isdigit(*s)) { + if (isdigit(UChar(*s))) { value = (value * 10) + (*s - '0'); if (value > 10000) err = TRUE; @@ -301,20 +312,24 @@ parse_format(const char *s, char *format, int *len) * If we found an error, ignore (and remove) the flags. */ if (err) { - prec = width = value = 0; + my_width = my_prec = value = 0; format = fmt; *format++ = '%'; *format++ = *s; } + /* + * Any value after '.' is the precision. If we did not see '.', then + * the value is the width. + */ if (dot) - width = value; + my_prec = value; else - prec = value; + my_width = value; *format = '\0'; /* return maximum string length in print */ - *len = (prec > width) ? prec : width; + *len = (my_width > my_prec) ? my_width : my_prec; return s; } @@ -326,7 +341,7 @@ tparam_internal(const char *string, va_list ap) { #define NUM_VARS 26 char *p_is_s[9]; - int param[9]; + long param[9]; int lastpop; int popcount; int number; @@ -410,6 +425,10 @@ tparam_internal(const char *string, va_list ap) break; case 'P': + ++number; + ++cp; + break; + case 'g': cp++; break; @@ -439,10 +458,14 @@ tparam_internal(const char *string, va_list ap) case '=': case '<': case '>': + lastpop = -1; + number += 2; + break; + case '!': case '~': lastpop = -1; - number += 2; + ++number; break; case 'i': @@ -462,12 +485,14 @@ tparam_internal(const char *string, va_list ap) /* * A few caps (such as plab_norm) have string-valued parms. * We'll have to assume that the caller knows the difference, since - * a char* and an int may not be the same size on the stack. + * a char* and an int may not be the same size on the stack. The + * normal prototype for this uses 9 long's, which is consistent with + * our va_arg() usage. */ if (p_is_s[i] != 0) { p_is_s[i] = va_arg(ap, char *); } else { - param[i] = va_arg(ap, int); + param[i] = va_arg(ap, long int); } } @@ -501,7 +526,7 @@ tparam_internal(const char *string, va_list ap) if (*string != '%') { save_char(*string); } else { - string++; + tparam_base = string++; string = parse_format(string, format, &len); switch (*string) { default: @@ -514,12 +539,15 @@ tparam_internal(const char *string, va_list ap) case 'o': /* FALLTHRU */ case 'x': /* FALLTHRU */ case 'X': /* FALLTHRU */ - case 'c': /* FALLTHRU */ save_number(format, npop(), len); break; + case 'c': /* FALLTHRU */ + save_char(npop()); + break; + case 'l': - save_number("%d", strlen(spop()), 0); + save_number("%d", (int) strlen(spop()), 0); break; case 's': @@ -724,12 +752,13 @@ tparam_internal(const char *string, va_list ap) return (out_buff); } -char * +NCURSES_EXPORT(char *) tparm(NCURSES_CONST char *string,...) { va_list ap; char *result; + _nc_tparm_err = 0; va_start(ap, string); #ifdef TRACE tname = "tparm"; diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index 93eebf88..2273b877 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -45,16 +45,16 @@ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.51 2000/10/08 00:22:24 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.60 2002/08/17 23:44:08 tom Exp $") -char PC = 0; /* used by termcap library */ -short ospeed = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ -int _nc_nulls_sent = 0; /* used by 'tack' program */ +NCURSES_EXPORT_VAR(int) _nc_nulls_sent = 0; /* used by 'tack' program */ static int (*my_outch) (int c) = _nc_outch; -int +NCURSES_EXPORT(int) delay_output(int ms) { T((T_CALLED("delay_output(%d)"), ms)); @@ -75,13 +75,13 @@ delay_output(int ms) returnCode(OK); } -void +NCURSES_EXPORT(void) _nc_flush(void) { (void) fflush(NC_OUTPUT); } -int +NCURSES_EXPORT(int) _nc_outch(int ch) { #ifdef TRACE @@ -102,79 +102,13 @@ _nc_outch(int ch) return OK; } -#if USE_WIDEC_SUPPORT -/* - * Reference: The Unicode Standard 2.0 - * - * No surrogates supported (we're storing only one 16-bit Unicode value per - * cell). - */ -int -_nc_utf8_outch(int ch) -{ - static const unsigned byteMask = 0xBF; - static const unsigned otherMark = 0x80; - static const unsigned firstMark[] = - {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}; - - int result[7], *ptr; - int count = 0; - - if ((unsigned int) ch < 0x80) - count = 1; - else if ((unsigned int) ch < 0x800) - count = 2; - else if ((unsigned int) ch < 0x10000) - count = 3; - else if ((unsigned int) ch < 0x200000) - count = 4; - else if ((unsigned int) ch < 0x4000000) - count = 5; - else if ((unsigned int) ch <= 0x7FFFFFFF) - count = 6; - else { - count = 3; - ch = 0xFFFD; - } - ptr = result + count; - switch (count) { - case 6: - *--ptr = (ch | otherMark) & byteMask; - ch >>= 6; - /* FALLTHRU */ - case 5: - *--ptr = (ch | otherMark) & byteMask; - ch >>= 6; - /* FALLTHRU */ - case 4: - *--ptr = (ch | otherMark) & byteMask; - ch >>= 6; - /* FALLTHRU */ - case 3: - *--ptr = (ch | otherMark) & byteMask; - ch >>= 6; - /* FALLTHRU */ - case 2: - *--ptr = (ch | otherMark) & byteMask; - ch >>= 6; - /* FALLTHRU */ - case 1: - *--ptr = (ch | firstMark[count]); - break; - } - while (count--) - _nc_outch(*ptr++); - return OK; -} -#endif - -int +NCURSES_EXPORT(int) putp(const char *string) { return tputs(string, 1, _nc_outch); } -int +NCURSES_EXPORT(int) tputs(const char *string, int affcnt, int (*outc) (int)) { bool always_delay; @@ -225,19 +159,19 @@ tputs(const char *string, int affcnt, int (*outc) (int)) * (like nethack) actually do the likes of tputs("50") to get delays. */ trailpad = 0; - if (isdigit(*string)) { - while (isdigit(*string)) { + if (isdigit(UChar(*string))) { + while (isdigit(UChar(*string))) { trailpad = trailpad * 10 + (*string - '0'); string++; } trailpad *= 10; if (*string == '.') { string++; - if (isdigit(*string)) { + if (isdigit(UChar(*string))) { trailpad += (*string - '0'); string++; } - while (isdigit(*string)) + while (isdigit(UChar(*string))) string++; } @@ -262,25 +196,26 @@ tputs(const char *string, int affcnt, int (*outc) (int)) bool mandatory; string++; - if ((!isdigit(*string) && *string != '.') || !strchr(string, '>')) { + if ((!isdigit(UChar(*string)) && *string != '.') + || !strchr(string, '>')) { (*outc) ('$'); (*outc) ('<'); continue; } number = 0; - while (isdigit(*string)) { + while (isdigit(UChar(*string))) { number = number * 10 + (*string - '0'); string++; } number *= 10; if (*string == '.') { string++; - if (isdigit(*string)) { + if (isdigit(UChar(*string))) { number += (*string - '0'); string++; } - while (isdigit(*string)) + while (isdigit(UChar(*string))) string++; } diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index 0e57c512..8c420e82 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,9 +36,9 @@ */ #include -#include /* cur_term */ +#include /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.3 1999/10/22 21:38:55 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.9 2002/10/12 21:28:16 tom Exp $") #undef tabs @@ -56,89 +56,97 @@ MODULE_ID("$Id: lib_ttyflags.c,v 1.3 1999/10/22 21:38:55 tom Exp $") # endif #endif -int _nc_get_tty_mode(TTY *buf) +NCURSES_EXPORT(int) +_nc_get_tty_mode(TTY * buf) { - if (cur_term == 0 - || GET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - TR(TRACE_BITS,("_nc_get_tty_mode: %s", _nc_tracebits())); - return (OK); + if (cur_term == 0 + || GET_TTY(cur_term->Filedes, buf) != 0) + return (ERR); + TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", + cur_term->Filedes, _nc_trace_ttymode(buf))); + return (OK); } -int _nc_set_tty_mode(TTY *buf) +NCURSES_EXPORT(int) +_nc_set_tty_mode(TTY * buf) { - if (cur_term == 0 - || SET_TTY(cur_term->Filedes, buf) != 0) - return(ERR); - TR(TRACE_BITS,("_nc_set_tty_mode: %s", _nc_tracebits())); - return (OK); + if (cur_term == 0 + || SET_TTY(cur_term->Filedes, buf) != 0) + return (ERR); + TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", + cur_term->Filedes, _nc_trace_ttymode(buf))); + return (OK); } -int def_shell_mode(void) +NCURSES_EXPORT(int) +def_shell_mode(void) { - T((T_CALLED("def_shell_mode()"))); + T((T_CALLED("def_shell_mode()"))); - /* - * Turn off the XTABS bit in the tty structure if it was on. If XTABS - * was on, remove the tab and backtab capabilities. - */ + /* + * Turn off the XTABS bit in the tty structure if it was on. If XTABS + * was on, remove the tab and backtab capabilities. + */ - if (_nc_get_tty_mode(&cur_term->Ottyb) != OK) - returnCode(ERR); + if (_nc_get_tty_mode(&cur_term->Ottyb) != OK) + returnCode(ERR); #ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & tabs) - tab = back_tab = NULL; + if (cur_term->Ottyb.c_oflag & tabs) + tab = back_tab = NULL; #else - if (cur_term->Ottyb.sg_flags & XTABS) - tab = back_tab = NULL; + if (cur_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; #endif - returnCode(OK); + returnCode(OK); } -int def_prog_mode(void) +NCURSES_EXPORT(int) +def_prog_mode(void) { - T((T_CALLED("def_prog_mode()"))); + T((T_CALLED("def_prog_mode()"))); - if (_nc_get_tty_mode(&cur_term->Nttyb) != OK) - returnCode(ERR); + if (_nc_get_tty_mode(&cur_term->Nttyb) != OK) + returnCode(ERR); #ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~tabs; + cur_term->Nttyb.c_oflag &= ~tabs; #else - cur_term->Nttyb.sg_flags &= ~XTABS; + cur_term->Nttyb.sg_flags &= ~XTABS; #endif - returnCode(OK); + returnCode(OK); } -int reset_prog_mode(void) +NCURSES_EXPORT(int) +reset_prog_mode(void) { - T((T_CALLED("reset_prog_mode()"))); - - if (cur_term != 0) { - _nc_set_tty_mode(&cur_term->Nttyb); - if (SP) { - if (stdscr && stdscr->_use_keypad) - _nc_keypad(TRUE); - NC_BUFFERED(TRUE); - } - returnCode(OK); + T((T_CALLED("reset_prog_mode()"))); + + if (cur_term != 0) { + if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) { + if (SP) { + if (SP->_keypad_on) + _nc_keypad(TRUE); + NC_BUFFERED(TRUE); + } + returnCode(OK); } - returnCode(ERR); + } + returnCode(ERR); } -int reset_shell_mode(void) +NCURSES_EXPORT(int) +reset_shell_mode(void) { - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) - { - _nc_keypad(FALSE); - _nc_flush(); - NC_BUFFERED(FALSE); - } - returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); + T((T_CALLED("reset_shell_mode()"))); + + if (cur_term != 0) { + if (SP) { + _nc_keypad(FALSE); + _nc_flush(); + NC_BUFFERED(FALSE); } - returnCode(ERR); + returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); + } + returnCode(ERR); } /* @@ -146,18 +154,20 @@ int reset_shell_mode(void) ** */ -static TTY buf; +static TTY buf; -int savetty(void) +NCURSES_EXPORT(int) +savetty(void) { - T((T_CALLED("savetty()"))); + T((T_CALLED("savetty()"))); - returnCode(_nc_get_tty_mode(&buf)); + returnCode(_nc_get_tty_mode(&buf)); } -int resetty(void) +NCURSES_EXPORT(int) +resetty(void) { - T((T_CALLED("resetty()"))); + T((T_CALLED("resetty()"))); - returnCode(_nc_set_tty_mode(&buf)); + returnCode(_nc_set_tty_mode(&buf)); } diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index 703ca5de..3c98da23 100644 --- a/ncurses/tinfo/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,98 +37,104 @@ */ #include -MODULE_ID("$Id: make_keys.c,v 1.8 2000/03/12 02:55:50 Todd.C.Miller Exp $") +MODULE_ID("$Id: make_keys.c,v 1.10 2000/12/10 02:55:08 tom Exp $") #include #define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames)) -static size_t lookup(const char *name) +static size_t +lookup(const char *name) { - size_t n; - bool found = FALSE; - for (n = 0; strnames[n] != 0; n++) { - if (!strcmp(name, strnames[n])) { - found = TRUE; - break; - } + size_t n; + bool found = FALSE; + for (n = 0; strnames[n] != 0; n++) { + if (!strcmp(name, strnames[n])) { + found = TRUE; + break; } - if (!found) { - for (n = 0; strfnames[n] != 0; n++) { - if (!strcmp(name, strfnames[n])) { - found = TRUE; - break; - } - } + } + if (!found) { + for (n = 0; strfnames[n] != 0; n++) { + if (!strcmp(name, strfnames[n])) { + found = TRUE; + break; + } } - return found ? n : UNKNOWN; + } + return found ? n : UNKNOWN; } -static void make_keys(FILE *ifp, FILE *ofp) +static void +make_keys(FILE * ifp, FILE * ofp) { - char buffer[BUFSIZ]; - char from[BUFSIZ]; - char to[BUFSIZ]; - int maxlen = 16; + char buffer[BUFSIZ]; + char from[BUFSIZ]; + char to[BUFSIZ]; + int maxlen = 16; - while (fgets(buffer, sizeof(buffer), ifp) != 0) { - if (*buffer == '#') - continue; - if (sscanf(buffer, "%s %s", to, from) == 2) { - int code = lookup(from); - if (code == UNKNOWN) - continue; - if ((int)strlen(from) > maxlen) - maxlen = strlen(from); - fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", - code, - maxlen, maxlen, - to, - from); - } + while (fgets(buffer, sizeof(buffer), ifp) != 0) { + if (*buffer == '#') + continue; + if (sscanf(buffer, "%s %s", to, from) == 2) { + int code = lookup(from); + if (code == UNKNOWN) + continue; + if ((int) strlen(from) > maxlen) + maxlen = strlen(from); + fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", + code, + maxlen, maxlen, + to, + from); } + } } -static void write_list(FILE *ofp, const char **list) +static void +write_list(FILE * ofp, const char **list) { - while (*list != 0) - fprintf(ofp, "%s\n", *list++); + while (*list != 0) + fprintf(ofp, "%s\n", *list++); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - static const char *prefix[] = { - "#ifndef NCU_KEYS_H", - "#define NCU_KEYS_H 1", - "", - "/* This file was generated by MAKE_KEYS */", - "", - "#if BROKEN_LINKER", - "static", - "#endif", - "struct tinfo_fkeys _nc_tinfo_fkeys[] = {", - 0 - }; - static const char *suffix[] = { - "\t{ 0, 0} };", - "", - "#endif /* NCU_KEYS_H */", - 0 - }; + static const char *prefix[] = + { + "#ifndef NCU_KEYS_H", + "#define NCU_KEYS_H 1", + "", + "/* This file was generated by MAKE_KEYS */", + "", + "#if BROKEN_LINKER", + "static", + "#endif", + "struct tinfo_fkeys _nc_tinfo_fkeys[] = {", + 0 + }; + static const char *suffix[] = + { + "\t{ 0, 0} };", + "", + "#endif /* NCU_KEYS_H */", + 0 + }; - write_list(stdout, prefix); - if (argc > 1) { - int n; - for (n = 1; n < argc; n++) { - FILE *fp = fopen(argv[n], "r"); - if (fp != 0) { - make_keys(fp, stdout); - fclose(fp); - } - } - } else { - make_keys(stdin, stdout); + write_list(stdout, prefix); + if (argc > 1) { + int n; + for (n = 1; n < argc; n++) { + FILE *fp = fopen(argv[n], "r"); + if (fp != 0) { + make_keys(fp, stdout); + fclose(fp); + } } - write_list(stdout, suffix); - return EXIT_SUCCESS; + } else { + make_keys(stdin, stdout); + } + write_list(stdout, suffix); + return EXIT_SUCCESS; } diff --git a/ncurses/tinfo/name_match.c b/ncurses/tinfo/name_match.c index a9e83969..9d8e390d 100644 --- a/ncurses/tinfo/name_match.c +++ b/ncurses/tinfo/name_match.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ #include #include -MODULE_ID("$Id: name_match.c,v 1.8 1999/03/07 01:58:36 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.12 2002/08/31 21:48:41 Philippe.Blain Exp $") /* * _nc_first_name(char *names) @@ -42,19 +42,22 @@ MODULE_ID("$Id: name_match.c,v 1.8 1999/03/07 01:58:36 tom Exp $") * Extract the primary name from a compiled entry. */ -char *_nc_first_name(const char *const sp) +NCURSES_EXPORT(char *) +_nc_first_name(const char *const sp) /* get the first name from the given name list */ { - static char buf[MAX_NAME_SIZE+1]; - register unsigned n; + static char *buf; + register unsigned n; - for (n = 0; n < sizeof(buf)-1; n++) { - if ((buf[n] = sp[n]) == '\0' - || (buf[n] == '|')) - break; - } - buf[n] = '\0'; - return(buf); + if (buf == 0) + buf = typeMalloc(char, MAX_NAME_SIZE + 1); + for (n = 0; n < MAX_NAME_SIZE; n++) { + if ((buf[n] = sp[n]) == '\0' + || (buf[n] == '|')) + break; + } + buf[n] = '\0'; + return (buf); } /* @@ -63,34 +66,36 @@ char *_nc_first_name(const char *const sp) * Is the given name matched in namelist? */ -int _nc_name_match(const char *const namelst, const char *const name, const char *const delim) +NCURSES_EXPORT(int) +_nc_name_match +(const char *const namelst, const char *const name, const char *const delim) { - const char *s, *d, *t; - int code, found; + const char *s, *d, *t; + int code, found; - if ((s = namelst) != 0) { - while (*s != '\0') { - for (d = name; *d != '\0'; d++) { - if (*s != *d) - break; - s++; - } - found = FALSE; - for (code = TRUE; *s != '\0'; code = FALSE, s++) { - for (t = delim; *t != '\0'; t++) { - if (*s == *t) { - found = TRUE; - break; - } - } - if (found) - break; - } - if (code && *d == '\0') - return code; - if (*s++ == 0) - break; + if ((s = namelst) != 0) { + while (*s != '\0') { + for (d = name; *d != '\0'; d++) { + if (*s != *d) + break; + s++; + } + found = FALSE; + for (code = TRUE; *s != '\0'; code = FALSE, s++) { + for (t = delim; *t != '\0'; t++) { + if (*s == *t) { + found = TRUE; + break; + } } + if (found) + break; + } + if (code && *d == '\0') + return code; + if (*s++ == 0) + break; } - return FALSE; + } + return FALSE; } diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c index 24bf3c37..87e424f7 100644 --- a/ncurses/tinfo/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,14 +40,14 @@ * from the input stream. */ +#define __INTERNAL_CAPS_VISIBLE #include #include #include -#define __INTERNAL_CAPS_VISIBLE #include -MODULE_ID("$Id: parse_entry.c,v 1.48 2000/10/03 09:38:48 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.57 2002/08/31 17:02:02 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -195,14 +195,15 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) * push back token */ -int -_nc_parse_entry(struct entry *entryp, int literal, bool silent) +NCURSES_EXPORT(int) +_nc_parse_entry +(struct entry *entryp, int literal, bool silent) { int token_type; struct name_table_entry const *entry_ptr; char *ptr, *base; - token_type = _nc_get_token(); + token_type = _nc_get_token(silent); if (token_type == EOF) return (EOF); @@ -242,15 +243,15 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) (base == entryp->tterm.term_names) ? "primary name" : "alias", - ptr - base, base); + (int) (ptr - base), base); } } entryp->nuses = 0; - for (token_type = _nc_get_token(); + for (token_type = _nc_get_token(silent); token_type != EOF && token_type != NAMES; - token_type = _nc_get_token()) { + token_type = _nc_get_token(silent)) { if (strcmp(_nc_curr_token.tk_name, "use") == 0 || strcmp(_nc_curr_token.tk_name, "tc") == 0) { entryp->uses[entryp->nuses].name = _nc_save_str(_nc_curr_token.tk_valstring); @@ -464,12 +465,12 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) } else postprocess_terminfo(&entryp->tterm); } - _nc_wrap_entry(entryp); + _nc_wrap_entry(entryp, FALSE); return (OK); } -int +NCURSES_EXPORT(int) _nc_capcmp(const char *s, const char *t) /* compare two string capabilities, stripping out padding */ { @@ -481,15 +482,21 @@ _nc_capcmp(const char *s, const char *t) for (;;) { if (s[0] == '$' && s[1] == '<') { for (s += 2;; s++) - if (!(isdigit(*s) || *s == '.' || *s == '*' || *s == '/' || - *s == '>')) + if (!(isdigit(UChar(*s)) + || *s == '.' + || *s == '*' + || *s == '/' + || *s == '>')) break; } if (t[0] == '$' && t[1] == '<') { for (t += 2;; t++) - if (!(isdigit(*t) || *t == '.' || *t == '*' || *t == '/' || - *t == '>')) + if (!(isdigit(UChar(*t)) + || *t == '.' + || *t == '*' + || *t == '/' + || *t == '>')) break; } @@ -507,7 +514,7 @@ _nc_capcmp(const char *s, const char *t) } static void -append_acs0(string_desc *dst, int code, int src) +append_acs0(string_desc * dst, int code, int src) { if (src != 0) { char temp[3]; @@ -519,7 +526,7 @@ append_acs0(string_desc *dst, int code, int src) } static void -append_acs(string_desc *dst, int code, char *src) +append_acs(string_desc * dst, int code, char *src) { if (src != 0 && strlen(src) == 1) { append_acs0(dst, code, *src); @@ -657,12 +664,12 @@ postprocess_termcap(TERMTYPE * tp, bool has_base) } else if (PRESENT(carriage_return) && PRESENT(scroll_forward)) { _nc_str_init(&result, buf, sizeof(buf)); if (_nc_safe_strcat(&result, carriage_return) - && _nc_safe_strcat(&result, scroll_forward)) + && _nc_safe_strcat(&result, scroll_forward)) newline = _nc_save_str(buf); } else if (PRESENT(carriage_return) && PRESENT(cursor_down)) { _nc_str_init(&result, buf, sizeof(buf)); if (_nc_safe_strcat(&result, carriage_return) - && _nc_safe_strcat(&result, cursor_down)) + && _nc_safe_strcat(&result, cursor_down)) newline = _nc_save_str(buf); } } @@ -813,13 +820,15 @@ postprocess_termcap(TERMTYPE * tp, bool has_base) } } - if (!hard_copy) { - if (WANTED(key_backspace)) - key_backspace = _nc_save_str(C_BS); - if (WANTED(key_left)) - key_left = _nc_save_str(C_BS); - if (WANTED(key_down)) - key_down = _nc_save_str(C_LF); + if (!has_base) { + if (!hard_copy) { + if (WANTED(key_backspace)) + key_backspace = _nc_save_str(C_BS); + if (WANTED(key_left)) + key_left = _nc_save_str(C_BS); + if (WANTED(key_down)) + key_down = _nc_save_str(C_LF); + } } /* @@ -841,17 +850,17 @@ postprocess_termcap(TERMTYPE * tp, bool has_base) _nc_str_init(&result, buf2, sizeof(buf2)); _nc_safe_strcat(&result, acs_chars); - append_acs (&result, 'j', acs_lrcorner); - append_acs (&result, 'k', acs_urcorner); - append_acs (&result, 'l', acs_ulcorner); - append_acs (&result, 'm', acs_llcorner); - append_acs (&result, 'n', acs_plus); - append_acs (&result, 'q', acs_hline); - append_acs (&result, 't', acs_ltee); - append_acs (&result, 'u', acs_rtee); - append_acs (&result, 'v', acs_btee); - append_acs (&result, 'w', acs_ttee); - append_acs (&result, 'x', acs_vline); + append_acs(&result, 'j', acs_lrcorner); + append_acs(&result, 'k', acs_urcorner); + append_acs(&result, 'l', acs_ulcorner); + append_acs(&result, 'm', acs_llcorner); + append_acs(&result, 'n', acs_plus); + append_acs(&result, 'q', acs_hline); + append_acs(&result, 't', acs_ltee); + append_acs(&result, 'u', acs_rtee); + append_acs(&result, 'v', acs_btee); + append_acs(&result, 'w', acs_ttee); + append_acs(&result, 'x', acs_vline); if (buf2[0]) { acs_chars = _nc_save_str(buf2); @@ -860,8 +869,7 @@ postprocess_termcap(TERMTYPE * tp, bool has_base) } else if (acs_chars == 0 && enter_alt_charset_mode != 0 && exit_alt_charset_mode != 0) { - acs_chars = - _nc_save_str("``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~"); + acs_chars = _nc_save_str(VT_ACSC); } } @@ -883,17 +891,17 @@ postprocess_terminfo(TERMTYPE * tp) _nc_str_init(&result, buf2, sizeof(buf2)); _nc_safe_strcat(&result, acs_chars); - append_acs0 (&result, 'l', box_chars_1[0]); /* ACS_ULCORNER */ - append_acs0 (&result, 'q', box_chars_1[1]); /* ACS_HLINE */ - append_acs0 (&result, 'k', box_chars_1[2]); /* ACS_URCORNER */ - append_acs0 (&result, 'x', box_chars_1[3]); /* ACS_VLINE */ - append_acs0 (&result, 'j', box_chars_1[4]); /* ACS_LRCORNER */ - append_acs0 (&result, 'm', box_chars_1[5]); /* ACS_LLCORNER */ - append_acs0 (&result, 'w', box_chars_1[6]); /* ACS_TTEE */ - append_acs0 (&result, 'u', box_chars_1[7]); /* ACS_RTEE */ - append_acs0 (&result, 'v', box_chars_1[8]); /* ACS_BTEE */ - append_acs0 (&result, 't', box_chars_1[9]); /* ACS_LTEE */ - append_acs0 (&result, 'n', box_chars_1[10]); /* ACS_PLUS */ + append_acs0(&result, 'l', box_chars_1[0]); /* ACS_ULCORNER */ + append_acs0(&result, 'q', box_chars_1[1]); /* ACS_HLINE */ + append_acs0(&result, 'k', box_chars_1[2]); /* ACS_URCORNER */ + append_acs0(&result, 'x', box_chars_1[3]); /* ACS_VLINE */ + append_acs0(&result, 'j', box_chars_1[4]); /* ACS_LRCORNER */ + append_acs0(&result, 'm', box_chars_1[5]); /* ACS_LLCORNER */ + append_acs0(&result, 'w', box_chars_1[6]); /* ACS_TTEE */ + append_acs0(&result, 'u', box_chars_1[7]); /* ACS_RTEE */ + append_acs0(&result, 'v', box_chars_1[8]); /* ACS_BTEE */ + append_acs0(&result, 't', box_chars_1[9]); /* ACS_LTEE */ + append_acs0(&result, 'n', box_chars_1[10]); /* ACS_PLUS */ if (buf2[0]) { acs_chars = _nc_save_str(buf2); diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index deef4985..006e56c3 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include #include -MODULE_ID("$Id: read_entry.c,v 1.69 2000/10/10 00:57:40 Todd.Miller Exp $") +MODULE_ID("$Id: read_entry.c,v 1.72 2000/12/10 02:55:08 tom Exp $") #if !HAVE_TELL #define tell(fd) 0 /* lseek() is POSIX, but not tell() - odd... */ @@ -70,7 +70,7 @@ static bool keep_tic_directory = FALSE; * Record the "official" location of the terminfo directory, according to * the place where we're writing to, or the normal default, if not. */ -const char * +NCURSES_EXPORT(const char *) _nc_tic_dir(const char *path) { static const char *result = TERMINFO; @@ -93,7 +93,7 @@ _nc_tic_dir(const char *path) * has chdir'd to it. If we let it be changed, then if $TERMINFO has a * relative path, we'll lose track of the actual directory. */ -void +NCURSES_EXPORT(void) _nc_keep_tic_dir(const char *path) { _nc_tic_dir(path); @@ -373,8 +373,9 @@ read_termtype(int fd, TERMTYPE * ptr) return (1); } -int -_nc_read_file_entry(const char *const filename, TERMTYPE * ptr) +NCURSES_EXPORT(int) +_nc_read_file_entry +(const char *const filename, TERMTYPE * ptr) /* return 1 if read, 0 if not found or garbled */ { int code, fd = -1; @@ -428,7 +429,7 @@ _nc_read_terminfo_dirs(const char *dirs, char *const filename, const char *const for (;;) { int c = *a; - if (c == 0 || c == ':') { + if (c == 0 || c == NCURSES_PATHSEP) { *a = 0; if ((b + 1) >= a) b = TERMINFO; @@ -456,8 +457,9 @@ _nc_read_terminfo_dirs(const char *dirs, char *const filename, const char *const * overrun the file buffer. */ -int -_nc_read_entry(const char *const tn, char *const filename, TERMTYPE * const tp) +NCURSES_EXPORT(int) +_nc_read_entry +(const char *const tn, char *const filename, TERMTYPE * const tp) { char *envp; char ttn[MAX_ALIAS + 3]; diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index 9487dd66..c6e7e358 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -52,10 +52,12 @@ #include #include +#include +#include #include #include -MODULE_ID("$Id: read_termcap.c,v 1.51 2000/10/21 00:34:11 Philip.Guenther Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.58 2001/10/28 01:11:34 tom Exp $") #if !PURE_TERMINFO @@ -72,6 +74,17 @@ MODULE_ID("$Id: read_termcap.c,v 1.51 2000/10/21 00:34:11 Philip.Guenther Exp $" #define TC_SYS_ERR -3 #define TC_REF_LOOP -4 +static char * +get_termpath(void) +{ + char *result; + + if (!use_terminfo_vars() || (result = getenv("TERMPATH")) == 0) + result = TERMPATH; + T(("TERMPATH is %s", result)); + return result; +} + #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -125,13 +138,7 @@ static int _nc_nfcmp(const char *, char *); #define BFRAG 1024 #define BSIZE 1024 -#define ESC ('[' & 037) /* ASCII ESC */ #define MAX_RECURSION 32 /* maximum getent recursion */ -#define SFRAG 100 /* cgetstr mallocs in SFRAG chunks */ - -#define RECOK (char)0 -#define TCERR (char)1 -#define SHADOW (char)2 static size_t topreclen; /* toprec length */ static char *toprec; /* Additional record specified by cgetset() */ @@ -784,7 +791,7 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) pvec = pathvec; tbuf = bp; p = pathbuf; - cp = use_terminfo_vars() ? getenv("TERMCAP") : NULL; + cp = use_terminfo_vars()? getenv("TERMCAP") : NULL; /* * TERMCAP can have one of two things in it. It can be the name of a file @@ -797,9 +804,9 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) */ _nc_str_init(&desc, pathbuf, sizeof(pathbuf)); if (cp == NULL) { - _nc_safe_strcpy(&desc, "/etc/termcap /usr/share/misc/termcap"); + _nc_safe_strcpy(&desc, get_termpath()); } else if (!is_pathname(cp)) { /* TERMCAP holds an entry */ - if ((termpath = getenv("TERMPATH")) != 0) { + if ((termpath = get_termpath()) != 0) { _nc_safe_strcat(&desc, termpath); } else { char temp[PBUFSIZ]; @@ -812,8 +819,8 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) /* if no $HOME look in current directory */ strcat(temp, ".termcap"); _nc_safe_strcat(&desc, temp); - _nc_safe_strcat(&desc, " /etc/termcap"); - _nc_safe_strcat(&desc, " /usr/share/misc/termcap"); + _nc_safe_strcat(&desc, " "); + _nc_safe_strcat(&desc, get_termpath()); } } else { /* user-defined name in TERMCAP */ _nc_safe_strcat(&desc, cp); /* still can be tokenized */ @@ -821,10 +828,10 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) *fname++ = pathbuf; /* tokenize path into vector of names */ while (*++p) { - if (*p == ' ' || *p == ':') { + if (*p == ' ' || *p == NCURSES_PATHSEP) { *p = '\0'; while (*++p) - if (*p != ' ' && *p != ':') + if (*p != ' ' && *p != NCURSES_PATHSEP) break; if (*p == '\0') break; @@ -908,16 +915,23 @@ _nc_tgetent(char *bp, char **sourcename, int *lineno, const char *name) static int add_tc(char *termpaths[], char *path, int count) { + char *save = strchr(path, NCURSES_PATHSEP); + if (save != 0) + *save = '\0'; if (count < MAXPATHS - && _nc_access(path, R_OK) == 0) + && _nc_access(path, R_OK) == 0) { termpaths[count++] = path; + T(("Adding termpath %s", path)); + } termpaths[count] = 0; + if (save != 0) + *save = NCURSES_PATHSEP; return count; } #define ADD_TC(path, count) filecount = add_tc(termpaths, path, count) #endif /* !USE_GETCAP */ -int +NCURSES_EXPORT(int) _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) { int found = FALSE; @@ -930,6 +944,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) static char *source; static int lineno; + T(("read termcap entry for %s", tn)); if (use_terminfo_vars() && (p = getenv("TERMCAP")) != 0 && !is_pathname(p) && _nc_name_match(p, tn, "|:")) { /* TERMCAP holds a termcap entry */ @@ -975,45 +990,42 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) FILE *fp; char *tc, *termpaths[MAXPATHS]; int filecount = 0; + int j, k; bool use_buffer = FALSE; + bool normal = TRUE; char tc_buf[1024]; char pathbuf[PATH_MAX]; + char *copied = 0; + char *cp; + struct stat test_stat[MAXPATHS]; termpaths[filecount] = 0; if (use_terminfo_vars() && (tc = getenv("TERMCAP")) != 0) { if (is_pathname(tc)) { /* interpret as a filename */ ADD_TC(tc, 0); + normal = FALSE; } else if (_nc_name_match(tc, tn, "|:")) { /* treat as a capability file */ use_buffer = TRUE; (void) sprintf(tc_buf, "%.*s\n", (int) sizeof(tc_buf) - 2, tc); - } else if ((tc = getenv("TERMPATH")) != 0) { - char *cp; - - for (cp = tc; *cp; cp++) { - if (*cp == ':') - *cp = '\0'; - else if (cp == tc || cp[-1] == '\0') { - ADD_TC(cp, filecount); - } - } + normal = FALSE; } - } else { /* normal case */ - char envhome[PATH_MAX], *h; + } - filecount = 0; + if (normal) { /* normal case */ + char envhome[PATH_MAX], *h; - /* - * Probably /etc/termcap is a symlink to /usr/share/misc/termcap. - * Avoid reading the same file twice. - */ - if (_nc_access("/etc/termcap", F_OK) == 0) - ADD_TC("/etc/termcap", filecount); - else - ADD_TC("/usr/share/misc/termcap", filecount); + copied = strdup(get_termpath()); + for (cp = copied; *cp; cp++) { + if (*cp == NCURSES_PATHSEP) + *cp = '\0'; + else if (cp == copied || cp[-1] == '\0') { + ADD_TC(cp, filecount); + } + } #define PRIVATE_CAP "%s/.termcap" - if ((h = getenv("HOME")) != NULL && *h != '\0' + if (use_terminfo_vars() && (h = getenv("HOME")) != NULL && *h != '\0' && (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) { /* user's .termcap, if any, should override it */ (void) strcpy(envhome, h); @@ -1022,6 +1034,37 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) } } + /* + * Probably /etc/termcap is a symlink to /usr/share/misc/termcap. + * Avoid reading the same file twice. + */ +#ifdef HAVE_LINK + for (j = 0; j < filecount; j++) { + bool omit = FALSE; + if (stat(termpaths[j], &test_stat[j]) != 0 + || (test_stat[j].st_mode & S_IFMT) != S_IFREG) { + omit = TRUE; + } else { + for (k = 0; k < j; k++) { + if (test_stat[k].st_dev == test_stat[j].st_dev + && test_stat[k].st_ino == test_stat[j].st_ino) { + omit = TRUE; + break; + } + } + } + if (omit) { + T(("Path %s is a duplicate", termpaths[j])); + for (k = j + 1; k < filecount; k++) { + termpaths[k - 1] = termpaths[k]; + test_stat[k - 1] = test_stat[k]; + } + --filecount; + --j; + } + } +#endif + /* parse the sources */ if (use_buffer) { _nc_set_source("TERMCAP"); @@ -1037,7 +1080,8 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) for (i = 0; i < filecount; i++) { T(("Looking for %s in %s", tn, termpaths[i])); - if ((fp = fopen(termpaths[i], "r")) != (FILE *) 0) { + if (_nc_access(termpaths[i], R_OK) == 0 + && (fp = fopen(termpaths[i], "r")) != (FILE *) 0) { _nc_set_source(termpaths[i]); /* @@ -1051,6 +1095,8 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) } } } + if (copied != 0) + free(copied); #endif /* USE_GETCAP */ if (_nc_head == 0) @@ -1103,8 +1149,10 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE * const tp) return (found); } #else -extern void _nc_read_termcap(void); -void +extern +NCURSES_EXPORT(void) +_nc_read_termcap(void); +NCURSES_EXPORT(void) _nc_read_termcap(void) { } diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c index c0e73565..6d0201bf 100644 --- a/ncurses/tinfo/setbuf.c +++ b/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,8 +31,6 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* ** setbuf.c ** @@ -42,7 +40,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.5 1999/02/27 20:00:15 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.7 2000/12/10 02:55:08 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -99,45 +97,47 @@ MODULE_ID("$Id: setbuf.c,v 1.5 1999/02/27 20:00:15 tom Exp $") * do indeed get confused by changing setbuf on/off, and will overrun the * buffer. So we disable this by default (there may yet be a workaround). */ -void _nc_set_buffer(FILE *ofp, bool buffered) +NCURSES_EXPORT(void) +_nc_set_buffer(FILE * ofp, bool buffered) { - /* optional optimization hack -- do before any output to ofp */ + /* optional optimization hack -- do before any output to ofp */ #if HAVE_SETVBUF || HAVE_SETBUFFER - unsigned buf_len; - char *buf_ptr; + unsigned buf_len; + char *buf_ptr; - if (getenv("NCURSES_NO_SETBUF") != 0) - return; + if (getenv("NCURSES_NO_SETBUF") != 0) + return; - fflush(ofp); - if ((SP->_buffered = buffered) != 0) { - buf_len = min(LINES * (COLS + 6), 2800); - if ((buf_ptr = SP->_setbuf) == 0) { - if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) - return; - SP->_setbuf = buf_ptr; - /* Don't try to free this! */ - } + fflush(ofp); + if ((SP->_buffered = buffered) != 0) { + buf_len = min(LINES * (COLS + 6), 2800); + if ((buf_ptr = SP->_setbuf) == 0) { + if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) + return; + SP->_setbuf = buf_ptr; + /* Don't try to free this! */ + } #if !USE_SETBUF_0 - else return; + else + return; #endif - } else { + } else { #if !USE_SETBUF_0 - return; + return; #else - buf_len = 0; - buf_ptr = 0; + buf_len = 0; + buf_ptr = 0; #endif - } + } #if HAVE_SETVBUF -#ifdef SETVBUF_REVERSED /* pre-svr3? */ - (void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IOLBF); +#ifdef SETVBUF_REVERSED /* pre-svr3? */ + (void) setvbuf(ofp, buf_ptr, buf_len, buf_len ? _IOFBF : _IOLBF); #else - (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, buf_len); + (void) setvbuf(ofp, buf_ptr, buf_len ? _IOFBF : _IOLBF, buf_len); #endif #elif HAVE_SETBUFFER - (void) setbuffer(ofp, buf_ptr, (int)buf_len); + (void) setbuffer(ofp, buf_ptr, (int) buf_len); #endif #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ diff --git a/ncurses/tinfo/strings.c b/ncurses/tinfo/strings.c index 8198ec40..5fa68caf 100644 --- a/ncurses/tinfo/strings.c +++ b/ncurses/tinfo/strings.c @@ -36,15 +36,16 @@ #include -MODULE_ID("$Id") +MODULE_ID("$Id: strings.c,v 1.3 2000/12/10 02:55:08 tom Exp $") /**************************************************************************** * Useful string functions (especially for mvcur) ****************************************************************************/ #if !HAVE_STRSTR -char * -_nc_strstr(const char *haystack, const char *needle) +NCURSES_EXPORT(char *) +_nc_strstr +(const char *haystack, const char *needle) { size_t len1 = strlen(haystack); size_t len2 = strlen(needle); @@ -64,8 +65,9 @@ _nc_strstr(const char *haystack, const char *needle) /* * Initialize the descriptor so we can append to it. */ -string_desc * -_nc_str_init(string_desc * dst, char *src, size_t len) +NCURSES_EXPORT(string_desc *) +_nc_str_init +(string_desc * dst, char *src, size_t len) { if (dst != 0) { dst->s_head = src; @@ -80,8 +82,9 @@ _nc_str_init(string_desc * dst, char *src, size_t len) /* * Initialize the descriptor for only tracking the amount of memory used. */ -string_desc * -_nc_str_null(string_desc * dst, size_t len) +NCURSES_EXPORT(string_desc *) +_nc_str_null +(string_desc * dst, size_t len) { return _nc_str_init(dst, 0, len); } @@ -89,8 +92,9 @@ _nc_str_null(string_desc * dst, size_t len) /* * Copy a descriptor */ -string_desc * -_nc_str_copy(string_desc * dst, string_desc * src) +NCURSES_EXPORT(string_desc *) +_nc_str_copy +(string_desc * dst, string_desc * src) { *dst = *src; return dst; @@ -99,7 +103,7 @@ _nc_str_copy(string_desc * dst, string_desc * src) /* * Replaces strcat into a fixed buffer, returning false on failure. */ -bool +NCURSES_EXPORT(bool) _nc_safe_strcat(string_desc * dst, const char *src) { if (src != 0) { @@ -120,7 +124,7 @@ _nc_safe_strcat(string_desc * dst, const char *src) /* * Replaces strcpy into a fixed buffer, returning false on failure. */ -bool +NCURSES_EXPORT(bool) _nc_safe_strcpy(string_desc * dst, const char *src) { if (src != 0) { diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index af4b4fda..9750dffd 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -52,7 +52,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.53 2000/10/04 02:32:14 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.58 2002/04/21 20:35:08 tom Exp $") static int total_written; @@ -109,7 +109,7 @@ make_directory(const char *path) return rc; } -void +NCURSES_EXPORT(void) _nc_set_writedir(char *dir) /* set the write directory for compiled entries */ { @@ -117,7 +117,7 @@ _nc_set_writedir(char *dir) char actual[PATH_MAX]; if (dir == 0 - && use_terminfo_vars()) + && use_terminfo_vars()) dir = getenv("TERMINFO"); if (dir != 0) @@ -131,7 +131,7 @@ _nc_set_writedir(char *dir) destination = home; if (make_directory(destination) < 0) _nc_err_abort("%s: permission denied (errno %d)", - destination, errno); + destination, errno); } } @@ -164,7 +164,7 @@ check_writeable(int code) static bool verified[sizeof(dirnames)]; char dir[2]; - char *s; + char *s = 0; if (code == 0 || (s = strchr(dirnames, code)) == 0) _nc_err_abort("Illegal terminfo subdirectory \"%c\"", code); @@ -214,6 +214,10 @@ _nc_write_entry(TERMTYPE * const tp) char linkname[PATH_MAX]; #if USE_SYMLINKS char symlinkname[PATH_MAX]; +#if !HAVE_LINK +#undef HAVE_LINK +#define HAVE_LINK 1 +#endif #endif /* USE_SYMLINKS */ static int call_count; static time_t start_time; /* time at start of writes */ @@ -275,7 +279,7 @@ _nc_write_entry(TERMTYPE * const tp) if (stat(filename, &statbuf) < 0 || (start_time = statbuf.st_mtime) == 0) { _nc_syserr_abort("error obtaining time from %s/%s", - _nc_tic_dir(0), filename); + _nc_tic_dir(0), filename); } } while (*other_names != '\0') { @@ -301,7 +305,7 @@ _nc_write_entry(TERMTYPE * const tp) if (strcmp(filename, linkname) == 0) { _nc_warning("self-synonym ignored"); } else if (stat(linkname, &statbuf) >= 0 && - statbuf.st_mtime < start_time) { + statbuf.st_mtime < start_time) { _nc_warning("alias %s multiply defined.", ptr); } else if (_nc_access(linkname, W_OK) == 0) #if HAVE_LINK @@ -333,10 +337,16 @@ _nc_write_entry(TERMTYPE * const tp) */ if (code == 0 && errno == EEXIST) _nc_warning("can't link %s to %s", filename, linkname); - else if (code == 0 && errno == EPERM) + else if (code == 0 && (errno == EPERM || errno == ENOENT)) write_file(linkname, tp); - else + else { +#if MIXEDCASE_FILENAMES _nc_syserr_abort("can't link %s to %s", filename, linkname); +#else + _nc_warning("can't link %s to %s (errno=%d)", filename, + linkname, errno); +#endif + } } else { DEBUG(1, ("Linked %s", linkname)); } @@ -355,10 +365,10 @@ _nc_write_entry(TERMTYPE * const tp) #define WRITE_STRING(str) (fwrite(str, sizeof(char), strlen(str) + 1, fp) == strlen(str) + 1) static int -compute_offsets(char **Strings, int strmax, short *offsets) +compute_offsets(char **Strings, unsigned strmax, short *offsets) { size_t nextfree = 0; - int i; + unsigned i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -375,9 +385,9 @@ compute_offsets(char **Strings, int strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, int count) +convert_shorts(unsigned char *buf, short *Numbers, unsigned count) { - int i; + unsigned i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -520,7 +530,7 @@ write_object(FILE * fp, TERMTYPE * tp) TRACE_OUT(("WRITE %d booleans @%ld", tp->ext_Booleans, ftell(fp))); if (tp->ext_Booleans && fwrite(tp->Booleans + BOOLCOUNT, sizeof(char), - tp->ext_Booleans, fp) != tp->ext_Booleans) + tp->ext_Booleans, fp) != tp->ext_Booleans) return (ERR); if (even_boundary(tp->ext_Booleans)) @@ -549,7 +559,7 @@ write_object(FILE * fp, TERMTYPE * tp) for (i = 0; i < tp->ext_Strings; i++) { if (VALID_STRING(tp->Strings[i + STRCOUNT])) { TRACE_OUT(("WRITE ext_Strings[%d]=%s", i, - _nc_visbuf(tp->Strings[i + STRCOUNT]))); + _nc_visbuf(tp->Strings[i + STRCOUNT]))); if (!WRITE_STRING(tp->Strings[i + STRCOUNT])) return (ERR); } @@ -574,7 +584,7 @@ write_object(FILE * fp, TERMTYPE * tp) /* * Returns the total number of entries written by this process */ -int +NCURSES_EXPORT(int) _nc_tic_written(void) { return total_written; diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 51260aec..57d49f3d 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,28 +40,28 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.34 2000/04/01 20:25:47 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.50 2002/10/12 15:20:15 tom Exp $") -unsigned _nc_tracing = 0; /* always define this */ +NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ #ifdef TRACE -const char *_nc_tputs_trace = ""; -long _nc_outchars = 0; +NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = ""; +NCURSES_EXPORT_VAR(long) _nc_outchars = 0; static FILE *tracefp; /* default to writing to stderr */ -void +NCURSES_EXPORT(void) trace(const unsigned int tracelevel GCC_UNUSED) { static bool been_here = FALSE; static char my_name[] = "trace"; - _nc_tracing = tracelevel; if (!been_here && tracelevel) { been_here = TRUE; + _nc_tracing = tracelevel; if (_nc_access(my_name, W_OK) < 0 - || (tracefp = fopen(my_name, "w")) == 0) { + || (tracefp = fopen(my_name, "wb")) == 0) { perror("curses: Can't open 'trace' file: "); exit(EXIT_FAILURE); } @@ -74,75 +74,15 @@ trace(const unsigned int tracelevel GCC_UNUSED) #elif HAVE_SETBUF /* POSIX */ (void) setbuffer(tracefp, (char *) 0); #endif - _tracef("TRACING NCURSES version %s (%d)", - NCURSES_VERSION, NCURSES_VERSION_PATCH); + _tracef("TRACING NCURSES version %s (tracelevel=%#x)", + curses_version(), tracelevel); + } else if (_nc_tracing != tracelevel) { + _nc_tracing = tracelevel; + _tracef("tracelevel=%#x", tracelevel); } } -#endif - -const char * -_nc_visbuf2(int bufnum, const char *buf) -/* visibilize a given string */ -{ - char *vbuf; - char *tp; - int c; - - if (buf == 0) - return ("(null)"); - if (buf == CANCELLED_STRING) - return ("(cancelled)"); - -#ifdef TRACE - tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5); -#else - { - static char *mybuf[2]; - mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (strlen(buf) * 4) + 5); - tp = vbuf = mybuf[bufnum]; - } -#endif - *tp++ = '"'; - while ((c = *buf++) != '\0') { - if (c == '"') { - *tp++ = '\\'; - *tp++ = '"'; - } else if (is7bits(c) && (isgraph(c) || c == ' ')) { - *tp++ = c; - } else if (c == '\n') { - *tp++ = '\\'; - *tp++ = 'n'; - } else if (c == '\r') { - *tp++ = '\\'; - *tp++ = 'r'; - } else if (c == '\b') { - *tp++ = '\\'; - *tp++ = 'b'; - } else if (c == '\033') { - *tp++ = '\\'; - *tp++ = 'e'; - } else if (is7bits(c) && iscntrl(c)) { - *tp++ = '\\'; - *tp++ = '^'; - *tp++ = '@' + c; - } else { - sprintf(tp, "\\%03o", c & 0xff); - tp += strlen(tp); - } - } - *tp++ = '"'; - *tp++ = '\0'; - return (vbuf); -} - -const char * -_nc_visbuf(const char *buf) -{ - return _nc_visbuf2(0, buf); -} -#ifdef TRACE -void +NCURSES_EXPORT(void) _tracef(const char *fmt,...) { static const char Called[] = T_CALLED(""); @@ -190,24 +130,48 @@ _tracef(const char *fmt,...) errno = save_err; } +/* Trace 'bool' return-values */ +NCURSES_EXPORT(NCURSES_BOOL) +_nc_retrace_bool(NCURSES_BOOL code) +{ + T((T_RETURN("%s"), code ? "TRUE" : "FALSE")); + return code; +} + /* Trace 'int' return-values */ -int +NCURSES_EXPORT(int) _nc_retrace_int(int code) { T((T_RETURN("%d"), code)); return code; } +/* Trace 'unsigned' return-values */ +NCURSES_EXPORT(unsigned) +_nc_retrace_unsigned(unsigned code) +{ + T((T_RETURN("%#x"), code)); + return code; +} + /* Trace 'char*' return-values */ -char * +NCURSES_EXPORT(char *) _nc_retrace_ptr(char *code) { T((T_RETURN("%s"), _nc_visbuf(code))); return code; } +/* Trace 'SCREEN *' return-values */ +NCURSES_EXPORT(SCREEN *) +_nc_retrace_sp(SCREEN * code) +{ + T((T_RETURN("%p"), code)); + return code; +} + /* Trace 'WINDOW *' return-values */ -WINDOW * +NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { T((T_RETURN("%p"), code)); diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index c65c584f..6cda1c8d 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * + * Author: Thomas Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * ****************************************************************************/ @@ -38,12 +39,16 @@ #include #include /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.30 2000/07/29 18:06:09 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.43 2002/09/28 12:37:03 tom Exp $") #define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name) #ifdef TRACE -char * + +static const char l_brace[] = {L_BRACE, 0}; +static const char r_brace[] = {R_BRACE, 0}; + +NCURSES_EXPORT(char *) _traceattr2(int bufnum, attr_t newmode) { char *buf = _nc_trace_buf(bufnum, BUFSIZ); @@ -87,7 +92,7 @@ _traceattr2(int bufnum, attr_t newmode) unsigned save_nc_tracing = _nc_tracing; _nc_tracing = 0; - strcpy(tmp++, "{"); + strcpy(tmp++, l_brace); for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { @@ -112,39 +117,38 @@ _traceattr2(int bufnum, attr_t newmode) } } } - if (AttrOf(newmode) == A_NORMAL) { + if (ChAttrOf(newmode) == A_NORMAL) { if (buf[1] != '\0') strcat(tmp, "|"); strcat(tmp, "A_NORMAL"); } _nc_tracing = save_nc_tracing; - return (strcat(buf, "}")); + return (strcat(buf, r_brace)); } -char * +NCURSES_EXPORT(char *) _traceattr(attr_t newmode) { return _traceattr2(0, newmode); } /* Trace 'int' return-values */ -attr_t +NCURSES_EXPORT(attr_t) _nc_retrace_attr_t(attr_t code) { T((T_RETURN("%s"), _traceattr(code))); return code; } -char * -_tracechtype2(int bufnum, chtype ch) +const char * +_nc_altcharset_name(attr_t attr, chtype ch) { - char *buf = _nc_trace_buf(bufnum, BUFSIZ); - char *found = 0; + const char *result = 0; - strcpy(buf, "{"); - if (ch & A_ALTCHARSET) { + if (attr & A_ALTCHARSET) { char *cp; + char *found = 0; static const struct { unsigned int val; const char *name; @@ -189,52 +193,109 @@ _tracechtype2(int bufnum, chtype ch) *sp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (TextOf(cp[1]) == TextOf(ch)) { + if (ChCharOf(cp[1]) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = TextOf(*found); + ch = ChCharOf(*found); for (sp = names; sp->val; sp++) if (sp->val == ch) { - (void) strcat(buf, sp->name); - ch &= ~A_ALTCHARSET; + result = sp->name; break; } } } + return result; +} + +NCURSES_EXPORT(char *) +_tracechtype2(int bufnum, chtype ch) +{ + char *buf = _nc_trace_buf(bufnum, BUFSIZ); + const char *found; - if (found == 0) - (void) strcat(buf, _tracechar(TextOf(ch))); + strcpy(buf, l_brace); + if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { + (void) strcat(buf, found); + } else + (void) strcat(buf, _tracechar(ChCharOf(ch))); - if (AttrOf(ch) != A_NORMAL) + if (ChAttrOf(ch) != A_NORMAL) (void) sprintf(buf + strlen(buf), " | %s", - _traceattr2(bufnum + 20, AttrOf(ch))); + _traceattr2(bufnum + 20, ChAttrOf(ch))); - strcat(buf, "}"); - return (buf); + return (strcat(buf, r_brace)); } -char * -_tracechtype(chtype ch) +NCURSES_EXPORT(char *) +_tracechtype (chtype ch) { return _tracechtype2(0, ch); } /* Trace 'chtype' return-values */ -attr_t -_nc_retrace_chtype(attr_t code) +NCURSES_EXPORT(chtype) +_nc_retrace_chtype (chtype code) { T((T_RETURN("%s"), _tracechtype(code))); return code; } -#else -extern void _nc_lib_traceatr(void); -void -_nc_lib_traceatr(void) +#if USE_WIDEC_SUPPORT +NCURSES_EXPORT(char *) +_tracecchar_t2 (int bufnum, const cchar_t *ch) { + char *buf = _nc_trace_buf(bufnum, BUFSIZ); + attr_t attr; + const char *found; + + strcpy(buf, l_brace); + if (ch != 0) { + attr = AttrOfD(ch); + if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) { + (void) strcat(buf, found); + attr &= ~A_ALTCHARSET; + } else if (!isnac(CHDEREF(ch))) { + PUTC_DATA; + int n; + + memset (&PUT_st, '\0', sizeof (PUT_st)); + PUTC_i = 0; + (void) strcat(buf, "{ "); + do { + PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0'; + PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + if (PUTC_ch == L'\0') + --PUTC_n; + if (PUTC_n <= 0) + break; + for (n = 0; n < PUTC_n; n++) { + if (n) + (void) strcat(buf, ", "); + (void) strcat(buf, _tracechar(UChar(PUTC_buf[n]))); + } + ++PUTC_i; + } while (PUTC_ch != L'\0'); + (void) strcat(buf, " }"); + } + if (attr != A_NORMAL) + (void) sprintf(buf + strlen(buf), " | %s", + _traceattr2(bufnum + 20, attr)); + } + + return (strcat(buf, r_brace)); } + +NCURSES_EXPORT(char *) +_tracecchar_t (const cchar_t *ch) +{ + return _tracecchar_t2(0, ch); +} +#endif + +#else +empty_module(_nc_lib_traceatr) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index a8cb343b..e6818626 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ #include #include /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.7 2000/09/02 18:08:37 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.12 2002/05/25 14:35:07 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -81,8 +81,8 @@ lookup_bits(char *buf, const BITNAMES * table, const char *label, unsigned int v (void) strcat(buf, "} "); } -char * -_nc_tracebits(void) +NCURSES_EXPORT(char *) +_nc_trace_ttymode(TTY * tty) /* describe the state of the terminal control bits exactly */ { char *buf; @@ -137,25 +137,25 @@ _nc_tracebits(void) }; buf = _nc_trace_buf(0, - 8 + sizeof(iflags) + - 8 + sizeof(oflags) + - 8 + sizeof(cflags) + - 8 + sizeof(lflags) + - 8); + 8 + sizeof(iflags) + + 8 + sizeof(oflags) + + 8 + sizeof(cflags) + + 8 + sizeof(lflags) + + 8); - if (cur_term->Nttyb.c_iflag & ALLIN) - lookup_bits(buf, iflags, "iflags", cur_term->Nttyb.c_iflag); + if (tty->c_iflag & ALLIN) + lookup_bits(buf, iflags, "iflags", tty->c_iflag); - if (cur_term->Nttyb.c_oflag & ALLOUT) - lookup_bits(buf, oflags, "oflags", cur_term->Nttyb.c_oflag); + if (tty->c_oflag & ALLOUT) + lookup_bits(buf, oflags, "oflags", tty->c_oflag); - if (cur_term->Nttyb.c_cflag & ALLCTRL) - lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.c_cflag); + if (tty->c_cflag & ALLCTRL) + lookup_bits(buf, cflags, "cflags", tty->c_cflag); #if defined(CS5) && defined(CS8) { static struct { - char *name; + const char *name; int value; } csizes[] = { { @@ -175,8 +175,8 @@ _nc_tracebits(void) "CS8 ", CS8 }, }; - char *result = "CSIZE? "; - int value = (cur_term->Nttyb.c_cflag & CSIZE); + const char *result = "CSIZE? "; + int value = (tty->c_cflag & CSIZE); unsigned n; if (value != 0) { @@ -191,8 +191,8 @@ _nc_tracebits(void) } #endif - if (cur_term->Nttyb.c_lflag & ALLLOCAL) - lookup_bits(buf, lflags, "lflags", cur_term->Nttyb.c_lflag); + if (tty->c_lflag & ALLLOCAL) + lookup_bits(buf, lflags, "lflags", tty->c_lflag); #else /* reference: ttcompat(4M) on SunOS 4.1 */ @@ -229,19 +229,20 @@ _nc_tracebits(void) }; buf = _nc_trace_buf(0, - 8 + sizeof(cflags)); + 8 + sizeof(cflags)); - if (cur_term->Nttyb.sg_flags & ALLCTRL) { - lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.sg_flags); + if (tty->sg_flags & ALLCTRL) { + lookup_bits(buf, cflags, "cflags", tty->sg_flags); } #endif return (buf); } -#else -char * + +NCURSES_EXPORT(char *) _nc_tracebits(void) { - static char tmp[] = ""; - return tmp; + return _nc_trace_ttymode(&(cur_term->Nttyb)); } +#else +empty_module(_nc_tracebits) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c index bf004f35..2f33391b 100644 --- a/ncurses/trace/lib_tracechr.c +++ b/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,16 +36,20 @@ */ #include -MODULE_ID("$Id: lib_tracechr.c,v 1.2 2000/04/01 20:17:26 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.9 2002/05/25 23:34:19 tom Exp $") #ifdef TRACE -char *_tracechar(const unsigned char ch) +NCURSES_EXPORT(char *) +_tracechar(int ch) { - static char crep[20]; - (void) sprintf(crep, "'%s' = 0x%02x", unctrl(ch), (unsigned)ch); - return(crep); + static char crep[40]; + (void) sprintf(crep, "'%.30s' = %#03o", + ((ch > KEY_MIN || ch < 0) + ? keyname(ch) + : unctrl(ch)), + ch); + return (crep); } #else -extern void _nc_lib_tracechr(void); - void _nc_lib_tracechr(void) { } +empty_module(_nc_lib_tracechr) #endif diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c index a67a37ef..c63cb564 100644 --- a/ncurses/trace/lib_tracedmp.c +++ b/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,8 @@ ****************************************************************************/ /**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * + * Author: Thomas E. Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * ****************************************************************************/ @@ -36,93 +37,110 @@ */ #include +#include -MODULE_ID("$Id: lib_tracedmp.c,v 1.13 1998/03/21 18:39:44 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.25 2002/09/22 22:21:38 tom Exp $") #ifdef TRACE -void _tracedump(const char *name, WINDOW *win) +NCURSES_EXPORT(void) +_tracedump(const char *name, WINDOW *win) { - int i, j, n, width; + static char *buf = 0; + static size_t used = 0; + + int i, j, n, width; /* compute narrowest possible display width */ - for (width = i = 0; i <= win->_maxy; i++) - { + for (width = i = 0; i <= win->_maxy; ++i) { n = 0; - for (j = 0; j <= win->_maxx; j++) - if (win->_line[i].text[j] != ' ') - n = j; + for (j = 0; j <= win->_maxx; ++j) + if (CharOf(win->_line[i].text[j]) != L(' ') + || AttrOf(win->_line[i].text[j]) != A_NORMAL) + n = j; if (n > width) - width = n; + width = n; } if (width < win->_maxx) - ++width; + ++width; + if (++width + 1 > (int) used) { + used = 2 * (width + 1); + buf = typeRealloc(char, used, buf); + } - for (n = 0; n <= win->_maxy; n++) - { - char buf[BUFSIZ], *ep; + for (n = 0; n <= win->_maxy; ++n) { + char *ep = buf; bool haveattrs, havecolors; - /* dump A_CHARTEXT part */ - (void) sprintf(buf, "%s[%2d] %3d%3d ='", + /* + * Dump A_CHARTEXT part. It is more important to make the grid line up + * in the trace file than to represent control- and wide-characters, so + * we map those to '.' and '?' respectively. + */ + for (j = 0; j < width; ++j) { + chtype test = CharOf(win->_line[n].text[j]); + ep[j] = (UChar(test) == test +#if USE_WIDEC_SUPPORT + && (win->_line[n].text[j].chars[1] == 0) +#endif + ) + ? (iscntrl(UChar(test)) + ? '.' + : UChar(test)) + : '?'; + } + ep[j] = '\0'; + _tracef("%s[%2d] %3d%3d ='%s'", name, n, win->_line[n].firstchar, - win->_line[n].lastchar); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) { - ep[j] = TextOf(win->_line[n].text[j]); - if (ep[j] == 0) - ep[j] = '.'; - } - ep[j] = '\''; - ep[j+1] = '\0'; - _tracef("%s", buf); + win->_line[n].lastchar, + ep); /* dump A_COLOR part, will screw up if there are more than 96 */ havecolors = FALSE; - for (j = 0; j <= width; j++) - if (win->_line[n].text[j] & A_COLOR) - { + for (j = 0; j < width; ++j) + if (AttrOf(win->_line[n].text[j]) & A_COLOR) { havecolors = TRUE; break; } - if (havecolors) - { - (void) sprintf(buf, "%*s[%2d]%*s='", (int)strlen(name), "colors", n, 8, " "); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) - ep[j] = ((win->_line[n].text[j] >> 8) & 0xff) + ' '; - ep[j] = '\''; - ep[j+1] = '\0'; - _tracef("%s", buf); + if (havecolors) { + ep = buf; + for (j = 0; j < width; ++j) + ep[j] = UChar(AttrOf(win->_line[n].text[j]) >> + NCURSES_ATTR_SHIFT) + ' '; + ep[j] = '\0'; + _tracef("%*s[%2d]%*s='%s'", (int) strlen(name), + "colors", n, 8, " ", buf); } - for (i = 0; i < 4; i++) - { - const char *hex = " 123456789ABCDEF"; - chtype mask = (0xf << ((i + 4) * 4)); + for (i = 0; i < 4; ++i) { + const char *hex = " 123456789ABCDEF"; + attr_t mask = (0xf << ((i + 4) * 4)); haveattrs = FALSE; - for (j = 0; j <= width; j++) - if (win->_line[n].text[j] & mask) - { + for (j = 0; j < width; ++j) + if (AttrOf(win->_line[n].text[j]) & mask) { haveattrs = TRUE; break; } - if (haveattrs) - { - (void) sprintf(buf, "%*s%d[%2d]%*s='", (int)strlen(name)-1, "attrs", i, n, 8, " "); - ep = buf + strlen(buf); - for (j = 0; j <= width; j++) - ep[j] = hex[(win->_line[n].text[j] & mask) >> ((i + 4) * 4)]; - ep[j] = '\''; - ep[j+1] = '\0'; - _tracef("%s", buf); + if (haveattrs) { + ep = buf; + for (j = 0; j < width; ++j) + ep[j] = hex[(AttrOf(win->_line[n].text[j]) & mask) >> + ((i + 4) * 4)]; + ep[j] = '\0'; + _tracef("%*s%d[%2d]%*s='%s'", (int) strlen(name) - + 1, "attrs", i, n, 8, " ", buf); } } } +#if NO_LEAKS + free(buf); + buf = 0; + used = 0; +#endif } + #else -extern void _nc_lib_tracedmp(void); - void _nc_lib_tracedmp(void) { } +empty_module(_nc_lib_tracedmp) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c index fbdd2c00..f4a100b6 100644 --- a/ncurses/trace/lib_tracemse.c +++ b/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000,2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,65 +31,62 @@ * and: Eric S. Raymond * ****************************************************************************/ - - /* * lib_tracemse.c - Tracing/Debugging routines (mouse events) */ #include -MODULE_ID("$Id: lib_tracemse.c,v 1.6 1998/11/16 14:28:17 Alexander.V.Lukyanov Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.10 2002/01/12 22:32:25 tom Exp $") #ifdef TRACE -char *_tracemouse(MEVENT const *ep) +NCURSES_EXPORT(char *) +_tracemouse(MEVENT const *ep) { - static char buf[80]; + static char buf[80]; - (void) sprintf(buf, "id %2d at (%2d, %2d, %2d) state %4lx = {", - ep->id, ep->x, ep->y, ep->z, ep->bstate); + (void) sprintf(buf, "id %2d at (%2d, %2d, %2d) state %4lx = {", + ep->id, ep->x, ep->y, ep->z, ep->bstate); -#define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");} - SHOW(BUTTON1_RELEASED, "release-1") - SHOW(BUTTON1_PRESSED, "press-1") - SHOW(BUTTON1_CLICKED, "click-1") - SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1") - SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1") - SHOW(BUTTON1_RESERVED_EVENT, "reserved-1") - SHOW(BUTTON2_RELEASED, "release-2") - SHOW(BUTTON2_PRESSED, "press-2") - SHOW(BUTTON2_CLICKED, "click-2") - SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2") - SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2") - SHOW(BUTTON2_RESERVED_EVENT, "reserved-2") - SHOW(BUTTON3_RELEASED, "release-3") - SHOW(BUTTON3_PRESSED, "press-3") - SHOW(BUTTON3_CLICKED, "click-3") - SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3") - SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3") - SHOW(BUTTON3_RESERVED_EVENT, "reserved-3") - SHOW(BUTTON4_RELEASED, "release-4") - SHOW(BUTTON4_PRESSED, "press-4") - SHOW(BUTTON4_CLICKED, "click-4") - SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4") - SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4") - SHOW(BUTTON4_RESERVED_EVENT, "reserved-4") - SHOW(BUTTON_CTRL, "ctrl") - SHOW(BUTTON_SHIFT, "shift") - SHOW(BUTTON_ALT, "alt") - SHOW(ALL_MOUSE_EVENTS, "all-events") - SHOW(REPORT_MOUSE_POSITION, "position") +#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(buf, s), ", ") + SHOW(BUTTON1_RELEASED, "release-1"); + SHOW(BUTTON1_PRESSED, "press-1"); + SHOW(BUTTON1_CLICKED, "click-1"); + SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1"); + SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1"); + SHOW(BUTTON1_RESERVED_EVENT, "reserved-1"); + SHOW(BUTTON2_RELEASED, "release-2"); + SHOW(BUTTON2_PRESSED, "press-2"); + SHOW(BUTTON2_CLICKED, "click-2"); + SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2"); + SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2"); + SHOW(BUTTON2_RESERVED_EVENT, "reserved-2"); + SHOW(BUTTON3_RELEASED, "release-3"); + SHOW(BUTTON3_PRESSED, "press-3"); + SHOW(BUTTON3_CLICKED, "click-3"); + SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3"); + SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3"); + SHOW(BUTTON3_RESERVED_EVENT, "reserved-3"); + SHOW(BUTTON4_RELEASED, "release-4"); + SHOW(BUTTON4_PRESSED, "press-4"); + SHOW(BUTTON4_CLICKED, "click-4"); + SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4"); + SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4"); + SHOW(BUTTON4_RESERVED_EVENT, "reserved-4"); + SHOW(BUTTON_CTRL, "ctrl"); + SHOW(BUTTON_SHIFT, "shift"); + SHOW(BUTTON_ALT, "alt"); + SHOW(ALL_MOUSE_EVENTS, "all-events"); + SHOW(REPORT_MOUSE_POSITION, "position"); #undef SHOW - if (buf[strlen(buf)-1] == ' ') - buf[strlen(buf)-2] = '\0'; - (void) strcat(buf, "}"); - return(buf); + if (buf[strlen(buf) - 1] == ' ') + buf[strlen(buf) - 2] = '\0'; + (void) strcat(buf, "}"); + return (buf); } #else /* !TRACE */ -/* don't make empty module */ -void _nc_lib_tracemouse(void); -void _nc_lib_tracemouse(void) {} +empty_module(_nc_lib_tracemouse) #endif diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 48f93d43..4fef57ee 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,46 +35,50 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.7 1999/02/27 19:50:58 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.11 2002/07/14 00:08:08 tom Exp $") typedef struct { - char *text; - size_t size; + char *text; + size_t size; } LIST; -char * _nc_trace_buf(int bufnum, size_t want) +NCURSES_EXPORT(char *) +_nc_trace_buf(int bufnum, size_t want) { - static LIST *list; - static size_t have; + char *result = 0; + static LIST *list; + static size_t have; -#if NO_LEAKS - if (bufnum < 0) { - if (have) { - while (have--) { - free(list[have].text); - } - free(list); - } - return 0; - } -#endif - - if ((size_t)(bufnum+1) > have) { - size_t need = (bufnum + 1) * 2; - if ((list = typeRealloc(LIST, need, list)) == 0) - return(0); - while (need > have) - list[have++].text = 0; + if (bufnum >= 0) { + if ((size_t) (bufnum + 1) > have) { + size_t need = (bufnum + 1) * 2; + if ((list = typeRealloc(LIST, need, list)) == 0) + return (0); + while (need > have) + list[have++].text = 0; } if (list[bufnum].text == 0 - || want > list[bufnum].size) - { - if ((list[bufnum].text = typeRealloc(char, want, list[bufnum].text)) != 0) - list[bufnum].size = want; + || want > list[bufnum].size) { + if ((list[bufnum].text = typeRealloc(char, want, list[bufnum].text)) + != 0) + list[bufnum].size = want; } if (list[bufnum].text != 0) - *(list[bufnum].text) = '\0'; - return list[bufnum].text; + *(list[bufnum].text) = '\0'; + result = list[bufnum].text; + } +#if NO_LEAKS + else { + if (have) { + while (have--) { + if (list[have].text != 0) + free(list[have].text); + } + free(list); + } + } +#endif + return result; } diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c index abd5db47..d7033227 100644 --- a/ncurses/trace/trace_tries.c +++ b/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,40 +35,42 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.6 1999/03/06 22:51:07 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.10 2001/10/20 22:42:51 tom Exp $") #ifdef TRACE static unsigned char *buffer; static unsigned len; -static void recur_tries(struct tries *tree, unsigned level) +static void +recur_tries(struct tries *tree, unsigned level) { - if (level > len) - buffer = (unsigned char *)realloc(buffer, len = (level + 1) * 4); + if (level > len) + buffer = (unsigned char *) realloc(buffer, len = (level + 1) * 4); - while (tree != 0) { - if ((buffer[level] = tree->ch) == 0) - buffer[level] = 128; - buffer[level+1] = 0; - if (tree->value != 0) { - _tracef("%5d: %s (%s)", tree->value, _nc_visbuf((char *)buffer), keyname(tree->value)); - } - if (tree->child) - recur_tries(tree->child, level+1); - tree = tree->sibling; + while (tree != 0) { + if ((buffer[level] = tree->ch) == 0) + buffer[level] = 128; + buffer[level + 1] = 0; + if (tree->value != 0) { + _tracef("%5d: %s (%s)", tree->value, + _nc_visbuf((char *) buffer), keyname(tree->value)); } + if (tree->child) + recur_tries(tree->child, level + 1); + tree = tree->sibling; + } } -void _nc_trace_tries(struct tries *tree) +NCURSES_EXPORT(void) +_nc_trace_tries(struct tries *tree) { - buffer = typeMalloc(unsigned char, len = 80); - _tracef("BEGIN tries %p", tree); - recur_tries(tree, 0); - _tracef(". . . tries %p", tree); - free(buffer); + buffer = typeMalloc(unsigned char, len = 80); + _tracef("BEGIN tries %p", tree); + recur_tries(tree, 0); + _tracef(". . . tries %p", tree); + free(buffer); } + #else -void _nc_trace_tries(struct tries *tree GCC_UNUSED) -{ -} +empty_module(_nc_trace_tries) #endif diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c index 6287fc85..9b0b5920 100644 --- a/ncurses/trace/trace_xnames.c +++ b/ncurses/trace/trace_xnames.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,9 +36,10 @@ #include #include -MODULE_ID("$Id: trace_xnames.c,v 1.3 1999/03/02 01:20:38 tom Exp $") +MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $") -void _nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) +NCURSES_EXPORT(void) +_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED) { #ifdef TRACE #if NCURSES_XNAMES @@ -56,16 +57,16 @@ void _nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) for (n = 0; n < limit; n++) { if ((m = n - begin_str) >= 0) { _tracef("[%d] %s = %s", n, - tp->ext_Names[n], - _nc_visbuf(tp->Strings[tp->num_Strings + m - tp->ext_Strings])); + tp->ext_Names[n], + _nc_visbuf(tp->Strings[tp->num_Strings + m - tp->ext_Strings])); } else if ((m = n - begin_num) >= 0) { _tracef("[%d] %s = %d (num)", n, - tp->ext_Names[n], - tp->Numbers[tp->num_Numbers + m - tp->ext_Numbers]); + tp->ext_Names[n], + tp->Numbers[tp->num_Numbers + m - tp->ext_Numbers]); } else { _tracef("[%d] %s = %d (bool)", n, - tp->ext_Names[n], - tp->Booleans[tp->num_Booleans + n - tp->ext_Booleans]); + tp->ext_Names[n], + tp->Booleans[tp->num_Booleans + n - tp->ext_Booleans]); } } } diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c new file mode 100644 index 00000000..0b3c28c4 --- /dev/null +++ b/ncurses/trace/varargs.c @@ -0,0 +1,182 @@ +/**************************************************************************** + * Copyright (c) 2001,2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2001 * + ****************************************************************************/ + +#include + +#include + +MODULE_ID("$Id: varargs.c,v 1.3 2002/10/05 23:04:17 tom Exp $") + +#ifdef TRACE + +#define MAX_PARMS 10 + +typedef enum { + atUnknown = 0, atInteger, atFloat, atPoint, atString +} ARGTYPE; + +#define VA_INT(type) ival = va_arg(ap, type) +#define VA_FLT(type) fval = va_arg(ap, type) +#define VA_PTR(type) pval = (void *)va_arg(ap, type) +#define VA_STR(type) sval = va_arg(ap, type) + +/* + * Returns a string that represents the parameter list of a printf-style call. + */ +NCURSES_EXPORT(char *) +_nc_varargs(const char *fmt, va_list ap) +{ + static char dummy[] = ""; + static char *result_buf; + static size_t result_len; + + char buffer[BUFSIZ]; + const char *param; + int n; + + if (fmt == 0 || *fmt == '\0') + return dummy; + if (result_len == 0) + result_buf = typeMalloc(char, result_len = BUFSIZ); + if (result_buf == 0) + return dummy; + *result_buf = '\0'; + + while (*fmt != '\0') { + if (*fmt == '%') { + char *pval = 0; /* avoid const-cast */ + const char *sval = ""; + double fval = 0.0; + int done = FALSE; + int ival = 0; + int type = 0; + ARGTYPE parm[MAX_PARMS]; + int parms = 0; + ARGTYPE used = atUnknown; + + while (*++fmt != '\0' && !done) { + + if (*fmt == '*') { + VA_INT(int); + if (parms < MAX_PARMS) + parm[parms++] = atInteger; + } else if (isalpha(UChar(*fmt))) { + done = TRUE; + switch (*fmt) { + case 'Z': /* FALLTHRU */ + case 'h': /* FALLTHRU */ + case 'l': /* FALLTHRU */ + done = FALSE; + type = *fmt; + break; + case 'i': /* FALLTHRU */ + case 'd': /* FALLTHRU */ + case 'u': /* FALLTHRU */ + case 'x': /* FALLTHRU */ + case 'X': /* FALLTHRU */ + if (type == 'l') + VA_INT(long); + else if (type == 'Z') + VA_INT(size_t); + else + VA_INT(int); + used = atInteger; + break; + case 'f': /* FALLTHRU */ + case 'e': /* FALLTHRU */ + case 'E': /* FALLTHRU */ + case 'g': /* FALLTHRU */ + case 'G': /* FALLTHRU */ + VA_FLT(double); + used = atFloat; + break; + case 'c': + VA_INT(int); + used = atInteger; + break; + case 's': + VA_STR(const char *); + used = atString; + break; + case 'p': + VA_PTR(void *); + used = atPoint; + break; + case 'n': + VA_PTR(int *); + used = atPoint; + break; + default: + break; + } + } else if (*fmt == '%') { + done = TRUE; + } + if (used != atUnknown && parms < MAX_PARMS) { + parm[parms++] = used; + for (n = 0; n < parms; ++n) { + used = parm[n]; + param = buffer; + switch (used) { + case atInteger: + sprintf(buffer, "%d", ival); + break; + case atFloat: + sprintf(buffer, "%f", fval); + break; + case atPoint: + sprintf(buffer, "%p", pval); + break; + case atString: + param = _nc_visbuf2(1, sval); + break; + default: + strcpy(buffer, "?"); + break; + } + result_len += strlen(param) + 2; + result_buf = typeRealloc(char, result_len, result_buf); + sprintf(result_buf + strlen(result_buf), ", %s", param); + } + } + used = atUnknown; + } + } else { + fmt++; + } + } + + return (result_buf); +} +#else +empty_module(_nc_varargs) +#endif diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c new file mode 100644 index 00000000..4fbecc50 --- /dev/null +++ b/ncurses/trace/visbuf.c @@ -0,0 +1,270 @@ +/**************************************************************************** + * Copyright (c) 2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 1996-2001 * + * and: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + ****************************************************************************/ + +/* + * visbuf.c - Tracing/Debugging support routines + */ + +#include + +#include +#include + +MODULE_ID("$Id: visbuf.c,v 1.6 2002/10/06 00:03:43 tom Exp $") + +static char * +_nc_vischar(char *tp, unsigned c) +{ + if (c == '"' || c == '\\') { + *tp++ = '\\'; + *tp++ = c; + } else if (is7bits(c) && (isgraph(c) || c == ' ')) { + *tp++ = c; + } else if (c == '\n') { + *tp++ = '\\'; + *tp++ = 'n'; + } else if (c == '\r') { + *tp++ = '\\'; + *tp++ = 'r'; + } else if (c == '\b') { + *tp++ = '\\'; + *tp++ = 'b'; + } else if (c == '\033') { + *tp++ = '\\'; + *tp++ = 'e'; + } else if (is7bits(c) && iscntrl(UChar(c))) { + *tp++ = '\\'; + *tp++ = '^'; + *tp++ = '@' + c; + } else { + sprintf(tp, "\\%03lo", ChCharOf(c)); + tp += strlen(tp); + } + return tp; +} + +static const char * +_nc_visbuf2n(int bufnum, const char *buf, int len) +{ + char *vbuf; + char *tp; + int c; + + if (buf == 0) + return ("(null)"); + if (buf == CANCELLED_STRING) + return ("(cancelled)"); + + if (len < 0) + len = strlen(buf); + +#ifdef TRACE + tp = vbuf = _nc_trace_buf(bufnum, (unsigned) (len * 4) + 5); +#else + { + static char *mybuf[2]; + mybuf[bufnum] = typeRealloc(char, (unsigned) (len * 4) + 5, mybuf[bufnum]); + tp = vbuf = mybuf[bufnum]; + } +#endif + *tp++ = D_QUOTE; + while ((--len >= 0) && (c = *buf++) != '\0') { + tp = _nc_vischar(tp, UChar(c)); + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + return (vbuf); +} + +NCURSES_EXPORT(const char *) +_nc_visbuf2(int bufnum, const char *buf) +{ + return _nc_visbuf2n(bufnum, buf, -1); +} + +NCURSES_EXPORT(const char *) +_nc_visbuf(const char *buf) +{ + return _nc_visbuf2(0, buf); +} + +NCURSES_EXPORT(const char *) +_nc_visbufn(const char *buf, int len) +{ + return _nc_visbuf2n(0, buf, len); +} + +#if USE_WIDEC_SUPPORT +#ifdef TRACE +static const char * +_nc_viswbuf2n(int bufnum, const wchar_t * buf, int len) +{ + char *vbuf; + char *tp; + wchar_t c; + + if (buf == 0) + return ("(null)"); + + if (len < 0) + len = wcslen(buf); + +#ifdef TRACE + tp = vbuf = _nc_trace_buf(bufnum, (unsigned) (len * 4) + 5); +#else + { + static char *mybuf[2]; + mybuf[bufnum] = typeRealloc(char, (unsigned) (len * 4) + 5, mybuf[bufnum]); + tp = vbuf = mybuf[bufnum]; + } +#endif + *tp++ = D_QUOTE; + while ((--len >= 0) && (c = *buf++) != '\0') { + char temp[CCHARW_MAX + 80]; + int j = wctomb(temp, c), k; + if (j <= 0) { + sprintf(temp, "\\u%08X", (wint_t) c); + j = strlen(temp); + } + for (k = 0; k < j; ++k) { + tp = _nc_vischar(tp, temp[k]); + } + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + return (vbuf); +} + +NCURSES_EXPORT(const char *) +_nc_viswbuf2(int bufnum, const wchar_t * buf) +{ + return _nc_viswbuf2n(bufnum, buf, -1); +} + +NCURSES_EXPORT(const char *) +_nc_viswbuf(const wchar_t * buf) +{ + return _nc_viswbuf2(0, buf); +} + +NCURSES_EXPORT(const char *) +_nc_viswbufn(const wchar_t * buf, int len) +{ + return _nc_viswbuf2n(0, buf, len); +} + +NCURSES_EXPORT(const char *) +_nc_viscbuf2(int bufnum, const cchar_t * buf, int len) +{ + size_t have = BUFSIZ; + char *result = _nc_trace_buf(bufnum, have); + char *tp = result; + int n; + bool same = TRUE; + attr_t attr = A_NORMAL; + const char *found; + + if (len < 0) + len = _nc_wchstrlen(buf); + + for (n = 1; n < len; n++) { + if (AttrOf(buf[n]) != AttrOf(buf[0])) { + same = FALSE; + break; + } + } + + /* + * If the rendition is the same for the whole string, display it as a + * quoted string, followed by the rendition. Otherwise, use the more + * detailed trace function that displays each character separately. + */ + if (same) { + *tp++ = D_QUOTE; + while (len-- > 0) { + if ((found = _nc_altcharset_name(attr, CharOfD(buf))) != 0) { + (void) strcpy(tp, found); + tp += strlen(tp); + attr &= ~A_ALTCHARSET; + } else if (!isnac(CHDEREF(buf))) { + PUTC_DATA; + + memset(&PUT_st, '\0', sizeof(PUT_st)); + PUTC_i = 0; + do { + PUTC_ch = PUTC_i < CCHARW_MAX ? buf->chars[PUTC_i] : L'\0'; + PUTC_n = wcrtomb(PUTC_buf, buf->chars[PUTC_i], &PUT_st); + if (PUTC_ch == L'\0') + --PUTC_n; + if (PUTC_n <= 0) + break; + for (n = 0; n < PUTC_n; n++) { + tp = _nc_vischar(tp, UChar(PUTC_buf[n])); + } + ++PUTC_i; + } while (PUTC_ch != L'\0'); + } + buf++; + } + *tp++ = D_QUOTE; + *tp++ = '\0'; + if (attr != A_NORMAL) + (void) sprintf(tp, " | %s", + _traceattr2(bufnum + 20, attr)); + } else { + *tp++ = L_BRACE; + while (len-- > 0) { + char *temp = _tracecchar_t2(bufnum + 20, buf++); + size_t used = (tp - result); + size_t want = strlen(temp) + 5 + used; + if (want > have) { + result = _nc_trace_buf(bufnum, have = want); + tp = result + used; + } + (void) strcpy(tp, temp); + tp += strlen(tp); + } + *tp++ = R_BRACE; + *tp++ = '\0'; + } + return result; +} + +NCURSES_EXPORT(const char *) +_nc_viscbuf(const cchar_t * buf, int len) +{ + return _nc_viscbuf2(0, buf, len); +} +#endif /* TRACE */ +#endif /* USE_WIDEC_SUPPORT */ diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index e44f5834..8e4a6c6c 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1997 # -# $Id: MKexpanded.sh,v 1.9 2000/09/02 22:55:21 tom Exp $ +# $Id: MKexpanded.sh,v 1.10 2000/12/10 00:24:33 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -68,23 +68,23 @@ cat >$TMP </dev/null | sed -e '1,/^IGNORE$/d' cat < * ****************************************************************************/ - /****************************************************************************** NAME @@ -146,13 +145,14 @@ AUTHOR #include -MODULE_ID("$Id: hardscroll.c,v 1.33 1999/02/27 20:01:29 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.36 2001/01/14 00:17:28 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) # undef screen_lines # define screen_lines MAXLINES -int oldnums[MAXLINES]; +NCURSES_EXPORT_VAR(int) +oldnums[MAXLINES]; # define OLDNUM(n) oldnums[n] # define _tracef printf # undef TR @@ -163,19 +163,21 @@ int oldnums[MAXLINES]; /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ +NCURSES_EXPORT_VAR(int *) +_nc_oldnums = 0; + # if USE_HASHMAP -int *_nc_oldnums = 0; -static int oldnums_allocated = 0; + static int oldnums_allocated = 0; # define oldnums _nc_oldnums # define OLDNUM(n) oldnums[n] -# else /* !USE_HASHMAP */ +# else /* !USE_HASHMAP */ # define OLDNUM(n) newscr->_line[n].oldindex -# endif /* !USE_HASHMAP */ +# endif /* !USE_HASHMAP */ #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ - -void _nc_scroll_optimize(void) +NCURSES_EXPORT(void) +_nc_scroll_optimize(void) /* scroll optimization to transform curscr to newscr */ { int i; @@ -186,8 +188,7 @@ void _nc_scroll_optimize(void) #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP /* get enough storage */ - if (oldnums_allocated < screen_lines) - { + if (oldnums_allocated < screen_lines) { int *new_oldnums = typeRealloc(int, screen_lines, oldnums); if (!new_oldnums) return; @@ -205,25 +206,24 @@ void _nc_scroll_optimize(void) #endif /* TRACE */ /* pass 1 - from top to bottom scrolling up */ - for (i = 0; i < screen_lines; ) - { + for (i = 0; i < screen_lines;) { while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i)) i++; if (i >= screen_lines) break; - shift = OLDNUM(i) - i; /* shift > 0 */ + shift = OLDNUM(i) - i; /* shift > 0 */ start = i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; - end = i-1 + shift; + end = i - 1 + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) - { + if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -231,25 +231,23 @@ void _nc_scroll_optimize(void) } /* pass 2 - from bottom to top scrolling down */ - for (i = screen_lines-1; i >= 0; ) - { + for (i = screen_lines - 1; i >= 0;) { while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i)) i--; if (i < 0) break; - shift = OLDNUM(i) - i; /* shift < 0 */ + shift = OLDNUM(i) - i; /* shift < 0 */ end = i; i--; while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) i--; - start = i+1 - (-shift); + start = i + 1 - (-shift); TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) - { + if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -258,14 +256,15 @@ void _nc_scroll_optimize(void) } #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) -void _nc_linedump(void) +NCURSES_EXPORT(void) +_nc_linedump(void) /* dump the state of the real and virtual oldnum fields */ { static size_t have; static char *buf; - int n; - size_t want = (screen_lines + 1) * 4; + int n; + size_t want = (screen_lines + 1) * 4; if (have < want) buf = typeMalloc(char, have = want); @@ -284,28 +283,26 @@ void _nc_linedump(void) #ifdef SCROLLDEBUG int -main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - char line[BUFSIZ], *st; + char line[BUFSIZ], *st; #ifdef TRACE _nc_tracing = TRACE_MOVE; #endif - for (;;) - { - int n; + for (;;) { + int n; for (n = 0; n < screen_lines; n++) oldnums[n] = _NEWINDEX; /* grab the test vector */ - if (fgets(line, sizeof(line), stdin) == (char *)NULL) + if (fgets(line, sizeof(line), stdin) == (char *) NULL) exit(EXIT_SUCCESS); /* parse it */ n = 0; - if (line[0] == '#') - { + if (line[0] == '#') { (void) fputs(line, stderr); continue; } @@ -313,7 +310,7 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) do { oldnums[n++] = atoi(st); } while - ((st = strtok((char *)NULL, " ")) != 0); + ((st = strtok((char *) NULL, " ")) != 0); /* display it */ (void) fputs("Initial input:\n", stderr); diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index 300ac9a3..ba53786a 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -68,9 +68,9 @@ AUTHOR *****************************************************************************/ #include -#include /* for back_color_erase */ +#include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.34 1999/11/28 00:10:57 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.46 2002/09/07 18:13:15 tom Exp $") #ifdef HASHDEBUG @@ -97,45 +97,56 @@ static chtype oldtext[MAXLINES][TEXTWIDTH], newtext[MAXLINES][TEXTWIDTH]; #endif /* !HASHDEBUG */ -#define oldhash (SP->oldhash) -#define newhash (SP->newhash) +#define oldhash (SP->oldhash) +#define newhash (SP->newhash) +#define hashtab (SP->hashtab) +#define lines_alloc (SP->hashtab_len) -static inline unsigned long hash(chtype *text) +#if USE_WIDEC_SUPPORT +#define HASH_VAL(ch) (ch.chars[0]) +#else +#define HASH_VAL(ch) (ch) +#endif + +static inline unsigned long +hash(NCURSES_CH_T * text) { int i; - chtype ch; + NCURSES_CH_T ch; unsigned long result = 0; - for (i = TEXTWIDTH; i>0; i--) - { + for (i = TEXTWIDTH; i > 0; i--) { ch = *text++; - result += (result<<5) + ch; + result += (result << 5) + HASH_VAL(ch); } return result; } /* approximate update cost */ -static int update_cost(chtype *from,chtype *to) +static int +update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) { - int cost=0; + int cost = 0; int i; - for (i=TEXTWIDTH; i>0; i--) - if (*from++ != *to++) + for (i = TEXTWIDTH; i > 0; i--) + if (!(CharEq(*from++, *to++))) cost++; return cost; } -static int update_cost_from_blank(chtype *to) + +static int +update_cost_from_blank(NCURSES_CH_T * to) { - int cost=0; + int cost = 0; int i; - chtype blank = BLANK; + NCURSES_CH_T blank = NewChar2(BLANK_TEXT, BLANK_ATTR); if (back_color_erase) - blank |= (stdscr->_bkgd & A_COLOR); + AddAttr(blank, (AttrOf(stdscr->_nc_bkgd) & A_COLOR)); - for (i=TEXTWIDTH; i>0; i--) - if (blank != *to++) + for (i = TEXTWIDTH; i > 0; i--) + if (!(CharEq(blank, *to++))) cost++; return cost; @@ -145,7 +156,8 @@ static int update_cost_from_blank(chtype *to) * Returns true when moving line 'from' to line 'to' seems to be cost * effective. 'blank' indicates whether the line 'to' would become blank. */ -static inline bool cost_effective(const int from, const int to, const bool blank) +static inline bool +cost_effective(const int from, const int to, const bool blank) { int new_from; @@ -161,30 +173,19 @@ static inline bool cost_effective(const int from, const int to, const bool blank * on the right side -- cost after moving. */ return (((blank ? update_cost_from_blank(NEWTEXT(to)) - : update_cost(OLDTEXT(to),NEWTEXT(to))) - + update_cost(OLDTEXT(new_from),NEWTEXT(from))) - >= ((new_from==from ? update_cost_from_blank(NEWTEXT(from)) - : update_cost(OLDTEXT(new_from),NEWTEXT(from))) - + update_cost(OLDTEXT(from),NEWTEXT(to)))) ? TRUE : FALSE; -} - - -typedef struct -{ - unsigned long hashval; - int oldcount, newcount; - int oldindex, newindex; + : update_cost(OLDTEXT(to), NEWTEXT(to))) + + update_cost(OLDTEXT(new_from), NEWTEXT(from))) + >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from)) + : update_cost(OLDTEXT(new_from), NEWTEXT(from))) + + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; } - sym; -static sym *hashtab=0; -static int lines_alloc=0; - -static void grow_hunks(void) +static void +grow_hunks(void) { int start, end, shift; - int back_limit, forward_limit; /* limits for cells to fill */ - int back_ref_limit, forward_ref_limit; /* limits for refrences */ + int back_limit, forward_limit; /* limits for cells to fill */ + int back_ref_limit, forward_ref_limit; /* limits for refrences */ int i; int next_hunk; @@ -198,14 +199,14 @@ static void grow_hunks(void) i = 0; while (i < screen_lines && OLDNUM(i) == _NEWINDEX) i++; - for ( ; i < screen_lines; i=next_hunk) - { + for (; i < screen_lines; i = next_hunk) { start = i; shift = OLDNUM(i) - i; /* get forward limit */ - i = start+1; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + i = start + 1; + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; end = i; while (i < screen_lines && OLDNUM(i) == _NEWINDEX) @@ -217,25 +218,21 @@ static void grow_hunks(void) else forward_ref_limit = OLDNUM(i); - i = start-1; + i = start - 1; /* grow back */ if (shift < 0) back_limit = back_ref_limit + (-shift); - while (i >= back_limit) - { - if(newhash[i] == oldhash[i+shift] - || cost_effective(i+shift, i, shift<0)) - { - OLDNUM(i) = i+shift; + while (i >= back_limit) { + if (newhash[i] == oldhash[i + shift] + || cost_effective(i + shift, i, shift < 0)) { + OLDNUM(i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (backward continuation)", - i, i+shift)); - } - else - { + i, i + shift)); + } else { TR(TRACE_UPDATE | TRACE_MOVE, ("not connecting new line %d to old line %d (backward continuation)", - i, i+shift)); + i, i + shift)); break; } i--; @@ -245,21 +242,17 @@ static void grow_hunks(void) /* grow forward */ if (shift > 0) forward_limit = forward_ref_limit - shift; - while (i < forward_limit) - { - if(newhash[i] == oldhash[i+shift] - || cost_effective(i+shift, i, shift>0)) - { - OLDNUM(i) = i+shift; + while (i < forward_limit) { + if (newhash[i] == oldhash[i + shift] + || cost_effective(i + shift, i, shift > 0)) { + OLDNUM(i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (forward continuation)", - i, i+shift)); - } - else - { + i, i + shift)); + } else { TR(TRACE_UPDATE | TRACE_MOVE, ("not connecting new line %d to old line %d (forward continuation)", - i, i+shift)); + i, i + shift)); break; } i++; @@ -271,22 +264,19 @@ static void grow_hunks(void) } } -void _nc_hash_map(void) +NCURSES_EXPORT(void) +_nc_hash_map(void) { - sym *sp; + HASHMAP *sp; register int i; int start, shift, size; - - if (screen_lines > lines_alloc) - { + if (screen_lines > lines_alloc) { if (hashtab) - free (hashtab); - hashtab = typeMalloc(sym, (screen_lines+1)*2); - if (!hashtab) - { - if (oldhash) - { + free(hashtab); + hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); + if (!hashtab) { + if (oldhash) { FreeAndNull(oldhash); } lines_alloc = 0; @@ -295,47 +285,40 @@ void _nc_hash_map(void) lines_alloc = screen_lines; } - if (oldhash && newhash) - { + if (oldhash && newhash) { /* re-hash only changed lines */ - for (i = 0; i < screen_lines; i++) - { + for (i = 0; i < screen_lines; i++) { if (PENDING(i)) newhash[i] = hash(NEWTEXT(i)); } - } - else - { + } else { /* re-hash all */ if (oldhash == 0) - oldhash = typeCalloc (unsigned long, screen_lines); + oldhash = typeCalloc(unsigned long, (unsigned) screen_lines); if (newhash == 0) - newhash = typeCalloc (unsigned long, screen_lines); + newhash = typeCalloc(unsigned long, (unsigned) screen_lines); if (!oldhash || !newhash) - return; /* malloc failure */ - for (i = 0; i < screen_lines; i++) - { + return; /* malloc failure */ + for (i = 0; i < screen_lines; i++) { newhash[i] = hash(NEWTEXT(i)); oldhash[i] = hash(OLDTEXT(i)); } } #ifdef HASH_VERIFY - for (i = 0; i < screen_lines; i++) - { - if(newhash[i] != hash(NEWTEXT(i))) - fprintf(stderr,"error in newhash[%d]\n",i); - if(oldhash[i] != hash(OLDTEXT(i))) - fprintf(stderr,"error in oldhash[%d]\n",i); + for (i = 0; i < screen_lines; i++) { + if (newhash[i] != hash(NEWTEXT(i))) + fprintf(stderr, "error in newhash[%d]\n", i); + if (oldhash[i] != hash(OLDTEXT(i))) + fprintf(stderr, "error in oldhash[%d]\n", i); } #endif /* * Set up and count line-hash values. */ - memset(hashtab, '\0', sizeof(*hashtab)*(screen_lines+1)*2); - for (i = 0; i < screen_lines; i++) - { + memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2); + for (i = 0; i < screen_lines; i++) { unsigned long hashval = oldhash[i]; for (sp = hashtab; sp->hashval; sp++) @@ -345,8 +328,7 @@ void _nc_hash_map(void) sp->oldcount++; sp->oldindex = i; } - for (i = 0; i < screen_lines; i++) - { + for (i = 0; i < screen_lines; i++) { unsigned long hashval = newhash[i]; for (sp = hashtab; sp->hashval; sp++) @@ -368,11 +350,10 @@ void _nc_hash_map(void) */ for (sp = hashtab; sp->hashval; sp++) if (sp->oldcount == 1 && sp->newcount == 1 - && sp->oldindex != sp->newindex) - { + && sp->oldindex != sp->newindex) { TR(TRACE_UPDATE | TRACE_MOVE, ("new line %d is hash-identical to old line %d (unique)", - sp->newindex, sp->oldindex)); + sp->newindex, sp->oldindex)); OLDNUM(sp->newindex) = sp->oldindex; } @@ -384,8 +365,7 @@ void _nc_hash_map(void) * those which are to be moved too far, they are likely to destroy * more than carry. */ - for (i = 0; i < screen_lines; ) - { + for (i = 0; i < screen_lines;) { while (i < screen_lines && OLDNUM(i) == _NEWINDEX) i++; if (i >= screen_lines) @@ -393,13 +373,12 @@ void _nc_hash_map(void) start = i; shift = OLDNUM(i) - i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; size = i - start; - if (size < 3 || size+min(size/8,2) < abs(shift)) - { - while (start < i) - { + if (size < 3 || size + min(size / 8, 2) < abs(shift)) { + while (start < i) { OLDNUM(start) = _NEWINDEX; start++; } @@ -408,48 +387,42 @@ void _nc_hash_map(void) /* After clearing invalid hunks, try grow the rest. */ grow_hunks(); - -#if NO_LEAKS - FreeAndNull(hashtab); - lines_alloc = 0; -#endif } -void _nc_make_oldhash(int i) +NCURSES_EXPORT(void) +_nc_make_oldhash(int i) { if (oldhash) oldhash[i] = hash(OLDTEXT(i)); } -void _nc_scroll_oldhash(int n, int top, int bot) +NCURSES_EXPORT(void) +_nc_scroll_oldhash(int n, int top, int bot) { - int size; + size_t size; int i; if (!oldhash) return; - size = sizeof(*oldhash) * (bot-top+1-abs(n)); - if (n > 0) - { - memmove (oldhash+top, oldhash+top+n, size); - for (i = bot; i > bot-n; i--) + size = sizeof(*oldhash) * (bot - top + 1 - abs(n)); + if (n > 0) { + memmove(oldhash + top, oldhash + top + n, size); + for (i = bot; i > bot - n; i--) oldhash[i] = hash(OLDTEXT(i)); - } - else - { - memmove (oldhash+top-n, oldhash+top, size); - for (i = top; i < top-n; i++) + } else { + memmove(oldhash + top - n, oldhash + top, size); + for (i = top; i < top - n; i++) oldhash[i] = hash(OLDTEXT(i)); } } - #ifdef HASHDEBUG static void usage(void) { - static const char *table[] = { + static const char *table[] = + { "hashmap test-driver", "", "# comment", @@ -461,19 +434,18 @@ usage(void) "? this message" }; size_t n; - for (n = 0; n < sizeof(table)/sizeof(table[0]); n++) + for (n = 0; n < sizeof(table) / sizeof(table[0]); n++) fprintf(stderr, "%s\n", table[n]); } int -main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - char line[BUFSIZ], *st; - int n; + char line[BUFSIZ], *st; + int n; - SP = typeCalloc(SCREEN,1); - for (n = 0; n < screen_lines; n++) - { + SP = typeCalloc(SCREEN, 1); + for (n = 0; n < screen_lines; n++) { reallines[n] = n; oldnums[n] = _NEWINDEX; oldtext[n][0] = newtext[n][0] = '.'; @@ -485,21 +457,18 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) #ifdef TRACE _nc_tracing = TRACE_MOVE; #endif - for (;;) - { + for (;;) { /* grab a test command */ - if (fgets(line, sizeof(line), stdin) == (char *)NULL) + if (fgets(line, sizeof(line), stdin) == (char *) NULL) exit(EXIT_SUCCESS); - switch(line[0]) - { - case '#': /* comment */ + switch (line[0]) { + case '#': /* comment */ (void) fputs(line, stderr); break; - case 'l': /* get initial line number vector */ - for (n = 0; n < screen_lines; n++) - { + case 'l': /* get initial line number vector */ + for (n = 0; n < screen_lines; n++) { reallines[n] = n; oldnums[n] = _NEWINDEX; } @@ -508,30 +477,30 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) do { oldnums[n++] = atoi(st); } while - ((st = strtok((char *)NULL, " ")) != 0); + ((st = strtok((char *) NULL, " ")) != 0); break; - case 'n': /* use following letters as text of new lines */ + case 'n': /* use following letters as text of new lines */ for (n = 0; n < screen_lines; n++) newtext[n][0] = '.'; for (n = 0; n < screen_lines; n++) - if (line[n+1] == '\n') + if (line[n + 1] == '\n') break; else - newtext[n][0] = line[n+1]; + newtext[n][0] = line[n + 1]; break; - case 'o': /* use following letters as text of old lines */ + case 'o': /* use following letters as text of old lines */ for (n = 0; n < screen_lines; n++) oldtext[n][0] = '.'; for (n = 0; n < screen_lines; n++) - if (line[n+1] == '\n') + if (line[n + 1] == '\n') break; else - oldtext[n][0] = line[n+1]; + oldtext[n][0] = line[n + 1]; break; - case 'd': /* dump state of test arrays */ + case 'd': /* dump state of test arrays */ #ifdef TRACE _nc_linedump(); #endif @@ -547,7 +516,7 @@ main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) putchar('\n'); break; - case 'h': /* apply hash mapper and see scroll optimization */ + case 'h': /* apply hash mapper and see scroll optimization */ _nc_hash_map(); (void) fputs("Result:\n", stderr); #ifdef TRACE diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 03abaffb..78581242 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -152,7 +152,7 @@ #include #include -MODULE_ID("$Id: lib_mvcur.c,v 1.72 2000/10/08 00:58:25 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.86 2002/09/14 23:02:06 Philippe.Blain Exp $") #define CURRENT_ROW SP->_cursrow /* phys cursor row */ #define CURRENT_COLUMN SP->_curscol /* phys cursor column */ @@ -206,7 +206,7 @@ trace_normalized_cost(const char *capname, const char *cap, int affcnt) #endif -int +NCURSES_EXPORT(int) _nc_msec_cost(const char *const cap, int affcnt) /* compute the cost of a given operation */ { @@ -222,11 +222,11 @@ _nc_msec_cost(const char *const cap, int affcnt) float number = 0.0; for (cp += 2; *cp != '>'; cp++) { - if (isdigit(*cp)) + if (isdigit(UChar(*cp))) number = number * 10 + (*cp - '0'); else if (*cp == '*') number *= affcnt; - else if (*cp == '.' && (*++cp != '>') && isdigit(*cp)) + else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) number += (*cp - '0') / 10.0; } @@ -262,7 +262,7 @@ reset_scroll_region(void) } } -void +NCURSES_EXPORT(void) _nc_mvcur_resume(void) /* what to do at initialization time and after each shellout */ { @@ -292,7 +292,7 @@ _nc_mvcur_resume(void) } } -void +NCURSES_EXPORT(void) _nc_mvcur_init(void) /* initialize the cost structure */ { @@ -406,7 +406,7 @@ _nc_mvcur_init(void) _nc_mvcur_resume(); } -void +NCURSES_EXPORT(void) _nc_mvcur_wrap(void) /* wrap up cursor-addressing mode */ { @@ -498,7 +498,9 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int vcost = SP->_cud_cost; } - if (cursor_down && (n * SP->_cud1_cost < vcost)) { + if (cursor_down + && (*cursor_down != '\n' || SP->_nl) + && (n * SP->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, SP->_cud1_cost, n, cursor_down); } @@ -569,6 +571,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int #endif /* USE_HARD_TABS */ #if defined(REAL_ATTR) && defined(WANT_CHAR) + if (n <= 0 || n >= (int) check.s_size) + ovw = FALSE; #if BSD_TPUTS /* * If we're allowing BSD-style padding in tputs, don't generate @@ -581,7 +585,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int && n < (int) check.s_size && vcost == 0 && str[0] == '\0' - && isdigit(TextOf(WANT_CHAR(to_y, from_x)))) + && isdigit(CharOf(WANT_CHAR(to_y, from_x)))) ovw = FALSE; #endif /* @@ -595,17 +599,23 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (ovw) { int i; - for (i = 0; i < n; i++) - if ((WANT_CHAR(to_y, from_x + i) & A_ATTRIBUTES) != CURRENT_ATTR) { + for (i = 0; i < n; i++) { + NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); + if (AttrOf(ch) != CURRENT_ATTR +#if USE_WIDEC_SUPPORT + || !Charable(ch) +#endif + ) { ovw = FALSE; break; } + } } if (ovw) { int i; for (i = 0; i < n; i++) - *check.s_tail++ = WANT_CHAR(to_y, from_x + i); + *check.s_tail++ = CharOf(WANT_CHAR(to_y, from_x + i)); *check.s_tail = '\0'; check.s_size -= n; lhcost += n * SP->_char_padding; @@ -826,14 +836,18 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) return (ERR); } -int +NCURSES_EXPORT(int) mvcur(int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { - TR(TRACE_MOVE, ("mvcur(%d,%d,%d,%d) called", yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), + yold, xold, ynew, xnew)); + + if (SP == 0) + returnCode(ERR); if (yold == ynew && xold == xnew) - return (OK); + returnCode(OK); /* * Most work here is rounding for terminal boundaries getting the @@ -848,26 +862,35 @@ mvcur(int yold, int xold, int ynew, int xnew) if (xold >= screen_columns) { int l; - l = (xold + 1) / screen_columns; - yold += l; - if (yold >= screen_lines) - l -= (yold - screen_lines - 1); + if (SP->_nl) { + l = (xold + 1) / screen_columns; + yold += l; + if (yold >= screen_lines) + l -= (yold - screen_lines - 1); - while (l > 0) { - if (newline) { - TPUTS_TRACE("newline"); - tputs(newline, 0, _nc_outch); - } else - putchar('\n'); - l--; - if (xold > 0) { - if (carriage_return) { - TPUTS_TRACE("carriage_return"); - tputs(carriage_return, 0, _nc_outch); + while (l > 0) { + if (newline) { + TPUTS_TRACE("newline"); + tputs(newline, 0, _nc_outch); } else - putchar('\r'); - xold = 0; + putchar('\n'); + l--; + if (xold > 0) { + if (carriage_return) { + TPUTS_TRACE("carriage_return"); + tputs(carriage_return, 0, _nc_outch); + } else + putchar('\r'); + xold = 0; + } } + } else { + /* + * If caller set nonl(), we cannot really use newlines to position + * to the next row. + */ + xold = -1; + yold = -1; } } @@ -877,11 +900,11 @@ mvcur(int yold, int xold, int ynew, int xnew) ynew = screen_lines - 1; /* destination location is on screen now */ - return (onscreen_mvcur(yold, xold, ynew, xnew, TRUE)); + returnCode(onscreen_mvcur(yold, xold, ynew, xnew, TRUE)); } #if defined(TRACE) || defined(NCURSES_TEST) -int _nc_optimize_enable = OPTIMIZE_ALL; +NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif #if defined(MAIN) || defined(NCURSES_TEST) @@ -894,12 +917,12 @@ int _nc_optimize_enable = OPTIMIZE_ALL; #include #include -const char *_nc_progname = "mvcur"; +NCURSES_EXPORT_VAR(const char *) _nc_progname = "mvcur"; static unsigned long xmits; /* these override lib_tputs.c */ -int +NCURSES_EXPORT(int) tputs(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) /* stub tputs() that dumps sequences in a visible form */ { @@ -910,24 +933,20 @@ tputs(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) return (OK); } -int +NCURSES_EXPORT(int) putp(const char *string) { return (tputs(string, 1, _nc_outch)); } -int +NCURSES_EXPORT(int) _nc_outch(int ch) { putc(ch, stdout); return OK; } -char PC = 0; /* used by termcap library */ -short ospeed = 0; /* used by termcap library */ -int _nc_nulls_sent = 0; /* used by 'tack' program */ - -int +NCURSES_EXPORT(int) delay_output(int ms GCC_UNUSED) { return OK; @@ -1054,7 +1073,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) } } else if (buf[0] == 'i') { dump_init((char *) NULL, F_TERMINFO, S_TERMINFO, 70, 0, FALSE); - dump_entry(&cur_term->type, FALSE, TRUE, 0); + dump_entry(&cur_term->type, FALSE, TRUE, 0, 0, 0); putchar('\n'); } else if (buf[0] == 'o') { if (_nc_optimize_enable & OPTIMIZE_MVCUR) { diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 512de68d..c850e41d 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas Dickey 1995-2001 * ****************************************************************************/ /* @@ -37,17 +38,15 @@ ** The routine _nc_signal_handler(). ** */ - #include -#include #include #if SVR4_ACTION && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.22 2000/09/02 18:33:17 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.30 2002/05/18 19:55:38 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -55,6 +54,41 @@ MODULE_ID("$Id: lib_tstp.c,v 1.22 2000/09/02 18:33:17 tom Exp $") #define USE_SIGTSTP 0 #endif +#ifdef TRACE +static const char * +signal_name(int sig) +{ + switch (sig) { + case SIGALRM: + return "SIGALRM"; +#ifdef SIGCONT + case SIGCONT: + return "SIGCONT"; +#endif + case SIGINT: + return "SIGINT"; + case SIGQUIT: + return "SIGQUIT"; + case SIGTERM: + return "SIGTERM"; +#ifdef SIGTSTP + case SIGTSTP: + return "SIGTSTP"; +#endif +#ifdef SIGTTOU + case SIGTTOU: + return "SIGTTOU"; +#endif +#ifdef SIGWINCH + case SIGWINCH: + return "SIGWINCH"; +#endif + default: + return "unknown signal"; + } +} +#endif + /* * Note: This code is fragile! Its problem is that different OSs * handle restart of system calls interrupted by signals differently. @@ -215,7 +249,7 @@ cleanup(int sig) sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_IGN; - if (sigaction(sig, &act, (sigaction_t *) 0) == 0) + if (sigaction(sig, &act, NULL) == 0) #else if (signal(sig, SIG_IGN) != SIG_ERR) #endif @@ -255,43 +289,57 @@ sigwinch(int sig GCC_UNUSED) * If the given signal is still in its default state, set it to the given * handler. */ -#if HAVE_SIGACTION || HAVE_SIGVEC static int -CatchIfDefault(int sig, sigaction_t * act) +CatchIfDefault(int sig, RETSIGTYPE (*handler) (int)) { + int result; +#if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t old_act; + sigaction_t new_act; + + memset(&new_act, 0, sizeof(new_act)); + sigemptyset(&new_act.sa_mask); +#ifdef SA_RESTART +#ifdef SIGWINCH + if (sig != SIGWINCH) +#endif + new_act.sa_flags |= SA_RESTART; +#endif /* SA_RESTART */ + new_act.sa_handler = handler; - if (sigaction(sig, (sigaction_t *) 0, &old_act) == 0 + if (sigaction(sig, NULL, &old_act) == 0 && (old_act.sa_handler == SIG_DFL + || old_act.sa_handler == handler #if USE_SIGWINCH || (sig == SIGWINCH && old_act.sa_handler == SIG_IGN) #endif )) { - (void) sigaction(sig, act, (sigaction_t *) 0); - return TRUE; + (void) sigaction(sig, &new_act, NULL); + result = TRUE; + } else { + result = FALSE; } - return FALSE; -} -#else -static int -CatchIfDefault(int sig, RETSIGTYPE(*handler) (int)) -{ - void (*ohandler) (int); +#else /* !HAVE_SIGACTION */ + RETSIGTYPE (*ohandler) (int); ohandler = signal(sig, SIG_IGN); if (ohandler == SIG_DFL + || ohandler == handler #if USE_SIGWINCH || (sig == SIGWINCH && ohandler == SIG_IGN) #endif ) { signal(sig, handler); - return TRUE; + result = TRUE; } else { signal(sig, ohandler); - return FALSE; + result = FALSE; } -} #endif + T(("CatchIfDefault - will %scatch %s", + result ? "" : "not ", signal_name(sig))); + return result; +} /* * This is invoked once at the beginning (e.g., from 'initscr()'), to @@ -304,63 +352,48 @@ CatchIfDefault(int sig, RETSIGTYPE(*handler) (int)) * The XSI document implies that we shouldn't keep the SIGTSTP handler if * the caller later changes its mind, but that doesn't seem correct. */ -void +NCURSES_EXPORT(void) _nc_signal_handler(bool enable) { -#if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ - static sigaction_t act, oact; - static int ignore; - - if (!ignore) { - if (!enable) { - act.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &act, &oact); - } else if (act.sa_handler) { - sigaction(SIGTSTP, &oact, NULL); - } else { /*initialize */ - sigemptyset(&act.sa_mask); - act.sa_flags = 0; -#if USE_SIGWINCH - act.sa_handler = sigwinch; - CatchIfDefault(SIGWINCH, &act); -#endif + static bool initialized = FALSE; + T((T_CALLED("_nc_signal_handler(%d)"), enable)); +#if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ + { + static bool ignore_tstp = FALSE; + + if (!ignore_tstp) { + static sigaction_t act, oact; + + if (!enable) { + act.sa_handler = SIG_IGN; + sigaction(SIGTSTP, &act, &oact); + } else if (act.sa_handler != SIG_DFL) { + sigaction(SIGTSTP, &oact, NULL); + } else if (sigaction(SIGTSTP, NULL, &oact) == 0 + && (oact.sa_handler == SIG_DFL)) { + sigemptyset(&act.sa_mask); #ifdef SA_RESTART - act.sa_flags |= SA_RESTART; + act.sa_flags |= SA_RESTART; #endif /* SA_RESTART */ - act.sa_handler = cleanup; - CatchIfDefault(SIGINT, &act); - CatchIfDefault(SIGTERM, &act); - - act.sa_handler = tstp; - if (!CatchIfDefault(SIGTSTP, &act)) - ignore = TRUE; + act.sa_handler = tstp; + (void) sigaction(SIGTSTP, &act, NULL); + } else { + ignore_tstp = TRUE; + } } } -#else /* !USE_SIGTSTP */ - if (enable) { -#if HAVE_SIGACTION || HAVE_SIGVEC - static sigaction_t act; - sigemptyset(&act.sa_mask); -#if USE_SIGWINCH - act.sa_handler = sigwinch; - CatchIfDefault(SIGWINCH, &act); -#endif -#ifdef SA_RESTART - act.sa_flags |= SA_RESTART; -#endif /* SA_RESTART */ - act.sa_handler = cleanup; - CatchIfDefault(SIGINT, &act); - CatchIfDefault(SIGTERM, &act); - -#else /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ +#endif /* !USE_SIGTSTP */ - CatchIfDefault(SIGINT, cleanup); - CatchIfDefault(SIGTERM, cleanup); + if (!initialized) { + if (enable) { + CatchIfDefault(SIGINT, cleanup); + CatchIfDefault(SIGTERM, cleanup); #if USE_SIGWINCH - CatchIfDefault(SIGWINCH, sigwinch); + CatchIfDefault(SIGWINCH, sigwinch); #endif -#endif /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ + initialized = TRUE; + } } -#endif /* !USE_SIGTSTP */ + returnVoid; } diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 6d24d8dd..a907914a 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,12 +40,14 @@ ** comments, none of the original code remains - T.Dickey). */ +#include + #ifdef __BEOS__ +#undef false +#undef true #include #endif -#include - #if USE_FUNC_POLL # if HAVE_SYS_TIME_H # include @@ -59,7 +61,7 @@ # endif #endif -MODULE_ID("$Id: lib_twait.c,v 1.39 2000/08/26 19:34:15 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.46 2002/09/01 00:28:18 tom Exp $") static long _nc_gettime(bool first) @@ -85,10 +87,34 @@ _nc_gettime(bool first) } res = (t1 - t0) * 1000; #endif - T(("%s time: %ld msec", first ? "get" : "elapsed", res)); + TR(TRACE_IEVENT, ("%s time: %ld msec", first ? "get" : "elapsed", res)); return res; } +#ifdef NCURSES_WGETCH_EVENTS +NCURSES_EXPORT(int) +_nc_eventlist_timeout(_nc_eventlist * evl) +{ + _nc_event **ev, **last; + int event_delay = -1; + + if (evl != 0) { + + ev = evl->events; + last = ev + evl->count; + + while (ev < last) { + if ((*ev)->type == _NC_EVENT_TIMEOUT_MSEC) { + event_delay = (*ev)->data.timeout_msec; + if (event_delay < 0) + event_delay = LONG_MAX; /* FIXME Is this defined? */ + } + } + } + return event_delay; +} +#endif /* NCURSES_WGETCH_EVENTS */ + /* * Wait a specified number of milliseconds, returning nonzero if the timer * didn't expire before there is activity on the specified file descriptors. @@ -97,21 +123,33 @@ _nc_gettime(bool first) * 1 - ncurses' normal input-descriptor * 2 - mouse descriptor, if any * 3 - either input or mouse. + * + * Experimental: if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines + * whether to pay attention to evl argument. If set, the smallest of + * millisecond and of timeout of evl is taken. + * * We return a mask that corresponds to the mode (e.g., 2 for mouse activity). * * If the milliseconds given are -1, the wait blocks until activity on the * descriptors. */ -int -_nc_timed_wait(int mode, int milliseconds, int *timeleft) +NCURSES_EXPORT(int) +_nc_timed_wait(int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) { int fd; int count; - int result; +#ifdef NCURSES_WGETCH_EVENTS + int timeout_is_event = 0; +#endif + #if USE_FUNC_POLL - struct pollfd fds[2]; + struct pollfd fd_list[2]; + struct pollfd *fds = fd_list; #elif defined(__BEOS__) #elif HAVE_SELECT static fd_set set; @@ -119,7 +157,20 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) long starttime, returntime; - T(("start twait: %d milliseconds, mode: %d", milliseconds, mode)); + TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", + milliseconds, mode)); + +#ifdef NCURSES_WGETCH_EVENTS + if (mode & 4) { + int event_delay = _nc_eventlist_timeout(evl); + + if (event_delay >= 0 + && (milliseconds >= event_delay || milliseconds < 0)) { + milliseconds = event_delay; + timeout_is_event = 1; + } + } +#endif #if PRECISE_GETTIME retry: @@ -128,8 +179,19 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) count = 0; +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) + evl->result_flags = 0; +#endif + #if USE_FUNC_POLL - memset(fds, 0, sizeof(fds)); + memset(fd_list, 0, sizeof(fd_list)); + +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) + fds = typeMalloc(struct pollfd, 2 + evl->count); +#endif + if (mode & 1) { fds[count].fd = SP->_ifd; fds[count].events = POLLIN; @@ -141,8 +203,54 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) fds[count].events = POLLIN; count++; } +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) { + _nc_event **ev = evl->events; + _nc_event **last = ev + evl->count; + + while (ev < last) { + if ((*ev)->type == _NC_EVENT_FILE + && ((*ev)->data.fev.flags & _NC_EVENT_FILE_READABLE)) { + fds[count].fd = (*ev)->data.fev.fd; + fds[count].events = POLLIN; + count++; + } + } + } +#endif + result = poll(fds, count, milliseconds); +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) { + _nc_event **ev = evl->events; + _nc_event **last = ev + evl->count; + int c; + + if (!result) + count = 0; + while (ev < last) { + if ((*ev)->type == _NC_EVENT_FILE + && ((*ev)->data.fev.flags & _NC_EVENT_FILE_READABLE)) { + (*ev)->data.fev.result = 0; + for (c = 0; c < count; c++) + if (fds[c].fd == (*ev)->data.fev.fd + && fds[c].revents & POLLIN) { + (*ev)->data.fev.result |= _NC_EVENT_FILE_READABLE; + evl->result_flags |= _NC_EVENT_FILE_READABLE; + } + } else if ((*ev)->type == _NC_EVENT_TIMEOUT_MSEC + && !result && timeout_is_event) { + evl->result_flags |= _NC_EVENT_TIMEOUT_MSEC; + } + } + } + + if (fds != fd_list) + free((char *) fds); + +#endif + #elif defined(__BEOS__) /* * BeOS's select() is declared in socket.h, so the configure script does @@ -152,26 +260,34 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) * * FIXME: the return values from the ioctl aren't very clear if we get * interrupted. + * + * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c). */ result = 0; if (mode & 1) { + int step = (milliseconds < 0) ? 0 : 5000; bigtime_t d; bigtime_t useconds = milliseconds * 1000; int n, howmany; - if (useconds == 0) /* we're here to go _through_ the loop */ + if (useconds <= 0) /* we're here to go _through_ the loop */ useconds = 1; - for (d = 0; d < useconds; d += 5000) { + for (d = 0; d < useconds; d += step) { n = 0; howmany = ioctl(0, 'ichr', &n); if (howmany >= 0 && n > 0) { result = 1; break; } - if (useconds > 1) - snooze(5000); - milliseconds -= 5; + if (useconds > 1 && step > 0) { + snooze(step); + milliseconds -= (step / 1000); + if (milliseconds <= 0) { + milliseconds = 0; + break; + } + } } } else if (milliseconds > 0) { snooze(milliseconds * 1000); @@ -193,6 +309,20 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) FD_SET(fd, &set); count = max(fd, count) + 1; } +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) { + _nc_event **ev = evl->events; + _nc_event **last = ev + evl->count; + + while (ev < last) { + if ((*ev)->type == _NC_EVENT_FILE + && ((*ev)->data.fev.flags & _NC_EVENT_FILE_READABLE)) { + FD_SET((*ev)->data.fev.fd, &set); + count = max((*ev)->data.fev.fd + 1, count); + } + } + } +#endif if (milliseconds >= 0) { struct timeval ntimeout; @@ -202,13 +332,54 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) } else { result = select(count, &set, NULL, NULL, NULL); } + +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl) { + _nc_event **ev = evl->events; + _nc_event **last = ev + evl->count; + + evl->result_flags = 0; + while (ev < last) { + if ((*ev)->type == _NC_EVENT_FILE + && ((*ev)->data.fev.flags & _NC_EVENT_FILE_READABLE)) { + (*ev)->data.fev.result = 0; + if (FD_ISSET((*ev)->data.fev.fd, &set)) { + (*ev)->data.fev.result |= _NC_EVENT_FILE_READABLE; + evl->result_flags |= _NC_EVENT_FILE_READABLE; + } + } else if ((*ev)->type == _NC_EVENT_TIMEOUT_MSEC + && !result && timeout_is_event) + evl->result_flags |= _NC_EVENT_TIMEOUT_MSEC; + } + } #endif +#endif /* USE_FUNC_POLL, etc */ + returntime = _nc_gettime(FALSE); if (milliseconds >= 0) milliseconds -= (returntime - starttime); +#ifdef NCURSES_WGETCH_EVENTS + if (evl) { + _nc_event **ev = evl->events; + _nc_event **last = ev + evl->count; + + evl->result_flags = 0; + while (ev < last) { + if ((*ev)->type == _NC_EVENT_TIMEOUT_MSEC) { + long diff = (returntime - starttime); + if ((*ev)->data.timeout_msec <= diff) + (*ev)->data.timeout_msec = 0; + else + (*ev)->data.timeout_msec -= diff; + } + + } + } +#endif + #if PRECISE_GETTIME /* * If the timeout hasn't expired, and we've gotten no data, @@ -227,8 +398,8 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) if (timeleft) *timeleft = milliseconds; - T(("end twait: returned %d (%d), remaining time %d msec", - result, errno, milliseconds)); + TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", + result, errno, milliseconds)); /* * Both 'poll()' and 'select()' return the number of file descriptors @@ -260,6 +431,10 @@ _nc_timed_wait(int mode, int milliseconds, int *timeleft) } else result = 0; } +#ifdef NCURSES_WGETCH_EVENTS + if ((mode & 4) && evl && evl->result_flags) + result |= 4; +#endif return (result); } diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index 5022cbdd..00611f4e 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -64,7 +64,7 @@ #include #include -MODULE_ID("$Id: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.39 2001/08/26 00:40:46 Philippe.Blain Exp $") #define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) @@ -86,14 +86,14 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.33 2000/10/09 22:45:29 tom Exp $") } \ } -int -vidputs(attr_t newmode, int (*outc) (int)) +NCURSES_EXPORT(int) +vidputs +(chtype newmode, int (*outc) (int)) { static attr_t previous_attr = A_NORMAL; attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool used_ncv = FALSE; bool can_color = (SP == 0 || SP->_coloron); #if NCURSES_EXT_FUNCS bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); @@ -134,11 +134,13 @@ vidputs(attr_t newmode, int (*outc) (int)) * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - attr_t mask = NCURSES_BITS((no_color_video & 63) - | ((no_color_video & 192) << 1) - | ((no_color_video & 256) >> 2), 8); + unsigned value = no_color_video; + attr_t mask = NCURSES_BITS((value & 63) + | ((value & 192) << 1) + | ((value & 256) >> 2), 8); - if (mask & A_REVERSE && newmode & A_REVERSE) { + if ((mask & A_REVERSE) != 0 + && (newmode & A_REVERSE) != 0) { reverse = TRUE; mask &= ~A_REVERSE; } @@ -179,7 +181,7 @@ vidputs(attr_t newmode, int (*outc) (int)) } SetColorsIf((pair != 0) || fix_pair0, previous_attr); - } else if (set_attributes && !used_ncv) { + } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); tputs(tparm(set_attributes, @@ -227,12 +229,24 @@ vidputs(attr_t newmode, int (*outc) (int)) TurnOn(A_PROTECT, enter_protected_mode); TurnOn(A_INVIS, enter_secure_mode); TurnOn(A_UNDERLINE, enter_underline_mode); +#ifdef enter_horizontal_hl_mode TurnOn(A_HORIZONTAL, enter_horizontal_hl_mode); +#endif +#ifdef enter_left_hl_mode TurnOn(A_LEFT, enter_left_hl_mode); +#endif +#ifdef enter_low_hl_mode TurnOn(A_LOW, enter_low_hl_mode); +#endif +#ifdef enter_right_hl_mode TurnOn(A_RIGHT, enter_right_hl_mode); +#endif +#ifdef enter_top_hl_mode TurnOn(A_TOP, enter_top_hl_mode); +#endif +#ifdef enter_vertical_hl_mode TurnOn(A_VERTICAL, enter_vertical_hl_mode); +#endif /* *INDENT-ON* */ } @@ -248,15 +262,15 @@ vidputs(attr_t newmode, int (*outc) (int)) returnCode(OK); } -int -vidattr(attr_t newmode) +NCURSES_EXPORT(int) +vidattr(chtype newmode) { T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); returnCode(vidputs(newmode, _nc_outch)); } -chtype +NCURSES_EXPORT(chtype) termattrs(void) { chtype attrs = A_NORMAL; diff --git a/ncurses/tty/tty_display.h b/ncurses/tty/tty_display.h index e7b447d8..8382c823 100644 --- a/ncurses/tty/tty_display.h +++ b/ncurses/tty/tty_display.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,20 +29,20 @@ #ifndef TTY_DISPLAY_H #define TTY_DISPLAY_H 1 -extern bool _nc_tty_beep(void); -extern bool _nc_tty_check_resize(void); -extern bool _nc_tty_cursor(int); -extern bool _nc_tty_flash(void); -extern bool _nc_tty_init_color(int,int,int,int); -extern bool _nc_tty_init_pair(int,int,int); -extern bool _nc_tty_slk_hide(bool); -extern bool _nc_tty_slk_update(int,const char *); -extern bool _nc_tty_start_color(void); -extern void _nc_tty_display_resume(void); -extern void _nc_tty_display_suspend(void); -extern void _nc_tty_dispose(void); /* frees SP->_term */ -extern void _nc_tty_switch_to(void); -extern void _nc_tty_update(void); +extern NCURSES_EXPORT(bool) _nc_tty_beep (void); +extern NCURSES_EXPORT(bool) _nc_tty_check_resize (void); +extern NCURSES_EXPORT(bool) _nc_tty_cursor (int); +extern NCURSES_EXPORT(bool) _nc_tty_flash (void); +extern NCURSES_EXPORT(bool) _nc_tty_init_color (int,int,int,int); +extern NCURSES_EXPORT(bool) _nc_tty_init_pair (int,int,int); +extern NCURSES_EXPORT(bool) _nc_tty_slk_hide (bool); +extern NCURSES_EXPORT(bool) _nc_tty_slk_update (int,const char *); +extern NCURSES_EXPORT(bool) _nc_tty_start_color (void); +extern NCURSES_EXPORT(void) _nc_tty_display_resume (void); +extern NCURSES_EXPORT(void) _nc_tty_display_suspend (void); +extern NCURSES_EXPORT(void) _nc_tty_dispose (void); /* frees SP->_term */ +extern NCURSES_EXPORT(void) _nc_tty_switch_to (void); +extern NCURSES_EXPORT(void) _nc_tty_update (void); struct tty_display_data { int _fifohold; /* set if breakout marked */ diff --git a/ncurses/tty/tty_input.h b/ncurses/tty/tty_input.h index 41c22833..e520793e 100644 --- a/ncurses/tty/tty_input.h +++ b/ncurses/tty/tty_input.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,19 +27,19 @@ ****************************************************************************/ /* - * $Id: tty_input.h,v 1.1 1998/12/19 22:42:57 tom Exp $ + * $Id: tty_input.h,v 1.2 2000/12/10 02:26:51 tom Exp $ */ #ifndef TTY_INPUT_H #define TTY_INPUT_H 1 -extern bool _nc_tty_mouse_mask(mmask_t); -extern bool _nc_tty_pending(void); -extern int _nc_tty_next_event(int); -extern void _nc_tty_flags_changed(void); -extern void _nc_tty_flush(void); -extern void _nc_tty_input_resume(void); -extern void _nc_tty_input_suspend(void); +extern NCURSES_EXPORT(bool) _nc_tty_mouse_mask (mmask_t); +extern NCURSES_EXPORT(bool) _nc_tty_pending (void); +extern NCURSES_EXPORT(int) _nc_tty_next_event (int); +extern NCURSES_EXPORT(void) _nc_tty_flags_changed (void); +extern NCURSES_EXPORT(void) _nc_tty_flush (void); +extern NCURSES_EXPORT(void) _nc_tty_input_resume (void); +extern NCURSES_EXPORT(void) _nc_tty_input_suspend (void); struct tty_input_data { int _ifd; /* input file ptr for screen */ diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 298c11ed..c792402d 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,12 +41,14 @@ * *-----------------------------------------------------------------*/ +#include + #ifdef __BEOS__ +#undef false +#undef true #include #endif -#include - #if defined(TRACE) && HAVE_SYS_TIMES_H && HAVE_TIMES #define USE_TRACE_TIMES 1 #else @@ -70,7 +72,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.146 2000/10/07 01:11:44 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.177 2002/09/28 20:41:55 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -92,12 +94,12 @@ MODULE_ID("$Id: tty_update.c,v 1.146 2000/10/07 01:11:44 tom Exp $") */ /* #define POSITION_DEBUG */ -static inline chtype ClrBlank(WINDOW *win); +static inline NCURSES_CH_T ClrBlank(WINDOW *win); static int ClrBottom(int total); -static void ClearScreen(chtype blank); +static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); -static void InsStr(chtype * line, int count); +static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); #ifdef POSITION_DEBUG @@ -163,7 +165,7 @@ position_check(int expected_y, int expected_x, char *legend) static inline void GoTo(int const row, int const col) { - chtype oldattr = SP->_current_attr; + attr_t oldattr = SP->_current_attr; TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", row, col, SP->_cursrow, SP->_curscol)); @@ -189,22 +191,30 @@ GoTo(int const row, int const col) } static inline void -PutAttrChar(chtype ch) +PutAttrChar(CARG_CH_T ch) { - int data; + PUTC_DATA; + NCURSES_CH_T tilde; - if (tilde_glitch && (TextOf(ch) == '~')) - ch = ('`' | AttrOf(ch)); + if (tilde_glitch && (CharOfD(ch) == L('~'))) { + SetChar(tilde, L('`'), AttrOfD(ch)); + ch = CHREF(tilde); + } TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", - _tracechtype(ch), + _tracech_t(ch), SP->_cursrow, SP->_curscol)); - UpdateAttrs(ch); - data = TextOf(ch); + UpdateAttrs(AttrOfD(ch)); +#if !USE_WIDEC_SUPPORT + /* FIXME - we do this special case for signal handling, should see how to + * make it work for wide characters. + */ if (SP->_outch != 0) { - SP->_outch(data); - } else { - putc(data, SP->_ofp); /* macro's fastest... */ + SP->_outch((int) ch); + } else +#endif + { + PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ #ifdef TRACE _nc_outchars++; #endif /* TRACE */ @@ -274,21 +284,9 @@ check_pending(void) return FALSE; } -/* - * No one supports recursive inline functions. However, gcc is quieter if we - * instantiate the recursive part separately. - */ -#if CC_HAS_INLINE_FUNCS -static void callPutChar(chtype const); -#else -#define callPutChar(ch) PutChar(ch) -#endif - -static inline void PutChar(chtype const ch); /* forward declaration */ - /* put char at lower right corner */ static void -PutCharLR(chtype const ch) +PutCharLR(const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ @@ -307,7 +305,7 @@ PutCharLR(chtype const ch) } else if ((enter_insert_mode && exit_insert_mode) || insert_character || parm_ich) { GoTo(screen_lines - 1, screen_columns - 2); - callPutChar(ch); + PutAttrChar(ch); GoTo(screen_lines - 1, screen_columns - 2); InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1); } @@ -345,7 +343,7 @@ wrap_cursor(void) } static inline void -PutChar(chtype const ch) +PutChar(const ARG_CH_T ch) /* insert character, handling automargin stuff */ { if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) @@ -366,19 +364,27 @@ PutChar(chtype const ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static inline bool -can_clear_with(chtype ch) +can_clear_with(ARG_CH_T ch) { if (!back_color_erase && SP->_coloron) { - if (ch & A_COLOR) - return FALSE; #if NCURSES_EXT_FUNCS if (!SP->_default_color) return FALSE; if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) return FALSE; + if (AttrOfD(ch) & A_COLOR) { + short fg, bg; + pair_content(PAIR_NUMBER(AttrOfD(ch)), &fg, &bg); + if (fg != C_MASK || bg != C_MASK) + return FALSE; + } +#else + if (AttrOfD(ch) & A_COLOR) + return FALSE; #endif } - return ((ch & ~(NONBLANK_ATTR | A_COLOR)) == BLANK); + return (ISBLANK(CHDEREF(ch)) && + (AttrOfD(ch) & ~(NONBLANK_ATTR | A_COLOR)) == BLANK_ATTR); } /* @@ -394,28 +400,28 @@ can_clear_with(chtype ch) * This code is optimized using ech and rep. */ static int -EmitRange(const chtype * ntext, int num) +EmitRange(const NCURSES_CH_T * ntext, int num) { int i; if (erase_chars || repeat_char) { while (num > 0) { int runcount; - chtype ntext0; + NCURSES_CH_T ntext0; - while (num > 1 && ntext[0] != ntext[1]) { - PutChar(ntext[0]); + while (num > 1 && !CharEq(ntext[0], ntext[1])) { + PutChar(CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(ntext0); + PutChar(CHREF(ntext0)); return 0; } runcount = 2; - while (runcount < num && ntext[runcount] == ntext0) + while (runcount < num && CharEq(ntext[runcount], ntext0)) runcount++; /* @@ -428,8 +434,8 @@ EmitRange(const chtype * ntext, int num) */ if (erase_chars && runcount > SP->_ech_cost + SP->_cup_ch_cost - && can_clear_with(ntext0)) { - UpdateAttrs(ntext0); + && can_clear_with(CHREF(ntext0))) { + UpdateAttrs(AttrOf(ntext0)); putp(tparm(erase_chars, runcount)); /* @@ -449,15 +455,15 @@ EmitRange(const chtype * ntext, int num) if (wrap_possible) rep_count--; - UpdateAttrs(ntext0); - putp(tparm(repeat_char, TextOf(ntext0), rep_count)); + UpdateAttrs(AttrOf(ntext0)); + putp(tparm(repeat_char, CharOf(ntext0), rep_count)); SP->_curscol += rep_count; if (wrap_possible) - PutChar(ntext0); + PutChar(CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(ntext[i]); + PutChar(CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -466,7 +472,7 @@ EmitRange(const chtype * ntext, int num) } for (i = 0; i < num; i++) - PutChar(ntext[i]); + PutChar(CHREF(ntext[i])); return 0; } @@ -479,11 +485,10 @@ EmitRange(const chtype * ntext, int num) * Returns: same as EmitRange */ static int -PutRange( - const chtype * otext, - const chtype * ntext, - int row, - int first, int last) +PutRange(const NCURSES_CH_T * otext, + const NCURSES_CH_T * ntext, + int row, + int first, int last) { int j, run; @@ -493,7 +498,9 @@ PutRange( if (otext != ntext && (last - first + 1) > SP->_inline_cost) { for (j = first, run = 0; j <= last; j++) { - if (otext[j] == ntext[j]) { + if (!run && isnac(otext[j])) + continue; + if (CharEq(otext[j], ntext[j])) { run++; } else { if (run > SP->_inline_cost) { @@ -508,21 +515,13 @@ PutRange( return EmitRange(ntext + first, last - first + 1); } -#if CC_HAS_INLINE_FUNCS -static void -callPutChar(chtype const ch) -{ - PutChar(ch); -} -#endif - /* leave unbracketed here so 'indent' works */ #define MARK_NOCHANGE(win,row) \ win->_line[row].firstchar = _NOCHANGE; \ win->_line[row].lastchar = _NOCHANGE; \ if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) -int +NCURSES_EXPORT(int) doupdate(void) { int i; @@ -600,7 +599,7 @@ doupdate(void) for (i = 0; i < screen_lines; i++) { for (j = 0; j < screen_columns; j++) { bool failed = FALSE; - chtype turnon = AttrOf(newscr->_line[i].text[j]) & ~rattr; + attr_t turnon = AttrOf(newscr->_line[i].text[j]) & ~rattr; /* is an attribute turned on here? */ if (turnon == 0) { @@ -617,16 +616,16 @@ doupdate(void) * ensure there's enough room to set the attribute before * the first non-blank in the run. */ -#define SAFE(a) (!((a) & (chtype)~NONBLANK_ATTR)) - if (TextOf(newscr->_line[i].text[j]) == ' ' && SAFE(turnon)) { - newscr->_line[i].text[j] &= ~turnon; +#define SAFE(a) (!((a) & (attr_t)~NONBLANK_ATTR)) + if (ISBLANK(newscr->_line[i].text[j]) && SAFE(turnon)) { + RemAttr(newscr->_line[i].text[j], turnon); continue; } /* check that there's enough room at start of span */ for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 - || TextOf(newscr->_line[i].text[j - k]) != ' ' + || !ISBLANK(newscr->_line[i].text[j - k]) || !SAFE(AttrOf(newscr->_line[i].text[j - k]))) failed = TRUE; } @@ -653,7 +652,7 @@ doupdate(void) foundit:; if (end_onscreen) { - chtype *lastline = newscr->_line[m].text; + NCURSES_CH_T *lastline = newscr->_line[m].text; /* * If there are safely-attributed blanks at the @@ -662,14 +661,14 @@ doupdate(void) * of span. */ while (n >= 0 - && TextOf(lastline[n]) == ' ' + && ISBLANK(lastline[n]) && SAFE(AttrOf(lastline[n]))) - lastline[n--] &= ~turnon; + RemAttr(lastline[n--], turnon); /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) if (n + k >= screen_columns - || TextOf(lastline[n + k]) != ' ' + || !ISBLANK(lastline[n + k]) || !SAFE(AttrOf(lastline[n + k]))) failed = TRUE; } @@ -687,7 +686,7 @@ doupdate(void) for (; q < screen_columns; q++) { if (AttrOf(newscr->_line[p].text[q]) == rattr) goto foundend; - newscr->_line[p].text[q] &= ~turnon; + RemAttr(newscr->_line[p].text[q], turnon); } q = 0; } @@ -702,7 +701,7 @@ doupdate(void) * for cookies before the first nonblank character */ for (k = 1; k <= magic_cookie_glitch; k++) - newscr->_line[i].text[j - k] |= turnon; + AddAttr(newscr->_line[i].text[j - k], turnon); } rattr = AttrOf(newscr->_line[i].text[j]); @@ -764,20 +763,20 @@ doupdate(void) /* mark line changed successfully */ if (i <= newscr->_maxy) { - MARK_NOCHANGE(newscr, i) + MARK_NOCHANGE(newscr, i); } if (i <= curscr->_maxy) { - MARK_NOCHANGE(curscr, i) + MARK_NOCHANGE(curscr, i); } } } /* put everything back in sync */ for (i = nonempty; i <= newscr->_maxy; i++) { - MARK_NOCHANGE(newscr, i) + MARK_NOCHANGE(newscr, i); } for (i = nonempty; i <= curscr->_maxy; i++) { - MARK_NOCHANGE(curscr, i) + MARK_NOCHANGE(curscr, i); } if (!newscr->_leaveok) { @@ -802,8 +801,8 @@ doupdate(void) TR(TRACE_TIMES, ("Update cost: %ld chars, %ld clocks system time, %ld clocks user time", _nc_outchars, - after.tms_stime - before.tms_stime, - after.tms_utime - before.tms_utime)); + (long) (after.tms_stime - before.tms_stime), + (long) (after.tms_utime - before.tms_utime))); #endif /* USE_TRACE_TIMES */ _nc_signal_handler(TRUE); @@ -822,14 +821,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_bkgd) +#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) -static inline chtype +static inline NCURSES_CH_T ClrBlank(WINDOW *win) { - chtype blank = BLANK; + NCURSES_CH_T blank = NewChar(BLANK_TEXT); if (back_color_erase) - blank |= (BCE_BKGD(win) & BCE_ATTRS); + AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); return blank; } @@ -844,7 +843,7 @@ static void ClrUpdate(void) { int i; - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); int nonempty = min(screen_lines, newscr->_maxy + 1); TR(TRACE_UPDATE, ("ClrUpdate() called")); @@ -866,7 +865,7 @@ ClrUpdate(void) */ static void -ClrToEOL(chtype blank, bool needclear) +ClrToEOL(NCURSES_CH_T blank, bool needclear) { int j; @@ -874,9 +873,9 @@ ClrToEOL(chtype blank, bool needclear) && SP->_cursrow >= 0) { for (j = SP->_curscol; j < screen_columns; j++) { if (j >= 0) { - chtype *cp = &(curscr->_line[SP->_cursrow].text[j]); + NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); - if (*cp != blank) { + if (!CharEq(*cp, blank)) { *cp = blank; needclear = TRUE; } @@ -887,12 +886,12 @@ ClrToEOL(chtype blank, bool needclear) } if (needclear) { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eol"); if (SP->_el_cost > (screen_columns - SP->_curscol)) { int count = (screen_columns - SP->_curscol); while (count-- > 0) - PutChar(blank); + PutChar(CHREF(blank)); } else { putp(clr_eol); } @@ -906,14 +905,14 @@ ClrToEOL(chtype blank, bool needclear) */ static void -ClrToEOS(chtype blank) +ClrToEOS(NCURSES_CH_T blank) { int row, col; row = SP->_cursrow; col = SP->_curscol; - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eos"); tputs(clr_eos, screen_lines - row, _nc_outch); @@ -940,20 +939,20 @@ ClrBottom(int total) int col; int top = total; int last = min(screen_columns, newscr->_maxx + 1); - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); bool ok; - if (clr_eos && can_clear_with(blank)) { + if (clr_eos && can_clear_with(CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (newscr->_line[row].text[col] == blank); + ok = (CharEq(newscr->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (curscr->_line[row].text[col] == blank); + ok = (CharEq(curscr->_line[row].text[col], blank)); } if (!ok) top = row; @@ -973,6 +972,25 @@ ClrBottom(int total) return total; } +#if USE_XMC_SUPPORT +#if USE_WIDEC_SUPPORT +static inline bool +check_xmc_transition(NCURSES_CH_T * a, NCURSES_CH_T * b) +{ + if (((a->attr ^ b->attr) & ~(a->attr) & SP->_xmc_triggers) != 0) { + return TRUE; + } + return FALSE; +} +#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) +#else +#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) +#endif + +#define xmc_new(r,c) newscr->_line[r].text[c] +#define xmc_turn_off(a,b) xmc_turn_on(b,a) +#endif /* USE_XMC_SUPPORT */ + /* ** TransformLine(lineno) ** @@ -995,8 +1013,8 @@ static void TransformLine(int const lineno) { int firstChar, oLastChar, nLastChar; - chtype *newLine = newscr->_line[lineno].text; - chtype *oldLine = curscr->_line[lineno].text; + NCURSES_CH_T *newLine = newscr->_line[lineno].text; + NCURSES_CH_T *oldLine = curscr->_line[lineno].text; int n; bool attrchanged = FALSE; @@ -1006,8 +1024,8 @@ TransformLine(int const lineno) if (SP->oldhash && SP->newhash) SP->oldhash[lineno] = SP->newhash[lineno]; -#define ColorOf(n) ((n) & A_COLOR) -#define unColor(n) ((n) & ALL_BUT_COLOR) +#define ColorOf(n) (AttrOf(n) & A_COLOR) +#define unColor(n) (AttrOf(n) & ALL_BUT_COLOR) /* * If we have colors, there is the possibility of having two color pairs * that display as the same colors. For instance, Lynx does this. Check @@ -1015,13 +1033,13 @@ TransformLine(int const lineno) * they are equivalent. */ if (SP->_coloron) { - chtype oldColor; - chtype newColor; + attr_t oldColor; + attr_t newColor; int oldPair; int newPair; for (n = 0; n < screen_columns; n++) { - if (newLine[n] != oldLine[n]) { + if (!CharEq(newLine[n], oldLine[n])) { oldColor = ColorOf(oldLine[n]); newColor = ColorOf(newLine[n]); if (oldColor != newColor @@ -1031,8 +1049,8 @@ TransformLine(int const lineno) if (oldPair < COLOR_PAIRS && newPair < COLOR_PAIRS && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { - oldLine[n] &= ~A_COLOR; - oldLine[n] |= ColorOf(newLine[n]); + RemAttr(oldLine[n], A_COLOR); + AddAttr(oldLine[n], ColorOf(newLine[n])); } } } @@ -1056,10 +1074,6 @@ TransformLine(int const lineno) PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); #if USE_XMC_SUPPORT -#define NEW(r,c) newscr->_line[r].text[c] -#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) -#define xmc_turn_off(a,b) xmc_turn_on(b,a) - /* * This is a very simple loop to paint characters which may have the * magic cookie glitch embedded. It doesn't know much about video @@ -1080,40 +1094,39 @@ TransformLine(int const lineno) * If we are writing an attributed blank, where the * previous cell is not attributed. */ - if (TextOf(newLine[n]) == ' ' + if (ISBLANK(newLine[n]) && ((n > 0 && xmc_turn_on(newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(NEW(lineno - 1, screen_columns - 1), + && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), newLine[n])))) { n = m; } - PutChar(newLine[n]); + PutChar(CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ - if (TextOf(newLine[n]) != ' ' + if (!ISBLANK(newLine[n]) && ((n + 1 < screen_columns && xmc_turn_off(newLine[n], newLine[n + 1])) || (n + 1 >= screen_columns && lineno + 1 < screen_lines - && xmc_turn_off(newLine[n], NEW(lineno + 1, 0))))) { + && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { n = m; } } -#undef NEW #endif } else { - chtype blank; + NCURSES_CH_T blank; /* find the first differing character */ while (firstChar < screen_columns && - newLine[firstChar] == oldLine[firstChar]) + CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; /* if there wasn't one, we're done */ @@ -1121,25 +1134,25 @@ TransformLine(int const lineno) return; /* it may be cheap to clear leading whitespace with clr_bol */ - if (clr_bol && can_clear_with(blank = newLine[0])) { + if (clr_bol && (blank = newLine[0], can_clear_with(CHREF(blank)))) { int oFirstChar, nFirstChar; for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) - if (oldLine[oFirstChar] != blank) + if (!CharEq(oldLine[oFirstChar], blank)) break; for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) - if (newLine[nFirstChar] != blank) + if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar > oFirstChar + SP->_el1_cost) { if (nFirstChar >= screen_columns && SP->_el_cost <= SP->_el1_cost) { GoTo(lineno, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eol"); putp(clr_eol); } else { GoTo(lineno, nFirstChar - 1); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_bol"); putp(clr_bol); } @@ -1154,12 +1167,12 @@ TransformLine(int const lineno) blank = newLine[screen_columns - 1]; - if (!can_clear_with(blank)) { + if (!can_clear_with(CHREF(blank))) { /* find the last differing character */ nLastChar = screen_columns - 1; while (nLastChar > firstChar - && newLine[nLastChar] == oldLine[nLastChar]) + && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { @@ -1167,29 +1180,29 @@ TransformLine(int const lineno) PutRange(oldLine, newLine, lineno, firstChar, nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(chtype)); + (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } return; } /* find last non-blank character on old line */ oLastChar = screen_columns - 1; - while (oLastChar > firstChar && oldLine[oLastChar] == blank) + while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ nLastChar = screen_columns - 1; - while (nLastChar > firstChar && newLine[nLastChar] == blank) + while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) && (SP->_el_cost < (oLastChar - nLastChar))) { GoTo(lineno, firstChar); - if (newLine[firstChar] != blank) - PutChar(newLine[firstChar]); + if (!CharEq(newLine[firstChar], blank)) + PutChar(CHREF(newLine[firstChar])); ClrToEOL(blank, FALSE); } else if ((nLastChar != oLastChar) - && (newLine[nLastChar] != oldLine[oLastChar] + && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) || !(_nc_idcok && has_ic()))) { GoTo(lineno, firstChar); if ((oLastChar - nLastChar) > SP->_el_cost) { @@ -1205,14 +1218,16 @@ TransformLine(int const lineno) int oLastNonblank = oLastChar; /* find the last characters that really differ */ - while (newLine[nLastChar] == oldLine[oLastChar]) { - if (nLastChar != 0 - && oLastChar != 0) { - nLastChar--; - oLastChar--; - } else { + /* can be -1 if no characters differ */ + while (CharEq(newLine[nLastChar], oldLine[oLastChar])) { + /* don't split a wide char */ + if (isnac(newLine[nLastChar]) && + !CharEq(newLine[nLastChar - 1], oldLine[oLastChar - 1])) + break; + nLastChar--; + oLastChar--; + if (nLastChar == -1 || oLastChar == -1) break; - } } n = min(oLastChar, nLastChar); @@ -1247,7 +1262,7 @@ TransformLine(int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); DelChar(oLastChar - nLastChar); } } @@ -1258,7 +1273,7 @@ TransformLine(int const lineno) if (screen_columns > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns - firstChar) * sizeof(chtype)); + (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); } /* @@ -1269,7 +1284,7 @@ TransformLine(int const lineno) */ static void -ClearScreen(chtype blank) +ClearScreen(NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1279,7 +1294,7 @@ ClearScreen(chtype blank) #if NCURSES_EXT_FUNCS if (SP->_coloron && !SP->_default_color) { - _nc_do_color(COLOR_PAIR(SP->_current_attr), 0, FALSE, _nc_outch); + _nc_do_color((int) COLOR_PAIR(SP->_current_attr), 0, FALSE, _nc_outch); if (!back_color_erase) { fast_clear = FALSE; } @@ -1288,7 +1303,7 @@ ClearScreen(chtype blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clear_screen"); putp(clear_screen); SP->_cursrow = SP->_curscol = 0; @@ -1297,13 +1312,13 @@ ClearScreen(chtype blank) SP->_cursrow = SP->_curscol = -1; GoTo(0, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("clr_eos"); putp(clr_eos); } else if (clr_eol) { SP->_cursrow = SP->_curscol = -1; - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < screen_lines; i++) { GoTo(i, 0); TPUTS_TRACE("clr_eol"); @@ -1312,11 +1327,11 @@ ClearScreen(chtype blank) GoTo(0, 0); } } else { - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < screen_lines; i++) { GoTo(i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } GoTo(0, 0); } @@ -1337,7 +1352,7 @@ ClearScreen(chtype blank) */ static void -InsStr(chtype * line, int count) +InsStr(NCURSES_CH_T * line, int count) { TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); @@ -1348,7 +1363,7 @@ InsStr(chtype * line, int count) TPUTS_TRACE("parm_ich"); tputs(tparm(parm_ich, count), count, _nc_outch); while (count) { - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); line++; count--; } @@ -1356,7 +1371,7 @@ InsStr(chtype * line, int count) TPUTS_TRACE("enter_insert_mode"); putp(enter_insert_mode); while (count) { - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); putp(insert_padding); @@ -1370,7 +1385,7 @@ InsStr(chtype * line, int count) while (count) { TPUTS_TRACE("insert_character"); putp(insert_character); - PutAttrChar(*line); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); putp(insert_padding); @@ -1414,7 +1429,7 @@ DelChar(int count) ** Emit a string without waiting for update. */ -void +NCURSES_EXPORT(void) _nc_outstr(const char *str) { (void) putp(str); @@ -1455,40 +1470,40 @@ _nc_outstr(const char *str) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) +scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) { - int i, j; + int i; if (n == 1 && scroll_forward && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("scroll_forward"); tputs(scroll_forward, 0, _nc_outch); } else if (n == 1 && delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); } else if (parm_index && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_index"); tputs(tparm(parm_index, n, 0), n, _nc_outch); } else if (parm_delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_delete_line"); tputs(tparm(parm_delete_line, n, 0), n, _nc_outch); } else if (scroll_forward && top == miny && bot == maxy) { GoTo(bot, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); tputs(scroll_forward, 0, _nc_outch); } } else if (delete_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); @@ -1498,10 +1513,11 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) #if NCURSES_EXT_FUNCS if (FILL_BCE()) { + int j; for (i = 0; i < n; i++) { GoTo(bot - i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } } #endif @@ -1511,40 +1527,41 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, chtype blank) /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) +scroll_csr_backward(int n, int top, int bot, int miny, int maxy, + NCURSES_CH_T blank) { - int i, j; + int i; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("scroll_reverse"); tputs(scroll_reverse, 0, _nc_outch); } else if (n == 1 && insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); } else if (parm_rindex && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_rindex"); tputs(tparm(parm_rindex, n, 0), n, _nc_outch); } else if (parm_insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); TPUTS_TRACE("parm_insert_line"); tputs(tparm(parm_insert_line, n, 0), n, _nc_outch); } else if (scroll_reverse && top == miny && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); tputs(scroll_reverse, 0, _nc_outch); } } else if (insert_line && bot == maxy) { GoTo(top, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); @@ -1554,10 +1571,11 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) #if NCURSES_EXT_FUNCS if (FILL_BCE()) { + int j; for (i = 0; i < n; i++) { GoTo(top + i, 0); for (j = 0; j < screen_columns; j++) - PutChar(blank); + PutChar(CHREF(blank)); } } #endif @@ -1567,7 +1585,7 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, chtype blank) /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(int n, int del, int ins, chtype blank) +scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) { int i; @@ -1575,7 +1593,7 @@ scroll_idl(int n, int del, int ins, chtype blank) return ERR; GoTo(del, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); tputs(delete_line, 0, _nc_outch); @@ -1590,7 +1608,7 @@ scroll_idl(int n, int del, int ins, chtype blank) } GoTo(ins, 0); - UpdateAttrs(blank); + UpdateAttrs(AttrOf(blank)); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); tputs(insert_line, 0, _nc_outch); @@ -1607,11 +1625,11 @@ scroll_idl(int n, int del, int ins, chtype blank) return OK; } -int +NCURSES_EXPORT(int) _nc_scrolln(int n, int top, int bot, int maxy) /* scroll region from top to bot by n lines */ { - chtype blank = ClrBlank(stdscr); + NCURSES_CH_T blank = ClrBlank(stdscr); int i; bool cursor_saved = FALSE; int res; @@ -1666,13 +1684,14 @@ _nc_scrolln(int n, int top, int bot, int maxy) */ if (res != ERR && (non_dest_scroll_region || (memory_below && bot == maxy))) { + NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { GoTo(bot - n, 0); - ClrToEOS(BLANK); + ClrToEOS(blank2); } else { for (i = 0; i < n; i++) { GoTo(bot - i, 0); - ClrToEOL(BLANK, FALSE); + ClrToEOL(blank2, FALSE); } } } @@ -1711,9 +1730,10 @@ _nc_scrolln(int n, int top, int bot, int maxy) */ if (res != ERR && (non_dest_scroll_region || (memory_above && top == 0))) { + NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { GoTo(i + top, 0); - ClrToEOL(BLANK, FALSE); + ClrToEOL(blank2, FALSE); } } } @@ -1729,15 +1749,31 @@ _nc_scrolln(int n, int top, int bot, int maxy) return (OK); } -void +NCURSES_EXPORT(void) _nc_screen_resume(void) { /* make sure terminal is in a sane known state */ SP->_current_attr = A_NORMAL; newscr->_clear = TRUE; - if (SP->_coloron == TRUE && orig_pair) - putp(orig_pair); + /* reset color pairs and definitions */ + if (SP->_coloron || SP->_color_defs) + _nc_reset_colors(); + + /* restore user-defined colors, if any */ + if (SP->_color_defs < 0) { + int n; + SP->_color_defs = -(SP->_color_defs); + for (n = 0; n < SP->_color_defs; ++n) { + if (SP->_color_table[n].init) { + init_color(n, + SP->_color_table[n].r, + SP->_color_table[n].g, + SP->_color_table[n].b); + } + } + } + if (exit_attribute_mode) putp(exit_attribute_mode); else { @@ -1755,20 +1791,21 @@ _nc_screen_resume(void) putp(auto_right_margin ? enter_am_mode : exit_am_mode); } -void +NCURSES_EXPORT(void) _nc_screen_init(void) { _nc_screen_resume(); } /* wrap up screen handling */ -void +NCURSES_EXPORT(void) _nc_screen_wrap(void) { UpdateAttrs(A_NORMAL); #if NCURSES_EXT_FUNCS if (SP->_coloron && !SP->_default_color) { + NCURSES_CH_T blank = NewChar(BLANK_TEXT); SP->_default_color = TRUE; _nc_do_color(-1, 0, FALSE, _nc_outch); SP->_default_color = FALSE; @@ -1777,13 +1814,16 @@ _nc_screen_wrap(void) SP->_cursrow = screen_lines - 1; SP->_curscol = 0; - ClrToEOL(BLANK, TRUE); + ClrToEOL(blank, TRUE); } #endif + if (SP->_color_defs) { + _nc_reset_colors(); + } } #if USE_XMC_SUPPORT -void +NCURSES_EXPORT(void) _nc_do_xmc_glitch(attr_t previous) { attr_t chg = XMC_CHANGES(previous ^ SP->_current_attr); diff --git a/ncurses/widechar/lib_box_set.c b/ncurses/widechar/lib_box_set.c new file mode 100644 index 00000000..1c8480f7 --- /dev/null +++ b/ncurses/widechar/lib_box_set.c @@ -0,0 +1,113 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Authors: Sven Verdoolaege and Thomas Dickey 2001,2002 * + ****************************************************************************/ + +/* +** lib_box_set.c +** +** The routine wborder_set(). +** +*/ + +#include + +MODULE_ID("$Id: lib_box_set.c,v 1.3 2002/09/15 00:18:05 tom Exp $") + +NCURSES_EXPORT(int) +wborder_set(WINDOW *win, + const ARG_CH_T ls, const ARG_CH_T rs, + const ARG_CH_T ts, const ARG_CH_T bs, + const ARG_CH_T tl, const ARG_CH_T tr, + const ARG_CH_T bl, const ARG_CH_T br) +{ + NCURSES_SIZE_T i; + NCURSES_SIZE_T endx, endy; + NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; + + T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), + win, + _tracech_t2(1, ls), + _tracech_t2(2, rs), + _tracech_t2(3, ts), + _tracech_t2(4, bs), + _tracech_t2(5, tl), + _tracech_t2(6, tr), + _tracech_t2(7, bl), + _tracech_t2(8, br))); + + if (!win) + returnCode(ERR); + +#define RENDER_WITH_DEFAULT(ch,def) w ##ch = _nc_render(win, (ch == 0) ? *def : *ch) + + RENDER_WITH_DEFAULT(ls, WACS_VLINE); + RENDER_WITH_DEFAULT(rs, WACS_VLINE); + RENDER_WITH_DEFAULT(ts, WACS_HLINE); + RENDER_WITH_DEFAULT(bs, WACS_HLINE); + RENDER_WITH_DEFAULT(tl, WACS_ULCORNER); + RENDER_WITH_DEFAULT(tr, WACS_URCORNER); + RENDER_WITH_DEFAULT(bl, WACS_LLCORNER); + RENDER_WITH_DEFAULT(br, WACS_LRCORNER); + + T(("using %s, %s, %s, %s, %s, %s, %s, %s", + _tracech_t2(1, CHREF(wls)), + _tracech_t2(2, CHREF(wrs)), + _tracech_t2(3, CHREF(wts)), + _tracech_t2(4, CHREF(wbs)), + _tracech_t2(5, CHREF(wtl)), + _tracech_t2(6, CHREF(wtr)), + _tracech_t2(7, CHREF(wbl)), + _tracech_t2(8, CHREF(wbr)))); + + endx = win->_maxx; + endy = win->_maxy; + + for (i = 0; i <= endx; i++) { + win->_line[0].text[i] = wts; + win->_line[endy].text[i] = wbs; + } + win->_line[endy].firstchar = win->_line[0].firstchar = 0; + win->_line[endy].lastchar = win->_line[0].lastchar = endx; + + for (i = 0; i <= endy; i++) { + win->_line[i].text[0] = wls; + win->_line[i].text[endx] = wrs; + win->_line[i].firstchar = 0; + win->_line[i].lastchar = endx; + } + win->_line[0].text[0] = wtl; + win->_line[0].text[endx] = wtr; + win->_line[endy].text[0] = wbl; + win->_line[endy].text[endx] = wbr; + + _nc_synchook(win); + returnCode(OK); +} diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c new file mode 100644 index 00000000..86b5e2ef --- /dev/null +++ b/ncurses/widechar/lib_cchar.c @@ -0,0 +1,114 @@ +/**************************************************************************** + * Copyright (c) 2001,2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* +** lib_cchar.c +** +** The routines setcchar() and getcchar(). +** +*/ + +#include + +MODULE_ID("$Id: lib_cchar.c,v 1.6 2002/08/10 22:27:37 tom Exp $") + +/* + * The SuSv2 description leaves some room for interpretation. We'll assume wch + * is L'\0' terminated, contains at most one character with strictly positive + * width, which must be the first, and contains no characters of negative + * width. + */ +NCURSES_EXPORT(int) +setcchar(cchar_t * wcval, const wchar_t * wch, const attr_t attrs, + short color_pair, const void *opts) +{ + int i; + int len; + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%ld,%d,%p)"), + wcval, _nc_viswbuf(wch), attrs, color_pair, opts)); + + if (opts != NULL || (len = wcslen(wch)) > CCHARW_MAX + || (len > 0 && wcwidth(wch[0]) < 0)) { + code = ERR; + } else { + + for (i = 1; i < len; ++i) { + if (wcwidth(wch[i]) != 0) { + code = ERR; + break; + } + } + + if (code != ERR) { + memset(wcval, 0, sizeof(*wcval)); + + if (len != 0) { + SetAttr(*wcval, attrs | color_pair); + memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); + TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, + _tracecchar_t(wcval))); + } + } + } + + TR(TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} + +NCURSES_EXPORT(int) +getcchar(const cchar_t * wcval, wchar_t * wch, attr_t * attrs, + short *color_pair, void *opts) +{ + wchar_t *wp; + int len; + int code = ERR; + + TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), + wcval, wch, attrs, color_pair, opts)); + + if (opts == NULL) { + len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? wp - wcval->chars + : CCHARW_MAX; + + if (wch == NULL) { + code = len; + } else if (len >= 0) { + *attrs = AttrOf(*wcval); + *color_pair = AttrOf(*wcval) & A_COLOR; + wmemcpy(wch, wcval->chars, (unsigned) len); + wch[len] = L'\0'; + code = OK; + } + } + + TR(TRACE_CCALLS, (T_RETURN("%d"), code)); + return (code); +} diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c new file mode 100644 index 00000000..7d645537 --- /dev/null +++ b/ncurses/widechar/lib_erasewchar.c @@ -0,0 +1,77 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ + +#include + +MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") + +/* + * erasewchar() + * + * Return erase character as given in cur_term->Ottyb. + * + */ + +NCURSES_EXPORT(int) +erasewchar(wchar_t * wch) +{ + int value; + int result = ERR; + + T((T_CALLED("erasewchar()"))); + if ((value = erasechar()) != ERR) { + *wch = value; + result = OK; + } + returnCode(result); +} + +/* + * killwchar() + * + * Return kill character as given in cur_term->Ottyb. + * + */ + +NCURSES_EXPORT(int) +killwchar(wchar_t * wch) +{ + int value; + int result = ERR; + + T((T_CALLED("killwchar()"))); + if ((value = killchar()) != ERR) { + *wch = value; + result = OK; + } + returnCode(result); +} diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c new file mode 100644 index 00000000..e2a7ce55 --- /dev/null +++ b/ncurses/widechar/lib_get_wch.c @@ -0,0 +1,99 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ + +/* +** lib_get_wch.c +** +** The routine get_wch(). +** +*/ + +#include + +MODULE_ID("$Id: lib_get_wch.c,v 1.5 2002/09/02 00:04:25 tom Exp $") + +NCURSES_EXPORT(int) +wget_wch(WINDOW *win, wint_t * result) +{ + int code; + char buffer[(MB_LEN_MAX * 9) + 1]; /* allow some redundant shifts */ + int status; + mbstate_t state; + size_t count = 0; + unsigned long value; + wchar_t wch; + + T((T_CALLED("wget_wch(%p)"), win)); + /* + * We can get a stream of single-byte characters and KEY_xxx codes from + * _nc_wgetch(), while we want to return a wide character or KEY_xxx code. + */ + for (;;) { + T(("reading %d of %d", count + 1, sizeof(buffer))); + code = _nc_wgetch(win, &value, TRUE); + if (code == ERR) { + break; + } else if (code == KEY_CODE_YES) { + /* + * If we were processing an incomplete multibyte character, return + * an error since we have a KEY_xxx code which interrupts it. For + * some cases, we could improve this by writing a new version of + * lib_getch.c(!), but it is not clear whether the improvement + * would be worth the effort. + */ + if (count != 0) { + ungetch(value); + code = ERR; + } + break; + } else if (count + 1 >= sizeof(buffer)) { + ungetch(value); + code = ERR; + break; + } else { + buffer[count++] = UChar(value); + memset(&state, 0, sizeof(state)); + status = mbrlen(buffer, count, &state); + if (status >= 0) { + memset(&state, 0, sizeof(state)); + if ((int) mbrtowc(&wch, buffer, count, &state) != status) { + code = ERR; /* the two calls should match */ + } + value = wch; + break; + } + } + } + *result = value; + T(("result %#lo", value)); + returnCode(code); +} diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c new file mode 100644 index 00000000..9467e53f --- /dev/null +++ b/ncurses/widechar/lib_get_wstr.c @@ -0,0 +1,205 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ + +/* +** lib_get_wstr.c +** +** The routine wgetn_wstr(). +** +*/ + +#include +#include + +MODULE_ID("$Id: lib_get_wstr.c,v 1.4 2002/07/20 19:28:29 tom Exp $") + +/* + * This wipes out the last character, no matter whether it was a tab, control + * or other character, and handles reverse wraparound. + */ +static wchar_t * +WipeOut(WINDOW *win, int y, int x, wchar_t * first, wchar_t * last, bool echoed) +{ + if (last > first) { + *--last = '\0'; + if (echoed) { + int y1 = win->_cury; + int x1 = win->_curx; + + wmove(win, y, x); + waddwstr(win, first); + getyx(win, y, x); + while (win->_cury < y1 + || (win->_cury == y1 && win->_curx < x1)) + waddch(win, (chtype) ' '); + + wmove(win, y, x); + } + } + return last; +} + +NCURSES_EXPORT(int) +wgetn_wstr(WINDOW *win, wint_t * str, int maxlen) +{ + TTY buf; + bool oldnl, oldecho, oldraw, oldcbreak; + wint_t erasec; + wint_t killc; + wchar_t *oldstr; + wchar_t *tmpstr; + wint_t ch; + int y, x, code; + + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + + if (!win) + returnCode(ERR); + + _nc_get_tty_mode(&buf); + + oldnl = SP->_nl; + oldecho = SP->_echo; + oldraw = SP->_raw; + oldcbreak = SP->_cbreak; + nl(); + noecho(); + noraw(); + cbreak(); + + erasec = erasechar(); + killc = killchar(); + + assert(sizeof(wchar_t) == sizeof(wint_t)); + oldstr = (wchar_t *) str; + tmpstr = (wchar_t *) str; + + getyx(win, y, x); + + if (is_wintouched(win) || (win->_flags & _HASMOVED)) + wrefresh(win); + + while ((code = wget_wch(win, &ch)) != ERR) { + if (code == KEY_CODE_YES) { + /* + * Some terminals (the Wyse-50 is the most common) generate a \n + * from the down-arrow key. With this logic, it's the user's + * choice whether to set kcud=\n for wget_wch(); terminating + * *getn_wstr() with \n should work either way. + */ + if (ch == '\n' + || ch == '\r' + || ch == KEY_DOWN + || ch == KEY_ENTER) { + if (oldecho == TRUE + && win->_cury == win->_maxy + && win->_scroll) + wechochar(win, (chtype) '\n'); + break; + } + if (ch == erasec || ch == KEY_LEFT || ch == KEY_BACKSPACE) { + if (tmpstr > oldstr) { + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + } + } else if (ch == killc) { + while (tmpstr > oldstr) { + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + } + } else { + beep(); + } + } else if (maxlen >= 0 && tmpstr - oldstr >= maxlen) { + beep(); + } else { + *tmpstr++ = ch; + if (oldecho == TRUE) { + int oldy = win->_cury; + cchar_t tmp; + + setcchar(&tmp, tmpstr - 1, A_NORMAL, 0, NULL); + if (wadd_wch(win, &tmp) == ERR) { + /* + * We can't really use the lower-right corner for input, + * since it'll mess up bookkeeping for erases. + */ + win->_flags &= ~_WRAPPED; + waddch(win, (chtype) ' '); + tmpstr = WipeOut(win, y, x, oldstr, tmpstr, oldecho); + continue; + } else if (win->_flags & _WRAPPED) { + /* + * If the last waddch forced a wrap & scroll, adjust our + * reference point for erasures. + */ + if (win->_scroll + && oldy == win->_maxy + && win->_cury == win->_maxy) { + if (--y <= 0) { + y = 0; + } + } + win->_flags &= ~_WRAPPED; + } + wrefresh(win); + } + } + } + + win->_curx = 0; + win->_flags &= ~_WRAPPED; + if (win->_cury < win->_maxy) + win->_cury++; + wrefresh(win); + + /* Restore with a single I/O call, to fix minor asymmetry between + * raw/noraw, etc. + */ + SP->_nl = oldnl; + SP->_echo = oldecho; + SP->_raw = oldraw; + SP->_cbreak = oldcbreak; + + (void) _nc_set_tty_mode(&buf); + + *tmpstr = 0; + if (code == ERR) { + if (tmpstr == oldstr) { + *tmpstr++ = (wchar_t)WEOF; + *tmpstr = 0; + } + returnCode(ERR); + } + + T(("wgetn_wstr returns %s", _nc_viswbuf(oldstr))); + + returnCode(OK); +} diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c new file mode 100644 index 00000000..43175de8 --- /dev/null +++ b/ncurses/widechar/lib_hline_set.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_hline_set.c +** +** The routine whline_set(). +** +*/ + +#include + +MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") + +NCURSES_EXPORT(int) +whline_set(WINDOW *win, const cchar_t * ch, int n) +{ + int code = ERR; + NCURSES_SIZE_T start; + NCURSES_SIZE_T end; + + T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + + if (win) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T wch; + + start = win->_curx; + end = start + n - 1; + if (end > win->_maxx) + end = win->_maxx; + + CHANGED_RANGE(line, start, end); + + if (ch == 0) + wch = *WACS_HLINE; + else + wch = *ch; + wch = _nc_render(win, wch); + + while (end >= start) { + line->text[end] = wch; + end--; + } + + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c new file mode 100644 index 00000000..5e110cb6 --- /dev/null +++ b/ncurses/widechar/lib_in_wch.c @@ -0,0 +1,60 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_in_wch.c +** +** The routine win_wch(). +** +*/ + +#include + +MODULE_ID("$Id: lib_in_wch.c,v 1.2 2002/08/03 20:23:29 tom Exp $") + +NCURSES_EXPORT(int) +win_wch(WINDOW *win, cchar_t * wcval) +{ + int row, col; + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + if (win != 0 + && wcval != 0) { + getyx(win, row, col); + + *wcval = win->_line[row].text[col]; + } else { + code = ERR; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_in_wchnstr.c b/ncurses/widechar/lib_in_wchnstr.c new file mode 100644 index 00000000..a757e727 --- /dev/null +++ b/ncurses/widechar/lib_in_wchnstr.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_in_wchnstr.c +** +** The routine win_wchnstr(). +** +*/ + +#include + +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.2 2002/08/03 20:38:45 tom Exp $") + +NCURSES_EXPORT(int) +win_wchnstr(WINDOW *win, cchar_t * wchstr, int n) +{ + int code = OK; + + TR(TRACE_CCALLS, (T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + if (win != 0 + && wchstr != 0) { + + if (n < 0) { + n = getmaxx(win) + 1 - getcurx(win); + } + while (n-- > 0) + win_wch(win, wchstr++); + } else { + code = ERR; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_ins_nwstr.c b/ncurses/widechar/lib_ins_nwstr.c new file mode 100644 index 00000000..4b737713 --- /dev/null +++ b/ncurses/widechar/lib_ins_nwstr.c @@ -0,0 +1,84 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_ins_nwstr.c +** +** The routine wins_nwstr(). +** +*/ + +#include +#include + +MODULE_ID("$Id: lib_ins_nwstr.c,v 1.3 2002/09/28 16:31:33 tom Exp $") + +NCURSES_EXPORT(int) +wins_nwstr(WINDOW *win, const wchar_t * wstr, int n) +{ + int code = ERR; + NCURSES_SIZE_T oy; + NCURSES_SIZE_T ox; + const wchar_t *cp; + + T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr,n), n)); + + if (win != 0 + && wstr != 0 + && wcwidth(*wstr) > 0) { + code = OK; + if (n < 1) + n = wcslen(wstr); + oy = win->_cury; + ox = win->_curx; + for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { + NCURSES_CH_T wch; + SetChar2(wch, *cp); + if (*cp == '\n' || *cp == '\r' || *cp == '\t' || *cp == '\b') { + _nc_waddch_nosync(win, wch); + } else if (is7bits(*cp) && iscntrl(*cp)) { + winsch(win, ' ' + (chtype) (*cp)); + winsch(win, (chtype) '^'); + win->_curx += 2; + } else if (wins_wch(win, &wch) == ERR + || win->_curx > win->_maxx) { + break; + } + } + + win->_curx = ox; + win->_cury = oy; + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c new file mode 100644 index 00000000..0821ee59 --- /dev/null +++ b/ncurses/widechar/lib_ins_wch.c @@ -0,0 +1,65 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_ins_wch.c +** +** The routine wins_wch(). +** +*/ + +#include + +MODULE_ID("$Id: lib_ins_wch.c,v 1.1 2002/03/10 22:25:06 tom Exp $") + +NCURSES_EXPORT(int) +wins_wch(WINDOW *win, const cchar_t * wch) +{ + int code = ERR; + + T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + + if (win) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - 1; + + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; + + *temp1 = _nc_render(win, *wch); + code = OK; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c new file mode 100644 index 00000000..91b1e0f1 --- /dev/null +++ b/ncurses/widechar/lib_inwstr.c @@ -0,0 +1,100 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_inwstr.c +** +** The routines winnwstr() and winwstr(). +** +*/ + +#include + +MODULE_ID("$Id: lib_inwstr.c,v 1.3 2002/10/06 00:56:36 tom Exp $") + +NCURSES_EXPORT(int) +winnwstr(WINDOW *win, wchar_t * wstr, int n) +{ + int row, col, inx; + int count = 0; + int last = 0; + cchar_t *text; + wchar_t wch; + + T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + if (wstr != 0) { + if (win) { + getyx(win, row, col); + + text = win->_line[row].text; + while (count < n && count != ERR) { + if (!isnac(text[col])) { + for (inx = 0; (inx < CCHARW_MAX) + && ((wch = text[col].chars[inx]) != 0); + ++inx) { + if (count + 1 > n) { + if ((count = last) == 0) { + count = ERR; /* error if we store nothing */ + } + break; + } + wstr[count++] = wch; + } + } + last = count; + if (++col > win->_maxx) { + break; + } + } + } + if (count > 0) { + wstr[count] = '\0'; + T(("winnwstr returns %s", _nc_viswbuf(wstr))); + } + } + returnCode(count); +} + +/* + * X/Open says winwstr() returns OK if not ERR. If that is not a blunder, it + * must have a null termination on the string (see above). Unlike winnstr(), + * it does not define what happens for a negative count with winnwstr(). + */ +NCURSES_EXPORT(int) +winwstr(WINDOW *win, wchar_t * wstr) +{ + int result = OK; + T((T_CALLED("winwstr(%p,%p)"), win, wstr)); + if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) + result = ERR; + returnCode(result); +} diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c new file mode 100644 index 00000000..7a062fd2 --- /dev/null +++ b/ncurses/widechar/lib_unget_wch.c @@ -0,0 +1,76 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ + +/* +** lib_unget_wch.c +** +** The routine unget_wch(). +** +*/ + +#include + +MODULE_ID("$Id: lib_unget_wch.c,v 1.3 2002/06/29 21:11:02 tom Exp $") + +NCURSES_EXPORT(int) +unget_wch(const wchar_t wch) +{ + int result = OK; + mbstate_t state; + size_t length; + int n; + + T((T_CALLED("unget_wch(%#lx)"), wch)); + + memset(&state, 0, sizeof(state)); + length = wcrtomb(0, wch, &state); + + if (length != (size_t) (-1) + && length != 0) { + char *string = malloc(length); + + memset(&state, 0, sizeof(state)); + wcrtomb(string, wch, &state); + + for (n = (int) (length - 1); n >= 0; --n) { + if (ungetch(string[n]) != OK) { + result = ERR; + break; + } + } + free(string); + } else { + result = ERR; + } + + returnCode(result); +} diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c new file mode 100644 index 00000000..06e7880d --- /dev/null +++ b/ncurses/widechar/lib_vid_attr.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ + +#include +#include + +MODULE_ID("$Id: lib_vid_attr.c,v 1.1 2002/05/11 20:55:26 tom Exp $") + +#define set_color(mode, pair) mode &= ~A_COLOR; mode |= COLOR_PAIR(pair) + +NCURSES_EXPORT(int) +vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) +{ + T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); + set_color(newmode, pair); + returnCode(vidputs(newmode, outc)); +} + +#undef vid_attr +NCURSES_EXPORT(int) +vid_attr(attr_t newmode, short pair, void *opts GCC_UNUSED) +{ + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + set_color(newmode, pair); + returnCode(vidputs(newmode, _nc_outch)); +} + +NCURSES_EXPORT(attr_t) +term_attrs(void) +{ + attr_t attrs = WA_NORMAL; + + T((T_CALLED("term_attrs()"))); + if (enter_alt_charset_mode) + attrs |= WA_ALTCHARSET; + + if (enter_blink_mode) + attrs |= WA_BLINK; + + if (enter_bold_mode) + attrs |= WA_BOLD; + + if (enter_dim_mode) + attrs |= WA_DIM; + + if (enter_reverse_mode) + attrs |= WA_REVERSE; + + if (enter_standout_mode) + attrs |= WA_STANDOUT; + + if (enter_protected_mode) + attrs |= WA_PROTECT; + + if (enter_secure_mode) + attrs |= WA_INVIS; + + if (enter_underline_mode) + attrs |= WA_UNDERLINE; + + if (SP->_coloron) + attrs |= A_COLOR; + + returnAttr(attrs); +} diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c new file mode 100644 index 00000000..af42df1f --- /dev/null +++ b/ncurses/widechar/lib_vline_set.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +/* +** lib_vline_set.c +** +** The routine wvline_set(). +** +*/ + +#include + +MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") + +NCURSES_EXPORT(int) +wvline_set(WINDOW *win, const cchar_t * ch, int n) +{ + int code = ERR; + NCURSES_SIZE_T row, col; + NCURSES_SIZE_T end; + + T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + + if (win) { + NCURSES_CH_T wch; + row = win->_cury; + col = win->_curx; + end = row + n - 1; + if (end > win->_maxy) + end = win->_maxy; + + if (ch == 0) + wch = *WACS_VLINE; + else + wch = *ch; + wch = _nc_render(win, wch); + + while (end >= row) { + struct ldat *line = &(win->_line[end]); + line->text[col] = wch; + CHANGED_CELL(line, col); + end--; + } + + _nc_synchook(win); + code = OK; + } + returnCode(code); +} diff --git a/ncurses/widechar/lib_wacs.c b/ncurses/widechar/lib_wacs.c new file mode 100644 index 00000000..4f8a3f6e --- /dev/null +++ b/ncurses/widechar/lib_wacs.c @@ -0,0 +1,127 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas Dickey 2002 * + ****************************************************************************/ + +#include +#include + +MODULE_ID("$Id: lib_wacs.c,v 1.5 2002/08/31 19:44:17 tom Exp $") + +NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; + +static int +_nc_unicode_locale(void) +{ + char *s; + if (((s = getenv("LC_ALL")) != 0 && *s != '\0') + || ((s = getenv("LC_ALL")) != 0 && *s != '\0') + || ((s = getenv("LC_ALL")) != 0 && *s != '\0')) { + if (strstr(s, ".UTF-8") != 0) + return 1; + } + return 0; +} + +NCURSES_EXPORT(void) +_nc_init_wacs(void) +{ + /* *INDENT-OFF* */ + static const struct { + int map; + int value[2]; + } table[] = { + /* VT100 symbols */ + { 'l', { '+', 0x250c }}, /* upper left corner */ + { 'm', { '+', 0x2514 }}, /* lower left corner */ + { 'k', { '+', 0x2510 }}, /* upper right corner */ + { 'j', { '+', 0x2518 }}, /* lower right corner */ + { 't', { '+', 0x251c }}, /* tee pointing left */ + { 'u', { '+', 0x2524 }}, /* tee pointing right */ + { 'v', { '+', 0x2534 }}, /* tee pointing up */ + { 'w', { '+', 0x252c }}, /* tee pointing down */ + { 'q', { '-', 0x2500 }}, /* horizontal line */ + { 'x', { '|', 0x2502 }}, /* vertical line */ + { 'n', { '+', 0x253c }}, /* large plus or crossover */ + { 'o', { '~', 0x23ba }}, /* scan line 1 */ + { 's', { '_', 0x23bd }}, /* scan line 9 */ + { '`', { '+', 0x25c6 }}, /* diamond */ + { 'a', { ':', 0x2592 }}, /* checker board (stipple) */ + { 'f', { '\'', 0x00b0 }}, /* degree symbol */ + { 'g', { '#', 0x00b1 }}, /* plus/minus */ + { '~', { 'o', 0x00b7 }}, /* bullet */ + /* Teletype 5410v1 symbols */ + { ',', { '<', 0x2190 }}, /* arrow pointing left */ + { '+', { '>', 0x2192 }}, /* arrow pointing right */ + { '.', { 'v', 0x2193 }}, /* arrow pointing down */ + { '-', { '^', 0x2191 }}, /* arrow pointing up */ + { 'h', { '#', 0x2592 }}, /* board of squares */ + { 'i', { '#', 0x2603 }}, /* lantern symbol */ + { '0', { '#', 0x25ae }}, /* solid square block */ + /* these defaults were invented for ncurses */ + { 'p', { '-', 0x23bb }}, /* scan line 3 */ + { 'r', { '-', 0x23bc }}, /* scan line 7 */ + { 'y', { '<', 0x2264 }}, /* less-than-or-equal-to */ + { 'z', { '>', 0x2265 }}, /* greater-than-or-equal-to */ + { '{', { '*', 0x03c0 }}, /* greek pi */ + { '|', { '!', 0x2260 }}, /* not-equal */ + { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ + }; + /* *INDENT-ON* */ + + unsigned n, m; + int active = _nc_unicode_locale(); + + /* + * If we're running in a UTF-8 locale, will use the Unicode equivalents + * rather than the terminfo information. Actually the terminfo should + * be the rule, but there are people who are offended by the notion that + * a Unicode-capable terminal would have something resembling a mode. + * So the smacs/rmacs may be disabled -- sometime. + */ + T(("initializing WIDE-ACS map (Unicode is%s active)", + active ? "" : " not")); + + _nc_wacs = typeCalloc(cchar_t, ACS_LEN); + for (n = 0; n < SIZEOF(table); ++n) { + m = table[n].map; + if (active) { + SetChar(_nc_wacs[m], table[n].value[active], A_NORMAL); + } else if (acs_map[m] & A_ALTCHARSET) { + SetChar(_nc_wacs[m], m, A_ALTCHARSET); + } else { + SetChar(_nc_wacs[m], table[n].value[0], A_NORMAL); + } + T(("#%d, SetChar(%c, %#04x) = %s", + n, m, + table[n].value[active], + _tracecchar_t(&_nc_wacs[m]))); + } +} diff --git a/ncurses/widechar/lib_wunctrl.c b/ncurses/widechar/lib_wunctrl.c new file mode 100644 index 00000000..f4887d12 --- /dev/null +++ b/ncurses/widechar/lib_wunctrl.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 2001 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* +** lib_wunctrl.c +** +** The routine wunctrl(). +** +*/ + +#include + +#if USE_WIDEC_SUPPORT + +MODULE_ID("$Id: lib_wunctrl.c,v 1.6 2001/09/22 19:18:02 tom Exp $") + +NCURSES_EXPORT(wchar_t *) +wunctrl(cchar_t * wc) +{ + static wchar_t str[5], *sp; + + if (Charable(*wc)) { + const char *p; + for (p = unctrl(wctob(CharOf(*wc))), sp = str; *p;) + *sp++ = btowc(*p++); + return str; + } else + return wc->chars; +} + +#endif diff --git a/panel/Makefile.in b/panel/Makefile.in index a33ca9c7..c3592526 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.35 2000/10/14 17:57:02 Johnny.C.Lam Exp $ +# $Id: Makefile.in,v 1.41 2002/01/20 00:41:18 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -50,6 +50,7 @@ DESTDIR = @DESTDIR@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ @@ -58,6 +59,7 @@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_PROG = @INSTALL_PROG@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -70,7 +72,7 @@ CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ \ +CPPFLAGS = @CPPFLAGS@ -I@top_srcdir@/ncurses \ -DHAVE_CONFIG_H CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -86,7 +88,7 @@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) LINK = $(LIBTOOL) $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ -SHLIB_DIRS = -L../lib -L$(libdir) +SHLIB_DIRS = -L../lib SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ MK_SHARED_LIB = @MK_SHARED_LIB@ @@ -98,6 +100,8 @@ ABI_VERSION = @cf_cv_abi_version@ RANLIB = @RANLIB@ +IMPORT_LIB = @IMPORT_LIB@ +SHARED_LIB = @SHARED_LIB@ LIBRARIES = @LIBS_TO_MAKE@ LINT = @LINT@ @@ -114,8 +118,9 @@ install :: $(AUTO_SRC) $(LIBRARIES) sources: $(AUTO_SRC) +$(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -134,7 +139,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -f $(AUTO_SRC) diff --git a/panel/llib-lpanel b/panel/llib-lpanel index 2ca1a3e3..42bb0f53 100644 --- a/panel/llib-lpanel +++ b/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997 * + * Author: Thomas E. Dickey 1997,2002 * ****************************************************************************/ /* LINTLIBRARY */ @@ -35,6 +35,40 @@ #include "panel.priv.h" +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } /* ./p_above.c */ diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw new file mode 100644 index 00000000..0c05a1e4 --- /dev/null +++ b/panel/llib-lpanelw @@ -0,0 +1,177 @@ +/**************************************************************************** + * Copyright (c) 2002 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2002 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include "panel.priv.h" + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/panel/p_above.c b/panel/p_above.c index fa32196d..36e67d2b 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,10 +35,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.3 1999/09/18 11:03:28 juergen Exp $") +MODULE_ID("$Id: p_above.c,v 1.4 2000/12/10 02:20:44 tom Exp $") -PANEL* -panel_above(const PANEL *pan) +NCURSES_EXPORT(PANEL *) +panel_above (const PANEL *pan) { if(!pan) { diff --git a/panel/p_below.c b/panel/p_below.c index a7eb4705..5420ff9e 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,10 +35,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.3 1999/09/18 11:03:33 juergen Exp $") +MODULE_ID("$Id: p_below.c,v 1.4 2000/12/10 02:20:44 tom Exp $") -PANEL* -panel_below(const PANEL *pan) +NCURSES_EXPORT(PANEL*) +panel_below (const PANEL *pan) { if(!pan) { diff --git a/panel/p_bottom.c b/panel/p_bottom.c index f6718642..0928e77e 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.7 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.9 2001/02/24 23:46:33 tom Exp $") -int -bottom_panel(PANEL *pan) +NCURSES_EXPORT(int) +bottom_panel (PANEL *pan) { int err = OK; @@ -49,7 +49,7 @@ bottom_panel(PANEL *pan) dBug(("--> bottom_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan,err,FALSE); + HIDE_PANEL(pan,err,OK); assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); dStack("",1,pan); diff --git a/panel/p_delete.c b/panel/p_delete.c index 3f975d3b..1d4670ef 100644 --- a/panel/p_delete.c +++ b/panel/p_delete.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,16 +36,16 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.4 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_delete.c,v 1.6 2001/02/24 23:46:41 tom Exp $") -int -del_panel(PANEL *pan) +NCURSES_EXPORT(int) +del_panel (PANEL *pan) { int err = OK; if(pan) { dBug(("--> del_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan,err,FALSE); + HIDE_PANEL(pan,err,OK); free((void *)pan); } else diff --git a/panel/p_hidden.c b/panel/p_hidden.c index 7a13ec43..d5d13f37 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.4 1999/11/22 18:02:41 juergen Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.5 2000/12/10 02:20:44 tom Exp $") -int -panel_hidden(const PANEL *pan) +NCURSES_EXPORT(int) +panel_hidden (const PANEL *pan) { if(!pan) return(ERR); diff --git a/panel/p_hide.c b/panel/p_hide.c index ecc9eed2..75599737 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.5 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_hide.c,v 1.7 2001/02/24 23:46:45 tom Exp $") -int -hide_panel(register PANEL *pan) +NCURSES_EXPORT(int) +hide_panel (register PANEL *pan) { int err = OK; @@ -49,7 +49,7 @@ hide_panel(register PANEL *pan) dBug(("--> hide_panel %s", USER_PTR(pan->user))); dStack("",1,pan); - HIDE_PANEL(pan,err,TRUE); + HIDE_PANEL(pan,err,ERR); dStack("",9,pan); diff --git a/panel/p_move.c b/panel/p_move.c index d34b4fb8..d7dbd2ea 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,16 +36,18 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.5 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_move.c,v 1.7 2001/02/24 23:41:35 tom Exp $") -int -move_panel(PANEL *pan, int starty, int startx) +NCURSES_EXPORT(int) +move_panel (PANEL *pan, int starty, int startx) { if(!pan) return(ERR); - if (IS_LINKED(pan)) - PANEL_UPDATE(pan,(PANEL*)0, TRUE); + if (IS_LINKED(pan)) { + Touchpan(pan); + PANEL_UPDATE(pan,(PANEL*)0); + } if (mvwin(pan->win,starty,startx)) return(ERR); diff --git a/panel/p_new.c b/panel/p_new.c index 43542fea..3dfd8069 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.5 1999/11/22 18:02:41 juergen Exp $") +MODULE_ID("$Id: p_new.c,v 1.6 2000/12/10 02:20:44 tom Exp $") #ifdef TRACE static char* stdscr_id; @@ -74,8 +74,8 @@ root_panel(void) return _nc_stdscr_pseudo_panel; } -PANEL * -new_panel(WINDOW *win) +NCURSES_EXPORT(PANEL *) +new_panel (WINDOW *win) { PANEL *pan = (PANEL*)0; diff --git a/panel/p_replace.c b/panel/p_replace.c index b7d51746..a3b88cbf 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,16 +36,18 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.5 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_replace.c,v 1.7 2001/02/24 23:41:38 tom Exp $") -int -replace_panel(PANEL *pan, WINDOW *win) +NCURSES_EXPORT(int) +replace_panel (PANEL *pan, WINDOW *win) { if(!pan) return(ERR); - if (IS_LINKED(pan)) - PANEL_UPDATE(pan,(PANEL*)0, TRUE); + if (IS_LINKED(pan)) { + Touchpan(pan); + PANEL_UPDATE(pan,(PANEL*)0); + } pan->win = win; diff --git a/panel/p_show.c b/panel/p_show.c index 4fc7b1db..0e1968fd 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.7 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_show.c,v 1.9 2001/02/24 23:46:50 tom Exp $") -int -show_panel(PANEL *pan) +NCURSES_EXPORT(int) +show_panel (PANEL *pan) { int err = OK; @@ -51,7 +51,7 @@ show_panel(PANEL *pan) dBug(("--> show_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan,err,FALSE); + HIDE_PANEL(pan,err,OK); dStack("",1,pan); assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); diff --git a/panel/p_top.c b/panel/p_top.c index 2ce5bb3e..aa7d9d42 100644 --- a/panel/p_top.c +++ b/panel/p_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.3 2000/12/10 02:20:44 tom Exp $") -int -top_panel(PANEL *pan) +NCURSES_EXPORT(int) +top_panel (PANEL *pan) { return(show_panel(pan)); } diff --git a/panel/p_update.c b/panel/p_update.c index 983d0b60..1a03739d 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.5 1999/11/25 13:49:26 juergen Exp $") +MODULE_ID("$Id: p_update.c,v 1.7 2001/02/24 23:41:42 tom Exp $") -void -update_panels(void) +NCURSES_EXPORT(void) +update_panels (void) { PANEL *pan; @@ -47,7 +47,7 @@ update_panels(void) pan = _nc_bottom_panel; while(pan && pan->above) { - PANEL_UPDATE(pan,pan->above, FALSE); + PANEL_UPDATE(pan,pan->above); pan = pan->above; } diff --git a/panel/p_user.c b/panel/p_user.c index 28b6526b..de1ec7dd 100644 --- a/panel/p_user.c +++ b/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.3 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.4 2000/12/10 02:20:44 tom Exp $") -int -set_panel_userptr(PANEL *pan, NCURSES_CONST void *uptr) +NCURSES_EXPORT(int) +set_panel_userptr +(PANEL *pan, NCURSES_CONST void *uptr) { if(!pan) return(ERR); @@ -47,8 +48,8 @@ set_panel_userptr(PANEL *pan, NCURSES_CONST void *uptr) return(OK); } -NCURSES_CONST void* -panel_userptr(const PANEL *pan) +NCURSES_EXPORT(NCURSES_CONST void*) +panel_userptr (const PANEL *pan) { return(pan ? pan->user : (NCURSES_CONST void *)0); } diff --git a/panel/p_win.c b/panel/p_win.c index 9c5a313d..2b9f5b0c 100644 --- a/panel/p_win.c +++ b/panel/p_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,10 +36,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.3 2000/12/10 02:20:43 tom Exp $") -WINDOW* -panel_window(const PANEL *pan) +NCURSES_EXPORT(WINDOW *) +panel_window (const PANEL *pan) { return(pan ? pan->win : (WINDOW *)0); } diff --git a/panel/panel.c b/panel/panel.c index 1b79b77f..a56d57ef 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,11 +34,12 @@ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.18 1999/09/29 15:22:32 juergen Exp $") +MODULE_ID("$Id: panel.c,v 1.20 2001/02/24 23:17:26 tom Exp $") #ifdef TRACE #ifndef TRACE_TXT -const char *_nc_my_visbuf(const void *ptr) +NCURSES_EXPORT(const char *) +_nc_my_visbuf (const void *ptr) { char temp[32]; if (ptr != 0) @@ -55,8 +56,9 @@ const char *_nc_my_visbuf(const void *ptr) dPanel(text,pan) --------------------------------------------------------------------------*/ #ifdef TRACE -void -_nc_dPanel(const char *text, const PANEL *pan) +NCURSES_EXPORT(void) +_nc_dPanel +(const char *text, const PANEL *pan) { _tracef("%s id=%s b=%s a=%s y=%d x=%d", text, USER_PTR(pan->user), @@ -70,8 +72,9 @@ _nc_dPanel(const char *text, const PANEL *pan) dStack(fmt,num,pan) --------------------------------------------------------------------------*/ #ifdef TRACE -void -_nc_dStack(const char *fmt, int num, const PANEL *pan) +NCURSES_EXPORT(void) +_nc_dStack +(const char *fmt, int num, const PANEL *pan) { char s80[80]; @@ -94,8 +97,8 @@ _nc_dStack(const char *fmt, int num, const PANEL *pan) Wnoutrefresh(pan) - debugging hook for wnoutrefresh --------------------------------------------------------------------------*/ #ifdef TRACE -void -_nc_Wnoutrefresh(const PANEL *pan) +NCURSES_EXPORT(void) +_nc_Wnoutrefresh (const PANEL *pan) { dPanel("wnoutrefresh",pan); wnoutrefresh(pan->win); @@ -106,8 +109,8 @@ _nc_Wnoutrefresh(const PANEL *pan) Touchpan(pan) --------------------------------------------------------------------------*/ #ifdef TRACE -void -_nc_Touchpan(const PANEL *pan) +NCURSES_EXPORT(void) +_nc_Touchpan (const PANEL *pan) { dPanel("Touchpan",pan); touchwin(pan->win); @@ -118,8 +121,9 @@ _nc_Touchpan(const PANEL *pan) Touchline(pan,start,count) --------------------------------------------------------------------------*/ #ifdef TRACE -void -_nc_Touchline(const PANEL *pan, int start, int count) +NCURSES_EXPORT(void) +_nc_Touchline +(const PANEL *pan, int start, int count) { char s80[80]; sprintf(s80,"Touchline s=%d c=%d",start,count); @@ -131,6 +135,6 @@ _nc_Touchline(const PANEL *pan, int start, int count) #ifndef TRACE # ifndef __GNUC__ /* Some C compilers need something defined in a source file */ - static char GCC_UNUSED dummy; + void _nc_dummy_panel(void) { } # endif #endif diff --git a/panel/panel.h b/panel/panel.h index dc33071b..3b8542a7 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,8 +33,8 @@ /* panel.h -- interface file for panels library */ -#ifndef _PANEL_H -#define _PANEL_H +#ifndef NCURSES_PANEL_H_incl +#define NCURSES_PANEL_H_incl 1 #include @@ -50,26 +50,26 @@ typedef struct panel extern "C" { #endif -extern WINDOW* panel_window(const PANEL *); -extern void update_panels(void); -extern int hide_panel(PANEL *); -extern int show_panel(PANEL *); -extern int del_panel(PANEL *); -extern int top_panel(PANEL *); -extern int bottom_panel(PANEL *); -extern PANEL* new_panel(WINDOW *); -extern PANEL* panel_above(const PANEL *); -extern PANEL* panel_below(const PANEL *); -extern int set_panel_userptr(PANEL *, NCURSES_CONST void *); -extern NCURSES_CONST void* panel_userptr(const PANEL *); -extern int move_panel(PANEL *, int, int); -extern int replace_panel(PANEL *,WINDOW *); -extern int panel_hidden(const PANEL *); +extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); +extern NCURSES_EXPORT(void) update_panels (void); +extern NCURSES_EXPORT(int) hide_panel (PANEL *); +extern NCURSES_EXPORT(int) show_panel (PANEL *); +extern NCURSES_EXPORT(int) del_panel (PANEL *); +extern NCURSES_EXPORT(int) top_panel (PANEL *); +extern NCURSES_EXPORT(int) bottom_panel (PANEL *); +extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); +extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); +extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); +extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); +extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); +extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); +extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); +extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); #if defined(__cplusplus) } #endif -#endif /* _PANEL_H */ +#endif /* NCURSES_PANEL_H_incl */ /* end of panel.h */ diff --git a/panel/panel.priv.h b/panel/panel.priv.h index f5a4798f..7097d842 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -26,10 +26,10 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.14 2000/09/02 18:22:23 tom Exp $ */ +/* $Id: panel.priv.h,v 1.19 2001/06/02 23:31:05 tom Exp $ */ -#ifndef _PANEL_PRIV_H -#define _PANEL_PRIV_H +#ifndef NCURSES_PANEL_PRIV_H +#define NCURSES_PANEL_PRIV_H 1 #if HAVE_CONFIG_H # include @@ -47,8 +47,9 @@ # include /* Conor Cahill's library */ #endif -#include +#include "curses.priv.h" #include "panel.h" +#include #if ( CC_HAS_INLINE_FUNCS && !defined(TRACE) ) # define INLINE inline @@ -64,18 +65,18 @@ #ifdef TRACE - extern const char *_nc_my_visbuf(const void *); + extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *); # ifdef TRACE_TXT # define USER_PTR(ptr) _nc_visbuf((const char *)ptr) # else # define USER_PTR(ptr) _nc_my_visbuf((const char *)ptr) # endif - extern void _nc_dPanel(const char*, const PANEL*); - extern void _nc_dStack(const char*, int, const PANEL*); - extern void _nc_Wnoutrefresh(const PANEL*); - extern void _nc_Touchpan(const PANEL*); - extern void _nc_Touchline(const PANEL*, int, int); + extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); + extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); + extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); + extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*); + extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int); # define dBug(x) _tracef x # define dPanel(text,pan) _nc_dPanel(text,pan) @@ -101,15 +102,6 @@ #define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) #define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) -/* borrowed from curses.priv.h */ -#define CHANGED_RANGE(line,start,end) \ - if (line->firstchar == _NOCHANGE \ - || line->firstchar > (start)) \ - line->firstchar = start; \ - if (line->lastchar == _NOCHANGE \ - || line->lastchar < (end)) \ - line->lastchar = end - /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack --------------------------------------------------------------------------*/ @@ -150,10 +142,8 @@ If the "touch" flag is set, the panel gets touched before it is updated. ---------------------------------------------------------------------------*/ -#define PANEL_UPDATE(pan,panstart,touch)\ +#define PANEL_UPDATE(pan,panstart)\ { PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ - if (touch)\ - Touchpan(pan);\ while(pan2) {\ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ int y,ix1,ix2,iy1,iy2;\ @@ -192,12 +182,12 @@ #define HIDE_PANEL(pan,err,err_if_unlinked)\ if (IS_LINKED(pan)) {\ - PANEL_UPDATE(pan,(PANEL*)0,TRUE);\ + Touchpan(pan);\ + PANEL_UPDATE(pan,(PANEL*)0);\ PANEL_UNLINK(pan,err);\ } \ else {\ - if (err_if_unlinked)\ - err = ERR;\ + err = err_if_unlinked;\ } -#endif /* _PANEL_PRIV_H */ +#endif /* NCURSES_PANEL_PRIV_H */ diff --git a/progs/MKtermsort.sh b/progs/MKtermsort.sh index 5486fd74..7f5b79a8 100755 --- a/progs/MKtermsort.sh +++ b/progs/MKtermsort.sh @@ -1,20 +1,55 @@ #!/bin/sh -# $Id: MKtermsort.sh,v 1.6 2000/01/25 11:35:36 tom Exp $ +# $Id: MKtermsort.sh,v 1.8 2002/06/29 20:02:48 tom Exp $ # # MKtermsort.sh -- generate indirection vectors for the various sort methods # +############################################################################## +# Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# # The output of this script is C source for nine arrays that list three sort # orders for each of the three different classes of terminfo capabilities. # # keep the order independent of locale: -LANGUAGE=C -LC_ALL=C -export LANGUAGE -export LC_ALL +if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi # AWK=${1-awk} DATA=${2-../include/Caps} +data=data$$ +trap 'rm -f $data' 1 2 5 15 +sed -e 's/[ ]\+/ /g' < $DATA >$data +DATA=$data + echo "/*"; echo " * termsort.c --- sort order arrays for use by infocmp."; echo " *"; @@ -104,24 +139,26 @@ echo ""; echo "static const bool bool_from_termcap[] = {"; $AWK <$DATA ' -$3 == "bool" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "bool" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "bool" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "bool" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; echo "static const bool num_from_termcap[] = {"; $AWK <$DATA ' -$3 == "num" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "num" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "num" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "num" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; echo "static const bool str_from_termcap[] = {"; $AWK <$DATA ' -$3 == "str" && substr($5, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} -$3 == "str" && substr($5, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} +$3 == "str" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";} +$3 == "str" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */";} ' echo "};"; echo ""; + +rm -f $data diff --git a/progs/Makefile.in b/progs/Makefile.in index b93ef8fa..43b85c43 100644 --- a/progs/Makefile.in +++ b/progs/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.51 2000/10/14 22:19:14 tom Exp $ +# $Id: Makefile.in,v 1.56 2001/12/08 18:48:01 tom Exp $ ############################################################################## -# Copyright (c) 1998-2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -107,7 +107,10 @@ AUTO_SRC = \ termsort.c \ transform.h -PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x +# tic and toe rely on direct access to the terminfo database +GET_PROGS = infocmp$x clear$x tput$x tset$x +PUT_PROGS = @MAKE_TERMINFO@ tic$x toe$x +PROGS = $(PUT_PROGS) $(GET_PROGS) TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x @@ -147,35 +150,35 @@ transform.h : echo "#define PROG_INIT \"$(actual_init)\"" >>$@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) - $(LIBTOOL) $(INSTALL_PROGRAM) tic$x $(DESTDIR)$(bindir)/$(actual_tic) - $(LIBTOOL) $(INSTALL_PROGRAM) toe$x $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ $(LIBTOOL) $(INSTALL_PROGRAM) tic$x $(DESTDIR)$(bindir)/$(actual_tic) +@MAKE_TERMINFO@ $(LIBTOOL) $(INSTALL_PROGRAM) toe$x $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ @echo "linking $(actual_infotocap) to $(actual_tic)" +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) +@MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap)) +@MAKE_TERMINFO@ @echo "linking $(actual_captoinfo) to $(actual_tic)" +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) +@MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp) $(LIBTOOL) $(INSTALL_PROGRAM) clear$x $(DESTDIR)$(bindir)/$(actual_clear) $(LIBTOOL) $(INSTALL_PROGRAM) tput$x $(DESTDIR)$(bindir)/$(actual_tput) $(LIBTOOL) $(INSTALL_PROGRAM) tset$x $(DESTDIR)$(bindir)/$(actual_tset) - @echo "linking $(actual_captoinfo) to $(actual_tic)" - -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) - (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) - @echo "linking $(actual_infotocap) to $(actual_tic)" - -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) - (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap)) @echo "linking $(actual_reset) to $(actual_tset)" -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset)) uninstall.progs: - -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic) - -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic) +@MAKE_TERMINFO@ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe) +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) +@MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp) -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear) -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput) -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset) - -@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo) - -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) $(DESTDIR)$(bindir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # # Utilities normally built by make all start here @@ -222,7 +225,7 @@ tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@ termsort.c: $(srcdir)/MKtermsort.sh - sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@ + sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@" >$@ # # Utility productions start here @@ -235,7 +238,7 @@ tags: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace -rm -f $(TESTPROGS) clean :: mostlyclean @@ -257,10 +260,10 @@ $(DEPS_CURSES) : cd ../ncurses; $(MAKE) $(CF_MFLAGS) lint: +@MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c $(srcdir)/dump_entry.c $(LINT_LIBS) +@MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) - $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c $(srcdir)/dump_entry.c $(LINT_LIBS) - $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 60c88d3f..b8d82b77 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996 on * ****************************************************************************/ #define __INTERNAL_CAPS_VISIBLE @@ -38,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.54 2000/10/01 01:34:06 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.64 2002/09/01 17:54:43 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -56,7 +57,6 @@ static int sortmode; /* sort mode to use */ static int width = 60; /* max line width for listings */ static int column; /* current column, limited by 'width' */ static int oldcol; /* last value of column before wrap */ -static int tracelevel; /* level of debug output */ static bool pretty; /* true if we format if-then-else strings */ static DYNBUF outbuf; @@ -167,18 +167,17 @@ nametrans(const char *name) void dump_init(const char *version, int mode, int sort, int twidth, int traceval, - bool formatted) + bool formatted) /* set up for entry display */ { width = twidth; pretty = formatted; - tracelevel = traceval; /* versions */ if (version == 0) tversion = V_ALLCAPS; else if (!strcmp(version, "SVr1") || !strcmp(version, "SVR1") - || !strcmp(version, "Ultrix")) + || !strcmp(version, "Ultrix")) tversion = V_SVR1; else if (!strcmp(version, "HP")) tversion = V_HPUX; @@ -223,13 +222,13 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval, case S_NOSORT: if (traceval) (void) fprintf(stderr, - "%s: sorting by term structure order\n", _nc_progname); + "%s: sorting by term structure order\n", _nc_progname); break; case S_TERMINFO: if (traceval) (void) fprintf(stderr, - "%s: sorting by terminfo name order\n", _nc_progname); + "%s: sorting by terminfo name order\n", _nc_progname); bool_indirect = bool_terminfo_sort; num_indirect = num_terminfo_sort; str_indirect = str_terminfo_sort; @@ -238,7 +237,7 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval, case S_VARIABLE: if (traceval) (void) fprintf(stderr, - "%s: sorting by C variable order\n", _nc_progname); + "%s: sorting by C variable order\n", _nc_progname); bool_indirect = bool_variable_sort; num_indirect = num_variable_sort; str_indirect = str_variable_sort; @@ -247,7 +246,7 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval, case S_TERMCAP: if (traceval) (void) fprintf(stderr, - "%s: sorting by termcap name order\n", _nc_progname); + "%s: sorting by termcap name order\n", _nc_progname); bool_indirect = bool_termcap_sort; num_indirect = num_termcap_sort; str_indirect = str_termcap_sort; @@ -256,8 +255,8 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval, if (traceval) (void) fprintf(stderr, - "%s: width = %d, tversion = %d, outform = %d\n", - _nc_progname, width, tversion, outform); + "%s: width = %d, tversion = %d, outform = %d\n", + _nc_progname, width, tversion, outform); } static TERMTYPE *cur_type; @@ -288,6 +287,14 @@ static void set_obsolete_termcaps(TERMTYPE * tp); /* is this the index of a function key string? */ #define FNKEY(i) (((i)<= 65 && (i)>= 75) || ((i)<= 216 && (i)>= 268)) +/* + * If we configure with a different Caps file, the offsets into the arrays + * will change. So we use an address expression. + */ +#define BOOL_IDX(name) (&(name) - &(CUR Booleans[0])) +#define NUM_IDX(name) (&(name) - &(CUR Numbers[0])) +#define STR_IDX(name) (&(name) - &(CUR Strings[0])) + static bool version_filter(int type, int idx) /* filter out capabilities we may want to suppress */ @@ -299,31 +306,28 @@ version_filter(int type, int idx) case V_SVR1: /* System V Release 1, Ultrix */ switch (type) { case BOOLEAN: - /* below and including xon_xoff */ - return ((idx <= 20) ? TRUE : FALSE); + return ((idx <= BOOL_IDX(xon_xoff)) ? TRUE : FALSE); case NUMBER: - /* below and including width_status_line */ - return ((idx <= 7) ? TRUE : FALSE); + return ((idx <= NUM_IDX(width_status_line)) ? TRUE : FALSE); case STRING: - /* below and including prtr_non */ - return ((idx <= 144) ? TRUE : FALSE); + return ((idx <= STR_IDX(prtr_non)) ? TRUE : FALSE); } break; case V_HPUX: /* Hewlett-Packard */ switch (type) { case BOOLEAN: - /* below and including xon_xoff */ - return ((idx <= 20) ? TRUE : FALSE); + return ((idx <= BOOL_IDX(xon_xoff)) ? TRUE : FALSE); case NUMBER: - /* below and including label_width */ - return ((idx <= 10) ? TRUE : FALSE); + return ((idx <= NUM_IDX(label_width)) ? TRUE : FALSE); case STRING: - if (idx <= 144) /* below and including prtr_non */ + if (idx <= STR_IDX(prtr_non)) return (TRUE); else if (FNKEY(idx)) /* function keys */ return (TRUE); - else if (idx == 147 || idx == 156 || idx == 157) /* plab_norm,label_on,label_off */ + else if (idx == STR_IDX(plab_norm) + || idx == STR_IDX(label_on) + || idx == STR_IDX(label_off)) return (TRUE); else return (FALSE); @@ -333,13 +337,11 @@ version_filter(int type, int idx) case V_AIX: /* AIX */ switch (type) { case BOOLEAN: - /* below and including xon_xoff */ - return ((idx <= 20) ? TRUE : FALSE); + return ((idx <= BOOL_IDX(xon_xoff)) ? TRUE : FALSE); case NUMBER: - /* below and including width_status_line */ - return ((idx <= 7) ? TRUE : FALSE); + return ((idx <= NUM_IDX(width_status_line)) ? TRUE : FALSE); case STRING: - if (idx <= 144) /* below and including prtr_non */ + if (idx <= STR_IDX(prtr_non)) return (TRUE); else if (FNKEY(idx)) /* function keys */ return (TRUE); @@ -498,10 +500,11 @@ fmt_complex(char *src, int level) int fmt_entry(TERMTYPE * tterm, - int (*pred) (int type, int idx), - bool suppress_untranslatable, - bool infodump, - int numbers) + int (*pred) (int type, int idx), + bool content_only, + bool suppress_untranslatable, + bool infodump, + int numbers) { int i, j; char buffer[MAX_TERMINFO_LENGTH]; @@ -524,10 +527,14 @@ fmt_entry(TERMTYPE * tterm, } strcpy_DYN(&outbuf, 0); - strcpy_DYN(&outbuf, tterm->term_names); - strcpy_DYN(&outbuf, separator); - column = outbuf.used; - force_wrap(); + if (content_only) { + column = INDENT; /* FIXME: workaround to prevent empty lines */ + } else { + strcpy_DYN(&outbuf, tterm->term_names); + strcpy_DYN(&outbuf, separator); + column = outbuf.used; + force_wrap(); + } for_each_boolean(j, tterm) { i = BoolIndirect(j); @@ -641,14 +648,16 @@ fmt_entry(TERMTYPE * tterm, sprintf(buffer, "%s@", name); WRAP_CONCAT; } else if (outform == F_TERMCAP || outform == F_TCONVERR) { - int params = (i < (int) SIZEOF(parametrized)) ? parametrized[i] : 0; + int params = ((i < (int) SIZEOF(parametrized)) + ? parametrized[i] + : 0); char *srccap = _nc_tic_expand(tterm->Strings[i], TRUE, numbers); char *cv = _nc_infotocap(name, srccap, params); if (cv == 0) { if (outform == F_TCONVERR) { sprintf(buffer, "%s=!!! %s WILL NOT CONVERT !!!", - name, srccap); + name, srccap); } else if (suppress_untranslatable) { continue; } else { @@ -672,7 +681,7 @@ fmt_entry(TERMTYPE * tterm, WRAP_CONCAT; } else { char *src = _nc_tic_expand(tterm->Strings[i], - outform == F_TERMINFO, numbers); + outform == F_TERMINFO, numbers); strcpy_DYN(&tmpbuf, 0); strcpy_DYN(&tmpbuf, name); @@ -728,7 +737,7 @@ fmt_entry(TERMTYPE * tterm, if (box_ok) { (void) strcpy(buffer, "box1="); (void) strcat(buffer, _nc_tic_expand(boxchars, - outform == F_TERMINFO, numbers)); + outform == F_TERMINFO, numbers)); WRAP_CONCAT; } } @@ -747,10 +756,10 @@ fmt_entry(TERMTYPE * tterm, outbuf.used -= 2; trimmed = TRUE; } else if (j >= 4 - && outbuf.text[j - 1] == ':' - && outbuf.text[j - 2] == '\t' - && outbuf.text[j - 3] == '\n' - && outbuf.text[j - 4] == '\\') { + && outbuf.text[j - 1] == ':' + && outbuf.text[j - 2] == '\t' + && outbuf.text[j - 3] == '\n' + && outbuf.text[j - 4] == '\\') { outbuf.used -= 4; trimmed = TRUE; } @@ -764,7 +773,7 @@ fmt_entry(TERMTYPE * tterm, fprintf(stderr, "num_values = %d\n", num_values); fprintf(stderr, "num_strings = %d\n", num_strings); fprintf(stderr, "term_names=%s, len=%d, strlen(outbuf)=%d, outbuf=%s\n", - tterm->term_names, len, outbuf.used, outbuf.text); + tterm->term_names, len, outbuf.used, outbuf.text); #endif /* * Here's where we use infodump to trigger a more stringent length check @@ -773,12 +782,104 @@ fmt_entry(TERMTYPE * tterm, * It gives an idea of which entries are deadly to even *scan past*, * as opposed to *use*. */ - return (infodump ? len : termcap_length(outbuf.text)); + return (infodump ? len : (int) termcap_length(outbuf.text)); } +static bool +kill_string(TERMTYPE * tterm, char *cap) +{ + int n; + for (n = 0; n < NUM_STRINGS(tterm); ++n) { + if (cap == tterm->Strings[n]) { + tterm->Strings[n] = ABSENT_STRING; + return TRUE; + } + } + return FALSE; +} + +static char * +find_string(TERMTYPE * tterm, char *name) +{ + int n; + for (n = 0; n < NUM_STRINGS(tterm); ++n) { + if (version_filter(STRING, n) + && !strcmp(name, strnames[n])) { + char *cap = tterm->Strings[n]; + if (VALID_STRING(cap)) { + return cap; + } + break; + } + } + return ABSENT_STRING; +} + +/* + * This is used to remove function-key labels from a termcap entry to + * make it smaller. + */ +static int +kill_labels(TERMTYPE * tterm, int target) +{ + int n; + int result = 0; + char *cap; + char name[10]; + + for (n = 0; n <= 10; ++n) { + sprintf(name, "lf%d", n); + if ((cap = find_string(tterm, name)) != ABSENT_STRING + && kill_string(tterm, cap)) { + target -= (strlen(cap) + 5); + ++result; + if (target < 0) + break; + } + } + return result; +} + +/* + * This is used to remove function-key definitions from a termcap entry to + * make it smaller. + */ +static int +kill_fkeys(TERMTYPE * tterm, int target) +{ + int n; + int result = 0; + char *cap; + char name[10]; + + for (n = 60; n >= 0; --n) { + sprintf(name, "kf%d", n); + if ((cap = find_string(tterm, name)) != ABSENT_STRING + && kill_string(tterm, cap)) { + target -= (strlen(cap) + 5); + ++result; + if (target < 0) + break; + } + } + return result; +} + +#define FMT_ENTRY() \ + fmt_entry(tterm, pred, \ + (already_used > 0), \ + suppress_untranslatable, \ + infodump, numbers) + +#define SHOW_WHY if (!already_used) PRINTF + int -dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int - type, int idx)) +dump_entry(TERMTYPE * tterm, + bool suppress_untranslatable, + bool limited, + int already_used, + int numbers, + int (*pred) (int type, int idx)) /* dump a single entry */ { int len, critlen; @@ -795,12 +896,16 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int legend = "terminfo"; infodump = TRUE; } + critlen -= already_used; - if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen) + if (((len = FMT_ENTRY()) > critlen) && limited) { - PRINTF("# (untranslatable capabilities removed to fit entry within %d bytes)\n", - critlen); - if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { + if (!suppress_untranslatable) { + SHOW_WHY("# (untranslatable capabilities removed to fit entry within %d bytes)\n", + critlen); + suppress_untranslatable = TRUE; + } + if ((len = FMT_ENTRY()) > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. Another good candidate is @@ -809,29 +914,40 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int char *oldsgr = set_attributes; char *oldacsc = acs_chars; set_attributes = ABSENT_STRING; - PRINTF("# (sgr removed to fit entry within %d bytes)\n", - critlen); - if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { + SHOW_WHY("# (sgr removed to fit entry within %d bytes)\n", + critlen); + if ((len = FMT_ENTRY()) > critlen) { acs_chars = ABSENT_STRING; - PRINTF("# (acsc removed to fit entry within %d bytes)\n", - critlen); + SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n", + critlen); } - if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) { + if ((len = FMT_ENTRY()) > critlen) { int oldversion = tversion; tversion = V_BSD; - PRINTF("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n", - critlen); - - if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) - > critlen) { + SHOW_WHY("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n", + critlen); + + len = FMT_ENTRY(); + if (len > critlen + && kill_labels(tterm, len - critlen)) { + SHOW_WHY("# (some labels capabilities suppressed to fit entry within %d bytes)\n", + critlen); + len = FMT_ENTRY(); + } + if (len > critlen + && kill_fkeys(tterm, len - critlen)) { + SHOW_WHY("# (some function-key capabilities suppressed to fit entry within %d bytes)\n", + critlen); + len = FMT_ENTRY(); + } + if (len > critlen && !already_used) { (void) fprintf(stderr, - "warning: %s entry is %d bytes long\n", - _nc_first_name(tterm->term_names), - len); - PRINTF( - "# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n", - len, legend); + "warning: %s entry is %d bytes long\n", + _nc_first_name(tterm->term_names), + len); + SHOW_WHY("# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n", + already_used + len, legend); } tversion = oldversion; } @@ -859,7 +975,7 @@ dump_uses(const char *name, bool infodump) void compare_entry(void (*hook) (int t, int i, const char *name), TERMTYPE * tp - GCC_UNUSED, bool quiet) + GCC_UNUSED, bool quiet) /* compare two entries */ { int i, j; diff --git a/progs/dump_entry.h b/progs/dump_entry.h index 57354702..bf67ddd8 100644 --- a/progs/dump_entry.h +++ b/progs/dump_entry.h @@ -58,8 +58,8 @@ extern NCURSES_CONST char *nametrans(const char *); extern void dump_init(const char *, int, int, int, int, bool); -extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool, int); -extern int dump_entry(TERMTYPE *, bool, int, int (*)(int, int)); +extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool, bool, int); +extern int dump_entry(TERMTYPE *, bool, bool, int, int, int (*)(int, int)); extern int dump_uses(const char *, bool); extern void compare_entry(void (*)(int, int, const char *), TERMTYPE *, bool); extern void repair_acsc(TERMTYPE * tp); diff --git a/progs/infocmp.c b/progs/infocmp.c index bf7ff1c5..5d80511c 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,7 +41,7 @@ #include #include -MODULE_ID("$Id: infocmp.c,v 1.57 2000/10/01 01:26:25 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.68 2002/10/06 01:13:04 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -710,7 +710,6 @@ file_comparison(int argc, char *argv[]) /* someday we may allow comparisons on more files */ int filecount = 0; ENTRY *heads[MAXCOMPARE]; - ENTRY *tails[MAXCOMPARE]; ENTRY *qp, *rp; int i, n; @@ -744,7 +743,6 @@ file_comparison(int argc, char *argv[]) } heads[filecount] = _nc_head; - tails[filecount] = _nc_tail; filecount++; } @@ -919,6 +917,9 @@ usage(void) ," -r with -C, output in termcap form" ," -r with -F, resolve use-references" ," -s [d|i|l|c] sort fields" +#if NCURSES_XNAMES + ," -t suppress commented-out capabilities" +#endif ," -u produce source with 'use='" ," -v number (verbose)" ," -w number (width)" @@ -939,30 +940,75 @@ usage(void) } static char * -name_initializer(const char *type) +any_initializer(const char *fmt, const char *type) { static char *initializer; char *s; if (initializer == 0) - initializer = (char *) malloc(strlen(entries->tterm.term_names) + 20); + initializer = (char *) malloc(strlen(entries->tterm.term_names) + + strlen(type) + strlen(fmt)); - (void) sprintf(initializer, "%s_data_%s", type, entries->tterm.term_names); + (void) strcpy(initializer, entries->tterm.term_names); for (s = initializer; *s != 0 && *s != '|'; s++) { - if (!isalnum(*s)) + if (!isalnum(UChar(*s))) *s = '_'; } *s = 0; + (void) sprintf(s, fmt, type); return initializer; } +static char * +name_initializer(const char *type) +{ + return any_initializer("_%s_data", type); +} + +static char * +string_variable(const char *type) +{ + return any_initializer("_s_%s", type); +} + /* dump C initializers for the terminal type */ static void dump_initializers(TERMTYPE * term) { int n; - const char *str = 0; int size; + const char *str = 0; + + printf("\nstatic char %s[] = \"%s\";\n\n", + name_initializer("alias"), entries->tterm.term_names); + + for_each_string(n, term) { + char buf[MAX_STRING], *sp, *tp; + + if (VALID_STRING(term->Strings[n])) { + tp = buf; + *tp++ = '"'; + for (sp = term->Strings[n]; + *sp != 0 && (tp - buf) < MAX_STRING - 6; + sp++) { + if (isascii(UChar(*sp)) + && isprint(UChar(*sp)) + && *sp != '\\' + && *sp != '"') + *tp++ = *sp; + else { + (void) sprintf(tp, "\\%03o", UChar(*sp)); + tp += 4; + } + } + *tp++ = '"'; + *tp = '\0'; + size += (strlen(term->Strings[n]) + 1); + (void) printf("static char %-20s[] = %s;\n", + string_variable(ExtStrname(term, n, strnames)), buf); + } + } + printf("\n"); (void) printf("static char %s[] = %s\n", name_initializer("bool"), L_CURL); @@ -1017,49 +1063,47 @@ dump_initializers(TERMTYPE * term) (void) printf("static char * %s[] = %s\n", name_initializer("string"), L_CURL); for_each_string(n, term) { - char buf[MAX_STRING], *sp, *tp; if (term->Strings[n] == ABSENT_STRING) str = "ABSENT_STRING"; else if (term->Strings[n] == CANCELLED_STRING) str = "CANCELLED_STRING"; else { - tp = buf; - *tp++ = '"'; - for (sp = term->Strings[n]; - *sp != 0 && (tp - buf) < MAX_STRING - 6; - sp++) { - if (isascii(*sp) && isprint(*sp) && *sp != '\\' && *sp != '"') - *tp++ = *sp; - else { - (void) sprintf(tp, "\\%03o", *sp & 0xff); - tp += 4; - } - } - *tp++ = '"'; - *tp = '\0'; - size += (strlen(term->Strings[n]) + 1); - str = buf; + str = string_variable(ExtStrname(term, n, strnames)); } -#if NCURSES_XNAMES - if (n == STRCOUNT) { - (void) printf("%s;\n", R_CURL); - - (void) printf("static char * %s[] = %s\n", - name_initializer("string_ext"), L_CURL); - } -#endif (void) printf("\t/* %3d: %-8s */\t%s,\n", n, ExtStrname(term, n, strnames), str); } (void) printf("%s;\n", R_CURL); + +#if NCURSES_XNAMES + if ((NUM_BOOLEANS(term) != BOOLCOUNT) + || (NUM_NUMBERS(term) != NUMCOUNT) + || (NUM_STRINGS(term) != STRCOUNT)) { + (void) printf("static char * %s[] = %s\n", + name_initializer("string_ext"), L_CURL); + for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) { + (void) printf("\t/* %3d: bool */\t\"%s\",\n", + n, ExtBoolname(term, n, boolnames)); + } + for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) { + (void) printf("\t/* %3d: num */\t\"%s\",\n", + n, ExtNumname(term, n, numnames)); + } + for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) { + (void) printf("\t/* %3d: str */\t\"%s\",\n", + n, ExtStrname(term, n, strnames)); + } + (void) printf("%s;\n", R_CURL); + } +#endif } /* dump C initializers for the terminal type */ static void dump_termtype(TERMTYPE * term) { - (void) printf("\t%s\n\t\t\"%s\",\n", L_CURL, term->term_names); + (void) printf("\t%s\n\t\t%s,\n", L_CURL, name_initializer("alias")); (void) printf("\t\t(char *)0,\t/* pointer to string table */\n"); (void) printf("\t\t%s,\n", name_initializer("bool")); @@ -1071,7 +1115,9 @@ dump_termtype(TERMTYPE * term) (void) printf("#if NCURSES_XNAMES\n"); (void) printf("\t\t(char *)0,\t/* pointer to extended string table */\n"); (void) printf("\t\t%s,\t/* ...corresponding names */\n", - (NUM_STRINGS(term) != STRCOUNT) + ((NUM_BOOLEANS(term) != BOOLCOUNT) + || (NUM_NUMBERS(term) != NUMCOUNT) + || (NUM_STRINGS(term) != STRCOUNT)) ? name_initializer("string_ext") : "(char **)0"); @@ -1122,6 +1168,7 @@ main(int argc, char *argv[]) bool filecompare = FALSE; int initdump = 0; bool init_analyze = FALSE; + bool suppress_untranslatable = FALSE; if ((terminal = getenv("TERM")) == 0) { (void) fprintf(stderr, @@ -1132,35 +1179,53 @@ main(int argc, char *argv[]) /* where is the terminfo database location going to default to? */ restdir = firstdir = 0; - while ((c = getopt(argc, argv, "adeEcCfFGgIinlLpqrR:s:uv:Vw:A:B:1T")) != EOF) + while ((c = getopt(argc, + argv, + "1A:aB:CcdEeFfGgIiLlnpqR:rs:TtuVv:w:")) != EOF) switch (c) { + case '1': + mwidth = 0; + break; + + case 'A': + firstdir = optarg; + break; + #if NCURSES_XNAMES case 'a': _nc_disable_period = TRUE; use_extended_names(TRUE); break; #endif - case 'd': - compare = C_DIFFERENCE; + case 'B': + restdir = optarg; break; - case 'e': - initdump |= 1; + case 'C': + outform = F_TERMCAP; + tversion = "BSD"; + if (sortmode == S_DEFAULT) + sortmode = S_TERMCAP; + break; + + case 'c': + compare = C_COMMON; + break; + + case 'd': + compare = C_DIFFERENCE; break; case 'E': initdump |= 2; break; - case 'c': - compare = C_COMMON; + case 'e': + initdump |= 1; break; - case 'C': - outform = F_TERMCAP; - tversion = "BSD"; - if (sortmode == S_DEFAULT) - sortmode = S_TERMCAP; + case 'F': + filecompare = TRUE; break; case 'f': @@ -1175,10 +1240,6 @@ main(int argc, char *argv[]) numbers = -1; break; - case 'F': - filecompare = TRUE; - break; - case 'I': outform = F_TERMINFO; if (sortmode == S_DEFAULT) @@ -1190,16 +1251,16 @@ main(int argc, char *argv[]) init_analyze = TRUE; break; - case 'l': - outform = F_TERMINFO; - break; - case 'L': outform = F_VARIABLE; if (sortmode == S_DEFAULT) sortmode = S_VARIABLE; break; + case 'l': + outform = F_TERMINFO; + break; + case 'n': compare = C_NAND; break; @@ -1215,15 +1276,15 @@ main(int argc, char *argv[]) bool_sep = ", "; break; + case 'R': + tversion = optarg; + break; + case 'r': tversion = 0; limited = FALSE; break; - case 'R': - tversion = optarg; - break; - case 's': if (*optarg == 'd') sortmode = S_NOSORT; @@ -1240,38 +1301,34 @@ main(int argc, char *argv[]) } break; + case 'T': + limited = FALSE; + break; + +#if NCURSES_XNAMES + case 't': + _nc_disable_period = FALSE; + suppress_untranslatable = TRUE; + break; +#endif + case 'u': compare = C_USEALL; break; + case 'V': + puts(curses_version()); + ExitProgram(EXIT_SUCCESS); + case 'v': itrace = optarg_to_number(); set_trace_level(itrace); break; - case 'V': - puts(curses_version()); - ExitProgram(EXIT_SUCCESS); - case 'w': mwidth = optarg_to_number(); break; - case 'A': - firstdir = optarg; - break; - - case 'B': - restdir = optarg; - break; - - case '1': - mwidth = 0; - break; - - case 'T': - limited = FALSE; - break; default: usage(); } @@ -1384,7 +1441,12 @@ main(int argc, char *argv[]) tname[0]); (void) printf("#\tReconstructed via infocmp from file: %s\n", tfile[0]); - len = dump_entry(&entries[0].tterm, limited, numbers, NULL); + len = dump_entry(&entries[0].tterm, + suppress_untranslatable, + limited, + 0, + numbers, + NULL); putchar('\n'); if (itrace) (void) fprintf(stderr, "infocmp: length %d\n", len); @@ -1416,10 +1478,15 @@ main(int argc, char *argv[]) case C_USEALL: if (itrace) (void) fprintf(stderr, "infocmp: dumping use entry\n"); - len = dump_entry(&entries[0].tterm, limited, numbers, use_predicate); + len = dump_entry(&entries[0].tterm, + suppress_untranslatable, + limited, + 0, + numbers, + use_predicate); for (i = 1; i < termcount; i++) - len += dump_uses(tname[i], !(outform == F_TERMCAP || outform - == F_TCONVERR)); + len += dump_uses(tname[i], !(outform == F_TERMCAP + || outform == F_TCONVERR)); putchar('\n'); if (itrace) (void) fprintf(stderr, "infocmp: length %d\n", len); diff --git a/progs/progs.priv.h b/progs/progs.priv.h index d704c098..9d13b3c7 100644 --- a/progs/progs.priv.h +++ b/progs/progs.priv.h @@ -30,7 +30,7 @@ * Author: Thomas E. Dickey 1997,1998 * ****************************************************************************/ /* - * $Id: progs.priv.h,v 1.24 2000/10/01 01:33:34 tom Exp $ + * $Id: progs.priv.h,v 1.27 2001/06/18 18:43:52 tom Exp $ * * progs.priv.h * @@ -165,10 +165,12 @@ extern int optind; #if !HAVE_ISASCII # undef isascii # if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127) -# define isascii(c) (((c) & 0xff) <= 127) +# define isascii(c) (UChar(c) <= 127) # else # define isascii(c) 1 /* not really ascii anyway */ # endif #endif +#define UChar(c) ((unsigned char)(c)) + #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) diff --git a/progs/tic.c b/progs/tic.c index 620704fc..594474de 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996 on * ****************************************************************************/ /* @@ -44,7 +45,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.83 2000/10/14 17:30:26 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.102 2002/10/05 19:59:41 tom Exp $") const char *_nc_progname = "tic"; @@ -52,6 +53,7 @@ static FILE *log_fp; static FILE *tmp_fp; static bool showsummary = FALSE; static const char *to_remove; +static int tparm_errs; static void (*save_check_termtype) (TERMTYPE *); static void check_termtype(TERMTYPE * tt); @@ -87,24 +89,27 @@ usage(void) { "Options:", " -1 format translation output one capability per line", - " -C translate entries to termcap source form", - " -I translate entries to terminfo source form", - " -L translate entries to full terminfo source form", - " -N disable smart defaults for source translation", - " -R restrict translation to given terminfo/termcap version", - " -T remove size-restrictions on compiled description", - " -V print version", #if NCURSES_XNAMES " -a retain commented-out capabilities (sets -x also)", #endif + " -C translate entries to termcap source form", " -c check only, validate input without compiling or translating", + " -e translate/compile only entries named by comma-separated list", " -f format complex strings for readability", " -G format %{number} to %'char'", " -g format %'char' to %{number}", - " -e translate/compile only entries named by comma-separated list", + " -I translate entries to terminfo source form", + " -L translate entries to full terminfo source form", + " -N disable smart defaults for source translation", " -o set output directory for compiled entry writes", + " -R restrict translation to given terminfo/termcap version", " -r force resolution of all use entries in source translation", " -s print summary statistics", + " -T remove size-restrictions on compiled description", +#if NCURSES_XNAMES + " -t suppress commented-out capabilities", +#endif + " -V print version", " -v[n] set verbosity level", " -w[n] set format width for translation output", #if NCURSES_XNAMES @@ -292,12 +297,12 @@ put_translate(int c) static char * stripped(char *src) { - while (isspace(*src)) + while (isspace(UChar(*src))) src++; if (*src != '\0') { char *dst = strcpy(malloc(strlen(src) + 1), src); size_t len = strlen(dst); - while (--len != 0 && isspace(dst[len])) + while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; } @@ -441,10 +446,11 @@ main(int argc, char *argv[]) const char **namelst = 0; char *outdir = (char *) NULL; bool check_only = FALSE; + bool suppress_untranslatable = FALSE; log_fp = stderr; - _nc_progname = _nc_basename(argv[0]); + _nc_progname = _nc_rootname(argv[0]); if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { outform = F_TERMINFO; @@ -464,7 +470,7 @@ main(int argc, char *argv[]) * be optional. */ while ((this_opt = getopt(argc, argv, - "0123456789CILNR:TVace:fGgo:rsvwx")) != EOF) { + "0123456789CILNR:TVace:fGgo:rstvwx")) != EOF) { if (isdigit(this_opt)) { switch (last_opt) { case 'v': @@ -540,6 +546,10 @@ main(int argc, char *argv[]) width = 0; break; #if NCURSES_XNAMES + case 't': + _nc_disable_period = FALSE; + suppress_untranslatable = TRUE; + break; case 'a': _nc_disable_period = TRUE; /* FALLTHRU */ @@ -658,7 +668,7 @@ main(int argc, char *argv[]) if (check_only && (capdump || infodump)) { for_entry_list(qp) { if (matches(namelst, qp->tterm.term_names)) { - int len = fmt_entry(&qp->tterm, NULL, TRUE, infodump, numbers); + int len = fmt_entry(&qp->tterm, NULL, FALSE, TRUE, infodump, numbers); if (len > (infodump ? MAX_TERMINFO_LENGTH : MAX_TERMCAP_LENGTH)) (void) fprintf(stderr, @@ -697,7 +707,8 @@ main(int argc, char *argv[]) put_translate(fgetc(tmp_fp)); } - len = dump_entry(&qp->tterm, limited, numbers, NULL); + len = dump_entry(&qp->tterm, suppress_untranslatable, + limited, 0, numbers, NULL); for (j = 0; j < qp->nuses; j++) len += dump_uses(qp->uses[j].name, !capdump); (void) putchar('\n'); @@ -705,7 +716,7 @@ main(int argc, char *argv[]) printf("# length=%d\n", len); } } - if (!namelst) { + if (!namelst && _nc_tail) { int c, oldc = '\0'; bool in_comment = FALSE; bool trailing_comment = FALSE; @@ -761,13 +772,14 @@ TERMINAL *cur_term; /* tweak to avoid linking lib_cur_term.c */ * Returns the expected number of parameters for the given capability. */ static int -expected_params(char *name) +expected_params(const char *name) { /* *INDENT-OFF* */ static const struct { const char *name; int count; } table[] = { + { "S0", 1 }, /* 'screen' extension */ { "birep", 2 }, { "chr", 1 }, { "colornm", 1 }, @@ -820,8 +832,8 @@ expected_params(char *name) { "sgr1", 6 }, { "slength", 1 }, { "slines", 1 }, - { "smgbp", 2 }, - { "smglp", 2 }, + { "smgbp", 1 }, /* 2 if smgtp is not given */ + { "smglp", 1 }, { "smglr", 2 }, { "smgrp", 1 }, { "smgtb", 2 }, @@ -853,7 +865,7 @@ expected_params(char *name) * markers. */ static void -check_params(TERMTYPE * tp, char *name, char *value) +check_params(TERMTYPE * tp, const char *name, char *value) { int expected = expected_params(name); int actual = 0; @@ -861,6 +873,12 @@ check_params(TERMTYPE * tp, char *name, char *value) bool params[10]; char *s = value; +#ifdef set_top_margin_parm + if (!strcmp(name, "smgbp") + && set_top_margin_parm == 0) + expected = 2; +#endif + for (n = 0; n < 10; n++) params[n] = FALSE; @@ -899,6 +917,14 @@ check_params(TERMTYPE * tp, char *name, char *value) } } +static char * +skip_delay(char *s) +{ + while (*s == '/' || isdigit(UChar(*s))) + ++s; + return s; +} + /* * An sgr string may contain several settings other than the one we're * interested in, essentially sgr0 + rmacs + whatever. As long as the @@ -906,13 +932,57 @@ check_params(TERMTYPE * tp, char *name, char *value) * sanity check. */ static bool -similar_sgr(char *a, char *b) +similar_sgr(int num, char *a, char *b) { + static const char *names[] = + { + "none" + ,"standout" + ,"underline" + ,"reverse" + ,"blink" + ,"dim" + ,"bold" + ,"invis" + ,"protect" + ,"altcharset" + }; + char *base_a = a; + char *base_b = b; + int delaying = 0; + while (*b != 0) { while (*a != *b) { - if (*a == 0) + if (*a == 0) { + if (b[0] == '$' + && b[1] == '<') { + _nc_warning("Did not find delay %s", _nc_visbuf(b)); + } else { + _nc_warning("checking sgr(%s) %s\n\tcompare to %s\n\tunmatched %s", + names[num], _nc_visbuf2(1, base_a), + _nc_visbuf2(2, base_b), + _nc_visbuf2(3, b)); + } return FALSE; - a++; + } else if (delaying) { + a = skip_delay(a); + b = skip_delay(b); + } else { + a++; + } + } + switch (*a) { + case '$': + if (delaying == 0) + delaying = 1; + break; + case '<': + if (delaying == 1) + delaying = 2; + break; + default: + delaying = 0; + break; } a++; b++; @@ -933,11 +1003,14 @@ check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, const char *name) num == 7, num == 8, num == 9); + tparm_errs += _nc_tparm_err; if (test != 0) { if (PRESENT(cap)) { - if (!similar_sgr(test, cap)) { - _nc_warning("%s differs from sgr(%d): %s", name, num, - _nc_visbuf(test)); + if (!similar_sgr(num, test, cap)) { + _nc_warning("%s differs from sgr(%d)\n\t%s=%s\n\tsgr(%d)=%s", + name, num, + name, _nc_visbuf2(1, cap), + num, _nc_visbuf2(2, test)); } } else if (strcmp(test, zero)) { _nc_warning("sgr(%d) present, but not %s", num, name); @@ -1008,8 +1081,9 @@ check_termtype(TERMTYPE * tp) * non-ANSI strings are misused. */ if ((max_colors > 0) != (max_pairs > 0) - || (max_colors > max_pairs)) - _nc_warning("inconsistent values for max_colors and max_pairs"); + || ((max_colors > max_pairs) && (initialize_pair == 0))) + _nc_warning("inconsistent values for max_colors (%d) and max_pairs (%d)", + max_colors, max_pairs); PAIRED(set_foreground, set_background); PAIRED(set_a_foreground, set_a_background); @@ -1033,6 +1107,7 @@ check_termtype(TERMTYPE * tp) ANDMISSING(change_scroll_region, save_cursor); ANDMISSING(change_scroll_region, restore_cursor); + tparm_errs = 0; if (PRESENT(set_attributes)) { char *zero = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, 0); @@ -1047,17 +1122,19 @@ check_termtype(TERMTYPE * tp) CHECK_SGR(8, enter_protected_mode); CHECK_SGR(9, enter_alt_charset_mode); free(zero); + if (tparm_errs) + _nc_warning("stack error in sgr string"); } /* * Some standard applications (e.g., vi) and some non-curses - * applications (e.g., jove) get confused if we have both ich/ich1 and + * applications (e.g., jove) get confused if we have both ich1 and * smir/rmir. Let's be nice and warn about that, too, even though * ncurses handles it. */ if ((PRESENT(enter_insert_mode) || PRESENT(exit_insert_mode)) - && (PRESENT(insert_character) || PRESENT(parm_ich))) { - _nc_warning("non-curses applications may be confused by ich/ich1 with smir/rmir"); + && PRESENT(parm_ich)) { + _nc_warning("non-curses applications may be confused by ich1 with smir/rmir"); } /* diff --git a/progs/toe.c b/progs/toe.c index b7afb676..abeffde1 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,14 +43,14 @@ #include #include -MODULE_ID("$Id: toe.c,v 1.24 2000/09/09 19:52:35 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.27 2002/10/06 01:22:05 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) const char *_nc_progname; static int typelist(int eargc, char *eargv[], bool, - void (*)(const char *, TERMTYPE *)); + void (*)(const char *, TERMTYPE *)); static void deschook(const char *, TERMTYPE *); #if NO_LEAKS @@ -65,13 +65,27 @@ ExitProgram(int code) GCC_NORETURN; } #endif +static bool +is_a_file(char *path) +{ + struct stat sb; + return (stat(path, &sb) == 0 + && (sb.st_mode & S_IFMT) == S_IFREG); +} + +static bool +is_a_directory(char *path) +{ + struct stat sb; + return (stat(path, &sb) == 0 + && (sb.st_mode & S_IFMT) == S_IFDIR); +} + static char * get_directory(char *path) { if (path != 0) { - struct stat sb; - if (stat(path, &sb) != 0 - || (sb.st_mode & S_IFMT) != S_IFDIR + if (!is_a_directory(path) || access(path, R_OK | X_OK) != 0) path = 0; } @@ -87,7 +101,7 @@ main(int argc, char *argv[]) int i, c; int code; - _nc_progname = _nc_basename(argv[0]); + _nc_progname = _nc_rootname(argv[0]); while ((c = getopt(argc, argv, "huv:UV")) != EOF) switch (c) { @@ -127,14 +141,15 @@ main(int argc, char *argv[]) if (direct_dependencies) { ENTRY *qp; - for_entry_list(qp) + for_entry_list(qp) { if (qp->nuses) { - int j; + int j; - (void) printf("%s:", _nc_first_name(qp->tterm.term_names)); - for (j = 0; j < qp->nuses; j++) - (void) printf(" %s", qp->uses[j].name); - putchar('\n'); + (void) printf("%s:", _nc_first_name(qp->tterm.term_names)); + for (j = 0; j < qp->nuses; j++) + (void) printf(" %s", qp->uses[j].name); + putchar('\n'); + } } ExitProgram(EXIT_SUCCESS); @@ -153,12 +168,12 @@ main(int argc, char *argv[]) for (i = 0; i < rp->nuses; i++) if (_nc_name_match(qp->tterm.term_names, - rp->uses[i].name, "|")) { + rp->uses[i].name, "|")) { if (matchcount++ == 0) (void) printf("%s:", - _nc_first_name(qp->tterm.term_names)); + _nc_first_name(qp->tterm.term_names)); (void) printf(" %s", - _nc_first_name(rp->tterm.term_names)); + _nc_first_name(rp->tterm.term_names)); } } if (matchcount) @@ -214,8 +229,8 @@ deschook(const char *cn, TERMTYPE * tp) static int typelist(int eargc, char *eargv[], - bool verbosity, - void (*hook) (const char *, TERMTYPE * tp)) + bool verbosity, + void (*hook) (const char *, TERMTYPE * tp)) /* apply a function to each entry in given terminfo directories */ { int i; @@ -227,8 +242,8 @@ typelist(int eargc, char *eargv[], if ((termdir = opendir(eargv[i])) == 0) { (void) fflush(stdout); (void) fprintf(stderr, - "%s: can't open terminfo directory %s\n", - _nc_progname, eargv[i]); + "%s: can't open terminfo directory %s\n", + _nc_progname, eargv[i]); return (EXIT_FAILURE); } else if (verbosity) (void) printf("#\n#%s:\n#\n", eargv[i]); @@ -245,7 +260,9 @@ typelist(int eargc, char *eargv[], continue; (void) sprintf(buf, "%s/%s/", eargv[i], name_1); - chdir(buf); + if (chdir(buf) != 0) + continue; + entrydir = opendir("."); while ((entry = readdir(entrydir)) != 0) { char name_2[PATH_MAX]; @@ -255,15 +272,15 @@ typelist(int eargc, char *eargv[], len = NAMLEN(entry); strncpy(name_2, entry->d_name, len)[len] = '\0'; - if (isDotname(name_2)) + if (isDotname(name_2) || !is_a_file(name_2)) continue; status = _nc_read_file_entry(name_2, <erm); if (status <= 0) { (void) fflush(stdout); (void) fprintf(stderr, - "toe: couldn't open terminfo file %s.\n", - name_2); + "toe: couldn't open terminfo file %s.\n", + name_2); return (EXIT_FAILURE); } diff --git a/progs/tput.c b/progs/tput.c index a72a2e89..3e09eab2 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -45,7 +45,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.24 2000/10/05 00:05:04 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.31 2002/07/20 19:09:47 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -96,7 +96,7 @@ check_aliases(const char *name) * in tparm() to decide how to parse the varargs list. */ static TParams -tparm_type(char *name) +tparm_type(const char *name) { #define TD(code, longname, ti, tc) {code,longname},{code,ti},{code,tc} TParams result = Numbers; @@ -123,6 +123,25 @@ tparm_type(char *name) return result; } +static int +exit_code(int token, int value) +{ + int result = 99; + + switch (token) { + case BOOLEAN: + result = !value; /* TRUE=0, FALSE=1 */ + break; + case NUMBER: + result = 0; /* always zero */ + break; + case STRING: + result = value; /* 0=normal, 1=missing */ + break; + } + return result; +} + static int tput(int argc, char *argv[]) { @@ -131,8 +150,11 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; + int token = UNDEF; - check_aliases(name = argv[0]); + if ((name = argv[0]) == 0) + name = ""; + check_aliases(name); if (is_reset || is_init) { if (init_prog != 0) { system(init_prog); @@ -153,15 +175,21 @@ tput(int argc, char *argv[]) } FLUSH; +#ifdef set_lr_margin if (set_lr_margin != 0) { PUTS(tparm(set_lr_margin, 0, columns - 1)); - } else if (set_left_margin_parm != 0 - && set_right_margin_parm != 0) { + } else +#endif +#ifdef set_left_margin_parm + if (set_left_margin_parm != 0 + && set_right_margin_parm != 0) { PUTS(tparm(set_left_margin_parm, 0)); PUTS(tparm(set_right_margin_parm, columns - 1)); - } else if (clear_margins != 0 - && set_left_margin != 0 - && set_right_margin != 0) { + } else +#endif + if (clear_margins != 0 + && set_left_margin != 0 + && set_right_margin != 0) { PUTS(clear_margins); if (carriage_return != 0) { PUTS(carriage_return); @@ -203,7 +231,7 @@ tput(int argc, char *argv[]) if (is_reset && reset_file != 0) { f = fopen(reset_file, "r"); if (f == 0) { - quit(errno, "Can't open reset_file: '%s'", reset_file); + quit(4 + errno, "Can't open reset_file: '%s'", reset_file); } while ((c = fgetc(f)) != EOF) { PUTCHAR(c); @@ -212,7 +240,7 @@ tput(int argc, char *argv[]) } else if (init_file != 0) { f = fopen(init_file, "r"); if (f == 0) { - quit(errno, "Can't open init_file: '%s'", init_file); + quit(4 + errno, "Can't open init_file: '%s'", init_file); } while ((c = fgetc(f)) != EOF) { PUTCHAR(c); @@ -259,13 +287,14 @@ tput(int argc, char *argv[]) #endif if ((status = tigetflag(name)) != -1) { - return (status != 0); + return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); - return (0); + return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { quit(4, "%s: unknown terminfo capability '%s'", prg_name, name); } else if (s != ABSENT_STRING) { + token = STRING; if (argc > 1) { int k; int numbers[10]; @@ -306,9 +335,9 @@ tput(int argc, char *argv[]) /* use putp() in order to perform padding */ putp(s); - return (0); + return exit_code(STRING, 0); } - return (0); + return exit_code(STRING, 1); } int @@ -319,9 +348,10 @@ main(int argc, char **argv) bool cmdline = TRUE; int c; char buf[BUFSIZ]; - int errors = 0; + int result = 0; + int err; - check_aliases(prg_name = _nc_basename(argv[0])); + check_aliases(prg_name = _nc_rootname(argv[0])); term = getenv("TERM"); @@ -376,16 +406,23 @@ main(int argc, char **argv) /* crack the argument list into a dope vector */ for (cp = buf; *cp; cp++) { - if (isspace(*cp)) + if (isspace(UChar(*cp))) { *cp = '\0'; - else if (cp == buf || cp[-1] == 0) + } else if (cp == buf || cp[-1] == 0) { argvec[argnum++] = cp; + if (argnum >= (int) SIZEOF(argvec) - 1) + break; + } } argvec[argnum] = 0; - if (tput(argnum, argvec) != 0) - errors++; + if (argnum != 0 + && (err = tput(argnum, argvec)) != 0) { + if (result == 0) + result = 4; /* will return value >4 */ + ++result; + } } - return errors > 0; + return result; } diff --git a/progs/tset.c b/progs/tset.c index d8dbda49..03c8ffde 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -95,15 +95,15 @@ char *ttyname(int fd); #if NEED_PTEM_H /* they neglected to define struct winsize in termios.h -- it's only in termio.h */ -#include -#include +#include +#include #endif #include /* for bool typedef */ #include #include -MODULE_ID("$Id: tset.c,v 0.47 2000/10/08 01:01:08 tom Exp $") +MODULE_ID("$Id: tset.c,v 0.53 2002/08/24 23:18:16 tom Exp $") extern char **environ; @@ -112,15 +112,16 @@ extern char **environ; const char *_nc_progname = "tset"; -static TTY mode, oldmode; +static TTY mode, oldmode, original; +static bool can_restore = FALSE; static bool isreset = FALSE; /* invoked as reset */ static int terasechar = -1; /* new erase character */ static int intrchar = -1; /* new interrupt character */ static int tkillchar = -1; /* new kill character */ static int tlines, tcolumns; /* window size */ -#define LOWERCASE(c) ((isalpha(c) && isupper(c)) ? tolower(c) : (c)) +#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c)) static int CaselessCmp(const char *a, const char *b) @@ -134,6 +135,17 @@ CaselessCmp(const char *a, const char *b) return LOWERCASE(*a) - LOWERCASE(*b); } +static void +exit_error(void) +{ + if (can_restore) + SET_TTY(STDERR_FILENO, &original); + (void) fprintf(stderr, "\n"); + fflush(stderr); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + static void err(const char *fmt,...) { @@ -142,8 +154,7 @@ err(const char *fmt,...) (void) fprintf(stderr, "tset: "); (void) vfprintf(stderr, fmt, ap); va_end(ap); - (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); /* NOTREACHED */ } @@ -152,25 +163,24 @@ failed(const char *msg) { char temp[BUFSIZ]; perror(strncat(strcpy(temp, "tset: "), msg, sizeof(temp) - 10)); - exit(EXIT_FAILURE); + exit_error(); /* NOTREACHED */ } static void cat(char *file) { - register int fd, nr, nw; + FILE *fp; + size_t nr; char buf[BUFSIZ]; - if ((fd = open(file, O_RDONLY, 0)) < 0) + if ((fp = fopen(file, "r")) == 0) failed(file); - while ((nr = read(fd, buf, sizeof(buf))) > 0) - if ((nw = write(STDERR_FILENO, buf, (size_t) nr)) == -1) - failed("write to stderr"); - if (nr != 0) - failed(file); - (void) close(fd); + while ((nr = fread(buf, sizeof(char), sizeof(buf), fp)) != 0) + if (fwrite(buf, sizeof(char), nr, stderr) != nr) + failed("write to stderr"); + fclose(fp); } static int @@ -187,9 +197,11 @@ askuser(const char *dflt) char *p; /* We can get recalled; if so, don't continue uselessly. */ + clearerr(stdin); if (feof(stdin) || ferror(stdin)) { (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); + /* NOTREACHED */ } for (;;) { if (dflt) @@ -200,8 +212,8 @@ askuser(const char *dflt) if (fgets(answer, sizeof(answer), stdin) == 0) { if (dflt == 0) { - (void) fprintf(stderr, "\n"); - exit(EXIT_FAILURE); + exit_error(); + /* NOTREACHED */ } return (dflt); } @@ -495,7 +507,7 @@ mapped(const char *type) static const char * get_termcap_entry(char *userarg) { - int rval, errret; + int errret; char *p; const char *ttype; #if HAVE_GETTTYNAM @@ -534,7 +546,7 @@ get_termcap_entry(char *userarg) while (fgets(buffer, sizeof(buffer) - 1, fp) != 0) { for (s = buffer, t = d = 0; *s; s++) { - if (isspace(*s)) + if (isspace(UChar(*s))) *s = '\0'; else if (t == 0) t = s; @@ -588,8 +600,8 @@ get_termcap_entry(char *userarg) ttype = askuser(0); } /* Find the terminfo entry. If it doesn't exist, ask the user. */ - while ((rval = setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, - &errret)) != OK) { + while (setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, &errret) + != OK) { if (errret == 0) { (void) fprintf(stderr, "tset: unknown terminal type %s\n", ttype); @@ -757,11 +769,7 @@ reset_mode(void) ); #endif -#ifdef TERMIOS - tcsetattr(STDERR_FILENO, TCSADRAIN, &mode); -#else - stty(STDERR_FILENO, &mode); -#endif + SET_TTY(STDERR_FILENO, &mode); } /* @@ -891,7 +899,7 @@ set_init(void) #ifdef TAB3 if (oldmode.c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) { oldmode.c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET); - tcsetattr(STDERR_FILENO, TCSADRAIN, &oldmode); + SET_TTY(STDERR_FILENO, &oldmode); } #endif settle = set_tabs(); @@ -1034,8 +1042,9 @@ static void usage(const char *pname) { (void) fprintf(stderr, - "usage: %s [-IQVrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n", pname); - exit(EXIT_FAILURE); + "usage: %s [-IQVrs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]", pname); + exit_error(); + /* NOTREACHED */ } static char @@ -1058,14 +1067,15 @@ main(int argc, char **argv) if (GET_TTY(STDERR_FILENO, &mode) < 0) failed("standard error"); - oldmode = mode; + can_restore = TRUE; + original = oldmode = mode; #ifdef TERMIOS ospeed = cfgetospeed(&mode); #else ospeed = mode.sg_ospeed; #endif - p = _nc_basename(*argv); + p = _nc_rootname(*argv); if (!strcmp(p, PROG_RESET)) { isreset = TRUE; reset_mode(); @@ -1154,11 +1164,7 @@ main(int argc, char **argv) /* Set the modes if they've changed. */ if (memcmp(&mode, &oldmode, sizeof(mode))) { -#ifdef TERMIOS - tcsetattr(STDERR_FILENO, TCSADRAIN, &mode); -#else - stty(STDERR_FILENO, &mode); -#endif + SET_TTY(STDERR_FILENO, &mode); } } diff --git a/tack/Makefile.in b/tack/Makefile.in index b2237cca..732da7f9 100644 --- a/tack/Makefile.in +++ b/tack/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.24 2000/10/14 22:19:37 tom Exp $ +# $Id: Makefile.in,v 1.27 2001/12/08 18:48:01 tom Exp $ # Makefile for tack # # The variable 'srcdir' refers to the source-distribution, and can be set with @@ -101,7 +101,7 @@ uninstall.tack: $(DESTDIR)$(bindir) \ $(DESTDIR)$(mandir) : - $(srcdir)/../mkinstalldirs $@ + sh $(srcdir)/../mkinstalldirs $@ # # Rules for building tack @@ -138,16 +138,16 @@ tags: @MAKE_UPPER_TAGS@TAGS: @MAKE_UPPER_TAGS@ etags *.[ch] -clean :: - -rm -f tags TAGS do.tic *~ +mostlyclean :: + -rm -f core tags TAGS *~ *.bak *.i *.atac trace + +clean :: mostlyclean -rm -f $(PROGS) -rm -rf .libs distclean :: clean -rm -f Makefile -mostlyclean :: clean - realclean :: distclean tack.tar: Makefile.in modules *.[ch] tack.1 HISTORY COPYING diff --git a/tack/ansi.c b/tack/ansi.c index df7b39f3..807bc539 100644 --- a/tack/ansi.c +++ b/tack/ansi.c @@ -21,7 +21,7 @@ #include -MODULE_ID("$Id: ansi.c,v 1.5 2000/04/22 21:06:57 tom Exp $") +MODULE_ID("$Id: ansi.c,v 1.9 2001/06/18 18:44:17 tom Exp $") /* * Standalone tests for ANSI terminals. Three entry points: @@ -135,7 +135,7 @@ read_ansi(void) int ch, i, j, last_escape; fflush(stdout); - read_key(ansi_buf, sizeof(ansi_buf)); + read_key((char *)ansi_buf, sizeof(ansi_buf)); /* Throw away control characters inside CSI sequences. Convert two character 7-bit sequences into 8-bit sequences. */ for (i = j = last_escape = 0; (ch = ansi_buf[i]) != 0; i++) { @@ -174,13 +174,13 @@ read_ansi(void) static int valid_mode(int expected) { - char *s; + unsigned char *s; int ch, terminator; read_ansi(); ape = 0; - ch = pack_buf[0] & 0xff; + ch = UChar(pack_buf[0]); ansi_value[0] = 0; if (ch != A_CSI && ch != A_DCS) return FALSE; @@ -216,6 +216,7 @@ read_reports(void) { int i, j, k, tc, vcr, lc; char *s; + const char *t; lc = 5; terminal_class = tc = 0; @@ -254,15 +255,15 @@ read_reports(void) vcr = TRUE; break; } - j = pack_buf[0] & 0xff; + j = UChar(pack_buf[0]); if (j != A_CSI && j != A_DCS) { put_crlf(); - s = "*** The above request gives illegal response ***"; - ptext(s); - for (j = strlen(s); j < 49; j++) + t = "*** The above request gives illegal response ***"; + ptext(t); + for (j = strlen(t); j < 49; j++) putchp(' '); } - s = expand(ansi_buf); + s = expand((const char *)ansi_buf); if (char_count + expand_chars >= columns) { put_str("\r\n "); lc++; @@ -322,14 +323,14 @@ request_cfss(void) putchp(' '); for (j = 0; ansi_buf[j]; j++) { if (ansi_buf[j] == 'r') { - for (k = j++; (ch = (ansi_buf[k] & 0xff)); k++) + for (k = j++; (ch = UChar(ansi_buf[k])) != 0; k++) if (ch == A_ESC) { break; } else if (ch == A_ST) { break; } ansi_buf[k] = '\0'; - s = expand(&ansi_buf[j]); + s = expand((const char *)&ansi_buf[j]); if (char_count + expand_chars >= columns) put_str("\r\n "); put_str(s); @@ -432,7 +433,7 @@ terminal_state(void) tc_putp(temp); if (!valid_mode(('$' << 8) | 'y')) { /* not valid, save terminating value */ - s = expand(ansi_buf); + s = expand((const char *)ansi_buf); sprintf(tms, "%s%s%d %s ", tms, puc[i], j, s); break; diff --git a/tack/charset.c b/tack/charset.c index ca0ac6ff..991401f3 100644 --- a/tack/charset.c +++ b/tack/charset.c @@ -21,7 +21,7 @@ #include -MODULE_ID("$Id: charset.c,v 1.4 2000/03/04 20:30:52 tom Exp $") +MODULE_ID("$Id: charset.c,v 1.8 2001/06/18 18:44:26 tom Exp $") /* Menu definitions for alternate character set and SGR tests. @@ -285,10 +285,12 @@ charset_sgr( } put_crlf(); +#ifdef max_attributes if (max_attributes >= 0) { sprintf(temp, "(ma) Maximum attributes %d ", max_attributes); ptext(temp); } +#endif generic_done_message(t, state, ch); } @@ -433,12 +435,12 @@ test_acs( break; } if (glyph[j].name[0] == '\0') { - if (isgraph(acs_chars[i])) { + if (isgraph(UChar(acs_chars[i]))) { sprintf(temp, " %c", acs_chars[i]); } else { sprintf(temp, " 0x%02x", - (acs_chars[i] & 0xff)); + UChar(acs_chars[i])); } strcpy(&temp[5], " *** has no mapping ***"); putln(temp); diff --git a/tack/edit.c b/tack/edit.c index a6281036..2d1a780d 100644 --- a/tack/edit.c +++ b/tack/edit.c @@ -23,7 +23,7 @@ #include #include -MODULE_ID("$Id: edit.c,v 1.5 2000/03/25 17:26:12 tom Exp $") +MODULE_ID("$Id: edit.c,v 1.8 2001/06/18 18:44:32 tom Exp $") /* * Terminfo edit features @@ -563,11 +563,11 @@ can_test( const char *s, int flags) { - int ch, i, j; + int ch, j; char name[32]; if (s) { - for (i = j = 0; (name[j] = ch = *s); s++) { + for (j = 0; (name[j] = ch = *s); s++) { if (ch == ' ' || ch == ')' || ch == '(') { if (j) { name[j] = '\0'; @@ -597,11 +597,11 @@ cap_index( int *inx) { struct name_table_entry const *nt; - int ch, i, j; + int ch, j; char name[32]; if (s) { - for (i = j = 0; ; s++) { + for (j = 0; ; s++) { name[j] = ch = *s; if (ch == ' ' || ch == ')' || ch == '(' || ch == 0) { if (j) { @@ -876,7 +876,7 @@ change_one_entry( putln(buf); ptextln("Enter new pad. 0 for no pad. CR for no change."); read_string(buf, 32); - if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(buf[0]))) { + if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(UChar(buf[0])))) { *chp = buf[0]; return; } diff --git a/tack/init.c b/tack/init.c index 42554526..8a2e44fa 100644 --- a/tack/init.c +++ b/tack/init.c @@ -22,7 +22,7 @@ #include -MODULE_ID("$Id: init.c,v 1.2 2000/05/13 19:58:48 Daniel.Weaver Exp $") +MODULE_ID("$Id: init.c,v 1.3 2001/06/16 17:54:19 tom Exp $") #if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219 #define _nc_get_curterm(p) _nc_get_tty_mode(p) @@ -163,8 +163,12 @@ display_basic(void) } else { report_cap(" (home)", cursor_home); } +#ifdef user9 report_cap("ENQ (u9)", user9); +#endif +#ifdef user8 report_cap("ACK (u8)", user8); +#endif sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %ld. Frame size: %d.%d", columns, lines, tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); putln(temp); diff --git a/tack/output.c b/tack/output.c index fac566e3..5825bea8 100644 --- a/tack/output.c +++ b/tack/output.c @@ -23,7 +23,7 @@ #include #include -MODULE_ID("$Id: output.c,v 1.5 2000/03/04 21:06:57 tom Exp $") +MODULE_ID("$Id: output.c,v 1.7 2001/06/18 18:44:40 tom Exp $") /* globals */ long char_sent; /* number of characters sent */ @@ -122,7 +122,7 @@ tc_putch(int c) } if (log_fp) { /* terminal output logging */ - c &= 0xff; + c = UChar(c); if (c < 32) { fprintf(log_fp, "<%s>", c0[c]); log_count += 5; @@ -561,7 +561,7 @@ hex_expand_to(char *s, int l) char *t; for (t = buf; *s; s++) { - sprintf(t, "%02X ", *s & 0xff); + sprintf(t, "%02X ", UChar(*s)); t += 3; if (t - buf > (int) sizeof(buf) - 4) { break; @@ -584,13 +584,13 @@ expand_command(const char *c) char *s; s = buf; - for (i = FALSE; (ch = (*c & 0xff)); c++) { + for (i = FALSE; (ch = UChar(*c)) != 0; c++) { if (i) { *s++ = ' '; } i = TRUE; if (ch < 32) { - j = c[1] & 0xff; + j = UChar(c[1]); if (ch == '\033' && j >= '@' && j <= '_') { ch = j - '@'; c++; @@ -599,7 +599,7 @@ expand_command(const char *c) for (j = 0; (*s = c0[ch][j++]); s++); } else { *s++ = ch; - j = c[1] & 0xff; + j = UChar(c[1]); if (ch >= '0' && ch <= '9' && j >= '0' && j <= '9') { i = FALSE; diff --git a/tack/sync.c b/tack/sync.c index 3323b93f..6eb91b25 100644 --- a/tack/sync.c +++ b/tack/sync.c @@ -22,7 +22,7 @@ #include #include -MODULE_ID("$Id: sync.c,v 1.2 2000/03/04 20:28:16 tom Exp $") +MODULE_ID("$Id: sync.c,v 1.3 2001/06/16 17:55:48 tom Exp $") /* terminal-synchronization and performance tests */ @@ -143,7 +143,11 @@ probe_enq_ok(void) fflush(stdout); can_test("u8 u9", FLAG_TESTED); +#ifdef user9 tty_ENQ = user9 ? user9 : "\005"; +#else + tty_ENQ = "\005"; +#endif tc_putp(tty_ENQ); event_start(TIME_SYNC); /* start the timer */ read_key(tty_ACK, TTY_ACK_SIZE - 1); @@ -159,16 +163,22 @@ probe_enq_ok(void) putln(expand(tty_ENQ)); ptext("ACK received: "); putln(expand(tty_ACK)); +#ifdef user8 len = user8 ? strlen(user8) : 0; +#else + len = 0; +#endif sprintf(temp, "Length of ACK %d. Expected length of ACK %d.", (int) strlen(tty_ACK), len); ptextln(temp); +#ifdef user8 if (len) { temp[0] = user8[len - 1]; temp[1] = '\0'; ptext("Terminating character found in (u8): "); putln(expand(temp)); } +#endif return; } @@ -180,6 +190,7 @@ probe_enq_ok(void) return; } tc = tty_ACK[len - 1]; +#ifdef user8 if (user8) { ulen = strlen(user8); if (tc == user8[ulen - 1]) { @@ -189,6 +200,7 @@ probe_enq_ok(void) return; } } +#endif /* fixed length acknowledge string */ ACK_length = len; ACK_terminator = -2; diff --git a/tack/sysdep.c b/tack/sysdep.c index 25376578..d8b48023 100644 --- a/tack/sysdep.c +++ b/tack/sysdep.c @@ -24,16 +24,19 @@ * global has no effect. */ -#if defined(__BEOS__) -#include -#endif +#include /* include before curses.h to work around glibc bug */ #include -#include #include #include +#if defined(__BEOS__) +#undef false +#undef true +#include +#endif + #if HAVE_SELECT #if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT #include @@ -43,7 +46,7 @@ #endif #endif -MODULE_ID("$Id: sysdep.c,v 1.9 2000/09/02 19:17:39 tom Exp $") +MODULE_ID("$Id: sysdep.c,v 1.11 2002/04/21 19:40:43 tom Exp $") #if DECL_ERRNO extern int errno; diff --git a/tack/tack.c b/tack/tack.c index 8ada023f..f6e37d44 100644 --- a/tack/tack.c +++ b/tack/tack.c @@ -21,7 +21,7 @@ #include -MODULE_ID("$Id: tack.c,v 1.1 1998/01/10 01:34:45 tom Exp $") +MODULE_ID("$Id: tack.c,v 1.2 2001/10/28 01:05:35 tom Exp $") /* This program is designed to test terminfo, not curses. Therefore @@ -126,7 +126,7 @@ struct test_menu edit_menu = { extern struct test_list mode_test_list[]; struct test_menu mode_menu = { - 0, 'n', 0, "Mode test menu", + 0, 'n', 0, "Test modes and glitches:", "mode", "n) run standard tests", 0, mode_test_list, 0, 0, 0 }; @@ -135,7 +135,7 @@ extern struct test_list acs_test_list[]; static struct test_menu acs_menu = { 0, 'n', 0, - "Alternate character set and graphics rendition test menu", + "Test alternate character set and graphics rendition:", "acs", "n) run standard tests", 0, acs_test_list, 0, 0, 0 }; @@ -144,7 +144,7 @@ extern struct test_list color_test_list[]; struct test_menu color_menu = { 0, 'n', 0, - "Color test menu", + "Test color:", "color", "n) run standard tests", 0, color_test_list, 0, 0, 0 }; @@ -153,7 +153,7 @@ extern struct test_list crum_test_list[]; static struct test_menu crum_menu = { 0, 'n', 0, - "Cursor movement test menu", + "Test cursor movement:", "move", "n) run standard tests", 0, crum_test_list, 0, 0, 0 }; @@ -162,7 +162,7 @@ extern struct test_list funkey_test_list[]; static struct test_menu funkey_menu = { 0, 'n', 0, - "Function key test menu", + "Test function keys:", "fkey", "n) run standard tests", sync_test, funkey_test_list, 0, 0, 0 }; @@ -171,7 +171,7 @@ extern struct test_list printer_test_list[]; static struct test_menu printer_menu = { 0, 'n', 0, - "Printer test menu", + "Test printer:", "printer", "n) run standard tests", 0, printer_test_list, 0, 0, 0 }; @@ -181,7 +181,7 @@ extern struct test_list pad_test_list[]; static struct test_menu pad_menu = { 0, 'n', 0, - "Pad test menu", + "Test padding and string capabilities:", "pad", "n) run standard tests", sync_test, pad_test_list, 0, 0, 0 }; @@ -190,11 +190,11 @@ static struct test_list normal_test_list[] = { {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, {MENU_NEXT, 0, 0, 0, "x) test modes and glitches", 0, &mode_menu}, - {MENU_NEXT, 0, 0, 0, "a) test alternate character sets", 0, &acs_menu}, + {MENU_NEXT, 0, 0, 0, "a) test alternate character set and graphic rendition", 0, &acs_menu}, {MENU_NEXT, 0, 0, 0, "c) test color", 0, &color_menu}, {MENU_NEXT, 0, 0, 0, "m) test cursor movement", 0, &crum_menu}, {MENU_NEXT, 0, 0, 0, "f) test function keys", 0, &funkey_menu}, - {MENU_NEXT, 0, 0, 0, "p) test string capabilities", 0, &pad_menu}, + {MENU_NEXT, 0, 0, 0, "p) test padding and string capabilities", 0, &pad_menu}, {0, 0, 0, 0, "P) test printer", 0, &printer_menu}, {MENU_MENU, 0, 0, 0, "/) test a specific capability", 0, 0}, {0, 0, 0, 0, "t) auto generate pad delays", pad_gen, &pad_menu}, diff --git a/tack/tack.h b/tack/tack.h index 52464d3e..daca1e12 100644 --- a/tack/tack.h +++ b/tack/tack.h @@ -19,10 +19,10 @@ ** Boston, MA 02111-1307, USA. */ -/* $Id: tack.h,v 1.6 2000/03/04 21:10:07 tom Exp $ */ +/* $Id: tack.h,v 1.9 2001/06/18 18:44:49 tom Exp $ */ -#ifndef _TACK_H -#define _TACK_H 1 +#ifndef NCURSES_TACK_H_incl +#define NCURSES_TACK_H_incl 1 /* terminfo action checker include file */ @@ -60,6 +60,8 @@ extern char *_nc_strstr(const char *, const char *); #define strstr(h,n) _nc_strstr(h,n) #endif +#define UChar(c) ((unsigned char)(c)) + extern FILE *log_fp; extern FILE *debug_fp; extern int debug_level; @@ -400,4 +402,4 @@ extern void menu_clear_screen(struct test_list *, int *, int *); extern void menu_reset_init(struct test_list *, int *, int *); extern int subtest_menu(struct test_list *, int *, int *); -#endif /* _TACK_H */ +#endif /* NCURSES_TACK_H_incl */ diff --git a/test/Makefile.in b/test/Makefile.in index 4cab5742..833b57f7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.60 2000/10/14 22:51:19 tom Exp $ +# $Id: Makefile.in,v 1.63 2002/02/03 00:54:10 china Exp $ ############################################################################## -# Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. # +# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -69,7 +69,7 @@ LOCAL_LIBS = @TEST_DEPS@ MATH_LIB = @MATH_LIB@ LD = @LD@ -LINK = @LINK_TESTS@ $(LIBTOOL) $(CC) +LINK = @LINK_TESTS@ $(LIBTOOL) $(CC) $(CFLAGS) LDFLAGS = @LD_MODEL@ @TEST_ARGS@ @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@ @@ -201,7 +201,7 @@ uninstall.libs: uninstall.test: mostlyclean :: - -rm -f core tags TAGS *~ *.ln *.atac trace + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace clean :: mostlyclean -rm -rf *.o screendump *.lis $(TESTS) .libs diff --git a/test/blue.c b/test/blue.c index 4f733513..cd0ccdaa 100644 --- a/test/blue.c +++ b/test/blue.c @@ -13,16 +13,12 @@ * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is * just as good. * - * $Id: blue.c,v 1.18 1999/01/17 00:11:56 tom Exp $ + * $Id: blue.c,v 1.24 2002/06/29 23:32:18 tom Exp $ */ -#include - -#include -#include #include -#include +#include #define NOCARD (-1) @@ -55,7 +51,7 @@ static int deck[PACK_SIZE]; static int grid[GRID_LENGTH]; /* card layout grid */ static int freeptr[4]; /* free card space pointers */ -static int deal_number=0; +static int deal_number = 0; static chtype ranks[SUIT_LENGTH][2] = { @@ -106,75 +102,75 @@ static chtype glyphs[] = static chtype *suits = letters; /* this may change to glyphs below */ -static RETSIGTYPE die(int onsig) +static RETSIGTYPE +die(int onsig) { (void) signal(onsig, SIG_IGN); endwin(); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } -static void init_vars(void) +static void +init_vars(void) { int i; deck_size = PACK_SIZE; - for (i=0; i < PACK_SIZE; i++) - deck[i]=i; + for (i = 0; i < PACK_SIZE; i++) + deck[i] = i; for (i = 0; i < 4; i++) - freeptr[i]=i * GRID_WIDTH; + freeptr[i] = i * GRID_WIDTH; } -static void shuffle(int size) +static void +shuffle(int size) { - int i,j,numswaps,swapnum,temp; + int i, j, numswaps, swapnum, temp; - numswaps=size*10; /* an arbitrary figure */ + numswaps = size * 10; /* an arbitrary figure */ - for (swapnum=0;swapnum=PACK_SIZE)) - return(NOCARD); - for(i = 0; i < GRID_LENGTH; i++) + if ((card < 0) || (card >= PACK_SIZE)) + return (NOCARD); + for (i = 0; i < GRID_LENGTH; i++) if (grid[i] == card) return i; - return(NOCARD); + return (NOCARD); } -static void movecard(int src, int dst) +static void +movecard(int src, int dst) { - grid[dst]=grid[src]; - grid[src]=NOCARD; + grid[dst] = grid[src]; + grid[src] = NOCARD; - move( BASEROW + (dst / GRID_WIDTH)*2+2, (dst % GRID_WIDTH)*5 + 1); + move(BASEROW + (dst / GRID_WIDTH) * 2 + 2, (dst % GRID_WIDTH) * 5 + 1); printcard(grid[dst]); - move( BASEROW + (src / GRID_WIDTH)*2+2, (src % GRID_WIDTH)*5 + 1); + move(BASEROW + (src / GRID_WIDTH) * 2 + 2, (src % GRID_WIDTH) * 5 + 1); printcard(grid[src]); refresh(); } -static void play_game(void) +static void +play_game(void) { - int dead=0, i, j; + int dead = 0, i, j; char c; int selection[4], card; - while (dead<4) - { - dead=0; - for (i=0;i<4;i++) - { - card=grid[freeptr[i]-1]; + while (dead < 4) { + dead = 0; + for (i = 0; i < 4; i++) { + card = grid[freeptr[i] - 1]; - if ( ((card % SUIT_LENGTH)==KING) + if (((card % SUIT_LENGTH) == KING) || - (card==NOCARD) ) - selection[i]=NOCARD; + (card == NOCARD)) + selection[i] = NOCARD; else - selection[i]=find(card+1); + selection[i] = find(card + 1); - if (selection[i]==NOCARD) + if (selection[i] == NOCARD) dead++; }; - if (dead < 4) - { - char live[NSUITS+1], *lp = live; - - for (i=0;i<4;i++) - { - if (selection[i] != NOCARD) - { - move(BASEROW + (selection[i] / GRID_WIDTH)*2+3, - (selection[i] % GRID_WIDTH)*5); - (void)printw(" %c ", *lp++ = 'a' + i); + if (dead < 4) { + char live[NSUITS + 1], *lp = live; + + for (i = 0; i < 4; i++) { + if (selection[i] != NOCARD) { + move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, + (selection[i] % GRID_WIDTH) * 5); + (void) printw(" %c ", *lp++ = 'a' + i); } }; *lp = '\0'; - if (strlen(live) == 1) - { - move(PROMPTROW,0); - (void)printw( - "Making forced moves... "); + if (strlen(live) == 1) { + move(PROMPTROW, 0); + (void) printw( + "Making forced moves... "); refresh(); (void) sleep(1); c = live[0]; - } - else - { - char buf[BUFSIZ]; + } else { + char buf[BUFSIZ]; - (void)sprintf(buf, - "Type [%s] to move, r to redraw, q or INTR to quit: ", - live); + (void) sprintf(buf, + "Type [%s] to move, r to redraw, q or INTR to quit: ", + live); do { - move(PROMPTROW,0); + move(PROMPTROW, 0); (void) addstr(buf); - move(PROMPTROW, (int)strlen(buf)); + move(PROMPTROW, (int) strlen(buf)); clrtoeol(); (void) addch(' '); } while - (((c = getch())<'a' || c>'d') && (c!='r') && (c!='q')); + (((c = getch()) < 'a' || c > 'd') && (c != 'r') && (c != 'q')); } for (j = 0; j < 4; j++) - if (selection[j]!=NOCARD) - { - move(BASEROW + (selection[j] / GRID_WIDTH)*2+3, - (selection[j] % GRID_WIDTH)*5); - (void)printw(" "); + if (selection[j] != NOCARD) { + move(BASEROW + (selection[j] / GRID_WIDTH) * 2 + 3, + (selection[j] % GRID_WIDTH) * 5); + (void) printw(" "); } if (c == 'r') display_cards(deal_number); else if (c == 'q') die(SIGINT); - else - { - i = c-'a'; + else { + i = c - 'a'; if (selection[i] == NOCARD) beep(); - else - { + else { movecard(selection[i], freeptr[i]); - freeptr[i]=selection[i]; + freeptr[i] = selection[i]; } } } @@ -334,76 +323,79 @@ static void play_game(void) move(PROMPTROW, 0); standout(); - (void)printw("Finished deal %d - type any character to continue...", deal_number); + (void) printw("Finished deal %d - type any character to continue...", deal_number); standend(); (void) getch(); } -static int collect_discards(void) +static int +collect_discards(void) { - int row, col, cardno=0, finish, gridno; - - for (row=HEARTS;row<=CLUBS;row++) - { - finish=0; - for (col=1;col - -#include #include -#include #include #include +#include + #ifndef SIGIOT #define SIGIOT SIGABRT #endif -#ifndef A_UNDERLINE /* BSD curses */ -#define beep() write(1,"\007",1); -#define cbreak crmode -#define saveterm savetty -#define resetterm resetty -#define nocbreak nocrmode -#define strchr index -#endif /* !A_UNDERLINE */ - static int getcoord(int); /* @@ -57,7 +46,7 @@ static int getcoord(int); /* display symbols */ #define SHOWHIT '*' #define SHOWSPLASH ' ' -#define IS_SHIP(c) (isupper(c) ? TRUE : FALSE) +#define IS_SHIP(c) (isupper(UChar(c)) ? TRUE : FALSE) /* how to position us on player board */ #define PYBASE 3 @@ -79,12 +68,12 @@ static int getcoord(int); /* other board locations */ #define COLWIDTH 80 -#define PROMPTLINE 21 /* prompt line */ +#define PROMPTLINE 21 /* prompt line */ #define SYBASE CYBASE + BDEPTH + 3 /* move key diagram */ #define SXBASE 63 -#define MYBASE SYBASE - 1 /* diagram caption */ +#define MYBASE SYBASE - 1 /* diagram caption */ #define MXBASE 64 -#define HYBASE SYBASE - 1 /* help area */ +#define HYBASE SYBASE - 1 /* help area */ #define HXBASE 0 /* this will need to be changed if BWIDTH changes */ @@ -108,76 +97,76 @@ static char dftname[] = "stranger"; #define NW 5 #define N 6 #define NE 7 -static int xincr[8] = {1, 1, 0, -1, -1, -1, 0, 1}; -static int yincr[8] = {0, 1, 1, 1, 0, -1, -1, -1}; +static int xincr[8] = +{1, 1, 0, -1, -1, -1, 0, 1}; +static int yincr[8] = +{0, 1, 1, 1, 0, -1, -1, -1}; /* current ship position and direction */ static int curx = (BWIDTH / 2); static int cury = (BDEPTH / 2); -typedef struct -{ +typedef struct { char *name; /* name of the ship type */ int hits; /* how many times has this ship been hit? */ char symbol; /* symbol for game purposes */ int length; /* length of ship */ - char x, y; /* coordinates of ship start point */ - unsigned char dir; /* direction of `bow' */ + int x, y; /* coordinates of ship start point */ + int dir; /* direction of `bow' */ bool placed; /* has it been placed on the board? */ -} -ship_t; +} ship_t; -static bool checkplace(int b, ship_t *ss, int vis); +static bool checkplace(int b, ship_t * ss, int vis); #define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE } static ship_t plyship[SHIPTYPES] = { - SHIPIT(carrier, 'A', 5), - SHIPIT(battle, 'B', 4), - SHIPIT(destroy, 'D', 3), - SHIPIT(sub, 'S', 3), - SHIPIT(ptboat, 'P', 2), + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), }; static ship_t cpuship[SHIPTYPES] = { - SHIPIT(carrier, 'A', 5), - SHIPIT(battle, 'B', 4), - SHIPIT(destroy, 'D', 3), - SHIPIT(sub, 'S', 3), - SHIPIT(ptboat, 'P', 2), + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), }; /* "Hits" board, and main board. */ static char hits[2][BWIDTH][BDEPTH]; static char board[2][BWIDTH][BDEPTH]; -static int turn; /* 0=player, 1=computer */ -static int plywon=0, cpuwon=0; /* How many games has each won? */ +static int turn; /* 0=player, 1=computer */ +static int plywon = 0, cpuwon = 0; /* How many games has each won? */ static int salvo, blitz, closepack; #define PR (void)addstr -static RETSIGTYPE uninitgame(int sig) GCC_NORETURN; +static RETSIGTYPE uninitgame(int sig) GCC_NORETURN; static RETSIGTYPE uninitgame(int sig GCC_UNUSED) /* end the game, either normally or due to signal */ { clear(); - (void)refresh(); - (void)resetterm(); - (void)echo(); - (void)endwin(); - exit(EXIT_FAILURE); + (void) refresh(); + (void) reset_shell_mode(); + (void) echo(); + (void) endwin(); + ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS); } -static void announceopts(void) +static void +announceopts(void) /* announce which game options are enabled */ { - if (salvo || blitz || closepack) - { + if (salvo || blitz || closepack) { (void) printw("Playing optional game ("); if (salvo) (void) printw("salvo, "); @@ -191,45 +180,41 @@ static void announceopts(void) (void) printw("closepack)"); else (void) printw("noclosepack)"); - } - else + } else (void) printw( - "Playing standard game (noblitz, nosalvo, noclosepack)"); + "Playing standard game (noblitz, nosalvo, noclosepack)"); } -static void intro(void) +static void +intro(void) { char *tmpname; - srand((unsigned)(time(0L)+getpid())); /* Kick the random number generator */ + srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */ - (void) signal(SIGINT,uninitgame); - (void) signal(SIGINT,uninitgame); - (void) signal(SIGIOT,uninitgame); /* for assert(3) */ - if(signal(SIGQUIT,SIG_IGN) != SIG_IGN) - (void)signal(SIGQUIT,uninitgame); + (void) signal(SIGINT, uninitgame); + (void) signal(SIGINT, uninitgame); + (void) signal(SIGIOT, uninitgame); /* for assert(3) */ + if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) + (void) signal(SIGQUIT, uninitgame); - if((tmpname = getlogin()) != 0) - { - (void)strcpy(name,tmpname); + if ((tmpname = getlogin()) != 0) { + (void) strcpy(name, tmpname); name[0] = toupper(name[0]); - } - else - (void)strcpy(name,dftname); + } else + (void) strcpy(name, dftname); - (void)initscr(); -#ifdef KEY_MIN + (void) initscr(); keypad(stdscr, TRUE); -#endif /* KEY_MIN */ - (void)saveterm(); - (void)nonl(); - (void)cbreak(); - (void)noecho(); + (void) def_prog_mode(); + (void) nonl(); + (void) cbreak(); + (void) noecho(); #ifdef PENGUIN - (void)clear(); - (void)mvaddstr(4,29,"Welcome to Battleship!"); - (void)move(8,0); + (void) clear(); + (void) mvaddstr(4, 29, "Welcome to Battleship!"); + (void) move(8, 0); PR(" \\\n"); PR(" \\ \\ \\\n"); PR(" \\ \\ \\ \\ \\_____________\n"); @@ -241,7 +226,8 @@ static void intro(void) PR(" \\ /\n"); PR(" \\___________________________________________________/\n"); - (void) mvaddstr(22,27,"Hit any key to continue..."); (void)refresh(); + (void) mvaddstr(22, 27, "Hit any key to continue..."); + (void) refresh(); (void) getch(); #endif /* PENGUIN */ @@ -259,12 +245,13 @@ static void intro(void) #endif /* A_COLOR */ #ifdef NCURSES_MOUSE_VERSION - (void) mousemask(BUTTON1_CLICKED, (mmask_t *)NULL); -#endif /* NCURSES_MOUSE_VERSION*/ -} + (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); +#endif /* NCURSES_MOUSE_VERSION */ +} /* VARARGS1 */ -static void prompt(int n, NCURSES_CONST char *f, const char *s) +static void +prompt(int n, NCURSES_CONST char *f, const char *s) /* print a message at the prompt line */ { (void) move(PROMPTLINE + n, 0); @@ -273,92 +260,90 @@ static void prompt(int n, NCURSES_CONST char *f, const char *s) (void) refresh(); } -static void error(NCURSES_CONST char *s) +static void +error(NCURSES_CONST char *s) { (void) move(PROMPTLINE + 2, 0); (void) clrtoeol(); - if (s) - { + if (s) { (void) addstr(s); (void) beep(); } } -static void placeship(int b, ship_t *ss, int vis) +static void +placeship(int b, ship_t * ss, int vis) { int l; - for(l = 0; l < ss->length; ++l) - { + for (l = 0; l < ss->length; ++l) { int newx = ss->x + l * xincr[ss->dir]; int newy = ss->y + l * yincr[ss->dir]; board[b][newx][newy] = ss->symbol; - if (vis) - { + if (vis) { pgoto(newy, newx); - (void) addch((chtype)ss->symbol); + (void) addch((chtype) ss->symbol); } } ss->hits = 0; } -static int rnd(int n) +static int +rnd(int n) { - return(((rand() & 0x7FFF) % n)); + return (((rand() & 0x7FFF) % n)); } -static void randomplace(int b, ship_t *ss) +static void +randomplace(int b, ship_t * ss) /* generate a valid random ship placement into px,py */ { - register int bwidth = BWIDTH - ss->length; - register int bdepth = BDEPTH - ss->length; do { - ss->y = rnd(bdepth); - ss->x = rnd(bwidth); ss->dir = rnd(2) ? E : S; + ss->x = rnd(BWIDTH - (ss->dir == E ? ss->length : 0)); + ss->y = rnd(BDEPTH - (ss->dir == S ? ss->length : 0)); } while (!checkplace(b, ss, FALSE)); } -static void initgame(void) +static void +initgame(void) { int i, j, unplaced; ship_t *ss; (void) clear(); - (void) mvaddstr(0,35,"BATTLESHIPS"); + (void) mvaddstr(0, 35, "BATTLESHIPS"); (void) move(PROMPTLINE + 2, 0); announceopts(); memset(board, 0, sizeof(char) * BWIDTH * BDEPTH * 2); - memset(hits, 0, sizeof(char) * BWIDTH * BDEPTH * 2); - for (i = 0; i < SHIPTYPES; i++) - { + memset(hits, 0, sizeof(char) * BWIDTH * BDEPTH * 2); + for (i = 0; i < SHIPTYPES; i++) { ss = cpuship + i; ss->x = - ss->y = - ss->dir = - ss->hits = 0; + ss->y = + ss->dir = + ss->hits = 0; ss->placed = FALSE; ss = plyship + i; ss->x = - ss->y = - ss->dir = - ss->hits = 0; + ss->y = + ss->dir = + ss->hits = 0; ss->placed = FALSE; } /* draw empty boards */ (void) mvaddstr(PYBASE - 2, PXBASE + 5, "Main Board"); - (void) mvaddstr(PYBASE - 1, PXBASE - 3,numbers); - for(i=0; i < BDEPTH; ++i) - { - (void) mvaddch(PYBASE + i, PXBASE - 3, (chtype)(i + 'A')); + (void) mvaddstr(PYBASE - 1, PXBASE - 3, numbers); + for (i = 0; i < BDEPTH; ++i) { + (void) mvaddch(PYBASE + i, PXBASE - 3, (chtype) (i + 'A')); #ifdef A_COLOR if (has_colors()) attron(COLOR_PAIR(COLOR_BLUE)); @@ -370,14 +355,13 @@ static void initgame(void) attrset(0); #endif /* A_COLOR */ (void) addch(' '); - (void) addch((chtype)(i + 'A')); + (void) addch((chtype) (i + 'A')); } - (void) mvaddstr(PYBASE + BDEPTH, PXBASE - 3,numbers); - (void) mvaddstr(CYBASE - 2, CXBASE + 7,"Hit/Miss Board"); + (void) mvaddstr(PYBASE + BDEPTH, PXBASE - 3, numbers); + (void) mvaddstr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board"); (void) mvaddstr(CYBASE - 1, CXBASE - 3, numbers); - for(i=0; i < BDEPTH; ++i) - { - (void) mvaddch(CYBASE + i, CXBASE - 3, (chtype)(i + 'A')); + for (i = 0; i < BDEPTH; ++i) { + (void) mvaddch(CYBASE + i, CXBASE - 3, (chtype) (i + 'A')); #ifdef A_COLOR if (has_colors()) attron(COLOR_PAIR(COLOR_BLUE)); @@ -389,39 +373,38 @@ static void initgame(void) attrset(0); #endif /* A_COLOR */ (void) addch(' '); - (void) addch((chtype)(i + 'A')); + (void) addch((chtype) (i + 'A')); } - (void) mvaddstr(CYBASE + BDEPTH,CXBASE - 3,numbers); + (void) mvaddstr(CYBASE + BDEPTH, CXBASE - 3, numbers); - (void) mvprintw(HYBASE, HXBASE, + (void) mvprintw(HYBASE, HXBASE, "To position your ships: move the cursor to a spot, then"); - (void) mvprintw(HYBASE+1,HXBASE, + (void) mvprintw(HYBASE + 1, HXBASE, "type the first letter of a ship type to select it, then"); - (void) mvprintw(HYBASE+2,HXBASE, + (void) mvprintw(HYBASE + 2, HXBASE, "type a direction ([hjkl] or [4862]), indicating how the"); - (void) mvprintw(HYBASE+3,HXBASE, + (void) mvprintw(HYBASE + 3, HXBASE, "ship should be pointed. You may also type a ship letter"); - (void) mvprintw(HYBASE+4,HXBASE, + (void) mvprintw(HYBASE + 4, HXBASE, "followed by `r' to position it randomly, or type `R' to"); - (void) mvprintw(HYBASE+5,HXBASE, + (void) mvprintw(HYBASE + 5, HXBASE, "place all remaining ships randomly."); - (void) mvaddstr(MYBASE, MXBASE, "Aiming keys:"); - (void) mvaddstr(SYBASE, SXBASE, "y k u 7 8 9"); - (void) mvaddstr(SYBASE+1, SXBASE, " \\|/ \\|/ "); - (void) mvaddstr(SYBASE+2, SXBASE, "h-+-l 4-+-6"); - (void) mvaddstr(SYBASE+3, SXBASE, " /|\\ /|\\ "); - (void) mvaddstr(SYBASE+4, SXBASE, "b j n 1 2 3"); + (void) mvaddstr(MYBASE, MXBASE, "Aiming keys:"); + (void) mvaddstr(SYBASE, SXBASE, "y k u 7 8 9"); + (void) mvaddstr(SYBASE + 1, SXBASE, " \\|/ \\|/ "); + (void) mvaddstr(SYBASE + 2, SXBASE, "h-+-l 4-+-6"); + (void) mvaddstr(SYBASE + 3, SXBASE, " /|\\ /|\\ "); + (void) mvaddstr(SYBASE + 4, SXBASE, "b j n 1 2 3"); /* have the computer place ships */ - for(ss = cpuship; ss < cpuship + SHIPTYPES; ss++) - { + for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) { randomplace(COMPUTER, ss); placeship(COMPUTER, ss, FALSE); } - ss = (ship_t *)NULL; + ss = (ship_t *) NULL; do { char c, docked[SHIPTYPES + 2], *cp = docked; @@ -433,7 +416,7 @@ static void initgame(void) *cp = '\0'; /* get a command letter */ - prompt(1, "Type one of [%s] to pick a ship.", docked+1); + prompt(1, "Type one of [%s] to pick a ship.", docked + 1); do { c = getcoord(PLAYER); } while @@ -441,8 +424,7 @@ static void initgame(void) if (c == 'R') (void) ungetch('R'); - else - { + else { /* map that into the corresponding symbol */ for (ss = plyship; ss < plyship + SHIPTYPES; ss++) if (ss->symbol == c) @@ -457,48 +439,50 @@ static void initgame(void) } while (!strchr("hjklrR", c) || c == FF); - if (c == FF) - { - (void)clearok(stdscr, TRUE); - (void)refresh(); - } - else if (c == 'r') - { + if (c == FF) { + (void) clearok(stdscr, TRUE); + (void) refresh(); + } else if (c == 'r') { prompt(1, "Random-placing your %s", ss->name); randomplace(PLAYER, ss); placeship(PLAYER, ss, TRUE); - error((char *)NULL); + error((char *) NULL); ss->placed = TRUE; - } - else if (c == 'R') - { + } else if (c == 'R') { prompt(1, "Placing the rest of your fleet at random...", ""); for (ss = plyship; ss < plyship + SHIPTYPES; ss++) - if (!ss->placed) - { + if (!ss->placed) { randomplace(PLAYER, ss); placeship(PLAYER, ss, TRUE); ss->placed = TRUE; } - error((char *)NULL); - } - else if (strchr("hjkl8462", c)) - { + error((char *) NULL); + } else if (strchr("hjkl8462", c)) { ss->x = curx; ss->y = cury; - switch(c) - { - case 'k': case '8': ss->dir = N; break; - case 'j': case '2': ss->dir = S; break; - case 'h': case '4': ss->dir = W; break; - case 'l': case '6': ss->dir = E; break; - } + switch (c) { + case 'k': + case '8': + ss->dir = N; + break; + case 'j': + case '2': + ss->dir = S; + break; + case 'h': + case '4': + ss->dir = W; + break; + case 'l': + case '6': + ss->dir = E; + break; + } - if (checkplace(PLAYER, ss, TRUE)) - { + if (checkplace(PLAYER, ss, TRUE)) { placeship(PLAYER, ss, TRUE); - error((char *)NULL); + error((char *) NULL); ss->placed = TRUE; } } @@ -510,116 +494,112 @@ static void initgame(void) turn = rnd(2); - (void) mvprintw(HYBASE, HXBASE, + (void) mvprintw(HYBASE, HXBASE, "To fire, move the cursor to your chosen aiming point "); - (void) mvprintw(HYBASE+1, HXBASE, + (void) mvprintw(HYBASE + 1, HXBASE, "and strike any key other than a motion key. "); - (void) mvprintw(HYBASE+2, HXBASE, + (void) mvprintw(HYBASE + 2, HXBASE, " "); - (void) mvprintw(HYBASE+3, HXBASE, + (void) mvprintw(HYBASE + 3, HXBASE, " "); - (void) mvprintw(HYBASE+4, HXBASE, + (void) mvprintw(HYBASE + 4, HXBASE, " "); - (void) mvprintw(HYBASE+5, HXBASE, + (void) mvprintw(HYBASE + 5, HXBASE, " "); (void) prompt(0, "Press any key to start...", ""); (void) getch(); } -static int getcoord(int atcpu) +static int +getcoord(int atcpu) { int ny, nx, c; if (atcpu) - cgoto(cury,curx); + cgoto(cury, curx); else pgoto(cury, curx); - (void)refresh(); - for (;;) - { - if (atcpu) - { - (void) mvprintw(CYBASE + BDEPTH+1, CXBASE+11, "(%d, %c)", curx, 'A'+cury); + (void) refresh(); + for (;;) { + if (atcpu) { + (void) mvprintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)", + curx, 'A' + cury); cgoto(cury, curx); - } - else - { - (void) mvprintw(PYBASE + BDEPTH+1, PXBASE+11, "(%d, %c)", curx, 'A'+cury); + } else { + (void) mvprintw(PYBASE + BDEPTH + 1, PXBASE + 11, "(%d, %c)", + curx, 'A' + cury); pgoto(cury, curx); } - switch(c = getch()) - { - case 'k': case '8': -#ifdef KEY_MIN + switch (c = getch()) { + case 'k': + case '8': case KEY_UP: -#endif /* KEY_MIN */ - ny = cury+BDEPTH-1; nx = curx; + ny = cury + BDEPTH - 1; + nx = curx; break; - case 'j': case '2': -#ifdef KEY_MIN + case 'j': + case '2': case KEY_DOWN: -#endif /* KEY_MIN */ - ny = cury+1; nx = curx; + ny = cury + 1; + nx = curx; break; - case 'h': case '4': -#ifdef KEY_MIN + case 'h': + case '4': case KEY_LEFT: -#endif /* KEY_MIN */ - ny = cury; nx = curx+BWIDTH-1; + ny = cury; + nx = curx + BWIDTH - 1; break; - case 'l': case '6': -#ifdef KEY_MIN + case 'l': + case '6': case KEY_RIGHT: -#endif /* KEY_MIN */ - ny = cury; nx = curx+1; + ny = cury; + nx = curx + 1; break; - case 'y': case '7': -#ifdef KEY_MIN + case 'y': + case '7': case KEY_A1: -#endif /* KEY_MIN */ - ny = cury+BDEPTH-1; nx = curx+BWIDTH-1; + ny = cury + BDEPTH - 1; + nx = curx + BWIDTH - 1; break; - case 'b': case '1': -#ifdef KEY_MIN + case 'b': + case '1': case KEY_C1: -#endif /* KEY_MIN */ - ny = cury+1; nx = curx+BWIDTH-1; + ny = cury + 1; + nx = curx + BWIDTH - 1; break; - case 'u': case '9': -#ifdef KEY_MIN + case 'u': + case '9': case KEY_A3: -#endif /* KEY_MIN */ - ny = cury+BDEPTH-1; nx = curx+1; + ny = cury + BDEPTH - 1; + nx = curx + 1; break; - case 'n': case '3': -#ifdef KEY_MIN + case 'n': + case '3': case KEY_C3: -#endif /* KEY_MIN */ - ny = cury+1; nx = curx+1; + ny = cury + 1; + nx = curx + 1; break; case FF: - nx = curx; ny = cury; - (void)clearok(stdscr, TRUE); - (void)refresh(); + nx = curx; + ny = cury; + (void) clearok(stdscr, TRUE); + (void) refresh(); break; #ifdef NCURSES_MOUSE_VERSION case KEY_MOUSE: { - MEVENT myevent; + MEVENT myevent; getmouse(&myevent); if (atcpu - && myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) - && myevent.x >= CX(0) && myevent.x <= CX(BDEPTH)) - { + && myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) + && myevent.x >= CX(0) && myevent.x <= CX(BDEPTH)) { curx = CXINV(myevent.x); cury = CYINV(myevent.y); - return(' '); - } - else - { + return (' '); + } else { beep(); continue; } @@ -632,7 +612,7 @@ static int getcoord(int atcpu) (void) mvaddstr(CYBASE + BDEPTH + 1, CXBASE + 11, " "); else (void) mvaddstr(PYBASE + BDEPTH + 1, PXBASE + 11, " "); - return(c); + return (c); } curx = nx % BWIDTH; @@ -640,48 +620,46 @@ static int getcoord(int atcpu) } } -static bool collidecheck(int b, int y, int x) +static bool +collidecheck(int b, int y, int x) /* is this location on the selected zboard adjacent to a ship? */ { bool collide; /* anything on the square */ if ((collide = IS_SHIP(board[b][x][y])) != FALSE) - return(collide); + return (collide); /* anything on the neighbors */ - if (!closepack) - { + if (!closepack) { int i; - for (i = 0; i < 8; i++) - { + for (i = 0; i < 8; i++) { int xend, yend; yend = y + yincr[i]; xend = x + xincr[i]; if (ONBOARD(xend, yend) - && IS_SHIP(board[b][xend][yend])) { + && IS_SHIP(board[b][xend][yend])) { collide = TRUE; break; } } } - return(collide); + return (collide); } -static bool checkplace(int b, ship_t *ss, int vis) +static bool +checkplace(int b, ship_t * ss, int vis) { int l, xend, yend; /* first, check for board edges */ - xend = ss->x + ss->length * xincr[ss->dir]; - yend = ss->y + ss->length * yincr[ss->dir]; - if (!ONBOARD(xend, yend)) - { + xend = ss->x + (ss->length - 1) * xincr[ss->dir]; + yend = ss->y + (ss->length - 1) * yincr[ss->dir]; + if (!ONBOARD(xend, yend)) { if (vis) - switch(rnd(3)) - { + switch (rnd(3)) { case 0: error("Ship is hanging from the edge of the world"); break; @@ -692,50 +670,48 @@ static bool checkplace(int b, ship_t *ss, int vis) error("Figure I won't find it if you put it there?"); break; } - return(FALSE); + return (FALSE); } - for(l = 0; l < ss->length; ++l) - { - if(collidecheck(b, ss->y+l*yincr[ss->dir], ss->x+l*xincr[ss->dir])) - { + for (l = 0; l < ss->length; ++l) { + if (collidecheck(b, ss->y + l * yincr[ss->dir], ss->x + l * xincr[ss->dir])) { if (vis) - switch(rnd(3)) - { - case 0: - error("There's already a ship there"); - break; - case 1: - error("Collision alert! Aaaaaagh!"); - break; - case 2: - error("Er, Admiral, what about the other ship?"); - break; - } - return(FALSE); - } + switch (rnd(3)) { + case 0: + error("There's already a ship there"); + break; + case 1: + error("Collision alert! Aaaaaagh!"); + break; + case 2: + error("Er, Admiral, what about the other ship?"); + break; + } + return (FALSE); } - return(TRUE); + } + return (TRUE); } -static int awinna(void) +static int +awinna(void) { int i, j; ship_t *ss; - for(i=0; i<2; ++i) - { + for (i = 0; i < 2; ++i) { ss = (i) ? cpuship : plyship; - for(j=0; j < SHIPTYPES; ++j, ++ss) - if(ss->length > ss->hits) + for (j = 0; j < SHIPTYPES; ++j, ++ss) + if (ss->length > ss->hits) break; if (j == SHIPTYPES) - return(OTHER); + return (OTHER); } - return(-1); + return (-1); } -static ship_t *hitship(int x, int y) +static ship_t * +hitship(int x, int y) /* register a hit on the targeted ship */ { ship_t *sb, *ss; @@ -744,85 +720,88 @@ static ship_t *hitship(int x, int y) getyx(stdscr, oldy, oldx); sb = (turn) ? plyship : cpuship; - if((sym = board[OTHER][x][y]) == 0) - return((ship_t *)NULL); - for(ss = sb; ss < sb + SHIPTYPES; ++ss) - if(ss->symbol == sym) - { + if ((sym = board[OTHER][x][y]) == 0) + return ((ship_t *) NULL); + for (ss = sb; ss < sb + SHIPTYPES; ++ss) + if (ss->symbol == sym) { if (++ss->hits < ss->length) /* still afloat? */ - return((ship_t *)NULL); - else /* sunk! */ - { + return ((ship_t *) NULL); + else { /* sunk! */ int i, j; if (!closepack) - for (j = -1; j <= 1; j++) - { + for (j = -1; j <= 1; j++) { int bx = ss->x + j * xincr[(ss->dir + 2) % 8]; int by = ss->y + j * yincr[(ss->dir + 2) % 8]; - for (i = -1; i <= ss->length; ++i) - { + for (i = -1; i <= ss->length; ++i) { int x1, y1; - + x1 = bx + i * xincr[ss->dir]; y1 = by + i * yincr[ss->dir]; - if (ONBOARD(x1, y1)) - { + if (ONBOARD(x1, y1)) { hits[turn][x1][y1] = MARK_MISS; - if (turn % 2 == PLAYER) - { + if (turn % 2 == PLAYER) { cgoto(y1, x1); #ifdef A_COLOR if (has_colors()) attron(COLOR_PAIR(COLOR_GREEN)); #endif /* A_COLOR */ - (void)addch(MARK_MISS); + (void) addch(MARK_MISS); #ifdef A_COLOR attrset(0); #endif /* A_COLOR */ + } else { + pgoto(y1, x1); + (void) addch(SHOWSPLASH); } } } } - for (i = 0; i < ss->length; ++i) - { + for (i = 0; i < ss->length; ++i) { int x1 = ss->x + i * xincr[ss->dir]; int y1 = ss->y + i * yincr[ss->dir]; hits[turn][x1][y1] = ss->symbol; - if (turn % 2 == PLAYER) - { + if (turn % 2 == PLAYER) { cgoto(y1, x1); - (void) addch((chtype)(ss->symbol)); + (void) addch((chtype) (ss->symbol)); + } else { + pgoto(y1, x1); +#ifdef A_COLOR + if (has_colors()) + attron(COLOR_PAIR(COLOR_RED)); +#endif /* A_COLOR */ + (void) addch(SHOWHIT); +#ifdef A_COLOR + attrset(0); +#endif /* A_COLOR */ } } (void) move(oldy, oldx); - return(ss); + return (ss); } } (void) move(oldy, oldx); - return((ship_t *)NULL); + return ((ship_t *) NULL); } -static int plyturn(void) +static bool +plyturn(void) { ship_t *ss; bool hit; NCURSES_CONST char *m = NULL; prompt(1, "Where do you want to shoot? ", ""); - for (;;) - { + for (;;) { (void) getcoord(COMPUTER); - if (hits[PLAYER][curx][cury]) - { + if (hits[PLAYER][curx][cury]) { prompt(1, "You shelled this spot already! Try again.", ""); beep(); - } - else + } else break; } hit = IS_SHIP(board[COMPUTER][curx][cury]); @@ -836,16 +815,14 @@ static int plyturn(void) attron(COLOR_PAIR(COLOR_GREEN)); } #endif /* A_COLOR */ - (void) addch((chtype)hits[PLAYER][curx][cury]); + (void) addch((chtype) hits[PLAYER][curx][cury]); #ifdef A_COLOR attrset(0); #endif /* A_COLOR */ prompt(1, "You %s.", hit ? "scored a hit" : "missed"); - if(hit && (ss = hitship(curx, cury))) - { - switch(rnd(5)) - { + if (hit && (ss = hitship(curx, cury))) { + switch (rnd(5)) { case 0: m = " You sank my %s!"; break; @@ -862,44 +839,43 @@ static int plyturn(void) m = " You'll pick up survivors from my %s, I hope...!"; break; } - (void)printw(m, ss->name); - (void)beep(); - return(awinna() == -1); + (void) printw(m, ss->name); + (void) beep(); + return (awinna() == -1); } return (hit); } -static int sgetc(const char *s) +static int +sgetc(const char *s) { const char *s1; int ch; - (void)refresh(); - for(;;) - { + (void) refresh(); + for (;;) { ch = getch(); if (islower(ch)) ch = toupper(ch); if (ch == CTRLC) uninitgame(0); - for (s1=s; *s1 && ch != *s1; ++s1) + for (s1 = s; *s1 && ch != *s1; ++s1) continue; - if (*s1) - { - (void) addch((chtype)ch); - (void)refresh(); - return(ch); - } + if (*s1) { + (void) addch((chtype) ch); + (void) refresh(); + return (ch); } + } } - -static void randomfire(int *px, int *py) +static void +randomfire(int *px, int *py) /* random-fire routine -- implements simple diagonal-striping strategy */ { static int turncount = 0; static int srchstep = BEGINSTEP; - static int huntoffs; /* Offset on search strategy */ + static int huntoffs; /* Offset on search strategy */ int ypossible[BWIDTH * BDEPTH], xpossible[BWIDTH * BDEPTH], nposs; int ypreferred[BWIDTH * BDEPTH], xpreferred[BWIDTH * BDEPTH], npref; int x, y, i; @@ -911,28 +887,23 @@ static void randomfire(int *px, int *py) nposs = npref = 0; for (x = 0; x < BWIDTH; x++) for (y = 0; y < BDEPTH; y++) - if (!hits[COMPUTER][x][y]) - { + if (!hits[COMPUTER][x][y]) { xpossible[nposs] = x; ypossible[nposs] = y; nposs++; - if (((x+huntoffs) % srchstep) != (y % srchstep)) - { + if (((x + huntoffs) % srchstep) != (y % srchstep)) { xpreferred[npref] = x; ypreferred[npref] = y; npref++; } } - if (npref) - { + if (npref) { i = rnd(npref); *px = xpreferred[i]; *py = ypreferred[i]; - } - else if (nposs) - { + } else if (nposs) { i = rnd(nposs); *px = xpossible[i]; @@ -940,12 +911,10 @@ static void randomfire(int *px, int *py) if (srchstep > 1) --srchstep; - } - else - { + } else { error("No moves possible?? Help!"); - exit(EXIT_FAILURE); - /*NOTREACHED*/ + ExitProgram(EXIT_FAILURE); + /*NOTREACHED */ } } @@ -953,7 +922,8 @@ static void randomfire(int *px, int *py) #define S_HIT 1 #define S_SUNK -1 -static int cpufire(int x, int y) +static int +cpufire(int x, int y) /* fire away at given location */ { bool hit, sunk; @@ -961,10 +931,11 @@ static int cpufire(int x, int y) hits[COMPUTER][x][y] = (hit = (board[PLAYER][x][y])) ? MARK_HIT : MARK_MISS; (void) mvprintw(PROMPTLINE, 0, - "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : "miss"); + "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : + "miss"); if ((sunk = (hit && (ss = hitship(x, y)))) != 0) (void) printw(" I've sunk your %s", ss->name); - (void)clrtoeol(); + (void) clrtoeol(); pgoto(y, x); #ifdef A_COLOR @@ -975,7 +946,7 @@ static int cpufire(int x, int y) attron(COLOR_PAIR(COLOR_GREEN)); } #endif /* A_COLOR */ - (void)addch((chtype)(hit ? SHOWHIT : SHOWSPLASH)); + (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH)); #ifdef A_COLOR attrset(0); #endif /* A_COLOR */ @@ -988,7 +959,8 @@ static int cpufire(int x, int y) * unstructuredness below. The five labels are states which need to be held * between computer turns. */ -static bool cputurn(void) +static bool +cputurn(void) { #define POSSIBLE(x, y) (ONBOARD(x, y) && !hits[COMPUTER][x][y]) #define RANDOM_FIRE 0 @@ -1003,29 +975,28 @@ static bool cputurn(void) int navail, x, y, d, n; int hit = S_MISS; - switch(next) - { - case RANDOM_FIRE: /* last shot was random and missed */ - refire: + switch (next) { + case RANDOM_FIRE: /* last shot was random and missed */ + refire: randomfire(&x, &y); if (!(hit = cpufire(x, y))) next = RANDOM_FIRE; - else - { - ts.x = x; ts.y = y; + else { + ts.x = x; + ts.y = y; ts.hits = 1; next = (hit == S_SUNK) ? RANDOM_FIRE : RANDOM_HIT; } break; - case RANDOM_HIT: /* last shot was random and hit */ - used[E/2] = used[S/2] = used[W/2] = used[N/2] = FALSE; + case RANDOM_HIT: /* last shot was random and hit */ + used[E / 2] = used[S / 2] = used[W / 2] = used[N / 2] = FALSE; /* FALLTHROUGH */ - case HUNT_DIRECT: /* last shot hit, we're looking for ship's long axis */ - for (d = navail = 0; d < 4; d++) - { - x = ts.x + xincr[d*2]; y = ts.y + yincr[d*2]; + case HUNT_DIRECT: /* last shot hit, we're looking for ship's long axis */ + for (d = navail = 0; d < 4; d++) { + x = ts.x + xincr[d * 2]; + y = ts.y + yincr[d * 2]; if (!used[d] && POSSIBLE(x, y)) navail++; else @@ -1033,8 +1004,7 @@ static bool cputurn(void) } if (navail == 0) /* no valid places for shots adjacent... */ goto refire; /* ...so we must random-fire */ - else - { + else { for (d = 0, n = rnd(navail) + 1; n; n--) while (used[d]) d++; @@ -1042,68 +1012,70 @@ static bool cputurn(void) assert(d <= 4); used[d] = FALSE; - x = ts.x + xincr[d*2]; - y = ts.y + yincr[d*2]; + x = ts.x + xincr[d * 2]; + y = ts.y + yincr[d * 2]; assert(POSSIBLE(x, y)); if (!(hit = cpufire(x, y))) next = HUNT_DIRECT; - else - { - ts.x = x; ts.y = y; ts.dir = d*2; ts.hits++; + else { + ts.x = x; + ts.y = y; + ts.dir = d * 2; + ts.hits++; next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; } } break; - case FIRST_PASS: /* we have a start and a direction now */ + case FIRST_PASS: /* we have a start and a direction now */ x = ts.x + xincr[ts.dir]; y = ts.y + yincr[ts.dir]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) - { - ts.x = x; ts.y = y; ts.hits++; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.hits++; next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; - } - else + } else next = REVERSE_JUMP; break; - case REVERSE_JUMP: /* nail down the ship's other end */ + case REVERSE_JUMP: /* nail down the ship's other end */ d = ts.dir + 4; x = ts.x + ts.hits * xincr[d]; y = ts.y + ts.hits * yincr[d]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) - { - ts.x = x; ts.y = y; ts.dir = d; ts.hits++; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.dir = d; + ts.hits++; next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; - } - else + } else next = RANDOM_FIRE; break; - case SECOND_PASS: /* kill squares not caught on first pass */ + case SECOND_PASS: /* kill squares not caught on first pass */ x = ts.x + xincr[ts.dir]; y = ts.y + yincr[ts.dir]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) - { - ts.x = x; ts.y = y; ts.hits++; - next = (hit == S_SUNK) ? RANDOM_FIRE: SECOND_PASS; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.hits++; + next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; break; - } - else + } else next = RANDOM_FIRE; break; } /* check for continuation and/or winner */ - if (salvo) - { - (void)refresh(); - (void)sleep(1); + if (salvo) { + (void) refresh(); + (void) sleep(1); } if (awinna() != -1) - return(FALSE); + return (FALSE); #ifdef DEBUG (void) mvprintw(PROMPTLINE + 2, 0, @@ -1113,46 +1085,43 @@ static bool cputurn(void) return ((hit) ? TRUE : FALSE); } -static -int playagain(void) +static int +playagain(void) { int j; ship_t *ss; for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) - for(j = 0; j < ss->length; j++) - { + for (j = 0; j < ss->length; j++) { cgoto(ss->y + j * yincr[ss->dir], ss->x + j * xincr[ss->dir]); - (void)addch((chtype)ss->symbol); + (void) addch((chtype) ss->symbol); } - if(awinna()) + if (awinna()) ++cpuwon; else ++plywon; j = 18 + strlen(name); - if(plywon >= 10) + if (plywon >= 10) ++j; - if(cpuwon >= 10) + if (cpuwon >= 10) ++j; - (void) mvprintw(1,(COLWIDTH-j)/2, - "%s: %d Computer: %d",name,plywon,cpuwon); + (void) mvprintw(1, (COLWIDTH - j) / 2, + "%s: %d Computer: %d", name, plywon, cpuwon); - prompt(2, (awinna()) ? "Want to be humiliated again, %s [yn]? " - : "Going to give me a chance for revenge, %s [yn]? ",name); - return(sgetc("YN") == 'Y'); + prompt(2, (awinna())? "Want to be humiliated again, %s [yn]? " + : "Going to give me a chance for revenge, %s [yn]? ", name); + return (sgetc("YN") == 'Y'); } -static void do_options(int c, char *op[]) +static void +do_options(int c, char *op[]) { register int i; - if (c > 1) - { - for (i=1; i 1) { + for (i = 1; i < c; i++) { + switch (op[i][0]) { default: case '?': (void) fprintf(stderr, "Usage: battle [-s | -b] [-c]\n"); @@ -1160,27 +1129,24 @@ static void do_options(int c, char *op[]) (void) fprintf(stderr, "\t-s : play a salvo game\n"); (void) fprintf(stderr, "\t-b : play a blitz game\n"); (void) fprintf(stderr, "\t-c : ships may be adjacent\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); break; case '-': - switch(op[i][1]) - { + switch (op[i][1]) { case 'b': blitz = 1; - if (salvo == 1) - { + if (salvo == 1) { (void) fprintf(stderr, - "Bad Arg: -b and -s are mutually exclusive\n"); - exit(EXIT_FAILURE); + "Bad Arg: -b and -s are mutually exclusive\n"); + ExitProgram(EXIT_FAILURE); } break; case 's': salvo = 1; - if (blitz == 1) - { + if (blitz == 1) { (void) fprintf(stderr, - "Bad Arg: -s and -b are mutually exclusive\n"); - exit(EXIT_FAILURE); + "Bad Arg: -s and -b are mutually exclusive\n"); + ExitProgram(EXIT_FAILURE); } break; case 'c': @@ -1188,81 +1154,75 @@ static void do_options(int c, char *op[]) break; default: (void) fprintf(stderr, - "Bad arg: type \"%s ?\" for usage message\n", op[0]); - exit(EXIT_FAILURE); + "Bad arg: type \"%s ?\" for usage message\n", + op[0]); + ExitProgram(EXIT_FAILURE); } } } } } -static int scount(int who) +static int +scount(int who) { register int i, shots; register ship_t *sp; if (who) - sp = cpuship; /* count cpu shots */ + sp = cpuship; /* count cpu shots */ else - sp = plyship; /* count player shots */ + sp = plyship; /* count player shots */ - for (i=0, shots = 0; i < SHIPTYPES; i++, sp++) - { + for (i = 0, shots = 0; i < SHIPTYPES; i++, sp++) { if (sp->hits >= sp->length) continue; /* dead ship */ else shots++; } - return(shots); + return (shots); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { + setlocale(LC_ALL, ""); + do_options(argc, argv); intro(); do { initgame(); - while(awinna() == -1) - { - if (!blitz) - { - if (!salvo) - { - if(turn) + while (awinna() == -1) { + if (!blitz) { + if (!salvo) { + if (turn) (void) cputurn(); else (void) plyturn(); - } - else - { + } else { register int i; i = scount(turn); - while (i--) - { - if (turn) - { + while (i--) { + if (turn) { if (cputurn() && awinna() != -1) i = 0; - } - else - { + } else { if (plyturn() && awinna() != -1) i = 0; } } - } - } - else - while(turn ? cputurn() : plyturn()) + } + } else + while (turn ? cputurn() : plyturn()) continue; turn = OTHER; } } while (playagain()); uninitgame(0); - /*NOTREACHED*/ + /*NOTREACHED */ } /* bs.c ends here */ diff --git a/test/cardfile.c b/test/cardfile.c index 75d20776..09a98239 100644 --- a/test/cardfile.c +++ b/test/cardfile.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,17 +29,18 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: cardfile.c,v 1.5 2000/09/09 19:08:32 tom Exp $ + * $Id: cardfile.c,v 1.19 2002/09/01 17:59:48 tom Exp $ * * File format: text beginning in column 1 is a title; other text forms the content. */ #include +#if HAVE_FORM_H && HAVE_PANEL_H && HAVE_LIBFORM && HAVE_LIBPANEL + #include #include -#include #include #define VISIBLE_CARDS 10 @@ -75,7 +76,7 @@ strdup(char *s) static const char * skip(const char *buffer) { - while (isspace(*buffer)) + while (isspace(UChar(*buffer))) buffer++; return buffer; } @@ -84,7 +85,7 @@ static void trim(char *buffer) { unsigned n = strlen(buffer); - while (n-- && isspace(buffer[n])) + while (n-- && isspace(UChar(buffer[n]))) buffer[n] = 0; } @@ -130,6 +131,8 @@ add_content(CARD * card, const char *content) card->content = (char *) realloc(card->content, total + 1); strcpy(card->content + offset++, " "); } else { + if (card->content != 0) + free(card->content); card->content = (char *) malloc(total + 1); } strcpy(card->content + offset, content); @@ -166,7 +169,7 @@ read_data(char *fname) if ((fp = fopen(fname, "r")) != 0) { while (fgets(buffer, sizeof(buffer), fp)) { trim(buffer); - if (isspace(*buffer)) { + if (isspace(UChar(*buffer))) { if (card == 0) card = add_title(""); add_content(card, buffer); @@ -300,6 +303,46 @@ form_virtualize(WINDOW *w) } } +static FIELD ** +make_fields(CARD * p, int form_high, int form_wide) +{ + FIELD **f = (FIELD **) calloc(3, sizeof(FIELD *)); + + f[0] = new_field(1, form_wide, 0, 0, 0, 0); + set_field_back(f[0], A_REVERSE); + set_field_buffer(f[0], 0, p->title); + + f[1] = new_field(form_high - 1, form_wide, 1, 0, 0, 0); + set_field_buffer(f[1], 0, p->content); + set_field_just(f[1], JUSTIFY_LEFT); + + f[2] = 0; + return f; +} + +static void +show_legend(void) +{ + erase(); + move(LINES - 3, 0); + addstr("^Q/ESC -- exit form ^W -- writes data to file\n"); + addstr("^N -- go to next card ^P -- go to previous card\n"); + addstr("Arrow keys move left/right within a field, up/down between fields"); +} + +#if (defined(KEY_RESIZE) && HAVE_WRESIZE) || NO_LEAKS +static void +free_form_fields(FIELD ** f) +{ + int n; + + for (n = 0; f[n] != 0; ++n) { + free_field(f[n]); + } + free(f); +} +#endif + /*******************************************************************************/ static void @@ -313,43 +356,29 @@ cardfile(char *fname) int panel_high = LINES - (visible_cards * OFFSET_CARD) - 5; int form_wide = panel_wide - 2; int form_high = panel_high - 2; - int x = (visible_cards - 1) * OFFSET_CARD; - int y = 0; - int ch; + int y = (visible_cards - 1) * OFFSET_CARD; + int x = 0; + int ch = ERR; + int last_ch; int finished = FALSE; - move(LINES - 3, 0); - addstr("^Q/ESC -- exit form ^W -- writes data to file\n"); - addstr("^N -- go to next card ^P -- go to previous card\n"); - addstr("Arrow keys move left/right within a field, up/down between fields"); + show_legend(); /* make a panel for each CARD */ for (p = all_cards; p != 0; p = p->link) { - FIELD **f = (FIELD **) calloc(3, sizeof(FIELD *)); - win = newwin(panel_high, panel_wide, x, y); + win = newwin(panel_high, panel_wide, y, x); keypad(win, TRUE); p->panel = new_panel(win); box(win, 0, 0); - /* ...and a form in each panel */ - f[0] = new_field(1, form_wide, 0, 0, 0, 0); - set_field_back(f[0], A_REVERSE); - set_field_buffer(f[0], 0, p->title); - - f[1] = new_field(form_high - 1, form_wide, 1, 0, 0, 0); - set_field_buffer(f[1], 0, p->content); - set_field_just(f[1], JUSTIFY_LEFT); - - f[2] = 0; - - p->form = new_form(f); + p->form = new_form(make_fields(p, form_high, form_wide)); set_form_win(p->form, win); set_form_sub(p->form, derwin(win, form_high, form_wide, 1, 1)); post_form(p->form); - x -= OFFSET_CARD; - y += OFFSET_CARD; + y -= OFFSET_CARD; + x += OFFSET_CARD; } order_cards(top_card = all_cards, visible_cards); @@ -358,8 +387,9 @@ cardfile(char *fname) update_panels(); doupdate(); - switch (form_driver(top_card->form, ch = - form_virtualize(panel_window(top_card->panel)))) { + last_ch = ch; + ch = form_virtualize(panel_window(top_card->panel)); + switch (form_driver(top_card->form, ch)) { case E_OK: break; case E_UNKNOWN_COMMAND: @@ -378,6 +408,58 @@ cardfile(char *fname) case MAX_FORM_COMMAND + 4: write_data(fname); break; +#if defined(KEY_RESIZE) && HAVE_WRESIZE + case KEY_RESIZE: + /* resizeterm already did "something" reasonable, but it cannot + * know much about layout. So let's make it nicer. + */ + panel_wide = COLS - (visible_cards * OFFSET_CARD); + panel_high = LINES - (visible_cards * OFFSET_CARD) - 5; + + form_wide = panel_wide - 2; + form_high = panel_high - 2; + + y = (visible_cards - 1) * OFFSET_CARD; + x = 0; + + show_legend(); + for (p = all_cards; p != 0; p = p->link) { + FIELD **oldf = form_fields(p->form); + WINDOW *olds = form_sub(p->form); + + win = form_win(p->form); + + /* move and resize the card as needed + * FIXME: if the windows are shrunk too much, this won't do + */ + mvwin(win, y, x); + wresize(win, panel_high, panel_wide); + + /* reconstruct each form. Forms are not resizable, and + * there appears to be no good way to reload the text in + * a resized window. + */ + werase(win); + + unpost_form(p->form); + free_form(p->form); + + p->form = new_form(make_fields(p, form_high, form_wide)); + set_form_win(p->form, win); + set_form_sub(p->form, derwin(win, form_high, form_wide, + 1, 1)); + post_form(p->form); + + free_form_fields(oldf); + delwin(olds); + + box(win, 0, 0); + + y -= OFFSET_CARD; + x += OFFSET_CARD; + } + break; +#endif default: beep(); break; @@ -388,6 +470,28 @@ cardfile(char *fname) break; } } +#if NO_LEAKS + while (all_cards != 0) { + FIELD **f; + int count; + + p = all_cards; + all_cards = all_cards->link; + + f = form_fields(p->form); + count = field_count(p->form); + + unpost_form(p->form); /* ...so we can free it */ + free_form(p->form); /* this also disconnects the fields */ + + free_form_fields(f); + + del_panel(p->panel); + free(p->title); + free(p->content); + free(p); + } +#endif } /*******************************************************************************/ @@ -397,6 +501,8 @@ main(int argc, char *argv[]) { int n; + setlocale(LC_ALL, ""); + initscr(); cbreak(); noecho(); @@ -416,5 +522,13 @@ main(int argc, char *argv[]) endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } +#else +int +main(void) +{ + printf("This program requires the curses form and panel libraries\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/configure b/test/configure index de1cf77f..8d44c2bb 100755 --- a/test/configure +++ b/test/configure @@ -184,6 +184,7 @@ EOF cat <&6 -echo "configure:532: checking for $ac_word" >&5 +echo "configure:533: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -558,7 +559,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:562: checking for $ac_word" >&5 +echo "configure:563: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -609,7 +610,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:613: checking for $ac_word" >&5 +echo "configure:614: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -641,7 +642,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:646: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -652,12 +653,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 656 "configure" +#line 657 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -683,12 +684,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:688: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:692: checking whether we are using GNU C" >&5 +echo "configure:693: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -697,7 +698,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -716,7 +717,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:720: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:721: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -784,16 +785,239 @@ fi + +# Check whether --with-ncursesw or --without-ncursesw was given. +if test "${with_ncursesw+set}" = set; then + withval="$with_ncursesw" + + cat >> confdefs.h <<\EOF +#define _GNU_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF + + echo $ac_n "checking for initscr""... $ac_c" 1>&6 +echo "configure:803: checking for initscr" >&5 +if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char initscr(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_initscr) || defined (__stub___initscr) +choke me +#else +initscr(); +#endif + +; return 0; } +EOF +if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_initscr=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_initscr=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 +echo "configure:850: checking for Gpm_Open in -lgpm" >&5 +ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgpm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo gpm | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + LIB_NAME=ncursesw + echo $ac_n "checking for putwc""... $ac_c" 1>&6 +echo "configure:898: checking for putwc" >&5 +if eval "test \"`echo '$''{'ac_cv_func_putwc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char putwc(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_putwc) || defined (__stub___putwc) +choke me +#else +putwc(); +#endif + +; return 0; } +EOF +if { (eval echo configure:926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_putwc=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_putwc=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'putwc`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + +echo $ac_n "checking for putwc in libutf8""... $ac_c" 1>&6 +echo "configure:945: checking for putwc in libutf8" >&5 +if eval "test \"`echo '$''{'cf_cv_libutf8'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +cat > conftest.$ac_ext < +int main() { +putwc(0,0); +; return 0; } +EOF +if { (eval echo configure:961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_libutf8=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_libutf8=no +fi +rm -f conftest* + LIBS="$cf_save_LIBS" + +fi + +echo "$ac_t""$cf_cv_libutf8" 1>&6 + +if test "$cf_cv_libutf8" = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LIBUTF8_H 1 +EOF + + LIBS="-lutf8 $LIBS" +fi + +fi + + for p in $HOME /usr/local /usr + do + if test -f $p/include/ncursesw/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include/ncursesw" + test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include" + test $p != /usr && LIBS="-L$p/lib $LIBS" + break + elif test $p != /usr + then + if test -f $p/include/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include" + LIBS="-L$p/lib $LIBS" + break + fi + fi + done + +fi + +fi + + + # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:792: checking for initscr" >&5 +echo "configure:1016: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -835,7 +1059,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:839: checking for Gpm_Open in -lgpm" >&5 +echo "configure:1063: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -843,7 +1067,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -909,12 +1133,12 @@ fi echo $ac_n "checking for initscr""... $ac_c" 1>&6 -echo "configure:913: checking for initscr" >&5 +echo "configure:1137: checking for initscr" >&5 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_initscr=yes" else @@ -956,7 +1180,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for initscr in -l$LIB_NAME""... $ac_c" 1>&6 -echo "configure:960: checking for initscr in -l$LIB_NAME" >&5 +echo "configure:1184: checking for initscr in -l$LIB_NAME" >&5 ac_lib_var=`echo $LIB_NAME'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -964,7 +1188,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$LIB_NAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1005,7 +1229,7 @@ fi fi echo $ac_n "checking for form_driver in -lform""... $ac_c" 1>&6 -echo "configure:1009: checking for form_driver in -lform" >&5 +echo "configure:1233: checking for form_driver in -lform" >&5 ac_lib_var=`echo form'_'form_driver | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1013,7 +1237,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lform $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1052,7 +1276,7 @@ else fi echo $ac_n "checking for menu_driver in -lmenu""... $ac_c" 1>&6 -echo "configure:1056: checking for menu_driver in -lmenu" >&5 +echo "configure:1280: checking for menu_driver in -lmenu" >&5 ac_lib_var=`echo menu'_'menu_driver | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1060,7 +1284,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lmenu $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1099,7 +1323,7 @@ else fi echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6 -echo "configure:1103: checking for new_panel in -lpanel" >&5 +echo "configure:1327: checking for new_panel in -lpanel" >&5 ac_lib_var=`echo panel'_'new_panel | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1107,7 +1331,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpanel $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1147,12 +1371,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1151: checking return type of signal handlers" >&5 +echo "configure:1375: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1169,7 +1393,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1189,7 +1413,7 @@ EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1193: checking how to run the C preprocessor" >&5 +echo "configure:1417: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1204,13 +1428,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1221,13 +1445,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1238,13 +1462,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1269,12 +1493,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1273: checking for ANSI C header files" >&5 +echo "configure:1497: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1282,7 +1506,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1299,7 +1523,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1317,7 +1541,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1338,7 +1562,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1349,7 +1573,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1373,12 +1597,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1377: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1601: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1387,7 +1611,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1410,8 +1634,10 @@ fi for ac_hdr in \ form.h \ getopt.h \ +locale.h \ menu.h \ nc_alloc.h \ +nomacros.h \ panel.h \ sys/ioctl.h \ sys/select.h \ @@ -1422,17 +1648,17 @@ unistd.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1426: checking for $ac_hdr" >&5 +echo "configure:1652: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1460,8 +1686,10 @@ done for ac_func in \ +getnstr \ gettimeofday \ napms \ +resize_term \ resizeterm \ strdup \ use_default_colors \ @@ -1470,12 +1698,12 @@ wresize \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1474: checking for $ac_func" >&5 +echo "configure:1702: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1524,7 +1752,7 @@ done echo $ac_n "checking for function curses_version""... $ac_c" 1>&6 -echo "configure:1528: checking for function curses_version" >&5 +echo "configure:1756: checking for function curses_version" >&5 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1533,7 +1761,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_curses_version=unknown else cat > conftest.$ac_ext < @@ -1545,7 +1773,7 @@ int main() } EOF -if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cf_cv_func_curses_version=yes @@ -1568,20 +1796,194 @@ test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF EOF -echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6 -echo "configure:1573: checking if sys/time.h conflicts with sys/select.h" >&5 +echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6 +echo "configure:1801: checking for alternate character set array" >&5 +if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cf_cv_curses_acs_map=unknown +for name in acs_map _acs_map __acs_map _nc_acs_map +do +cat > conftest.$ac_ext < + +int main() { + +$name['k'] = ACS_PLUS + +; return 0; } +EOF +if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_curses_acs_map=$name; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$cf_cv_curses_acs_map" 1>&6 + +test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <&6 +echo "configure:1841: checking for wide alternate character set array" >&5 +if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cf_cv_curses_wacs_map=unknown +for name in wacs_map _wacs_map __wacs_map _nc_wacs +do +cat > conftest.$ac_ext < + +int main() { + +$name['k'] = *WACS_PLUS + +; return 0; } +EOF +if { (eval echo configure:1864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + cf_cv_curses_wacs_map=$name; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6 + +test "$cf_cv_curses_wacs_map" != unknown && cat >> confdefs.h <&6 +echo "configure:1887: checking for type attr_t in curses.h" >&5 +cat > conftest.$ac_ext < +int main() { + +attr_t foo + +; return 0; } +EOF +if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_result=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_result=no +fi +rm -f conftest* +echo "$ac_t""$cf_result" 1>&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >> confdefs.h <> confdefs.h <&6 +echo "configure:1930: checking for type mbstate_t in curses.h" >&5 +cat > conftest.$ac_ext < +int main() { + +mbstate_t foo + +; return 0; } +EOF +if { (eval echo configure:1945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_result=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_result=no +fi +rm -f conftest* +echo "$ac_t""$cf_result" 1>&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >> confdefs.h <> confdefs.h <&6 +echo "configure:1974: checking if sys/time.h works with sys/select.h" >&5 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif @@ -1589,7 +1991,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sys_time_select=yes else @@ -1603,11 +2005,12 @@ rm -f conftest* fi echo "$ac_t""$cf_cv_sys_time_select" 1>&6 -test $cf_cv_sys_time_select = yes && cat >> confdefs.h <<\EOF +test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF #define HAVE_SYS_TIME_SELECT 1 EOF + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure diff --git a/test/configure.in b/test/configure.in index d61d477d..87b409a0 100644 --- a/test/configure.in +++ b/test/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -26,9 +26,9 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl Author: Thomas E. Dickey 1996,1997,1998,2000 +dnl Author: Thomas E. Dickey 1996, etc. dnl -dnl $Id: configure.in,v 1.31 2000/10/15 18:46:17 tom Exp $ +dnl $Id: configure.in,v 1.36 2002/09/07 16:55:23 tom Exp $ dnl This is a simple configuration-script for the ncurses test programs that dnl allows the test-directory to be separately configured against a reference dnl system (i.e., sysvr4 curses) @@ -36,7 +36,7 @@ dnl dnl If you're configuring ncurses, you shouldn't need to use this script. dnl It's only for testing purposes. dnl -dnl See http://dickey.his.com/autoconf/ for additional information. +dnl See http://invisible-island.net/autoconf/ for additional information. dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20000819) AC_INIT(ncurses.c) @@ -77,6 +77,57 @@ AC_ARG_WITH(5lib, [LIBS="-L/usr/5lib $LIBS" CPPFLAGS="$CPPFLAGS -I/usr/5include"]) +dnl --------------------------------------------------------------------------- +dnl Check for libutf8 +AC_DEFUN([CF_LIBUTF8], +[ +AC_CACHE_CHECK(for putwc in libutf8,cf_cv_libutf8,[ + cf_save_LIBS="$LIBS" + LIBS="-lutf8 $LIBS" +AC_TRY_LINK([ +#include ],[putwc(0,0);], + [cf_cv_libutf8=yes], + [cf_cv_libutf8=no]) + LIBS="$cf_save_LIBS" +]) + +if test "$cf_cv_libutf8" = yes ; then + AC_DEFINE(HAVE_LIBUTF8_H) + LIBS="-lutf8 $LIBS" +fi +])dnl + +dnl --------------------------------------------------------------------------- +dnl NcursesW, installed in conventional location +AC_ARG_WITH(ncursesw, + [ --with-ncursesw use wide ncurses-libraries (installed)], + [ + AC_DEFINE(_GNU_SOURCE) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) + AC_CHECK_FUNC(initscr,,[ + AC_CHECK_LIB(gpm,Gpm_Open) + LIB_NAME=ncursesw + AC_CHECK_FUNC(putwc,,[CF_LIBUTF8]) + for p in $HOME /usr/local /usr + do + if test -f $p/include/ncursesw/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include/ncursesw" + test $p != /usr && CPPFLAGS="$CPPFLAGS -I$p/include" + test $p != /usr && LIBS="-L$p/lib $LIBS" + break + elif test $p != /usr + then + if test -f $p/include/curses.h + then + CPPFLAGS="$CPPFLAGS -I$p/include" + LIBS="-L$p/lib $LIBS" + break + fi + fi + done + ],[test -d /usr/ccs/lib && LIBS="-L/usr/ccs/lib $LIBS"])]) + dnl Ncurses, installed in conventional location AC_ARG_WITH(ncurses, [ --with-ncurses use ncurses-libraries (installed)], @@ -121,8 +172,10 @@ AC_HEADER_TIME AC_CHECK_HEADERS( \ form.h \ getopt.h \ +locale.h \ menu.h \ nc_alloc.h \ +nomacros.h \ panel.h \ sys/ioctl.h \ sys/select.h \ @@ -132,8 +185,10 @@ unistd.h \ ) AC_CHECK_FUNCS( \ +getnstr \ gettimeofday \ napms \ +resize_term \ resizeterm \ strdup \ use_default_colors \ @@ -141,6 +196,7 @@ vsscanf \ wresize \ ) +dnl --------------------------------------------------------------------------- dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. dnl It's a character string "SVR4", not documented. AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[ @@ -159,21 +215,93 @@ rm -f core]) test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) dnl --------------------------------------------------------------------------- +dnl Check for likely values of acs_map[]: +AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[ +cf_cv_curses_acs_map=unknown +for name in acs_map _acs_map __acs_map _nc_acs_map +do +AC_TRY_LINK([ +#include +],[ +$name['k'] = ACS_PLUS +],[cf_cv_curses_acs_map=$name; break]) +done +]) + +test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map) + +dnl --------------------------------------------------------------------------- +dnl Check for likely values of wacs_map[]: +AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[ +cf_cv_curses_wacs_map=unknown +for name in wacs_map _wacs_map __wacs_map _nc_wacs +do +AC_TRY_LINK([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include +],[ +$name['k'] = *WACS_PLUS +],[cf_cv_curses_wacs_map=$name; break]) +done +]) + +test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map) + +dnl --------------------------------------------------------------------------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +])dnl + +dnl --------------------------------------------------------------------------- +dnl Check if curses.h defines the given type +AC_DEFUN([CF_CURSES_TYPE], +[ +AC_MSG_CHECKING(for type $1 in curses.h) +AC_TRY_COMPILE([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include ],[ +$1 foo +],cf_result=yes,cf_result=no) +AC_MSG_RESULT($cf_result) +if test $cf_result = yes ; then + CF_UPPER(cf_result,have_type_$1) + AC_DEFINE_UNQUOTED($cf_result) +else + AC_DEFINE_UNQUOTED($1,$2) +fi +])dnl + +CF_CURSES_TYPE(attr_t,long) +CF_CURSES_TYPE(mbstate_t,long) + +dnl --------------------------------------------------------------------------- +dnl Check if we can include with ; this breaks on +dnl older SCO configurations. dnl [CF_SYS_TIME_SELECT] -AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h) + +AC_MSG_CHECKING(if sys/time.h works with sys/select.h) AC_CACHE_VAL(cf_cv_sys_time_select,[ AC_TRY_COMPILE([ -#if HAVE_SYS_TIME_H +#include +#ifdef HAVE_SYS_TIME_H #include #endif -#if HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_SELECT_H #include #endif ],[],[cf_cv_sys_time_select=yes], [cf_cv_sys_time_select=no]) ]) AC_MSG_RESULT($cf_cv_sys_time_select) -test $cf_cv_sys_time_select = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT) +test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT) + dnl --------------------------------------------------------------------------- AC_OUTPUT(Makefile,[ diff --git a/test/ditto.c b/test/ditto.c index 8ceafe5d..c2c6b26d 100644 --- a/test/ditto.c +++ b/test/ditto.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey 1998 * - * $Id: ditto.c,v 1.3 1998/08/15 23:39:34 tom Exp $ + * $Id: ditto.c,v 1.4 2001/09/15 21:53:37 tom Exp $ * * The program illustrates how to set up multiple screens from a single * program. Invoke the program by specifying another terminal on the same @@ -41,108 +41,108 @@ #include typedef struct { - FILE *input; - FILE *output; - SCREEN *screen; + FILE *input; + FILE *output; + SCREEN *screen; } DITTO; static void failed(const char *s) { - perror(s); - exit(EXIT_FAILURE); + perror(s); + ExitProgram(EXIT_FAILURE); } static void usage(void) { - fprintf(stderr, "usage: ditto [terminal1 ...]\n"); - exit(EXIT_FAILURE); + fprintf(stderr, "usage: ditto [terminal1 ...]\n"); + ExitProgram(EXIT_FAILURE); } static FILE * open_tty(char *path) { - FILE *fp; - struct stat sb; + FILE *fp; + struct stat sb; - if (stat(path, &sb) < 0) - failed(path); - if ((sb.st_mode & S_IFMT) != S_IFCHR) { - errno = ENOTTY; - failed(path); - } - fp = fopen(path, "a+"); - if (fp == 0) - failed(path); - printf("opened %s\n", path); - return fp; + if (stat(path, &sb) < 0) + failed(path); + if ((sb.st_mode & S_IFMT) != S_IFCHR) { + errno = ENOTTY; + failed(path); + } + fp = fopen(path, "a+"); + if (fp == 0) + failed(path); + printf("opened %s\n", path); + return fp; } int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - int j; - int active_tty = 0; - DITTO *data; + int j; + int active_tty = 0; + DITTO *data; - if (argc <= 1) - usage(); + if (argc <= 1) + usage(); - if ((data = (DITTO *)calloc(argc, sizeof(DITTO))) == 0) - failed("calloc data"); + if ((data = (DITTO *) calloc(argc, sizeof(DITTO))) == 0) + failed("calloc data"); - data[0].input = stdin; - data[0].output = stdout; - for (j = 1; j < argc; j++) { - data[j].input = - data[j].output = open_tty(argv[j]); - } + data[0].input = stdin; + data[0].output = stdout; + for (j = 1; j < argc; j++) { + data[j].input = + data[j].output = open_tty(argv[j]); + } - /* - * If we got this far, we have open connection(s) to the terminal(s). - * Set up the screens. - */ - for (j = 0; j < argc; j++) { - active_tty++; - data[j].screen = newterm( - (char *)0, /* assume $TERM is the same */ - data[j].output, - data[j].input); - if (data[j].screen == 0) - failed("newterm"); - cbreak(); - noecho(); - scrollok(stdscr, TRUE); - } + /* + * If we got this far, we have open connection(s) to the terminal(s). + * Set up the screens. + */ + for (j = 0; j < argc; j++) { + active_tty++; + data[j].screen = newterm( + (char *) 0, /* assume $TERM is the same */ + data[j].output, + data[j].input); + if (data[j].screen == 0) + failed("newterm"); + cbreak(); + noecho(); + scrollok(stdscr, TRUE); + } - /* - * Loop, reading characters from any of the inputs and writing to all - * of the screens. - */ - for(;;) { - int ch; - set_term(data[0].screen); - ch = getch(); - if (ch == ERR) - continue; - if (ch == 4) - break; - for (j = 0; j < argc; j++) { - set_term(data[j].screen); - addch(ch); - refresh(); - } + /* + * Loop, reading characters from any of the inputs and writing to all + * of the screens. + */ + for (;;) { + int ch; + set_term(data[0].screen); + ch = getch(); + if (ch == ERR) + continue; + if (ch == 4) + break; + for (j = 0; j < argc; j++) { + set_term(data[j].screen); + addch(ch); + refresh(); } + } - /* - * Cleanup and exit - */ - for (j = argc-1; j >= 0; j--) { - set_term(data[j].screen); - endwin(); - } - return EXIT_SUCCESS; + /* + * Cleanup and exit + */ + for (j = argc - 1; j >= 0; j--) { + set_term(data[j].screen); + endwin(); + } + ExitProgram(EXIT_SUCCESS); } diff --git a/test/dots.c b/test/dots.c index a5ddcaad..2e0190fc 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,16 +29,13 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.4 2000/02/13 01:05:13 tom Exp $ + * $Id: dots.c,v 1.8 2002/04/06 21:33:42 tom Exp $ * * A simple demo of the terminfo interface. */ -#include - -#include /* for tparm() */ - #include -#include + +#include #define valid(s) ((s != 0) && s != (char *)-1) @@ -81,7 +78,7 @@ onsig(int n GCC_UNUSED) { interrupted = TRUE; cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float @@ -93,8 +90,8 @@ ranf(void) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { int x, y, z, j, p; float r; @@ -123,19 +120,19 @@ main( y = (int) (r * ranf()) + 2; p = (ranf() > 0.9) ? '*' : ' '; - tputs(tparm(cursor_address, y, x), 1, outc); + tputs(tparm3(cursor_address, y, x), 1, outc); if (max_colors > 0) { - z = (int)(ranf() * max_colors); + z = (int) (ranf() * max_colors); if (ranf() > 0.01) { - tputs(tparm(set_a_foreground, z), 1, outc); + tputs(tparm2(set_a_foreground, z), 1, outc); } else { - tputs(tparm(set_a_background, z), 1, outc); + tputs(tparm2(set_a_background, z), 1, outc); } } else if (valid(exit_attribute_mode) - && valid(enter_reverse_mode)) { + && valid(enter_reverse_mode)) { if (ranf() <= 0.01) outs((ranf() > 0.6) ? enter_reverse_mode : - exit_attribute_mode); + exit_attribute_mode); } outc(p); fflush(stdout); diff --git a/test/filter.c b/test/filter.c index 272f3722..c3ea3c18 100644 --- a/test/filter.c +++ b/test/filter.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey 1998 * - * $Id: filter.c,v 1.4 2000/09/02 18:50:38 tom Exp $ + * $Id: filter.c,v 1.7 2002/03/23 23:02:15 tom Exp $ */ #include @@ -45,11 +45,6 @@ * and refresh(), but that does not work any better. */ -#ifndef NCURSES_VERSION -#define attr_t long -#define getnstr(s,n) getstr(s) -#endif - static int new_command(char *buffer, int length, attr_t underline) { @@ -69,12 +64,11 @@ new_command(char *buffer, int length, attr_t underline) int main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - SCREEN *sp; char buffer[80]; attr_t underline; filter(); - sp = newterm((char *) 0, stdout, stdin); + (void) newterm((char *) 0, stdout, stdin); cbreak(); keypad(stdscr, TRUE); @@ -105,5 +99,5 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) printw("done"); refresh(); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } diff --git a/test/firework.c b/test/firework.c index 66c1227c..3d84c439 100644 --- a/test/firework.c +++ b/test/firework.c @@ -1,11 +1,10 @@ /* - * $Id: firework.c,v 1.17 2000/09/02 18:41:12 tom Exp $ + * $Id: firework.c,v 1.20 2002/03/23 21:41:42 tom Exp $ */ -#include - -#include #include +#include + static int my_bg = COLOR_BLACK; static void @@ -19,7 +18,7 @@ static RETSIGTYPE onsig(int n GCC_UNUSED) { cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -35,7 +34,7 @@ showit(void) #endif if (ch == 'q') { cleanup(); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } else if (ch == 's') { nodelay(stdscr, FALSE); } else if (ch == ' ') { @@ -114,8 +113,8 @@ explode(int row, int col) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { int j; int start, end, row, diff, flag = 0, direction; @@ -154,7 +153,7 @@ main( attrset(A_NORMAL); for (row = 0; row < diff; row++) { mvprintw(LINES - row, start + (row * direction), - (direction < 0) ? "\\" : "/"); + (direction < 0) ? "\\" : "/"); if (flag++) { showit(); erase(); diff --git a/test/firstlast.c b/test/firstlast.c index f9515dcb..6a79a33f 100644 --- a/test/firstlast.c +++ b/test/firstlast.c @@ -2,88 +2,89 @@ * This test was written by Alexander V. Lukyanov to demonstrate difference * between ncurses 4.1 and SVR4 curses * - * $Id: firstlast.c,v 1.2 1997/10/18 21:34:53 tom Exp $ + * $Id: firstlast.c,v 1.3 2001/09/15 21:46:34 tom Exp $ */ #include -static void fill(WINDOW *w,const char *str) +static void +fill(WINDOW *w, const char *str) { - const char *s; - for(;;) { - for(s=str; *s; s++) { - if(waddch(w,*s)==ERR) - { - wmove(w,0,0); - return; - } - } + const char *s; + for (;;) { + for (s = str; *s; s++) { + if (waddch(w, *s) == ERR) { + wmove(w, 0, 0); + return; + } } + } } -int main( +int +main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - WINDOW *large,*small; - initscr(); - noecho(); - - large = newwin(20,60,2,10); - small = newwin(10,30,7,25); - - /* test 1 - addch */ - fill(large,"LargeWindow"); - - refresh(); - wrefresh(large); - wrefresh(small); - - mvwaddstr(small,5,5," Test String "); - wrefresh(small); - getch(); - - touchwin(large); - wrefresh(large); - - mvwaddstr(small,5,5," Test <***************> String "); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - /* test 2: erase */ - erase(); - refresh(); - getch(); - - /* test 3: clrtoeol */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small,5,0); - waddstr(small," clrtoeol>"); - wclrtoeol(small); - wrefresh(small); - - /* DIFFERENCE! */; - getch(); - - /* test 4: clrtobot */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small,5,3); - waddstr(small," clrtobot>"); - wclrtobot(small); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - endwin(); - - return EXIT_SUCCESS; + WINDOW *large, *small; + initscr(); + noecho(); + + large = newwin(20, 60, 2, 10); + small = newwin(10, 30, 7, 25); + + /* test 1 - addch */ + fill(large, "LargeWindow"); + + refresh(); + wrefresh(large); + wrefresh(small); + + mvwaddstr(small, 5, 5, " Test String "); + wrefresh(small); + getch(); + + touchwin(large); + wrefresh(large); + + mvwaddstr(small, 5, 5, " Test <***************> String "); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + /* test 2: erase */ + erase(); + refresh(); + getch(); + + /* test 3: clrtoeol */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 0); + waddstr(small, " clrtoeol>"); + wclrtoeol(small); + wrefresh(small); + + /* DIFFERENCE! */ ; + getch(); + + /* test 4: clrtobot */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 3); + waddstr(small, " clrtobot>"); + wclrtobot(small); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + endwin(); + + ExitProgram(EXIT_SUCCESS); } diff --git a/test/gdc.c b/test/gdc.c index df9a0c3f..c466f2fd 100644 --- a/test/gdc.c +++ b/test/gdc.c @@ -6,14 +6,12 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.15 2000/09/02 18:40:39 tom Exp $ + * $Id: gdc.c,v 1.23 2002/08/10 19:20:14 tom Exp $ */ -#include - #include -#include -#include + +#include #define YBASE 10 #define XBASE 10 @@ -38,7 +36,7 @@ sighndl(int signo) sigtermed = signo; if (redirected) { endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } } @@ -97,7 +95,7 @@ set(int t, int n) m = 7 << n; for (i = 0; i < 5; i++) { - next[i] |= ((disp[t] >> (4 - i) * 3) & 07) << n; + next[i] |= ((disp[t] >> ((4 - i) * 3)) & 07) << n; mask |= (next[i] ^ older[i]) & m; } if (mask & m) @@ -120,7 +118,7 @@ usage(void) unsigned j; for (j = 0; j < SIZEOF(msg); j++) fprintf(stderr, "%s\n", msg[j]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } int @@ -135,9 +133,10 @@ main(int argc, char *argv[]) FILE *ifp = stdin; bool scrol = FALSE; + setlocale(LC_ALL, ""); + signal(SIGINT, sighndl); signal(SIGTERM, sighndl); - signal(SIGKILL, sighndl); while ((k = getopt(argc, argv, "sn")) != EOF) { switch (k) { @@ -163,7 +162,7 @@ main(int argc, char *argv[]) if (name == 0 || newterm(name, ofp, ifp) == 0) { fprintf(stderr, "cannot open terminal\n"); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } } else { @@ -304,13 +303,14 @@ main(int argc, char *argv[]) standend(); endwin(); fprintf(stderr, "gdc terminated by signal %d\n", sigtermed); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } + /* FALLTHRU */ default: continue; } } while (--count); standend(); endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } diff --git a/test/hanoi.c b/test/hanoi.c index 0b032f83..45d6b97d 100644 --- a/test/hanoi.c +++ b/test/hanoi.c @@ -14,17 +14,15 @@ * * Date: 05.Nov.90 * - * $Id: hanoi.c,v 1.19 2000/09/02 18:51:16 tom Exp $ + * $Id: hanoi.c,v 1.24 2002/06/29 23:32:18 tom Exp $ */ #include -#include - #define NPEGS 3 /* This is not configurable !! */ #define MINTILES 3 #define MAXTILES 9 -#define DEFAULTTILES 7 +#define DEFAULTTILES 7 #define TOPLINE 6 #define BASELINE 16 #define STATUSLINE (LINES-3) @@ -70,7 +68,9 @@ int main(int argc, char **argv) { int NTiles, FromCol, ToCol; - unsigned char AutoFlag = 0; + bool AutoFlag = 0; + + setlocale(LC_ALL, ""); switch (argc) { case 1: @@ -80,24 +80,24 @@ main(int argc, char **argv) NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 3: if (strcmp(argv[2], "a")) { Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } NTiles = atoi(argv[1]); if (NTiles > MAXTILES || NTiles < MINTILES) { fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } AutoFlag = TRUE; break; default: Usage(); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } #ifdef TRACE trace(TRACE_MAXIMUM); @@ -118,7 +118,7 @@ main(int argc, char **argv) if (LINES < 24) { endwin(); fprintf(stderr, "Min screen length 24 lines\n"); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } if (AutoFlag) { curs_set(0); @@ -154,7 +154,7 @@ main(int argc, char **argv) } } endwin(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } static int @@ -295,7 +295,7 @@ Solved(int NumTiles) } static void -Usage() +Usage(void) { fprintf(stderr, "Usage: hanoi [] [a]\n"); fprintf(stderr, diff --git a/test/hashtest.c b/test/hashtest.c index 52e5c216..06f29098 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -3,22 +3,20 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.15 2000/09/02 19:23:33 tom Exp $ + * $Id: hashtest.c,v 1.22 2002/06/29 23:32:18 tom Exp $ */ #ifdef TRACE #define Trace(p) _tracef p #define USE_TRACE 1 #else -#define Trace(p) /* nothing */ +#define Trace(p) /* nothing */ #define USE_TRACE 0 #endif -#include - -#include #include -#include + +#include #define LO_CHAR ' ' #define HI_CHAR '~' @@ -30,191 +28,201 @@ static bool extend_corner = FALSE; static int foot_lines = 0; static int head_lines = 0; -static void cleanup(void) +static void +cleanup(void) { - move(LINES-1,0); - clrtoeol(); - refresh(); - endwin(); + move(LINES - 1, 0); + clrtoeol(); + refresh(); + endwin(); } -static RETSIGTYPE finish(int sig GCC_UNUSED) +static RETSIGTYPE +finish(int sig GCC_UNUSED) { - cleanup(); - exit(EXIT_FAILURE); + cleanup(); + ExitProgram(EXIT_FAILURE); } -static void genlines(int base) +static void +genlines(int base) { - int i, j; + int i, j; #if USE_TRACE - if (base == 'a') - Trace(("Resetting screen")); - else - Trace(("Painting `%c' screen", base)); + if (base == 'a') + Trace(("Resetting screen")); + else + Trace(("Painting `%c' screen", base)); #endif - /* Do this so writes to lower-right corner don't cause a spurious - * scrolling operation. This _shouldn't_ break the scrolling - * optimization, since that's computed in the refresh() call. - */ - scrollok(stdscr, FALSE); - - move(0,0); - for (i = 0; i < head_lines; i++) - for (j = 0; j < COLS; j++) - addch((j % 8 == 0) ? ('A' + j/8) : '-'); - - move(head_lines, 0); - for (i = head_lines; i < LINES - foot_lines; i++) { - int c = (base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + LO_CHAR; - int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; - for (j = 0; j < hi; j++) - addch(c); - } - - for (i = LINES - foot_lines; i < LINES; i++) { - move(i, 0); - for (j = 0; j < (extend_corner ? COLS : COLS - 1); j++) - addch((j % 8 == 0) ? ('A' + j/8) : '-'); - } - - scrollok(stdscr, TRUE); - if (single_step) { - move(LINES-1, 0); - getch(); - } else - refresh(); + /* Do this so writes to lower-right corner don't cause a spurious + * scrolling operation. This _shouldn't_ break the scrolling + * optimization, since that's computed in the refresh() call. + */ + scrollok(stdscr, FALSE); + + move(0, 0); + for (i = 0; i < head_lines; i++) + for (j = 0; j < COLS; j++) + addch((j % 8 == 0) ? ('A' + j / 8) : '-'); + + move(head_lines, 0); + for (i = head_lines; i < LINES - foot_lines; i++) { + int c = (base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + LO_CHAR; + int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; + for (j = 0; j < hi; j++) + addch(c); + } + + for (i = LINES - foot_lines; i < LINES; i++) { + move(i, 0); + for (j = 0; j < (extend_corner ? COLS : COLS - 1); j++) + addch((j % 8 == 0) ? ('A' + j / 8) : '-'); + } + + scrollok(stdscr, TRUE); + if (single_step) { + move(LINES - 1, 0); + getch(); + } else + refresh(); } -static void one_cycle(int ch) +static void +one_cycle(int ch) { - if (continuous) { - genlines(ch); - } else if (ch != 'a') { - genlines('a'); - genlines(ch); - } + if (continuous) { + genlines(ch); + } else if (ch != 'a') { + genlines('a'); + genlines(ch); + } } -static void run_test(bool optimized) +static void +run_test(bool optimized GCC_UNUSED) { - char ch; - int lo = continuous ? LO_CHAR : 'a' - LINES; - int hi = continuous ? HI_CHAR : 'a' + LINES; + char ch; + int lo = continuous ? LO_CHAR : 'a' - LINES; + int hi = continuous ? HI_CHAR : 'a' + LINES; - if (lo < LO_CHAR) - lo = LO_CHAR; - if (hi > HI_CHAR) - hi = HI_CHAR; + if (lo < LO_CHAR) + lo = LO_CHAR; + if (hi > HI_CHAR) + hi = HI_CHAR; #if defined(TRACE) || defined(NCURSES_TEST) - if (optimized) { - Trace(("With hash mapping")); - _nc_optimize_enable |= OPTIMIZE_HASHMAP; - } else { - Trace(("Without hash mapping")); - _nc_optimize_enable &= ~OPTIMIZE_HASHMAP; - } + if (optimized) { + Trace(("With hash mapping")); + _nc_optimize_enable |= OPTIMIZE_HASHMAP; + } else { + Trace(("Without hash mapping")); + _nc_optimize_enable &= ~OPTIMIZE_HASHMAP; + } #endif - if (reverse_loops) - for (ch = hi; ch >= lo; ch--) - one_cycle(ch); - else - for (ch = lo; ch <= hi; ch++) - one_cycle(ch); + if (reverse_loops) + for (ch = hi; ch >= lo; ch--) + one_cycle(ch); + else + for (ch = lo; ch <= hi; ch++) + one_cycle(ch); } -static void usage(void) +static void +usage(void) { - static const char *const tbl[] = { - "Usage: hashtest [options]" - ,"" - ,"Options:" - ," -c continuous (don't reset between refresh's)" - ," -f num leave 'num' lines constant for footer" - ," -h num leave 'num' lines constant for header" - ," -l num repeat test 'num' times" - ," -n test the normal optimizer" - ," -o test the hashed optimizer" - ," -r reverse the loops" - ," -s single-step" - ," -x assume lower-right corner extension" - }; - size_t n; - - for (n = 0; n < sizeof(tbl)/sizeof(tbl[0]); n++) - fprintf(stderr, "%s\n", tbl[n]); - exit(EXIT_FAILURE); + static const char *const tbl[] = + { + "Usage: hashtest [options]" + ,"" + ,"Options:" + ," -c continuous (don't reset between refresh's)" + ," -f num leave 'num' lines constant for footer" + ," -h num leave 'num' lines constant for header" + ," -l num repeat test 'num' times" + ," -n test the normal optimizer" + ," -o test the hashed optimizer" + ," -r reverse the loops" + ," -s single-step" + ," -x assume lower-right corner extension" + }; + size_t n; + + for (n = 0; n < SIZEOF(tbl); n++) + fprintf(stderr, "%s\n", tbl[n]); + ExitProgram(EXIT_FAILURE); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - int c; - int test_loops = 1; - int test_normal = FALSE; - int test_optimize = FALSE; - - while ((c = getopt(argc, argv, "cf:h:l:norsx")) != EOF) { - switch (c) { - case 'c': - continuous = TRUE; - break; - case 'f': - foot_lines = atoi(optarg); - break; - case 'h': - head_lines = atoi(optarg); - break; - case 'l': - test_loops = atoi(optarg); - break; - case 'n': - test_normal = TRUE; - break; - case 'o': - test_optimize = TRUE; - break; - case 'r': - reverse_loops = TRUE; - break; - case 's': - single_step = TRUE; - break; - case 'x': - extend_corner = TRUE; - break; - default: - usage(); - } - } - if (!test_normal && !test_optimize) { - test_normal = TRUE; - test_optimize = TRUE; + int c; + int test_loops = 1; + int test_normal = FALSE; + int test_optimize = FALSE; + + setlocale(LC_ALL, ""); + + while ((c = getopt(argc, argv, "cf:h:l:norsx")) != EOF) { + switch (c) { + case 'c': + continuous = TRUE; + break; + case 'f': + foot_lines = atoi(optarg); + break; + case 'h': + head_lines = atoi(optarg); + break; + case 'l': + test_loops = atoi(optarg); + break; + case 'n': + test_normal = TRUE; + break; + case 'o': + test_optimize = TRUE; + break; + case 'r': + reverse_loops = TRUE; + break; + case 's': + single_step = TRUE; + break; + case 'x': + extend_corner = TRUE; + break; + default: + usage(); } + } + if (!test_normal && !test_optimize) { + test_normal = TRUE; + test_optimize = TRUE; + } #if USE_TRACE - trace(TRACE_TIMES); + trace(TRACE_TIMES); #endif - (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ + (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ - (void) initscr(); /* initialize the curses library */ - keypad(stdscr, TRUE); /* enable keyboard mapping */ - (void) nonl(); /* tell curses not to do NL->CR/NL on output */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - scrollok(stdscr, TRUE); + (void) initscr(); /* initialize the curses library */ + keypad(stdscr, TRUE); /* enable keyboard mapping */ + (void) nonl(); /* tell curses not to do NL->CR/NL on output */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + scrollok(stdscr, TRUE); - while (test_loops-- > 0) { - if (test_normal) - run_test(FALSE); - if (test_optimize) - run_test(TRUE); - } + while (test_loops-- > 0) { + if (test_normal) + run_test(FALSE); + if (test_optimize) + run_test(TRUE); + } - cleanup(); /* we're done */ - return(EXIT_SUCCESS); + cleanup(); /* we're done */ + ExitProgram(EXIT_SUCCESS); } /* hashtest.c ends here */ diff --git a/test/keynames.c b/test/keynames.c index 88cadd2f..ee8fac89 100644 --- a/test/keynames.c +++ b/test/keynames.c @@ -1,14 +1,17 @@ /* - * $Id: keynames.c,v 1.2 1998/06/06 22:45:13 tom Exp $ + * $Id: keynames.c,v 1.4 2002/09/01 19:42:42 tom Exp $ */ #include -int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - int n; - for (n = -1; n < 512; n++) { - printf("%d(%5o):%s\n", n, n, keyname(n)); - } - return EXIT_SUCCESS; + int n; + for (n = -1; n < 512; n++) { + char *result = keyname(n); + if (result != 0) + printf("%d(%5o):%s\n", n, n, result); + } + ExitProgram(EXIT_SUCCESS); } diff --git a/test/knight.c b/test/knight.c index e759d426..0e091f46 100644 --- a/test/knight.c +++ b/test/knight.c @@ -6,14 +6,12 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.18 2000/10/15 18:36:34 Brian.Raiter Exp $ + * $Id: knight.c,v 1.25 2002/06/29 23:32:18 tom Exp $ */ -#include - #include -#include -#include + +#include /* board size */ #define BDEPTH 8 @@ -35,8 +33,8 @@ #define PLUS_COLOR 2 #define MINUS_COLOR 3 -#define CX(x) (2 + 4 * (x)) -#define CY(y) (1 + 2 * (y)) +#define CX(x) (2 + 4 * (x)) +#define CY(y) (1 + 2 * (y)) #define cellmove(y, x) wmove(boardwin, CY(y), CX(x)) #define CXINV(x) (((x) - 1) / 4) #define CYINV(y) (((y) - 2) / 2) @@ -45,42 +43,38 @@ typedef struct { short x, y; } cell; -static short board[BDEPTH][BWIDTH]; /* the squares */ -static int rw, col; /* current row and column */ -static int lastrow, lastcol; /* last location visited */ -static cell history[BDEPTH * BWIDTH + 1]; /* choice history */ -static int movecount; /* count of moves so far */ static WINDOW *boardwin; /* the board window */ static WINDOW *helpwin; /* the help window */ static WINDOW *msgwin; /* the message window */ -static chtype trail = '#'; /* trail character */ -static chtype plus = '+'; /* cursor hot-spot character */ +static cell history[BDEPTH * BWIDTH + 1]; /* choice history */ static chtype minus = '-'; /* possible-move character */ static chtype oldch; - -static void init(void); -static void play(void); -static void dosquares(void); -static void drawmove(char, int, int, int, int); -static bool evalmove(int, int); -static bool chkmoves(void); -static bool chksqr(int, int); -static int iabs(int); - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - init(); - - play(); - - endwin(); - return EXIT_SUCCESS; -} +static chtype plus = '+'; /* cursor hot-spot character */ +static chtype trail = '#'; /* trail character */ +static int movecount; /* count of moves so far */ +static int trialcount; /* count of trials so far */ +static short board[BDEPTH][BWIDTH]; /* the squares */ +/* *INDENT-OFF* */ +static const struct { + int y; + int x; +} offsets[] = { + { 2, 1 }, + { 1, 2 }, + { -1, 2 }, + { -2, 1 }, + { -2, -1 }, + { -1, -2 }, + { 1, -2 }, + { 2, -1 }, +}; +/* *INDENT-ON* */ static void -init(void) +init_program(void) { + setlocale(LC_ALL, ""); + srand((unsigned) getpid()); initscr(); cbreak(); /* immediate char return */ @@ -155,24 +149,288 @@ help2(void) (void) waddstr(helpwin, "x,q -- exit y k u 7 8 9\n"); (void) waddstr(helpwin, "r -- redraw screen \\|/ \\|/ \n"); (void) waddstr(helpwin, "bksp -- undo move h-+-l 4-+-6\n"); - (void) waddstr(helpwin, " /|\\ /|\\ \n"); + (void) waddstr(helpwin, "a -- autojump /|\\ /|\\ \n"); (void) waddstr(helpwin, " b j n 1 2 3\n"); (void) waddstr(helpwin, "\nYou can place your knight on the selected\n"); (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n"); - (void) waddstr(helpwin, "center key. You can quit with `x' or `q'.\n"); + (void) waddstr(helpwin, "center key. Use F/B to review the path.\n"); (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0, "Press `?' to go to game explanation"); } +static void +show_help(bool * keyhelp) +{ + werase(helpwin); + if (*keyhelp) { + help1(); + *keyhelp = FALSE; + } else { + help2(); + *keyhelp = TRUE; + } + wrefresh(helpwin); +} + +static bool +chksqr(int r1, int c1) +{ + if ((r1 < 0) || (r1 > BDEPTH - 1)) + return (FALSE); + if ((c1 < 0) || (c1 > BWIDTH - 1)) + return (FALSE); + return ((!board[r1][c1]) ? TRUE : FALSE); +} + +static bool +chkmoves(int rw, int col) +/* check to see if valid moves are available */ +{ + unsigned n; + + for (n = 0; n < SIZEOF(offsets); n++) + if (chksqr(rw + offsets[n].y, col + offsets[n].x)) + return (TRUE); + return (FALSE); +} + +static void +dosquares(void) +{ + int i, j; + + mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); + + move(BOARDY, BOARDX); + waddch(boardwin, ACS_ULCORNER); + for (j = 0; j < 7; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_TTEE); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_URCORNER); + + for (i = 1; i < BDEPTH; i++) { + move(BOARDY + i * 2 - 1, BOARDX); + waddch(boardwin, ACS_VLINE); + for (j = 0; j < BWIDTH; j++) { + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ACS_VLINE); + } + move(BOARDY + i * 2, BOARDX); + waddch(boardwin, ACS_LTEE); + for (j = 0; j < BWIDTH - 1; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_PLUS); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_RTEE); + } + + move(BOARDY + i * 2 - 1, BOARDX); + waddch(boardwin, ACS_VLINE); + for (j = 0; j < BWIDTH; j++) { + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ACS_VLINE); + } + + move(BOARDY + i * 2, BOARDX); + waddch(boardwin, ACS_LLCORNER); + for (j = 0; j < BWIDTH - 1; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_BTEE); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_LRCORNER); +} + +static void +mark_possibles(int prow, int pcol, chtype mark) +{ + unsigned n; + + for (n = 0; n < SIZEOF(offsets); n++) { + if (chksqr(prow + offsets[n].y, pcol + offsets[n].x)) { + cellmove(prow + offsets[n].y, pcol + offsets[n].x); + waddch(boardwin, mark); + } + } +} + +static void +find_next_move(int *y, int *x) +{ + unsigned j, k; + int found = -1; + int first = -1; + int next = 0; + int oldy, oldx; + int newy, newx; + + if (movecount > 1) { + oldy = history[movecount - 1].y; + oldx = history[movecount - 1].x; + for (j = 0; j < SIZEOF(offsets) * 2; j++) { + k = j % SIZEOF(offsets); + newy = oldy + offsets[k].y; + newx = oldx + offsets[k].x; + if (chksqr(newy, newx)) { + if (first < 0) + first = k; + if (newy == *y + && newx == *x) { + found = k; + } else if (found >= 0) { + next = k; + break; + } + } + } + if (found < 0) + next = first; + if (next >= 0) { + *y = oldy + offsets[next].y; + *x = oldx + offsets[next].x; + } + } else { + beep(); + } +} + +static void +unmarkcell(int row, int column) +{ + cellmove(row, column); + waddch(boardwin, '\b'); + waddch(boardwin, ' '); + waddch(boardwin, minus); + waddch(boardwin, ' '); +} + +static void +markcell(chtype tchar, int row, int column) +{ + cellmove(row, column); + waddch(boardwin, '\b'); + waddch(boardwin, tchar); + waddch(boardwin, tchar); + waddch(boardwin, tchar); +} + +static void +drawmove(chtype tchar, int oldy, int oldx, int row, int column) +/* place the stars, update board & currents */ +{ + if (movecount <= 1) { + int i, j; + + for (i = 0; i < BDEPTH; i++) { + for (j = 0; j < BWIDTH; j++) { + if (movecount == 0) { + unmarkcell(i, j); + } else { + cellmove(i, j); + if (winch(boardwin) == minus) + waddch(boardwin, movecount ? ' ' : minus); + } + } + } + } else { + markcell(tchar, oldy, oldx); + mark_possibles(oldy, oldx, ' '); + } + + if (row != -1 && column != -1) { + markcell(trail, row, column); + mark_possibles(row, column, minus); + board[row][column] = TRUE; + } + + wprintw(msgwin, "\nMove %d", movecount); + if (trialcount != movecount) + wprintw(msgwin, " (%d tries)", trialcount); + wclrtoeol(msgwin); +} + +static int +iabs(int num) +{ + if (num < 0) + return (-num); + else + return (num); +} + +static bool +evalmove(int row, int column) +/* evaluate move */ +{ + if (movecount == 1) + return (TRUE); + else if (board[row][column] == TRUE) { + waddstr(msgwin, "\nYou've already been there."); + return (FALSE); + } else { + int rdif = iabs(row - history[movecount - 1].y); + int cdif = iabs(column - history[movecount - 1].x); + + if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) { + waddstr(msgwin, "\nThat's not a legal knight's move."); + return (FALSE); + } + } + + return (TRUE); +} + +static int +completed(void) +{ + int i, j, count = 0; + + for (i = 0; i < BDEPTH; i++) + for (j = 0; j < BWIDTH; j++) + if (board[i][j] != 0) + count += 1; + return (count == (BWIDTH * BDEPTH) ? -1 : count); +} + +static void +no_previous_move(void) +{ + waddstr(msgwin, "\nNo previous move."); + beep(); +} + static void play(void) /* play the game */ { bool keyhelp; /* TRUE if keystroke help is up */ - int c, ny = 0, nx = 0; int i, j, count; + int lastcol = 0; /* last location visited */ + int lastrow = 0; + int ny = 0, nx = 0; + int review = 0; /* review history */ + int rw = 0, col = 0; /* current row and column */ do { /* clear screen and draw board */ @@ -187,17 +445,21 @@ play(void) wnoutrefresh(boardwin); doupdate(); - for (i = 0; i < BDEPTH; i++) + movecount = 0; + for (i = 0; i < BDEPTH; i++) { for (j = 0; j < BWIDTH; j++) { board[i][j] = FALSE; - cellmove(i, j); - waddch(boardwin, minus); + unmarkcell(i, j); } - memset(history, '\0', sizeof(history)); + } + memset(history, 0, sizeof(history)); history[0].y = history[0].x = -1; + history[1].y = history[1].x = -1; lastrow = lastcol = -2; movecount = 1; + trialcount = 1; keyhelp = FALSE; + show_help(&keyhelp); for (;;) { if (rw != lastrow || col != lastcol) { @@ -221,11 +483,7 @@ play(void) wrefresh(msgwin); - c = wgetch(boardwin); - - werase(msgwin); - - switch (c) { + switch (wgetch(boardwin)) { case 'k': case '8': case KEY_UP: @@ -297,6 +555,7 @@ play(void) case KEY_B2: case '\n': case ' ': + review = 0; if (evalmove(rw, col)) { drawmove(trail, history[movecount - 1].y, @@ -305,40 +564,58 @@ play(void) history[movecount].y = rw; history[movecount].x = col; movecount++; - - if (!chkmoves()) - goto dropout; - } else + trialcount++; + + if (!chkmoves(rw, col)) { + if (completed() < 0) { + waddstr(msgwin, "\nYou won."); + } else { + waddstr(msgwin, + "\nNo further moves are possible."); + } + } + } else { beep(); - break; - - case KEY_REDO: - case '\f': - case 'r': - clearok(curscr, TRUE); - wnoutrefresh(stdscr); - wnoutrefresh(boardwin); - wnoutrefresh(msgwin); - wnoutrefresh(helpwin); - doupdate(); + } break; case KEY_UNDO: case KEY_BACKSPACE: case '\b': - if (movecount == 1) { - ny = lastrow; - nx = lastcol; - waddstr(msgwin, "\nNo previous move."); - beep(); + review = 0; + if (movecount <= 0) { + no_previous_move(); + } else if (movecount <= 1) { + ny = history[movecount].y; + nx = history[movecount].x; + if (nx < 0 || ny < 0) { + ny = lastrow; + nx = lastcol; + } + movecount = 0; + board[ny][nx] = FALSE; + oldch = minus; + drawmove(' ', ny, nx, -1, -1); + movecount = 1; + trialcount = 1; + no_previous_move(); } else { int oldy = history[movecount - 1].y; int oldx = history[movecount - 1].x; + if (!board[rw][col]) { + cellmove(rw, col); + waddch(boardwin, ' '); + } + board[oldy][oldx] = FALSE; --movecount; ny = history[movecount - 1].y; nx = history[movecount - 1].x; + if (nx < 0 || ny < 0) { + ny = oldy; + nx = oldx; + } drawmove(' ', oldy, oldx, ny, nx); /* avoid problems if we just changed the current cell */ @@ -347,20 +624,49 @@ play(void) } break; + case 'a': + nx = col; + ny = rw; + find_next_move(&ny, &nx); + break; + + case 'F': + if (review > 0) { + review--; + ny = history[movecount - review - 1].y; + nx = history[movecount - review - 1].x; + } else { + beep(); + } + break; + + case 'B': + if (review < movecount - 2) { + review++; + ny = history[movecount - review - 1].y; + nx = history[movecount - review - 1].x; + } else { + beep(); + } + break; + + case KEY_REDO: + case '\f': + case 'r': + clearok(curscr, TRUE); + wnoutrefresh(stdscr); + wnoutrefresh(boardwin); + wnoutrefresh(msgwin); + wnoutrefresh(helpwin); + doupdate(); + break; + case 'q': case 'x': goto dropout; case '?': - werase(helpwin); - if (keyhelp) { - help1(); - keyhelp = FALSE; - } else { - help2(); - keyhelp = TRUE; - } - wrefresh(helpwin); + show_help(&keyhelp); break; default: @@ -373,219 +679,24 @@ play(void) } dropout: - count = 0; - for (i = 0; i < BDEPTH; i++) - for (j = 0; j < BWIDTH; j++) - if (board[i][j] != 0) - count += 1; - if (count == (BWIDTH * BDEPTH)) + if ((count = completed()) < 0) wprintw(msgwin, "\nYou won. Care to try again? "); else wprintw(msgwin, "\n%d squares filled. Try again? ", count); + wclrtoeol(msgwin); } while (tolower(wgetch(msgwin)) == 'y'); } -static void -dosquares(void) -{ - int i, j; - - mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); - - move(BOARDY, BOARDX); - waddch(boardwin, ACS_ULCORNER); - for (j = 0; j < 7; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_TTEE); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_URCORNER); - - for (i = 1; i < BDEPTH; i++) { - move(BOARDY + i * 2 - 1, BOARDX); - waddch(boardwin, ACS_VLINE); - for (j = 0; j < BWIDTH; j++) { - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ACS_VLINE); - } - move(BOARDY + i * 2, BOARDX); - waddch(boardwin, ACS_LTEE); - for (j = 0; j < BWIDTH - 1; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_PLUS); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_RTEE); - } - - move(BOARDY + i * 2 - 1, BOARDX); - waddch(boardwin, ACS_VLINE); - for (j = 0; j < BWIDTH; j++) { - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ACS_VLINE); - } - - move(BOARDY + i * 2, BOARDX); - waddch(boardwin, ACS_LLCORNER); - for (j = 0; j < BWIDTH - 1; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_BTEE); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_LRCORNER); -} - -static void -mark_possibles(int prow, int pcol, chtype mark) -{ - if (chksqr(prow + 2, pcol + 1)) { - cellmove(prow + 2, pcol + 1); - waddch(boardwin, mark); - }; - if (chksqr(prow + 2, pcol - 1)) { - cellmove(prow + 2, pcol - 1); - waddch(boardwin, mark); - }; - if (chksqr(prow - 2, pcol + 1)) { - cellmove(prow - 2, pcol + 1); - waddch(boardwin, mark); - }; - if (chksqr(prow - 2, pcol - 1)) { - cellmove(prow - 2, pcol - 1); - waddch(boardwin, mark); - }; - if (chksqr(prow + 1, pcol + 2)) { - cellmove(prow + 1, pcol + 2); - waddch(boardwin, mark); - }; - if (chksqr(prow + 1, pcol - 2)) { - cellmove(prow + 1, pcol - 2); - waddch(boardwin, mark); - }; - if (chksqr(prow - 1, pcol + 2)) { - cellmove(prow - 1, pcol + 2); - waddch(boardwin, mark); - }; - if (chksqr(prow - 1, pcol - 2)) { - cellmove(prow - 1, pcol - 2); - waddch(boardwin, mark); - }; -} - -static void -drawmove(char tchar, int oldy, int oldx, int row, int column) -/* place the stars, update board & currents */ -{ - if (movecount <= 1) { - int i, j; - - for (i = 0; i < BDEPTH; i++) - for (j = 0; j < BWIDTH; j++) { - cellmove(i, j); - if (winch(boardwin) == minus) - waddch(boardwin, movecount ? ' ' : minus); - } - } else { - cellmove(oldy, oldx); - waddch(boardwin, '\b'); - waddch(boardwin, tchar); - waddch(boardwin, tchar); - waddch(boardwin, tchar); - mark_possibles(oldy, oldx, ' '); - } - - if (row != -1 && column != -1) { - cellmove(row, column); - waddch(boardwin, '\b'); - waddch(boardwin, trail); - waddch(boardwin, trail); - waddch(boardwin, trail); - mark_possibles(row, column, minus); - board[row][column] = TRUE; - } - - wprintw(msgwin, "\nMove %d", movecount); -} - -static bool -evalmove(int row, int column) -/* evaluate move */ -{ - if (movecount == 1) - return (TRUE); - else if (board[row][column] == TRUE) { - waddstr(msgwin, "\nYou've already been there."); - return (FALSE); - } else { - int rdif = iabs(row - history[movecount - 1].y); - int cdif = iabs(column - history[movecount - 1].x); - - if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) { - waddstr(msgwin, "\nThat's not a legal knight's move."); - return (FALSE); - } - } - - return (TRUE); -} - -static bool -chkmoves(void) -/* check to see if valid moves are available */ +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - if (chksqr(rw + 2, col + 1)) - return (TRUE); - if (chksqr(rw + 2, col - 1)) - return (TRUE); - if (chksqr(rw - 2, col + 1)) - return (TRUE); - if (chksqr(rw - 2, col - 1)) - return (TRUE); - if (chksqr(rw + 1, col + 2)) - return (TRUE); - if (chksqr(rw + 1, col - 2)) - return (TRUE); - if (chksqr(rw - 1, col + 2)) - return (TRUE); - if (chksqr(rw - 1, col - 2)) - return (TRUE); - return (FALSE); -} + init_program(); -static int -iabs(int num) -{ - if (num < 0) - return (-num); - else - return (num); -} + play(); -static bool -chksqr(int r1, int c1) -{ - if ((r1 < 0) || (r1 > BDEPTH - 1)) - return (FALSE); - if ((c1 < 0) || (c1 > BWIDTH - 1)) - return (FALSE); - return ((!board[r1][c1]) ? TRUE : FALSE); + endwin(); + ExitProgram(EXIT_SUCCESS); } /* knight.c ends here */ diff --git a/test/lrtest.c b/test/lrtest.c index fb996411..78dcaad2 100644 --- a/test/lrtest.c +++ b/test/lrtest.c @@ -1,16 +1,16 @@ /* * Test lower-right-hand corner access * - * by Eric S. Raymond + * originally by Eric S. Raymond , written for animation + * and resizing -TD * * This can't be part of the ncurses test-program, because ncurses rips off the * bottom line to do labels. * - * $Id: lrtest.c,v 0.14 1999/10/23 19:44:35 tom Exp $ + * $Id: lrtest.c,v 1.19 2002/07/13 16:55:50 tom Exp $ */ #include -#include typedef struct { int y, x, mode, dir, inc; @@ -56,8 +56,8 @@ show(MARK * m) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { static MARK marks[] = { @@ -70,6 +70,8 @@ main( {2, 0, 1, 1, 1, '*' | A_REVERSE} }; + setlocale(LC_ALL, ""); + initscr(); noecho(); cbreak(); @@ -83,8 +85,8 @@ main( move(LINES / 2 - 1, 4); if (!(has_ic() /* see PutCharLR() */ - || auto_right_margin - || (enter_am_mode && exit_am_mode))) { + || auto_right_margin + || (enter_am_mode && exit_am_mode))) { addstr("Your terminal lacks the capabilities needed to address the\n"); move(LINES / 2, 4); addstr("lower-right-hand corner of the screen.\n"); @@ -103,7 +105,7 @@ main( unsigned n; box(stdscr, 0, 0); - for (n = 0; n < sizeof(marks) / sizeof(marks[0]); n++) { + for (n = 0; n < SIZEOF(marks); n++) { show(&marks[n]); } @@ -114,19 +116,37 @@ main( nodelay(stdscr, FALSE); else if (ch == ' ') nodelay(stdscr, TRUE); +#ifdef TRACE + else if (ch == 'T') + trace(0); + else if (ch == 't') + trace(TRACE_CALLS|TRACE_ICALLS|TRACE_UPDATE); +#endif #ifdef KEY_RESIZE else if (ch == KEY_RESIZE) { + for (n = 0; n < SIZEOF(marks); n++) { + if (marks[n].mode == 0) { /* moving along x-direction */ + if (marks[n].y) + marks[n].y = LINES - 1; + } else { + if (marks[n].x) + marks[n].x = COLS - 1; + } + } + flash(); erase(); + wrefresh(curscr); goto restart; } #endif } napms(50); + refresh(); } curs_set(1); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } /* lrtest.c ends here */ diff --git a/test/ncurses.c b/test/ncurses.c index ad1aa01c..b4bac67f 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,22 +38,17 @@ DESCRIPTION AUTHOR Author: Eric S. Raymond 1993 + Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.138 2000/09/17 01:24:00 tom Exp $ +$Id: ncurses.c,v 1.180 2002/09/15 00:39:33 tom Exp $ ***************************************************************************/ -#include - #include #include -#include #include -#include -#if HAVE_LOCALE_H -#include -#endif +#include #if HAVE_GETTIMEOFDAY #if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT @@ -64,7 +59,7 @@ $Id: ncurses.c,v 1.138 2000/09/17 01:24:00 tom Exp $ #endif #endif -#if HAVE_PANEL_H +#if HAVE_PANEL_H && HAVE_LIBPANEL #define USE_LIBPANEL 1 #include #else @@ -92,33 +87,56 @@ static int save_trace = TRACE_ORDINARY | TRACE_CALLS; extern int _nc_tracing; #endif -#if !defined(HAVE_NAPMS) -#define HAVE_NAPMS 1 -#endif - #else #define mmask_t chtype /* not specified in XSI */ -#define attr_t chtype /* not specified in XSI */ -#define ACS_S3 (acs_map['p']) /* scan line 3 */ -#define ACS_S7 (acs_map['r']) /* scan line 7 */ -#define ACS_LEQUAL (acs_map['y']) /* less/equal */ -#define ACS_GEQUAL (acs_map['z']) /* greater/equal */ -#define ACS_PI (acs_map['{']) /* Pi */ -#define ACS_NEQUAL (acs_map['|']) /* not equal */ -#define ACS_STERLING (acs_map['}']) /* UK pound sign */ + +#ifdef CURSES_ACS_ARRAY +#define ACS_S3 (CURSES_ACS_ARRAY['p']) /* scan line 3 */ +#define ACS_S7 (CURSES_ACS_ARRAY['r']) /* scan line 7 */ +#define ACS_LEQUAL (CURSES_ACS_ARRAY['y']) /* less/equal */ +#define ACS_GEQUAL (CURSES_ACS_ARRAY['z']) /* greater/equal */ +#define ACS_PI (CURSES_ACS_ARRAY['{']) /* Pi */ +#define ACS_NEQUAL (CURSES_ACS_ARRAY['|']) /* not equal */ +#define ACS_STERLING (CURSES_ACS_ARRAY['}']) /* UK pound sign */ +#else +#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */ +#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */ +#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */ +#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */ +#define ACS_PI (A_ALTCHARSET + '{') /* Pi */ +#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */ +#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */ +#endif + +#ifdef CURSES_WACS_ARRAY +#define WACS_S3 (&(CURSES_WACS_ARRAY['p'])) /* scan line 3 */ +#define WACS_S7 (&(CURSES_WACS_ARRAY['r'])) /* scan line 7 */ +#define WACS_LEQUAL (&(CURSES_WACS_ARRAY['y'])) /* less/equal */ +#define WACS_GEQUAL (&(CURSES_WACS_ARRAY['z'])) /* greater/equal */ +#define WACS_PI (&(CURSES_WACS_ARRAY['{'])) /* Pi */ +#define WACS_NEQUAL (&(CURSES_WACS_ARRAY['|'])) /* not equal */ +#define WACS_STERLING (&(CURSES_WACS_ARRAY['}'])) /* UK pound sign */ +#endif #endif #define P(string) printw("%s\n", string) -#ifndef CTRL -#define CTRL(x) ((x) & 0x1f) +#ifdef CTRL +#undef CTRL #endif +#define CTRL(x) ((x) & 0x1f) #define QUIT CTRL('Q') #define ESCAPE CTRL('[') #define BLANK ' ' /* this is the background character */ +#undef max_colors +static int max_colors; /* the actual number of colors we'll use */ + +#undef max_pairs +static int max_pairs; /* ...and the number of color pairs */ + /* The behavior of mvhline, mvvline for negative/zero length is unspecified, * though we can rely on negative x/y values to stop the macro. */ @@ -163,6 +181,33 @@ wGetchar(WINDOW *win) } #define Getchar() wGetchar(stdscr) +#if USE_WIDEC_SUPPORT +static int +wGet_wchar(WINDOW *win, wint_t * result) +{ + int c; +#ifdef TRACE + while ((c = wget_wch(win, result)) == CTRL('T')) { + if (_nc_tracing) { + save_trace = _nc_tracing; + _tracef("TOGGLE-TRACING OFF"); + _nc_tracing = 0; + } else { + _nc_tracing = save_trace; + } + trace(_nc_tracing); + if (_nc_tracing) + _tracef("TOGGLE-TRACING ON"); + } +#else + c = wget_wch(win, result); +#endif + return c; +} +#define Get_wchar(result) wGet_wchar(stdscr, result) + +#endif + static void Pause(void) { @@ -246,106 +291,497 @@ mouse_decode(MEVENT const *ep) ****************************************************************************/ static void -getch_test(void) -/* test the keypad feature */ +setup_getch(WINDOW *win, bool flags[]) { - char buf[BUFSIZ]; - int c; - int incount = 0, firsttime = 0; - bool blocking = TRUE; + keypad(win, flags['k']); /* should be redundant, but for testing */ + meta(win, flags['m']); /* force this to a known state */ + if (flags['e']) + echo(); + else + noecho(); +} + +static void +wgetch_help(WINDOW *win, bool flags[]) +{ + static const char *help[] = + { + "e -- toggle echo mode" + ,"g -- triggers a getstr test" + ,"k -- toggle keypad/literal mode" + ,"m -- toggle meta (7-bit/8-bit) mode" + ,"q -- quit (x also exits)" + ,"s -- shell out\n" + ,"w -- create a new window" +#ifdef SIGTSTP + ,"z -- suspend this process" +#endif + }; int y, x; + unsigned chk = ((SIZEOF(help) + 1) / 2); + unsigned n; - refresh(); + getyx(win, y, x); + move(0, 0); + printw("Type any key to see its %s value. Also:\n", + flags['k'] ? "keypad" : "literal"); + for (n = 0; n < SIZEOF(help); ++n) { + int row = 1 + (n % chk); + int col = (n >= chk) ? COLS / 2 : 0; + int flg = ((strstr(help[n], "toggle") != 0) + && (flags[UChar(*help[n])] != FALSE)); + if (flg) + standout(); + mvprintw(row, col, "%s", help[n]); + if (col == 0) + clrtoeol(); + if (flg) + standend(); + } + wrefresh(stdscr); + wmove(win, y, x); +} -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif +static void +wgetch_wrap(WINDOW *win, int first_y) +{ + int last_y = getmaxy(win) - 1; + int y = getcury(win) + 1; - (void) printw("Delay in 10ths of a second ( for blocking input)? "); - echo(); - getstr(buf); - noecho(); - nonl(); + if (y >= last_y) + y = first_y; + wmove(win, y, 0); + wclrtoeol(win); +} + +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE +typedef struct { + WINDOW *text; + WINDOW *frame; +} WINSTACK; - if (isdigit(buf[0])) { - timeout(atoi(buf) * 100); - blocking = FALSE; +static WINSTACK *winstack = 0; +static unsigned len_winstack = 0; + +static void +remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win) +{ + unsigned need = (level + 1) * 2; + + if (winstack == 0) { + len_winstack = 20; + winstack = malloc(len_winstack * sizeof(WINSTACK)); + } else if (need >= len_winstack) { + len_winstack = need; + winstack = realloc(winstack, len_winstack * sizeof(WINSTACK)); } + winstack[level].text = txt_win; + winstack[level].frame = box_win; +} + +/* + * For wgetch_test(), we create pairs of windows - one for a box, one for text. + * Resize both and paint the box in the parent. + */ +static void +resize_boxes(int level, WINDOW *win) +{ + unsigned n; + int base = 5; + int high = LINES - base; + int wide = COLS; + + touchwin(stdscr); + wnoutrefresh(stdscr); + + /* FIXME: this chunk should be done in resizeterm() */ + slk_touch(); + slk_clear(); + slk_noutrefresh(); + + for (n = 0; (int) n < level; ++n) { + wresize(winstack[n].frame, high, wide); + wresize(winstack[n].text, high - 2, wide - 2); + high -= 2; + wide -= 2; + werase(winstack[n].text); + box(winstack[n].frame, 0, 0); + wnoutrefresh(winstack[n].frame); + wprintw(winstack[n].text, + "size %dx%d\n", + getmaxy(winstack[n].text), + getmaxx(winstack[n].text)); + wnoutrefresh(winstack[n].text); + if (winstack[n].text == win) + break; + } + doupdate(); +} +#else +#define remember_boxes(level,text,frame) /* nothing */ +#endif + +static void +wgetch_test(int level, WINDOW *win, int delay) +{ + char buf[BUFSIZ]; + int first_y, first_x; + int c; + int incount = 0; + bool flags[256]; + bool blocking = (delay < 0); + int y, x; + + memset(flags, FALSE, sizeof(flags)); + flags['k'] = (win == stdscr); + + setup_getch(win, flags); + wtimeout(win, delay); + getyx(win, first_y, first_x); + + wgetch_help(win, flags); + wsetscrreg(win, first_y, getmaxy(win) - 1); + scrollok(win, TRUE); - c = '?'; - raw(); for (;;) { - if (firsttime++) { - printw("Key pressed: %04o ", c); + while ((c = wGetchar(win)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (c == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (c == 'x' || c == 'q') { + break; + } else if (c == 'e') { + flags['e'] = !flags['e']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + wgetnstr(win, buf, sizeof(buf) - 1); + noecho(); + wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf); + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags['k'] = !flags['k']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags['m'] = !flags['m']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = getmaxy(win) - 1 - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + remember_boxes(level, wi, wb); + wgetch_test(level + 1, wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + doupdate(); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", c); #ifdef NCURSES_MOUSE_VERSION if (c == KEY_MOUSE) { MEVENT event; getmouse(&event); - printw("KEY_MOUSE, %s\n", mouse_decode(&event)); + wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event)); + getyx(win, y, x); + move(event.y, event.x); + addch('*'); + wmove(win, y, x); } else #endif /* NCURSES_MOUSE_VERSION */ if (c >= KEY_MIN) { - (void) addstr(keyname(c)); - addch('\n'); +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE + if (c == KEY_RESIZE) { + resize_boxes(level, win); + } +#endif + (void) waddstr(win, keyname(c)); } else if (c > 0x80) { int c2 = (c & 0x7f); if (isprint(c2)) - (void) printw("M-%c", c2); + (void) wprintw(win, "M-%c", c2); else - (void) printw("M-%s", unctrl(c2)); - addstr(" (high-half character)\n"); + (void) wprintw(win, "M-%s", unctrl(c2)); + waddstr(win, " (high-half character)"); } else { if (isprint(c)) - (void) printw("%c (ASCII printable character)\n", c); + (void) wprintw(win, "%c (ASCII printable character)", c); else - (void) printw("%s (ASCII control character)\n", unctrl(c)); + (void) wprintw(win, "%s (ASCII control character)", + unctrl(c)); } - getyx(stdscr, y, x); - if (y >= LINES - 1) - move(0, 0); - clrtoeol(); + wgetch_wrap(win, first_y); } + } - if (c == 'g') { - addstr("getstr test: "); - echo(); - getstr(buf); - noecho(); - printw("I saw `%s'.\n", buf); - } - if (c == 's') { - ShellOut(TRUE); - } - if (c == 'x' || c == 'q' || (c == ERR && blocking)) - break; - if (c == '?') { - addstr("Type any key to see its keypad value. Also:\n"); - addstr("g -- triggers a getstr test\n"); - addstr("s -- shell out\n"); - addstr("q -- quit\n"); - addstr("? -- repeats this help message\n"); - } + wtimeout(win, -1); +} - while ((c = Getchar()) == ERR) - if (!blocking) - (void) printw("%05d: input timed out\n", incount++); - else { - (void) printw("%05d: input error\n", incount++); - break; - } +static int +begin_getch_test(void) +{ + char buf[BUFSIZ]; + int delay; + + refresh(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + (void) printw("Delay in 10ths of a second ( for blocking input)? "); + echo(); + getnstr(buf, sizeof(buf) - 1); + noecho(); + nonl(); + + if (isdigit(UChar(buf[0]))) { + delay = atoi(buf) * 100; + } else { + delay = -1; } + raw(); + move(5, 0); + return delay; +} +static void +finish_getch_test(void) +{ #ifdef NCURSES_MOUSE_VERSION mousemask(0, (mmask_t *) 0); #endif - timeout(-1); erase(); noraw(); nl(); endwin(); } +static void +getch_test(void) +{ + int delay = begin_getch_test(); + wgetch_test(0, stdscr, delay); + finish_getch_test(); +} + +#if USE_WIDEC_SUPPORT +/* + * For wgetch_test(), we create pairs of windows - one for a box, one for text. + * Resize both and paint the box in the parent. + */ +static void +resize_wide_boxes(int level, WINDOW *win) +{ + unsigned n; + int base = 5; + int high = LINES - base; + int wide = COLS; + + touchwin(stdscr); + wnoutrefresh(stdscr); + + /* FIXME: this chunk should be done in resizeterm() */ + slk_touch(); + slk_clear(); + slk_noutrefresh(); + + for (n = 0; (int) n < level; ++n) { + wresize(winstack[n].frame, high, wide); + wresize(winstack[n].text, high - 2, wide - 2); + high -= 2; + wide -= 2; + werase(winstack[n].text); + box_set(winstack[n].frame, 0, 0); + wnoutrefresh(winstack[n].frame); + wprintw(winstack[n].text, + "size %dx%d\n", + getmaxy(winstack[n].text), + getmaxx(winstack[n].text)); + wnoutrefresh(winstack[n].text); + if (winstack[n].text == win) + break; + } + doupdate(); +} + +static void +wget_wch_test(int level, WINDOW *win, int delay) +{ + char buf[BUFSIZ]; + int first_y, first_x; + wint_t c; + int incount = 0; + bool flags[256]; + bool blocking = (delay < 0); + int y, x, code; + + memset(flags, FALSE, sizeof(flags)); + flags['k'] = (win == stdscr); + + setup_getch(win, flags); + wtimeout(win, delay); + getyx(win, first_y, first_x); + + wgetch_help(win, flags); + wsetscrreg(win, first_y, getmaxy(win) - 1); + scrollok(win, TRUE); + + for (;;) { + while ((code = wGet_wchar(win, &c)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (code == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (c == 'x' || c == 'q') { + break; + } else if (c == 'e') { + flags['e'] = !flags['e']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + wgetnstr(win, buf, sizeof(buf) - 1); + noecho(); + wprintw(win, "I saw %d characters:\n\t`%s'.", strlen(buf), buf); + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags['k'] = !flags['k']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags['m'] = !flags['m']; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = getmaxy(win) - 1 - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box_set(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + remember_boxes(level, wi, wb); + wget_wch_test(level + 1, wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", c); +#ifdef NCURSES_MOUSE_VERSION + if (c == KEY_MOUSE) { + MEVENT event; + + getmouse(&event); + wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event)); + getyx(win, y, x); + move(event.y, event.x); + addch('*'); + wmove(win, y, x); + } else +#endif /* NCURSES_MOUSE_VERSION */ + if (code == KEY_CODE_YES) { +#ifdef KEY_RESIZE + if (c == KEY_RESIZE) { + resize_wide_boxes(level, win); + } +#endif + (void) waddstr(win, key_name(c)); + } else { + if (c < 256 && iscntrl(c)) { + (void) wprintw(win, "%s (control character)", unctrl(c)); + } else { + wchar_t c2 = c; + waddnwstr(win, &c2, 1); + (void) wprintw(win, " = %#x (printable character)", c); + } + } + wgetch_wrap(win, first_y); + } + } + + wtimeout(win, -1); +} + +static void +get_wch_test(void) +{ + int delay = begin_getch_test(); + wget_wch_test(0, stdscr, delay); + finish_getch_test(); +} +#endif + +/**************************************************************************** + * + * Character attributes test + * + ****************************************************************************/ + static int show_attr(int row, int skip, chtype attr, const char *name) { @@ -376,8 +812,10 @@ show_attr(int row, int skip, chtype attr, const char *name) const char *s = string; while (*s) { int ch = *s++; - if ((ch = acs_map[ch]) == 0) +#ifdef CURSES_ACS_ARRAY + if ((ch = CURSES_ACS_ARRAY[ch]) == 0) ch = ' '; +#endif addch(ch); } } else { @@ -391,7 +829,7 @@ show_attr(int row, int skip, chtype attr, const char *name) if (!(termattrs() & attr)) { printw(" (N/A)"); } else if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { - static const attr_t table[] = + static const chtype table[] = { A_STANDOUT, A_UNDERLINE, @@ -405,7 +843,7 @@ show_attr(int row, int skip, chtype attr, const char *name) }; unsigned n; bool found = FALSE; - for (n = 0; n < sizeof(table) / sizeof(table[0]); n++) { + for (n = 0; n < SIZEOF(table); n++) { if ((table[n] & attr) != 0 && ((1 << n) & ncv) != 0) { found = TRUE; @@ -426,11 +864,9 @@ attr_getc(int *skip, int *fg, int *bg, int *ac) if (isdigit(ch)) { *skip = (ch - '0'); - return TRUE; } else if (ch == CTRL('L')) { touchwin(stdscr); touchwin(curscr); - return TRUE; } else if (has_colors()) { switch (ch) { case 'a': @@ -454,15 +890,14 @@ attr_getc(int *skip, int *fg, int *bg, int *ac) default: return FALSE; } - if (*fg >= COLORS) + if (*fg >= max_colors) *fg = 0; if (*fg < 0) - *fg = COLORS - 1; - if (*bg >= COLORS) + *fg = max_colors - 1; + if (*bg >= max_colors) *bg = 0; if (*bg < 0) - *bg = COLORS - 1; - return TRUE; + *bg = max_colors - 1; } else { switch (ch) { case 'a': @@ -474,9 +909,8 @@ attr_getc(int *skip, int *fg, int *bg, int *ac) default: return FALSE; } - return TRUE; } - return FALSE; + return TRUE; } static void @@ -488,7 +922,7 @@ attr_test(void) int fg = COLOR_BLACK; /* color pair 0 is special */ int bg = COLOR_BLACK; int ac = 0; - bool *pairs = (bool *) calloc(COLOR_PAIRS, sizeof(bool)); + bool *pairs = (bool *) calloc(max_pairs, sizeof(bool)); pairs[0] = TRUE; if (skip < 0) @@ -501,16 +935,18 @@ attr_test(void) int normal = A_NORMAL | BLANK; if (has_colors()) { - int pair = (fg * COLORS) + bg; + int pair = (fg * max_colors) + bg; if (!pairs[pair]) { init_pair(pair, fg, bg); pairs[pair] = TRUE; } normal |= COLOR_PAIR(pair); } + bkgd(normal); bkgdset(normal); erase(); + box(stdscr, 0, 0); mvaddstr(0, 20, "Character attribute test display"); row = show_attr(row, n, ac | A_STANDOUT, "STANDOUT"); @@ -551,7 +987,7 @@ attr_test(void) * ****************************************************************************/ -static NCURSES_CONST char *color_names[] = +static NCURSES_CONST char *the_color_names[] = { "black", "red", @@ -574,10 +1010,10 @@ static NCURSES_CONST char *color_names[] = static void show_color_name(int y, int x, int color) { - if (COLORS > 8) + if (max_colors > 8) mvprintw(y, x, "%02d ", color); else - mvaddstr(y, x, color_names[color]); + mvaddstr(y, x, the_color_names[color]); } static void @@ -591,29 +1027,30 @@ color_test(void) refresh(); (void) printw("There are %d color pairs\n", COLOR_PAIRS); - width = (COLORS > 8) ? 4 : 8; - hello = (COLORS > 8) ? "Test" : "Hello"; + width = (max_colors > 8) ? 4 : 8; + hello = (max_colors > 8) ? "Test" : "Hello"; for (base = 0; base < 2; base++) { - top = (COLORS > 8) ? 0 : base * (COLORS + 3); + top = (max_colors > 8) ? 0 : base * (max_colors + 3); clrtobot(); (void) mvprintw(top + 1, 0, "%dx%d matrix of foreground/background colors, bright *%s*\n", - COLORS, COLORS, + max_colors, max_colors, base ? "on" : "off"); - for (i = 0; i < COLORS; i++) + for (i = 0; i < max_colors; i++) show_color_name(top + 2, (i + 1) * width, i); - for (i = 0; i < COLORS; i++) + for (i = 0; i < max_colors; i++) show_color_name(top + 3 + i, 0, i); - for (i = 1; i < COLOR_PAIRS; i++) { - init_pair(i, i % COLORS, i / COLORS); + for (i = 1; i < max_pairs; i++) { + init_pair(i, i % max_colors, i / max_colors); attron((attr_t) COLOR_PAIR(i)); if (base) attron((attr_t) A_BOLD); - mvaddstr(top + 3 + (i / COLORS), (i % COLORS + 1) * width, hello); + mvaddstr(top + 3 + (i / max_colors), (i % max_colors + 1) * + width, hello); attrset(A_NORMAL); } - if ((COLORS > 8) || base) + if ((max_colors > 8) || base) Pause(); } @@ -653,7 +1090,6 @@ color_edit(void) { int i, this_c = 0, value = 0, current = 0, field = 0; int last_c; - int max_colors = COLORS > 16 ? 16 : COLORS; refresh(); @@ -672,8 +1108,8 @@ color_edit(void) for (i = 0; i < max_colors; i++) { mvprintw(2 + i, 0, "%c %-8s:", (i == current ? '>' : ' '), - (i < (int) SIZEOF(color_names) - ? color_names[i] : "")); + (i < (int) SIZEOF(the_color_names) + ? the_color_names[i] : "")); attrset(COLOR_PAIR(i)); addstr(" "); attrset(A_NORMAL); @@ -950,6 +1386,27 @@ show_upper_chars(int first) } } +static void +show_box_chars(void) +{ + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + box(stdscr, 0, 0); + /* *INDENT-OFF* */ + mvhline(LINES / 2, 0, ACS_HLINE, COLS); + mvvline(0, COLS / 2, ACS_VLINE, LINES); + mvaddch(0, COLS / 2, ACS_TTEE); + mvaddch(LINES / 2, COLS / 2, ACS_PLUS); + mvaddch(LINES - 1, COLS / 2, ACS_BTEE); + mvaddch(LINES / 2, 0, ACS_LTEE); + mvaddch(LINES / 2, COLS - 1, ACS_RTEE); + /* *INDENT-ON* */ + +} + static int show_1_acs(int n, const char *name, chtype code) { @@ -976,37 +1433,43 @@ show_acs_chars(void) refresh(); n = show_1_acs(0, BOTH(ACS_ULCORNER)); - n = show_1_acs(n, BOTH(ACS_LLCORNER)); n = show_1_acs(n, BOTH(ACS_URCORNER)); + n = show_1_acs(n, BOTH(ACS_LLCORNER)); n = show_1_acs(n, BOTH(ACS_LRCORNER)); - n = show_1_acs(n, BOTH(ACS_RTEE)); + n = show_1_acs(n, BOTH(ACS_LTEE)); - n = show_1_acs(n, BOTH(ACS_BTEE)); + n = show_1_acs(n, BOTH(ACS_RTEE)); n = show_1_acs(n, BOTH(ACS_TTEE)); + n = show_1_acs(n, BOTH(ACS_BTEE)); + n = show_1_acs(n, BOTH(ACS_HLINE)); n = show_1_acs(n, BOTH(ACS_VLINE)); - n = show_1_acs(n, BOTH(ACS_PLUS)); - n = show_1_acs(n, BOTH(ACS_S1)); - n = show_1_acs(n, BOTH(ACS_S9)); - n = show_1_acs(n, BOTH(ACS_DIAMOND)); - n = show_1_acs(n, BOTH(ACS_CKBOARD)); - n = show_1_acs(n, BOTH(ACS_DEGREE)); - n = show_1_acs(n, BOTH(ACS_PLMINUS)); - n = show_1_acs(n, BOTH(ACS_BULLET)); + n = show_1_acs(n, BOTH(ACS_LARROW)); n = show_1_acs(n, BOTH(ACS_RARROW)); - n = show_1_acs(n, BOTH(ACS_DARROW)); n = show_1_acs(n, BOTH(ACS_UARROW)); + n = show_1_acs(n, BOTH(ACS_DARROW)); + + n = show_1_acs(n, BOTH(ACS_BLOCK)); n = show_1_acs(n, BOTH(ACS_BOARD)); n = show_1_acs(n, BOTH(ACS_LANTERN)); - n = show_1_acs(n, BOTH(ACS_BLOCK)); - n = show_1_acs(n, BOTH(ACS_S3)); - n = show_1_acs(n, BOTH(ACS_S7)); - n = show_1_acs(n, BOTH(ACS_LEQUAL)); + n = show_1_acs(n, BOTH(ACS_BULLET)); + n = show_1_acs(n, BOTH(ACS_CKBOARD)); + n = show_1_acs(n, BOTH(ACS_DEGREE)); + n = show_1_acs(n, BOTH(ACS_DIAMOND)); + n = show_1_acs(n, BOTH(ACS_PLMINUS)); + n = show_1_acs(n, BOTH(ACS_PLUS)); + n = show_1_acs(n, BOTH(ACS_GEQUAL)); - n = show_1_acs(n, BOTH(ACS_PI)); n = show_1_acs(n, BOTH(ACS_NEQUAL)); + n = show_1_acs(n, BOTH(ACS_LEQUAL)); + n = show_1_acs(n, BOTH(ACS_STERLING)); + n = show_1_acs(n, BOTH(ACS_PI)); + n = show_1_acs(n, BOTH(ACS_S1)); + n = show_1_acs(n, BOTH(ACS_S3)); + n = show_1_acs(n, BOTH(ACS_S7)); + n = show_1_acs(n, BOTH(ACS_S9)); } static void @@ -1019,6 +1482,9 @@ acs_display(void) case 'a': show_acs_chars(); break; + case 'b': + show_box_chars(); + break; case '0': case '1': case '2': @@ -1029,7 +1495,7 @@ acs_display(void) mvprintw(LINES - 3, 0, "Note: ANSI terminals may not display C1 characters."); mvprintw(LINES - 2, 0, - "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit"); + "Select: a=ACS, b=box, 0=C1, 1,2,3=GR characters, q=quit"); refresh(); } while ((c = Getchar()) != 'x' && c != 'q'); @@ -1038,6 +1504,221 @@ acs_display(void) endwin(); } +#if USE_WIDEC_SUPPORT +static void +show_upper_widechars(int first) +{ + cchar_t temp; + wchar_t code; + int last = first + 31; + + erase(); + attron(A_BOLD); + mvprintw(0, 20, "Display of Character Codes %d to %d", first, last); + attroff(A_BOLD); + refresh(); + + for (code = first; code <= last; code++) { + int row = 4 + ((code - first) % 16); + int col = ((code - first) / 16) * COLS / 2; + wchar_t codes[10]; + attr_t attrs = A_NORMAL; + char tmp[80]; + + memset(&codes, 0, sizeof(codes)); + codes[0] = code; + sprintf(tmp, "%3ld (0x%lx)", code, code); + mvprintw(row, col, "%*s: ", COLS / 4, tmp); + setcchar(&temp, codes, attrs, 0, 0); + echo_wchar(&temp); + } +} + +static int +show_1_wacs(int n, const char *name, const cchar_t * code) +{ + const int height = 16; + int row = 4 + (n % height); + int col = (n / height) * COLS / 2; + mvprintw(row, col, "%*s : ", COLS / 4, name); + add_wchnstr(code, 1); + return n + 1; +} + +static void +show_wacs_chars(void) +/* display the wide-ACS character set */ +{ + int n; + +/*#define BOTH2(name) #name, &(name) */ +#define BOTH2(name) #name, name + + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_wacs(0, BOTH2(WACS_ULCORNER)); + n = show_1_wacs(n, BOTH2(WACS_URCORNER)); + n = show_1_wacs(n, BOTH2(WACS_LLCORNER)); + n = show_1_wacs(n, BOTH2(WACS_LRCORNER)); + + n = show_1_wacs(n, BOTH2(WACS_LTEE)); + n = show_1_wacs(n, BOTH2(WACS_RTEE)); + n = show_1_wacs(n, BOTH2(WACS_TTEE)); + n = show_1_wacs(n, BOTH2(WACS_BTEE)); + + n = show_1_wacs(n, BOTH2(WACS_HLINE)); + n = show_1_wacs(n, BOTH2(WACS_VLINE)); + + n = show_1_wacs(n, BOTH2(WACS_LARROW)); + n = show_1_wacs(n, BOTH2(WACS_RARROW)); + n = show_1_wacs(n, BOTH2(WACS_UARROW)); + n = show_1_wacs(n, BOTH2(WACS_DARROW)); + + n = show_1_wacs(n, BOTH2(WACS_BLOCK)); + n = show_1_wacs(n, BOTH2(WACS_BOARD)); + n = show_1_wacs(n, BOTH2(WACS_LANTERN)); + n = show_1_wacs(n, BOTH2(WACS_BULLET)); + n = show_1_wacs(n, BOTH2(WACS_CKBOARD)); + n = show_1_wacs(n, BOTH2(WACS_DEGREE)); + n = show_1_wacs(n, BOTH2(WACS_DIAMOND)); + n = show_1_wacs(n, BOTH2(WACS_PLMINUS)); + n = show_1_wacs(n, BOTH2(WACS_PLUS)); + +#ifdef CURSES_WACS_ARRAY + n = show_1_wacs(n, BOTH2(WACS_GEQUAL)); + n = show_1_wacs(n, BOTH2(WACS_NEQUAL)); + n = show_1_wacs(n, BOTH2(WACS_LEQUAL)); + + n = show_1_wacs(n, BOTH2(WACS_STERLING)); + n = show_1_wacs(n, BOTH2(WACS_PI)); + n = show_1_wacs(n, BOTH2(WACS_S1)); + n = show_1_wacs(n, BOTH2(WACS_S3)); + n = show_1_wacs(n, BOTH2(WACS_S7)); + n = show_1_wacs(n, BOTH2(WACS_S9)); +#endif +} + +static void +show_wbox_chars(void) +{ + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + box_set(stdscr, 0, 0); + /* *INDENT-OFF* */ + mvhline_set(LINES / 2, 0, WACS_HLINE, COLS); + mvvline_set(0, COLS / 2, WACS_VLINE, LINES); + mvadd_wch(0, COLS / 2, WACS_TTEE); + mvadd_wch(LINES / 2, COLS / 2, WACS_PLUS); + mvadd_wch(LINES - 1, COLS / 2, WACS_BTEE); + mvadd_wch(LINES / 2, 0, WACS_LTEE); + mvadd_wch(LINES / 2, COLS - 1, WACS_RTEE); + /* *INDENT-ON* */ + +} + +static int +show_2_wacs(int n, const char *name, char *code) +{ + const int height = 16; + int row = 4 + (n % height); + int col = (n / height) * COLS / 2; + mvprintw(row, col, "%*s : ", COLS / 4, name); + addstr(code); + return n + 1; +} + +static void +show_utf8_chars(void) +/* display the wide-ACS character set */ +{ + int n; + + erase(); + attron(A_BOLD); + mvaddstr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + /* *INDENT-OFF* */ + n = show_2_wacs(0, "WACS_ULCORNER", "\342\224\214"); + n = show_2_wacs(n, "WACS_URCORNER", "\342\224\220"); + n = show_2_wacs(n, "WACS_LLCORNER", "\342\224\224"); + n = show_2_wacs(n, "WACS_LRCORNER", "\342\224\230"); + + n = show_2_wacs(n, "WACS_LTEE", "\342\224\234"); + n = show_2_wacs(n, "WACS_RTEE", "\342\224\244"); + n = show_2_wacs(n, "WACS_TTEE", "\342\224\254"); + n = show_2_wacs(n, "WACS_BTEE", "\342\224\264"); + + n = show_2_wacs(n, "WACS_HLINE", "\342\224\200"); + n = show_2_wacs(n, "WACS_VLINE", "\342\224\202"); + + n = show_2_wacs(n, "WACS_LARROW", "\342\206\220"); + n = show_2_wacs(n, "WACS_RARROW", "\342\206\222"); + n = show_2_wacs(n, "WACS_UARROW", "\342\206\221"); + n = show_2_wacs(n, "WACS_DARROW", "\342\206\223"); + + n = show_2_wacs(n, "WACS_BLOCK", "\342\226\256"); + n = show_2_wacs(n, "WACS_BOARD", "\342\226\222"); + n = show_2_wacs(n, "WACS_LANTERN", "\342\230\203"); + n = show_2_wacs(n, "WACS_BULLET", "\302\267"); + n = show_2_wacs(n, "WACS_CKBOARD", "\342\226\222"); + n = show_2_wacs(n, "WACS_DEGREE", "\302\260"); + n = show_2_wacs(n, "WACS_DIAMOND", "\342\227\206"); + n = show_2_wacs(n, "WACS_PLMINUS", "\302\261"); + n = show_2_wacs(n, "WACS_PLUS", "\342\224\274"); + n = show_2_wacs(n, "WACS_GEQUAL", "\342\211\245"); + n = show_2_wacs(n, "WACS_NEQUAL", "\342\211\240"); + n = show_2_wacs(n, "WACS_LEQUAL", "\342\211\244"); + + n = show_2_wacs(n, "WACS_STERLING", "\302\243"); + n = show_2_wacs(n, "WACS_PI", "\317\200"); + n = show_2_wacs(n, "WACS_S1", "\342\216\272"); + n = show_2_wacs(n, "WACS_S3", "\342\216\273"); + n = show_2_wacs(n, "WACS_S7", "\342\216\274"); + n = show_2_wacs(n, "WACS_S9", "\342\216\275"); + /* *INDENT-OFF* */ +} + +static void +wide_acs_display(void) +{ + int c = 'a'; + + do { + switch (c) { + case 'a': + show_wacs_chars(); + break; + case 'b': + show_wbox_chars(); + break; + case 'u': + show_utf8_chars(); + break; + default: + if (isdigit(c)) + show_upper_widechars((c - '0') * 32 + 128); + break; + } + mvprintw(LINES - 2, 0, + "Select: a WACS, b box, u UTF-8, 0-9 non-ASCII characters, q=quit"); + refresh(); + } while ((c = Getchar()) != 'x' && c != 'q'); + + Pause(); + erase(); + endwin(); +} + +#endif + /* * Graphic-rendition test (adapted from vttest) */ @@ -1139,21 +1820,30 @@ FRAME WINDOW *wind; }; +#ifdef NCURSES_VERSION +#define keypad_active(win) (win)->_use_keypad +#define scroll_active(win) (win)->_scroll +#else +#define keypad_active(win) FALSE +#define scroll_active(win) FALSE +#endif + /* We need to know if these flags are actually set, so don't look in FRAME. - * These names are known to work with SVr4 curses as well as ncurses. + * These names are known to work with SVr4 curses as well as ncurses. The + * _use_keypad name does not work with Solaris 8. */ static bool HaveKeypad(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); - return win->_use_keypad; + return keypad_active(win); } static bool HaveScroll(FRAME * curp) { WINDOW *win = (curp ? curp->wind : stdscr); - return win->_scroll; + return scroll_active(win); } static void @@ -1200,7 +1890,7 @@ newwin_legend(FRAME * curp) } }; size_t n; - int y, x; + int x; bool do_keypad = HaveKeypad(curp); bool do_scroll = HaveScroll(curp); char buf[BUFSIZ]; @@ -1221,7 +1911,7 @@ newwin_legend(FRAME * curp) sprintf(buf, legend[n].msg, do_keypad ? "/ESC" : ""); break; } - getyx(stdscr, y, x); + x = getcurx(stdscr); addstr((COLS < (x + 3 + (int) strlen(buf))) ? "\n" : (n ? ", " : "")); addstr(buf); } @@ -1491,11 +2181,12 @@ acs_and_scroll(void) break; case CTRL('W'): /* save and delete window */ - if (current == current->next) + if (current == current->next) { + transient(current, "Will not save/delete ONLY window"); break; - if ((fp = fopen(DUMPFILE, "w")) == (FILE *) 0) + } else if ((fp = fopen(DUMPFILE, "w")) == (FILE *) 0) { transient(current, "Can't open screen dump file"); - else { + } else { (void) putwin(current->wind, fp); (void) fclose(fp); @@ -1504,9 +2195,9 @@ acs_and_scroll(void) break; case CTRL('R'): /* restore window */ - if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) + if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) { transient(current, "Can't open screen dump file"); - else { + } else { neww = (FRAME *) calloc(1, sizeof(FRAME)); neww->next = current->next; @@ -1629,7 +2320,7 @@ acs_and_scroll(void) wrefresh(usescr); } while ((c = wGetchar(usescr)) != QUIT - && !((c == ESCAPE) && (usescr->_use_keypad)) + && !((c == ESCAPE) && (keypad_active(usescr))) && (c != ERR)); breakout: @@ -2297,7 +2988,7 @@ padgetch(WINDOW *win) switch (c = wGetchar(win)) { case '!': ShellOut(FALSE); - c = KEY_REFRESH; + /* FALLTHRU */ case CTRL('r'): endwin(); refresh(); @@ -3022,7 +3713,7 @@ form_virtualize(FORM * f, WINDOW *w) mode = REQ_INS_MODE; c = mode; } else { - for (n = 0; n < sizeof(lookup) / sizeof(lookup[0]); n++) { + for (n = 0; n < SIZEOF(lookup); n++) { if (lookup[n].code == c) { c = lookup[n].result; break; @@ -3261,6 +3952,12 @@ do_single_test(const char c) getch_test(); break; +#if USE_WIDEC_SUPPORT + case 'A': + get_wch_test(); + break; +#endif + case 'b': attr_test(); break; @@ -3289,6 +3986,12 @@ do_single_test(const char c) acs_display(); break; +#if USE_WIDEC_SUPPORT + case 'F': + wide_acs_display(); + break; +#endif + #if USE_LIBPANEL case 'o': demo_panels(); @@ -3366,9 +4069,9 @@ usage(void) #endif }; size_t n; - for (n = 0; n < sizeof(tbl) / sizeof(tbl[0]); n++) + for (n = 0; n < SIZEOF(tbl); n++) fprintf(stderr, "%s\n", tbl[n]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -3391,23 +4094,23 @@ announce_sig(int sig) #endif static int -rip_footer(WINDOW *win, int columns) +rip_footer(WINDOW *win, int cols) { wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "footer: %d columns", columns); + wprintw(win, "footer: %d columns", cols); wnoutrefresh(win); return OK; } static int -rip_header(WINDOW *win, int columns) +rip_header(WINDOW *win, int cols) { wbkgd(win, A_REVERSE); werase(win); wmove(win, 0, 0); - wprintw(win, "header: %d columns", columns); + wprintw(win, "header: %d columns", cols); wnoutrefresh(win); return OK; } @@ -3428,9 +4131,7 @@ main(int argc, char *argv[]) bool default_colors = FALSE; #endif -#if HAVE_LOCALE_H - setlocale(LC_CTYPE, ""); -#endif + setlocale(LC_ALL, ""); while ((c = getopt(argc, argv, "a:de:fhs:t:")) != EOF) { switch (c) { @@ -3504,12 +4205,22 @@ main(int argc, char *argv[]) /* tests, in general, will want these modes */ if (has_colors()) { start_color(); -#ifdef NCURSES_VERSION +#ifdef NCURSES_VERSION_PATCH + max_colors = COLORS > 16 ? 16 : COLORS; +#if HAVE_USE_DEFAULT_COLORS if (default_colors) use_default_colors(); +#if NCURSES_VERSION_PATCH >= 20000708 else if (assumed_colors) assume_default_colors(default_fg, default_bg); #endif +#endif +#else /* normal SVr4 curses */ + max_colors = COLORS > 8 ? 8 : COLORS; +#endif + max_pairs = (max_colors * max_colors); + if (max_pairs < COLOR_PAIRS) + max_pairs = COLOR_PAIRS; } set_terminal_modes(); def_prog_mode(); @@ -3534,11 +4245,17 @@ main(int argc, char *argv[]) do { (void) puts("This is the ncurses main menu"); (void) puts("a = keyboard and mouse input test"); +#if USE_WIDEC_SUPPORT + (void) puts("A = wide-character keyboard and mouse input test"); +#endif (void) puts("b = character attribute test"); (void) puts("c = color test pattern"); (void) puts("d = edit RGB color values"); (void) puts("e = exercise soft keys"); (void) puts("f = display ACS characters"); +#if USE_WIDEC_SUPPORT + (void) puts("F = display Wide-ACS characters"); +#endif (void) puts("g = display windows and scrolling"); (void) puts("i = test of flushinp()"); (void) puts("k = display character attributes"); @@ -3574,7 +4291,7 @@ main(int argc, char *argv[]) if (command == 0) command = 'q'; break; - } else if (command == 0 && !isspace(ch)) { + } else if (command == 0 && !isspace(UChar(ch))) { command = ch; } else if (ch == '\n' || ch == '\r') { if (command != 0) diff --git a/test/newdemo.c b/test/newdemo.c index d47d275e..7f583389 100644 --- a/test/newdemo.c +++ b/test/newdemo.c @@ -2,19 +2,12 @@ * newdemo.c - A demo program using PDCurses. The program illustrate * the use of colours for text output. * - * $Id: newdemo.c,v 1.17 1997/09/20 15:11:26 tom Exp $ + * $Id: newdemo.c,v 1.24 2002/06/29 23:32:18 tom Exp $ */ -#include - -#include #include -#include -static int SubWinTest(WINDOW *win); -static int WaitForUser(WINDOW *win); -static int BouncingBalls(WINDOW *win); -static RETSIGTYPE trap(int); +#include #define delay_output(x) napms(x) @@ -54,157 +47,59 @@ NCURSES_CONST char *messages[] = }; /* - * Main driver + * Trap interrupt */ -int -main( - int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) +static RETSIGTYPE +trap(int sig GCC_UNUSED) { -WINDOW *win; -int w, x, y, i, j, k; -char buffer[200]; -const char *message; -int width, height; -chtype save[80]; -chtype c; + endwin(); + ExitProgram(EXIT_FAILURE); +} - initscr(); - start_color(); - cbreak(); - signal(SIGINT, trap); - width = 48; - height = 14; /* Create a drawing window */ - win = newwin(height, width, (LINES-height)/2, (COLS-width)/2); - if(win == NULL) - { endwin(); - return 1; +/* + * Wait for user + */ +static int +WaitForUser(WINDOW *win) +{ + time_t t; + chtype key; + + nodelay(win, TRUE); + t = time((time_t *) 0); + while (1) { + if ((int) (key = wgetch(win)) != ERR) { + if (key == 'q' || key == 'Q') + return 1; + else + return 0; + } + if (time((time_t *) 0) - t > 5) + return 0; } +} - while(1) - { init_pair(1,COLOR_WHITE,COLOR_BLUE); - wattrset(win, COLOR_PAIR(1)); - werase(win); - - init_pair(2,COLOR_RED,COLOR_RED); - wattrset(win, COLOR_PAIR(2)); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - /* Do ramdom output of a character */ - wattrset(win, COLOR_PAIR(1)); - c = 'a'; - for(i=0; i < 5000; ++i) - { x = rand() % (width-2) + 1; - y = rand() % (height-2) + 1; - mvwaddch(win, y, x, c); - wrefresh(win); - nodelay(win,TRUE); - if (wgetch(win) != ERR) - break; - if(i == 2000) - { c = 'b'; - init_pair(3,COLOR_CYAN,COLOR_YELLOW); - wattron(win, COLOR_PAIR(3)); - } - } - - SubWinTest(win); - /* Erase and draw green window */ - init_pair(4,COLOR_YELLOW,COLOR_GREEN); - wbkgd(win, COLOR_PAIR(4) | A_BOLD); - wattrset(win, COLOR_PAIR(4) | A_BOLD); - werase(win); - wrefresh(win); - /* Draw RED bounding box */ - wattrset(win, COLOR_PAIR(2)); - box(win, ' ', ' '); - wrefresh(win); - /* Display Australia map */ - wattrset(win, COLOR_PAIR(4) | A_BOLD); - i = 0; - while(*AusMap[i]) - { mvwaddstr(win, i+1, 8, AusMap[i]); - wrefresh(win); - delay_output(50); - ++i; - } - - init_pair(5,COLOR_BLUE,COLOR_WHITE); - wattrset(win, COLOR_PAIR(5) | A_BLINK); - mvwaddstr(win, height-2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); - wrefresh(win); - - /* Draw running messages */ - init_pair(6,COLOR_YELLOW,COLOR_WHITE); - wattrset(win, COLOR_PAIR(6)); - message = messages[j = 0]; - i = 1; - w = width-2; - strcpy(buffer, message); - while(j < NMESSAGES) { - while ((int)strlen(buffer) < w) { - strcat(buffer, " ... "); - strcat(buffer, messages[++j % NMESSAGES]); - } - - if (i < w) - mvwaddnstr(win, height/2, w - i, buffer, i); - else - mvwaddnstr(win, height/2, 1, buffer, w); - - wrefresh(win); - nodelay(win,TRUE); - if (wgetch(win) != ERR) - { flushinp(); - break; - } - if (i++ >= w) { - for (k = 0; (buffer[k] = buffer[k+1]) != '\0'; k++) - ; - } - delay_output(100); - } - - j = 0; - /* Draw running As across in RED */ - init_pair(7,COLOR_RED,COLOR_GREEN); - wattron(win, COLOR_PAIR(7)); - for(i=2; i < width - 4; ++i) - { - k = mvwinch(win, 4, i); - if (k == ERR) - break; - save[j++] = c = k; - c &= A_CHARTEXT; - mvwaddch(win, 4, i, c); - } - wrefresh(win); - - /* Put a message up wait for a key */ - i = height-2; - wattrset(win, COLOR_PAIR(5)); - mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - - if(WaitForUser(win) == 1) - break; - - j = 0; /* Restore the old line */ - for(i=2; i < width - 4; ++i) - mvwaddch(win, 4, i, save[j++]); - wrefresh(win); +static void +set_colors(WINDOW *win, int pair, int foreground, int background) +{ + if (has_colors()) { + if (pair > COLOR_PAIRS) + pair = COLOR_PAIRS; + init_pair(pair, foreground, background); + wattrset(win, COLOR_PAIR(pair)); + } +} - BouncingBalls(win); - /* Put a message up wait for a key */ - i = height-2; - wattrset(win, COLOR_PAIR(5)); - mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - if(WaitForUser(win) == 1) - break; +static int +use_colors(WINDOW *win, int pair, int attrs) +{ + if (has_colors()) { + if (pair > COLOR_PAIRS) + pair = COLOR_PAIRS; + attrs |= COLOR_PAIR(pair); } - endwin(); - return 0; + wattrset(win, attrs); + return attrs; } /* @@ -213,34 +108,31 @@ chtype c; static int SubWinTest(WINDOW *win) { -int w, h, sw, sh, bx, by; -WINDOW *swin1, *swin2, *swin3; + int w, h, sw, sh, bx, by; + WINDOW *swin1, *swin2, *swin3; - getmaxyx(win, h, w); + getmaxyx(win, h, w); getbegyx(win, by, bx); sw = w / 3; sh = h / 3; - if((swin1 = subwin(win, sh, sw, by+3, bx+5)) == NULL) - return 1; - if((swin2 = subwin(win, sh, sw, by+4, bx+8)) == NULL) - return 1; - if((swin3 = subwin(win, sh, sw, by+5, bx+11)) == NULL) - return 1; - - init_pair(8,COLOR_RED,COLOR_BLUE); - wattrset(swin1, COLOR_PAIR(8)); + if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL) + return 1; + if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL) + return 1; + if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL) + return 1; + + set_colors(swin1, 8, COLOR_RED, COLOR_BLUE); werase(swin1); mvwaddstr(swin1, 0, 3, "Sub-window 1"); wrefresh(swin1); - init_pair(8,COLOR_CYAN,COLOR_MAGENTA); - wattrset(swin2, COLOR_PAIR(8)); + set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA); werase(swin2); mvwaddstr(swin2, 0, 3, "Sub-window 2"); wrefresh(swin2); - init_pair(8,COLOR_YELLOW,COLOR_GREEN); - wattrset(swin3, COLOR_PAIR(8)); + set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN); werase(swin3); mvwaddstr(swin3, 0, 3, "Sub-window 3"); wrefresh(swin3); @@ -249,7 +141,19 @@ WINDOW *swin1, *swin2, *swin3; delwin(swin2); delwin(swin3); WaitForUser(win); - return 0; + return 0; +} + +static int +bounce(int n, int *dir, int len) +{ + if (*dir > 0) + ++n; + else + --n; + if (n <= 1 || n >= len - 2) + *dir = *dir ? 0 : 1; + return n; } /* @@ -258,91 +162,197 @@ WINDOW *swin1, *swin2, *swin3; static int BouncingBalls(WINDOW *win) { -int w, h; -int x1, y1, xd1, yd1; -int x2, y2, xd2, yd2; -int x3, y3, xd3, yd3; + int w, h; + int x1, y1, xd1, yd1; + int x2, y2, xd2, yd2; + int x3, y3, xd3, yd3; getmaxyx(win, h, w); - x1 = 2 + rand() % (w - 4); - y1 = 2 + rand() % (h - 4); - x2 = 2 + rand() % (w - 4); - y2 = 2 + rand() % (h - 4); - x3 = 2 + rand() % (w - 4); - y3 = 2 + rand() % (h - 4); - xd1 = 1; yd1 = 1; - xd2 = 1; yd2 = 0; - xd3 = 0; yd3 = 1; - nodelay(win,TRUE); - while(wgetch(win) == ERR) - { x1 = xd1 > 0 ? ++x1 : --x1; - if(x1 <= 1 || x1 >= w - 2) - xd1 = xd1 ? 0 : 1; - y1 = yd1 > 0 ? ++y1 : --y1; - if(y1 <= 1 || y1 >= h - 2) - yd1 = yd1 ? 0 : 1; - - x2 = xd2 > 0 ? ++x2 : --x2; - if(x2 <= 1 || x2 >= w - 2) - xd2 = xd2 ? 0 : 1; - y2 = yd2 > 0 ? ++y2 : --y2; - if(y2 <= 1 || y2 >= h - 2) - yd2 = yd2 ? 0 : 1; - - x3 = xd3 > 0 ? ++x3 : --x3; - if(x3 <= 1 || x3 >= w - 2) - xd3 = xd3 ? 0 : 1; - y3 = yd3 > 0 ? ++y3 : --y3; - if(y3 <= 1 || y3 >= h - 2) - yd3 = yd3 ? 0 : 1; - - init_pair(8,COLOR_RED,COLOR_BLUE); - wattrset(win, COLOR_PAIR(8)); + + x1 = 2 + rand() % (w - 4); + y1 = 2 + rand() % (h - 4); + x2 = 2 + rand() % (w - 4); + y2 = 2 + rand() % (h - 4); + x3 = 2 + rand() % (w - 4); + y3 = 2 + rand() % (h - 4); + + xd1 = 1; + yd1 = 1; + xd2 = 1; + yd2 = 0; + xd3 = 0; + yd3 = 1; + + nodelay(win, TRUE); + + while (wgetch(win) == ERR) { + x1 = bounce(x1, &xd1, w); + y1 = bounce(y1, &yd1, h); + x2 = bounce(x2, &xd2, w); + y2 = bounce(y2, &yd2, h); + x3 = bounce(x3, &xd3, w); + y3 = bounce(y3, &yd3, h); + + set_colors(win, 11, COLOR_RED, COLOR_BLUE); mvwaddch(win, y1, x1, 'O'); - init_pair(8,COLOR_BLUE,COLOR_RED); - wattrset(win, COLOR_PAIR(8)); - mvwaddch(win, y2, x2, '*'); - init_pair(8,COLOR_YELLOW,COLOR_WHITE); - wattrset(win, COLOR_PAIR(8)); - mvwaddch(win, y3, x3, '@'); - wmove(win, 0, 0); - wrefresh(win); + + set_colors(win, 12, COLOR_BLUE, COLOR_RED); + mvwaddch(win, y2, x2, '*'); + + set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE); + mvwaddch(win, y3, x3, '@'); + + wmove(win, 0, 0); + wrefresh(win); delay_output(100); } return 0; } /* - * Wait for user + * Main driver */ -static int WaitForUser(WINDOW *win) +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { - time_t t; - chtype key; - - nodelay(win,TRUE); - t = time((time_t *)0); - while(1) - { - if ((int)(key = wgetch(win)) != ERR) - { - if (key == 'q' || key == 'Q') - return 1; - else - return 0; - } - if (time((time_t *)0) - t > 5) - return 0; - } -} + WINDOW *win; + int w, x, y, i, j, k; + char buffer[200]; + const char *message; + int width, height; + chtype save[80]; + chtype c; -/* - * Trap interrupt - */ -static RETSIGTYPE trap(int sig GCC_UNUSED) -{ + setlocale(LC_ALL, ""); + + initscr(); + if (has_colors()) + start_color(); + cbreak(); + curs_set(0); + signal(SIGINT, trap); + width = 48; + height = 14; /* Create a drawing window */ + win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); + if (win == NULL) { + endwin(); + ExitProgram(EXIT_FAILURE); + } + + while (1) { + set_colors(win, 1, COLOR_WHITE, COLOR_BLUE); + werase(win); + + set_colors(win, 2, COLOR_RED, COLOR_RED); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + /* Do ramdom output of a character */ + use_colors(win, 1, A_NORMAL); + c = 'a'; + for (i = 0; i < 5000; ++i) { + x = rand() % (width - 2) + 1; + y = rand() % (height - 2) + 1; + mvwaddch(win, y, x, c); + wrefresh(win); + nodelay(win, TRUE); + if (wgetch(win) != ERR) + break; + if (i == 2000) { + c = 'b'; + set_colors(win, 3, COLOR_CYAN, COLOR_YELLOW); + } + } + + SubWinTest(win); + /* Erase and draw green window */ + set_colors(win, 4, COLOR_YELLOW, COLOR_GREEN); + wbkgd(win, use_colors(win, 4, A_BOLD)); + werase(win); + wrefresh(win); + /* Draw RED bounding box */ + use_colors(win, 2, A_NORMAL); + box(win, ' ', ' '); + wrefresh(win); + /* Display Australia map */ + use_colors(win, 4, A_BOLD); + i = 0; + while (*AusMap[i]) { + mvwaddstr(win, i + 1, 8, AusMap[i]); + wrefresh(win); + delay_output(50); + ++i; + } + + set_colors(win, 5, COLOR_BLUE, COLOR_WHITE); + use_colors(win, 5, A_BLINK); + mvwaddstr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); + wrefresh(win); + + /* Draw running messages */ + set_colors(win, 6, COLOR_YELLOW, COLOR_WHITE); + message = messages[j = 0]; + i = 1; + w = width - 2; + strcpy(buffer, message); + while (j < NMESSAGES) { + while ((int) strlen(buffer) < w) { + strcat(buffer, " ... "); + strcat(buffer, messages[++j % NMESSAGES]); + } + + if (i < w) + mvwaddnstr(win, height / 2, w - i, buffer, i); + else + mvwaddnstr(win, height / 2, 1, buffer, w); + + wrefresh(win); + nodelay(win, TRUE); + if (wgetch(win) != ERR) { + flushinp(); + break; + } + if (i++ >= w) { + for (k = 0; (buffer[k] = buffer[k + 1]) != '\0'; k++) ; + } + delay_output(100); + } + + j = 0; + /* Draw running As across in RED */ + set_colors(win, 7, COLOR_RED, COLOR_GREEN); + for (i = 2; i < width - 4; ++i) { + k = mvwinch(win, 4, i); + if (k == ERR) + break; + save[j++] = c = k; + c &= A_CHARTEXT; + mvwaddch(win, 4, i, c); + } + wrefresh(win); + + /* Put a message up wait for a key */ + i = height - 2; + use_colors(win, 5, A_NORMAL); + mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); + wrefresh(win); + + if (WaitForUser(win) == 1) + break; + + j = 0; /* Restore the old line */ + for (i = 2; i < width - 4; ++i) + mvwaddch(win, 4, i, save[j++]); + wrefresh(win); + + BouncingBalls(win); + /* Put a message up wait for a key */ + i = height - 2; + use_colors(win, 5, A_NORMAL); + mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit "); + wrefresh(win); + if (WaitForUser(win) == 1) + break; + } endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_SUCCESS); } - -/* End of DEMO.C */ diff --git a/test/railroad.c b/test/railroad.c index 90eac981..fd773c8c 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000 Free Software Foundation, Inc. * + * Copyright (c) 2000-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,15 +29,13 @@ /* * Author: Thomas E. Dickey 2000 * - * $Id: railroad.c,v 1.4 2000/10/15 00:21:33 tom Exp $ + * $Id: railroad.c,v 1.10 2002/04/06 20:45:22 tom Exp $ * * A simple demo of the termcap interface. */ #include -#include #include -#include static char *wipeit; static char *moveit; @@ -119,36 +117,38 @@ ShowSign(char *string) while (*string != 0) { ch = *string; - if (moveit != 0) { - for (first = length - 2; first >= (string - base); first--) { - if (first < length - 1) { - tputs(tgoto(moveit, first + 1, height - 1), 1, outc); - PutChar(' '); + if (ch != ' ') { + if (moveit != 0) { + for (first = length - 2; first >= (string - base); first--) { + if (first < length - 1) { + tputs(tgoto(moveit, first + 1, height - 1), 1, outc); + PutChar(' '); + } + tputs(tgoto(moveit, first, height - 1), 1, outc); + PutChar(ch); } - tputs(tgoto(moveit, first, height - 1), 1, outc); - PutChar(ch); - } - } else { - last = ch; - if (isalpha(ch)) { - first = isupper(ch) ? 'A' : 'a'; - } else if (isdigit(ch)) { - first = '0'; } else { - first = ch; - } - if (first < last) { - Underline(1); - while (first < last) { - PutChar(first); - Backup(); - first++; + last = ch; + if (isalpha(ch)) { + first = isupper(ch) ? 'A' : 'a'; + } else if (isdigit(ch)) { + first = '0'; + } else { + first = ch; + } + if (first < last) { + Underline(1); + while (first < last) { + PutChar(first); + Backup(); + first++; + } + Underline(0); } - Underline(0); } + if (moveit != 0) + Backup(); } - if (moveit != 0) - Backup(); StandOut(1); PutChar(ch); StandOut(0); @@ -173,7 +173,7 @@ onsig(int n GCC_UNUSED) { interrupted = TRUE; cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static void @@ -233,9 +233,10 @@ main(int argc, char *argv[]) if (argc > 1) { railroad(argv + 1); } else { + static char world[] = "Hello World"; static char *hello[] = - {"Hello World", 0}; + {world, 0}; railroad(hello); } - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } diff --git a/test/rain.c b/test/rain.c index a7771b09..19e7f900 100644 --- a/test/rain.c +++ b/test/rain.c @@ -1,22 +1,22 @@ /* - * $Id: rain.c,v 1.15 2000/09/02 18:41:22 tom Exp $ + * $Id: rain.c,v 1.20 2002/06/29 23:32:18 tom Exp $ */ #include -#include /* for tparm() */ - -#include - /* rain 11/3/1980 EPS/CITHEP */ static float ranf(void); static void onsig(int sig); -static int next_j(int j) +static int +next_j(int j) { - if (j==0) j=4; else --j; + if (j == 0) + j = 4; + else + --j; if (has_colors()) { - int z = (int)(3*ranf()); + int z = (int) (3 * ranf()); chtype color = COLOR_PAIR(z); if (z) color |= A_BOLD; @@ -28,15 +28,18 @@ static int next_j(int j) int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { -int x, y, j; -static int xpos[5], ypos[5]; -float r; -float c; + int x, y, j; + static int xpos[5], ypos[5]; + float r; + float c; + + setlocale(LC_ALL, ""); - for (j=SIGHUP;j<=SIGTERM;j++) - if (signal(j,SIG_IGN)!=SIG_IGN) signal(j,onsig); + for (j = SIGHUP; j <= SIGTERM; j++) + if (signal(j, SIG_IGN) != SIG_IGN) + signal(j, onsig); initscr(); if (has_colors()) { @@ -44,7 +47,7 @@ float c; start_color(); #if HAVE_USE_DEFAULT_COLORS if (use_default_colors() == OK) - bg = -1; + bg = -1; #endif init_pair(1, COLOR_BLUE, bg); init_pair(2, COLOR_CYAN, bg); @@ -54,18 +57,18 @@ float c; curs_set(0); timeout(0); - r = (float)(LINES - 4); - c = (float)(COLS - 4); - for (j=5;--j>=0;) { - xpos[j]=(int)(c* ranf())+2; - ypos[j]=(int)(r* ranf())+2; + r = (float) (LINES - 4); + c = (float) (COLS - 4); + for (j = 5; --j >= 0;) { + xpos[j] = (int) (c * ranf()) + 2; + ypos[j] = (int) (r * ranf()) + 2; } - for (j=0;;) { - x=(int)(c*ranf())+2; - y=(int)(r*ranf())+2; + for (j = 0;;) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; - mvaddch(y,x, '.'); + mvaddch(y, x, '.'); mvaddch(ypos[j], xpos[j], 'o'); @@ -73,33 +76,33 @@ float c; mvaddch(ypos[j], xpos[j], 'O'); j = next_j(j); - mvaddch( ypos[j]-1, xpos[j], '-'); - mvaddstr(ypos[j], xpos[j]-1, "|.|"); - mvaddch( ypos[j]+1, xpos[j], '-'); + mvaddch(ypos[j] - 1, xpos[j], '-'); + mvaddstr(ypos[j], xpos[j] - 1, "|.|"); + mvaddch(ypos[j] + 1, xpos[j], '-'); j = next_j(j); - mvaddch( ypos[j]-2, xpos[j], '-'); - mvaddstr(ypos[j]-1, xpos[j]-1, "/ \\"); - mvaddstr(ypos[j], xpos[j]-2, "| O |"); - mvaddstr(ypos[j]+1, xpos[j]-1, "\\ /"); - mvaddch( ypos[j]+2, xpos[j], '-'); + mvaddch(ypos[j] - 2, xpos[j], '-'); + mvaddstr(ypos[j] - 1, xpos[j] - 1, "/ \\"); + mvaddstr(ypos[j], xpos[j] - 2, "| O |"); + mvaddstr(ypos[j] + 1, xpos[j] - 1, "\\ /"); + mvaddch(ypos[j] + 2, xpos[j], '-'); j = next_j(j); - mvaddch( ypos[j]-2, xpos[j], ' '); - mvaddstr(ypos[j]-1, xpos[j]-1, " "); - mvaddstr(ypos[j], xpos[j]-2, " "); - mvaddstr(ypos[j]+1, xpos[j]-1, " "); - mvaddch( ypos[j]+2, xpos[j], ' '); - - xpos[j] = x; ypos[j] = y; - - switch(getch()) - { - case('q'): - case('Q'): + mvaddch(ypos[j] - 2, xpos[j], ' '); + mvaddstr(ypos[j] - 1, xpos[j] - 1, " "); + mvaddstr(ypos[j], xpos[j] - 2, " "); + mvaddstr(ypos[j] + 1, xpos[j] - 1, " "); + mvaddch(ypos[j] + 2, xpos[j], ' '); + + xpos[j] = x; + ypos[j] = y; + + switch (getch()) { + case ('q'): + case ('Q'): curs_set(1); endwin(); - return(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); case 's': nodelay(stdscr, FALSE); break; @@ -107,9 +110,9 @@ float c; nodelay(stdscr, TRUE); break; #ifdef KEY_RESIZE - case(KEY_RESIZE): - r = (float)(LINES - 4); - c = (float)(COLS - 4); + case (KEY_RESIZE): + r = (float) (LINES - 4); + c = (float) (COLS - 4); break; #endif } @@ -122,7 +125,7 @@ onsig(int n GCC_UNUSED) { curs_set(1); endwin(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float diff --git a/test/tclock.c b/test/tclock.c index 9f846554..d1cc0fa1 100644 --- a/test/tclock.c +++ b/test/tclock.c @@ -1,7 +1,19 @@ +/* $Id: tclock.c,v 1.22 2002/06/29 23:34:13 tom Exp $ */ + #include "test.priv.h" #include -#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif /* tclock - analog/digital clock for curses. @@ -103,12 +115,10 @@ dline(int pair, int from_x, int from_y, int x2, int y2, char ch) } int -main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { int i, cx, cy; - double mradius, hradius, mangle, hangle; + double cr, mradius, hradius, mangle, hangle; double sangle, sradius, hours; int hdx, hdy; int mdx, mdy; @@ -119,6 +129,12 @@ main( struct tm *t; char szChar[10]; int my_bg = COLOR_BLACK; +#if HAVE_GETTIMEOFDAY + struct timeval current; + double fraction = 0.0; +#endif + + setlocale(LC_ALL, ""); initscr(); noecho(); @@ -142,14 +158,16 @@ main( #endif cx = (COLS - 1) / 2; /* 39 */ cy = LINES / 2; /* 12 */ - ch = (cx > cy) ? cy : cx; /* usually cy */ - mradius = (3 * cy) / 4; /* 9 */ - hradius = cy / 2; /* 6 */ - sradius = (2 * cy) / 3; /* 8 */ + if (cx / ASPECT < cy) + cr = cx / ASPECT; + else + cr = cy; + sradius = (5 * cr) / 6; /* 10 */ + mradius = (3 * cr) / 4; /* 9 */ + hradius = cr / 2; /* 6 */ for (i = 0; i < 12; i++) { sangle = (i + 1) * (2.0 * PI) / 12.0; - sradius = (5 * cy) / 6; /* 10 */ sdx = A2X(sangle, sradius); sdy = A2Y(sangle, sradius); sprintf(szChar, "%d", i + 1); @@ -159,9 +177,9 @@ main( mvaddstr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994"); - sradius = 8; + sradius = (4 * sradius) / 5; for (;;) { - napms(1000); + napms(100); tim = time(0); t = localtime(&tim); @@ -170,7 +188,7 @@ main( if (hours > 12.0) hours -= 12.0; - mangle = ((t->tm_min) * (2 * PI) / 60.0); + mangle = ((t->tm_min + (t->tm_sec / 60.0)) * (2 * PI) / 60.0); mdx = A2X(mangle, mradius); mdy = A2Y(mangle, mradius); @@ -178,7 +196,11 @@ main( hdx = A2X(hangle, hradius); hdy = A2Y(hangle, hradius); - sangle = ((t->tm_sec) * (2.0 * PI) / 60.0); +#if HAVE_GETTIMEOFDAY + gettimeofday(¤t, 0); + fraction = (current.tv_usec / 1.0e6); +#endif + sangle = ((t->tm_sec + fraction) * (2.0 * PI) / 60.0); sdx = A2X(sangle, sradius); sdy = A2Y(sangle, sradius); @@ -191,7 +213,7 @@ main( if (has_colors()) attrset(COLOR_PAIR(1)); - plot(cx + sdx, cy - sdy, 'O'); + dline(1, cx, cy, cx + sdx, cy - sdy, 'O'); if (has_colors()) attrset(COLOR_PAIR(0)); @@ -199,7 +221,7 @@ main( mvaddstr(LINES - 2, 0, ctime(&tim)); refresh(); if ((t->tm_sec % 5) == 0 - && t->tm_sec != lastbeep) { + && t->tm_sec != lastbeep) { lastbeep = t->tm_sec; beep(); } @@ -207,20 +229,22 @@ main( if ((ch = getch()) != ERR) { #ifdef KEY_RESIZE if (ch == KEY_RESIZE) { + flash(); erase(); + wrefresh(curscr); goto restart; } #endif break; } - plot(cx + sdx, cy - sdy, ' '); dline(0, cx, cy, cx + hdx, cy - hdy, ' '); dline(0, cx, cy, cx + mdx, cy - mdy, ' '); + dline(0, cx, cy, cx + sdx, cy - sdy, ' '); } curs_set(1); endwin(); - return 0; + ExitProgram(EXIT_SUCCESS); } diff --git a/test/test.priv.h b/test/test.priv.h index 58bbd162..18c1eb5c 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996 * ****************************************************************************/ -/* $Id: test.priv.h,v 1.19 2000/09/02 19:31:58 tom Exp $ */ +/* $Id: test.priv.h,v 1.35 2002/06/29 23:36:12 tom Exp $ */ #if HAVE_CONFIG_H #include @@ -40,14 +40,50 @@ #define HAVE_WRESIZE 0 #endif -#ifndef HAVE_NC_ALLOC_H -#define HAVE_NC_ALLOC_H 0 +#ifndef HAVE_CURSES_VERSION +#define HAVE_CURSES_VERSION 0 +#endif + +#ifndef HAVE_FORM_H +#define HAVE_FORM_H 0 +#endif + +#ifndef HAVE_LIBFORM +#define HAVE_LIBFORM 0 +#endif + +#ifndef HAVE_LIBMENU +#define HAVE_LIBMENU 0 +#endif + +#ifndef HAVE_LIBPANEL +#define HAVE_LIBPANEL 0 #endif #ifndef HAVE_LOCALE_H #define HAVE_LOCALE_H 0 #endif +#ifndef HAVE_MENU_H +#define HAVE_MENU_H 0 +#endif + +#ifndef HAVE_NAPMS +#define HAVE_NAPMS 1 +#endif + +#ifndef HAVE_NC_ALLOC_H +#define HAVE_NC_ALLOC_H 0 +#endif + +#ifndef HAVE_PANEL_H +#define HAVE_PANEL_H 0 +#endif + +#ifndef HAVE_WRESIZE +#define HAVE_WRESIZE 0 +#endif + #ifndef NCURSES_NOMACROS #define NCURSES_NOMACROS 0 #endif @@ -64,7 +100,10 @@ #include #endif +#include /* include before curses.h to work around glibc bug */ + #include +#include #if NCURSES_NOMACROS #include @@ -80,6 +119,12 @@ extern char *optarg; extern int optind; #endif /* HAVE_GETOPT_H */ +#if HAVE_LOCALE_H +#include +#else +#define setlocale(name,string) /* nothing */ +#endif + #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ #endif @@ -87,17 +132,74 @@ extern int optind; #define GCC_UNUSED /* nothing */ #endif +#ifndef HAVE_GETNSTR +#define getnstr(s,n) getstr(s) +#endif + +#ifndef USE_WIDEC_SUPPORT +#if defined(_XOPEN_SOURCE_EXTENDED) && defined(WACS_ULCORNER) +#define USE_WIDEC_SUPPORT 1 +#else +#define USE_WIDEC_SUPPORT 0 +#endif +#endif + +#ifndef HAVE_TYPE_ATTR_T +#if !USE_WIDEC_SUPPORT +#define attr_t long +#endif +#endif + +#ifndef NCURSES_CH_T +#if !USE_WIDEC_SUPPORT +#define NCURSES_CH_T chtype +#else +#define NCURSES_CH_T cchar_t +#endif +#endif + +#ifndef CCHARW_MAX +#define CCHARW_MAX 5 +#endif + +#ifndef KEY_MIN +#define KEY_MIN 256 /* not defined in Solaris 8 */ +#endif + +#ifndef getcurx +#define getcurx(win) ((win)?(win)->_curx:ERR) +#define getcury(win) ((win)?(win)->_cury:ERR) +#endif + +#ifndef getbegx +#define getbegx(win) ((win)?(win)->_begx:ERR) +#define getbegy(win) ((win)?(win)->_begy:ERR) +#endif + +#ifndef getmaxx +#define getmaxx(win) ((win)?((win)->_maxx + 1):ERR) +#define getmaxy(win) ((win)?((win)->_maxy + 1):ERR) +#endif + +/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list + * (which is incompatible with legacy usage, doesn't solve any problems). + */ +#define tparm3(a,b,c) tparm(a,b,c,0,0,0,0,0,0,0) +#define tparm2(a,b) tparm(a,b,0,0,0,0,0,0,0,0) + +#define UChar(c) ((unsigned char)(c)) + #define SIZEOF(table) (sizeof(table)/sizeof(table[0])) #if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H #include #else -#define typeMalloc(type,n) (type *) malloc(n * sizeof(type)) -#define typeRealloc(type,n,p) (type *) realloc(p, n * sizeof(type)) +#define typeMalloc(type,n) (type *) malloc((n) * sizeof(type)) +#define typeRealloc(type,n,p) (type *) realloc(p, (n) * sizeof(type)) #endif #ifndef ExitProgram -#define ExitProgram(code) return code +#define ExitProgram(code) exit(code) #endif #ifndef EXIT_SUCCESS diff --git a/test/testaddch.c b/test/testaddch.c index 444da0a1..ddc6776f 100644 --- a/test/testaddch.c +++ b/test/testaddch.c @@ -2,59 +2,60 @@ * This is an example written by Alexander V. Lukyanov , * to demonstrate an inconsistency between ncurses and SVr4 curses. * - * $Id: testaddch.c,v 1.3 1997/10/18 21:35:15 tom Exp $ + * $Id: testaddch.c,v 1.5 2002/06/29 23:32:18 tom Exp $ */ #include -static void attr_addstr(const char *s, chtype a) +static void +attr_addstr(const char *s, chtype a) { - while(*s) - addch(((unsigned char)(*s++))|a); + while (*s) + addch(((unsigned char) (*s++)) | a); } int main( int argc GCC_UNUSED, - char *argv[] GCC_UNUSED) + char *argv[]GCC_UNUSED) { - unsigned i; - chtype back,set,attr; - - initscr(); - start_color(); - init_pair(1,COLOR_WHITE,COLOR_BLUE); - init_pair(2,COLOR_WHITE,COLOR_RED); - init_pair(3,COLOR_BLACK,COLOR_MAGENTA); - init_pair(4,COLOR_BLACK,COLOR_GREEN); - init_pair(5,COLOR_BLACK,COLOR_CYAN); - init_pair(6,COLOR_BLACK,COLOR_YELLOW); - init_pair(7,COLOR_BLACK,COLOR_WHITE); - - for(i=0; i<8; i++) - { - back = (i&1) ? A_BOLD|'B' : ' '; - set = (i&2) ? A_REVERSE : 0; - attr = (i&4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - attrset(set); - - attr_addstr("Test string with spaces -> <-\n",attr); - } - addch('\n'); - for(i=0; i<8; i++) - { - back = (i&1) ? A_BOLD|'B'|COLOR_PAIR(1) : ' '; - set = (i&2) ? A_REVERSE|COLOR_PAIR(2) : 0; - attr = (i&4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - attrset(set); - - attr_addstr("Test string with spaces -> <-\n",attr); - } - - getch(); - endwin(); - return EXIT_SUCCESS; + unsigned i; + chtype back, set, attr; + + setlocale(LC_ALL, ""); + + initscr(); + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_WHITE, COLOR_RED); + init_pair(3, COLOR_BLACK, COLOR_MAGENTA); + init_pair(4, COLOR_BLACK, COLOR_GREEN); + init_pair(5, COLOR_BLACK, COLOR_CYAN); + init_pair(6, COLOR_BLACK, COLOR_YELLOW); + init_pair(7, COLOR_BLACK, COLOR_WHITE); + + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' : ' '; + set = (i & 2) ? A_REVERSE : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + addch('\n'); + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' | COLOR_PAIR(1) : ' '; + set = (i & 2) ? A_REVERSE | COLOR_PAIR(2) : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + + getch(); + endwin(); + ExitProgram(EXIT_SUCCESS); } diff --git a/test/testcurs.c b/test/testcurs.c index 5fa054a9..fd189a94 100644 --- a/test/testcurs.c +++ b/test/testcurs.c @@ -7,7 +7,7 @@ * wrs(5/28/93) -- modified to be consistent (perform identically) with either * PDCurses or under Unix System V, R4 * - * $Id: testcurs.c,v 1.22 2000/06/17 23:23:34 tom Exp $ + * $Id: testcurs.c,v 1.31 2002/09/14 22:45:15 tom Exp $ */ #include @@ -36,7 +36,7 @@ typedef struct commands COMMAND; const COMMAND command[] = { - {"Intro Test", introTest}, + {"General Test", introTest}, {"Pad Test", padTest}, #if defined(PDCURSES) && !defined(XCURSES) {"Resize Test", resizeTest}, @@ -45,28 +45,45 @@ const COMMAND command[] = {"Input Test", inputTest}, {"Output Test", outputTest} }; -#define MAX_OPTIONS ((sizeof(command)/sizeof(command[0]))) +#define MAX_OPTIONS SIZEOF(command) + +#if !HAVE_STRDUP +#define strdup my_strdup +static char * +strdup(char *s) +{ + char *p = (char *) malloc(strlen(s) + 1); + if (p) + strcpy(p, s); + return (p); +} +#endif /* not HAVE_STRDUP */ int width, height; int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { WINDOW *win; - int key, old_option = (-1), new_option = 0; + int key; + int old_option = (-1); + int new_option = 0; bool quit = FALSE; + unsigned n; + + setlocale(LC_ALL, ""); #ifdef PDCDEBUG PDC_debug("testcurs started\n"); #endif if (!initTest(&win)) - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); erase(); display_menu(old_option, new_option); - while (1) { + for (;;) { #ifdef A_COLOR if (has_colors()) { init_pair(1, COLOR_WHITE, COLOR_BLUE); @@ -82,6 +99,17 @@ main( keypad(stdscr, TRUE); raw(); key = getch(); + if (key < KEY_MIN && key > 0 && isalpha(key)) { + if (islower(key)) + key = toupper(key); + for (n = 0; n < MAX_OPTIONS; ++n) { + if (key == command[n].text[0]) { + display_menu(old_option, new_option = n); + key = ' '; + break; + } + } + } switch (key) { case 10: case 13: @@ -106,6 +134,9 @@ main( quit = TRUE; break; default: + beep(); + break; + case ' ': break; } if (quit == TRUE) @@ -118,7 +149,7 @@ main( #ifdef XCURSES XCursesExit(); #endif - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); } static void @@ -186,7 +217,7 @@ introTest(WINDOW *win) wrefresh(win); cbreak(); mvwaddstr(win, 1, 1, - "You should have rectangle in the middle of the screen"); + "You should have rectangle in the middle of the screen"); mvwaddstr(win, 2, 1, "You should have heard a beep"); Continue(win); return; @@ -197,11 +228,11 @@ scrollTest(WINDOW *win) { int i; int half; - int OldX, OldY; + int OldY; NCURSES_CONST char *Message = "The window will now scroll slowly"; wclear(win); - getmaxyx(win, OldY, OldX); + OldY = getmaxy(win); half = OldY / 2; mvwprintw(win, OldY - 2, 1, Message); wrefresh(win); @@ -249,6 +280,8 @@ scrollTest(WINDOW *win) static void inputTest(WINDOW *win) { + int answered; + int repeat; int w, h, bx, by, sw, sh, i, c, num; char buffer[80]; WINDOW *subWin; @@ -317,7 +350,7 @@ inputTest(WINDOW *win) #if defined(PDCURSES) mouse_set(ALL_MOUSE_EVENTS); #endif - while (1) { + for (;;) { wmove(win, 3, 5); c = wgetch(win); wclrtobot(win); @@ -365,20 +398,38 @@ inputTest(WINDOW *win) mouse_set(0L); #endif refresh(); - wclear(win); - mvwaddstr(win, 3, 2, "The window should have moved"); - mvwaddstr(win, 4, 2, - "This text should have appeared without you pressing a key"); - mvwaddstr(win, 6, 2, "Enter a number then a string separated by space"); - mvwin(win, 2, 1); - wrefresh(win); - echo(); - noraw(); - num = 0; - *buffer = 0; - mvwscanw(win, 7, 6, "%d %s", &num, buffer); - mvwprintw(win, 8, 6, "String: %s Number: %d", buffer, num); - Continue(win); + + repeat = 0; + do { + static const char *fmt[] = { + "%d %10s", + "%d %[a-zA-Z]s", + "%d %[][a-zA-Z]s", + "%d %[^0-9]" + }; + const char *format = fmt[repeat % SIZEOF(fmt)]; + + wclear(win); + mvwaddstr(win, 3, 2, "The window should have moved"); + mvwaddstr(win, 4, 2, + "This text should have appeared without you pressing a key"); + mvwprintw(win, 6, 2, + "Scanning with format \"%s\"", format); + mvwin(win, 2 + 2 * (repeat % 4), 1 + 2 * (repeat % 4)); + erase(); + refresh(); + wrefresh(win); + echo(); + noraw(); + num = 0; + *buffer = 0; + answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer); + mvwprintw(win, 8, 6, + "String: %s Number: %d (%d values read)", + buffer, num, answered); + Continue(win); + ++repeat; + } while (answered > 0); } static void @@ -392,7 +443,7 @@ outputTest(WINDOW *win) nl(); wclear(win); mvwaddstr(win, 1, 1, - "You should now have a screen in the upper left corner, and this text should have wrapped"); + "You should now have a screen in the upper left corner, and this text should have wrapped"); mvwin(win, 2, 1); waddstr(win, "\nThis text should be down\n"); waddstr(win, "and broken into two here ^"); @@ -409,7 +460,7 @@ outputTest(WINDOW *win) if (LINES < 24 || COLS < 75) { mvwaddstr(win, 5, 1, - "Some tests have been skipped as they require a"); + "Some tests have been skipped as they require a"); mvwaddstr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS"); Continue(win); } else { @@ -429,7 +480,7 @@ outputTest(WINDOW *win) #endif wclear(win1); mvwaddstr(win1, 5, 1, - "This text should appear; using overlay option"); + "This text should appear; using overlay option"); copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE); #if defined(PDCURSES) && !defined(XCURSES) @@ -444,7 +495,7 @@ outputTest(WINDOW *win) wclear(win1); wattron(win1, A_BLINK); mvwaddstr(win1, 4, 1, - "This blinking text should appear in only the second window"); + "This blinking text should appear in only the second window"); wattroff(win1, A_BLINK); mvwin(win1, by, bx); overlay(win, win1); @@ -490,7 +541,7 @@ outputTest(WINDOW *win) wclear(win); wmove(win, 2, 2); wprintw(win, "This is a formatted string in a window: %d %s\n", 42, - "is it"); + "is it"); mvwaddstr(win, 10, 1, "Enter a string: "); wrefresh(win); noraw(); @@ -514,7 +565,7 @@ outputTest(WINDOW *win) wclear(win); curs_set(0); mvwaddstr(win, 1, 1, - "The cursor should have disappeared (invisible)"); + "The cursor should have disappeared (invisible)"); Continue(win); } @@ -608,7 +659,7 @@ padTest(WINDOW *dummy GCC_UNUSED) mvwaddstr(pad, 5, 2, "This is a new pad"); wattrset(pad, A_NORMAL); mvwaddstr(pad, 8, 0, - "The end of this line should be truncated here:except now"); + "The end of this line should be truncated here:except now"); mvwaddstr(pad, 11, 1, "This line should not appear.It will now"); wmove(pad, 10, 1); wclrtoeol(pad); @@ -652,6 +703,6 @@ display_menu(int old_option, int new_option) mvaddstr(5 + new_option, 25, command[new_option].text); attrset(A_NORMAL); mvaddstr(13, 3, - "Use Up and Down Arrows to select - Enter to run - Q to quit"); + "Use Up and Down Arrows to select - Enter to run - Q to quit"); refresh(); } diff --git a/test/testscanw.c b/test/testscanw.c index 8420ea0f..7bce567b 100644 --- a/test/testscanw.c +++ b/test/testscanw.c @@ -2,37 +2,40 @@ * Date: 1997/03/17 * From: bayern@morpheus.cis.yale.edu * - * $Id: testscanw.c,v 1.5 1997/09/20 14:16:20 tom Exp $ + * $Id: testscanw.c,v 1.9 2002/06/29 23:32:18 tom Exp $ */ #include #include -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - long badanswer = 1; - long *response = &badanswer; + long badanswer = 1; + long *response = &badanswer; - initscr(); - scrollok(stdscr, TRUE); - idlok(stdscr, TRUE); - echo(); + setlocale(LC_ALL, ""); + + initscr(); + scrollok(stdscr, TRUE); + idlok(stdscr, TRUE); + echo(); #if 0 - trace(TRACE_UPDATE|TRACE_CALLS); + trace(TRACE_UPDATE | TRACE_CALLS); #endif - while (argc > 1) { - if (isdigit(*argv[1])) - move(atoi(argv[1]), 0); - else if (!strcmp(argv[1], "-k")) - keypad(stdscr, TRUE); - argc--, argv++; - } + while (argc > 1) { + if (isdigit(UChar(*argv[1]))) + move(atoi(argv[1]), 0); + else if (!strcmp(argv[1], "-k")) + keypad(stdscr, TRUE); + argc--, argv++; + } - while (badanswer) { - printw("Enter a number (0 to quit):\n"); - printw("--> "); - scanw("%20ld", response); /* yes, it's a pointer */ - } - endwin(); - return EXIT_SUCCESS; + while (badanswer) { + printw("Enter a number (0 to quit):\n"); + printw("--> "); + scanw("%20ld", response); /* yes, it's a pointer */ + } + endwin(); + ExitProgram(EXIT_SUCCESS); } diff --git a/test/tracemunch b/test/tracemunch index d6761cd0..451d17f3 100755 --- a/test/tracemunch +++ b/test/tracemunch @@ -1,16 +1,44 @@ -#!/usr/bin/perl -# +#!/usr/bin/perl -w +# $Id: tracemunch,v 1.3 2002/09/22 16:31:18 tom Exp $ +############################################################################## +# Copyright (c) 1998,2002 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "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. # +############################################################################## # tracemunch -- compactify ncurses trace logs # # The error logs produced by ncurses with tracing enabled can be very tedious # to wade through. This script helps by compacting runs of log lines that # can be conveniently expressed as higher-level operations. # -# ($Id: tracemunch,v 1.2 1995/10/06 15:02:37 esr Exp $) $putattr="PutAttrChar\\('(.)' = 0x.., {A_NORMAL}\\) at \\(([0-9]+), ([0-9]+)\\)"; $waddnstr="waddnstr\\(0x([0-9a-f]+),\"([^\"]+)\",[0-9]+\\) called {A_NORMAL}"; +$win_nums=0; + sub transaddr { $arg = $_[0]; @@ -18,6 +46,9 @@ sub transaddr $arg =~ s/$curscr/curscr/ if ($curscr); $arg =~ s/$newscr/newscr/ if ($newscr); $arg =~ s/$stdscr/stdscr/ if ($stdscr); + for $n (0..$#win_addr) { + $arg =~ s/$win_addr[$n]/window$n/ if $win_addr[$n]; + } return $arg; } @@ -26,15 +57,37 @@ while () { CLASSIFY: { # Transform window pointer addresses so it's easier to compare logs - $awaiting = "curscr" if ($_ =~ /creating curscr/); - $awaiting = "newscr" if ($_ =~ /creating newscr/); - $awaiting = "stdscr" if ($_ =~ /creating stdscr/); - if ($awaiting && $_ =~ /newwin: returned window is 0x([0-9a-f]+)/) - { - $curscr = "0x$1" if ($awaiting eq "curscr"); - $newscr = "0x$1" if ($awaiting eq "newscr"); - $stdscr = "0x$1" if ($awaiting eq "stdscr"); + $awaiting = "curscr" if ($_ =~ /creating curscr/); + $awaiting = "newscr" if ($_ =~ /creating newscr/); + $awaiting = "stdscr" if ($_ =~ /creating stdscr/); + if ($_ =~ /^create :window 0x([0-9a-f]+)/) { + $addr = "0x$1"; + if ($awaiting eq "curscr") { + $curscr = $addr; + } elsif ($awaiting eq "newscr") { + $newscr = $addr; + } elsif ($awaiting eq "stdscr") { + $stdscr = $addr; + } else { + $win_addr[$win_nums] = $addr; + $win_nums = $win_nums + 1; + } $awaiting = ""; + } elsif ($_ =~ /^\.\.\.deleted win=0x([0-9a-f]+)/) { + $addr = "0x$1"; + if ($addr eq $curscr) { + $curscr = ""; + } elsif ($addr eq $newscr) { + $newscr = ""; + } elsif ($addr eq $stdscr) { + $stdscr = ""; + } else { + for $n (0..$#win_addr) { + if ($win_addr[$n] eq $addr) { + $win_addr[$n] = ""; + } + } + } } # Compactify runs of PutAttrChar calls (TR_CHARPUT) diff --git a/test/view.c b/test/view.c index 4c1344cb..a6303c1d 100644 --- a/test/view.c +++ b/test/view.c @@ -23,14 +23,13 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.31 2000/09/02 18:14:52 tom Exp $ + * $Id: view.c,v 1.53 2002/06/29 23:28:27 tom Exp $ */ -#include - -#include #include -#include +#include + +#include #if HAVE_TERMIOS_H # include @@ -44,6 +43,8 @@ # endif #endif +#define my_pair 1 + /* This is needed to compile 'struct winsize' */ #if NEED_PTEM_H #include @@ -51,7 +52,7 @@ #endif static RETSIGTYPE finish(int sig) GCC_NORETURN; -static void show_all(void); +static void show_all(const char *tag); #if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZETERM #define CAN_RESIZE 1 @@ -64,13 +65,13 @@ static RETSIGTYPE adjust(int sig); static int interrupted; #endif -static int waiting; -static int shift; -static int utf8_mode = FALSE; +static bool waiting = FALSE; +static int shift = 0; +static bool try_color = FALSE; static char *fname; -static chtype **lines; -static chtype **lptr; +static NCURSES_CH_T **my_lines; +static NCURSES_CH_T **lptr; static void usage(void) @@ -80,28 +81,37 @@ usage(void) "Usage: view [options] file" ,"" ,"Options:" + ," -c use color if terminal supports it" + ," -i ignore INT, QUIT, TERM signals" ," -n NUM specify maximum number of lines (default 1000)" #if defined(KEY_RESIZE) - ," -r use experimental KEY_RESIZE rather than our own handler" + ," -r use old-style sigwinch handler rather than KEY_RESIZE" #endif #ifdef TRACE ," -t trace screen updates" ," -T NUM specify trace mask" #endif - ," -u translate UTF-8 data" }; size_t n; for (n = 0; n < SIZEOF(msg); n++) fprintf(stderr, "%s\n", msg[n]); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static int -ch_len(chtype * src) +ch_len(NCURSES_CH_T * src) { int result = 0; +#if USE_WIDEC_SUPPORT +#endif + +#if USE_WIDEC_SUPPORT + while (getcchar(src++, NULL, NULL, NULL, NULL) > 0) + result++; +#else while (*src++) result++; +#endif return result; } @@ -109,78 +119,56 @@ ch_len(chtype * src) * Allocate a string into an array of chtype's. If UTF-8 mode is * active, translate the string accordingly. */ -static chtype * +static NCURSES_CH_T * ch_dup(char *src) { unsigned len = strlen(src); - chtype *dst = typeMalloc(chtype, len + 1); + NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1); unsigned j, k; - unsigned utf_count = 0; - unsigned utf_char = 0; - -#define UCS_REPL 0xfffd +#if USE_WIDEC_SUPPORT + wchar_t wstr[CCHARW_MAX + 1]; + wchar_t wch; + int l = 0; + mbstate_t state; + size_t rc; + int width; +#endif +#if USE_WIDEC_SUPPORT + memset(&state, 0, sizeof(state)); +#endif for (j = k = 0; j < len; j++) { - if (utf8_mode) { - unsigned c = src[j] & 0xff; - /* Combine UTF-8 into Unicode */ - if (c < 0x80) { - /* We received an ASCII character */ - if (utf_count > 0) - dst[k++] = UCS_REPL; /* prev. sequence incomplete */ - dst[k++] = c; - utf_count = 0; - } else if (c < 0xc0) { - /* We received a continuation byte */ - if (utf_count < 1) { - dst[k++] = UCS_REPL; /* ... unexpectedly */ - } else { - if (!utf_char && !((c & 0x7f) >> (7 - utf_count))) { - utf_char = UCS_REPL; - } - /* characters outside UCS-2 become UCS_REPL */ - if (utf_char > 0x03ff) { - /* value would be >0xffff */ - utf_char = UCS_REPL; - } else { - utf_char <<= 6; - utf_char |= (c & 0x3f); - } - utf_count--; - if (utf_count == 0) - dst[k++] = utf_char; - } - } else { - /* We received a sequence start byte */ - if (utf_count > 0) - dst[k++] = UCS_REPL; /* prev. sequence incomplete */ - if (c < 0xe0) { - utf_count = 1; - utf_char = (c & 0x1f); - if (!(c & 0x1e)) - utf_char = UCS_REPL; /* overlong sequence */ - } else if (c < 0xf0) { - utf_count = 2; - utf_char = (c & 0x0f); - } else if (c < 0xf8) { - utf_count = 3; - utf_char = (c & 0x07); - } else if (c < 0xfc) { - utf_count = 4; - utf_char = (c & 0x03); - } else if (c < 0xfe) { - utf_count = 5; - utf_char = (c & 0x01); - } else { - dst[k++] = UCS_REPL; - utf_count = 0; - } - } - } else { - dst[k++] = src[j]; +#if USE_WIDEC_SUPPORT + rc = mbrtowc(&wch, src + j, len - j, &state); + if (rc == (size_t) -1 || rc == (size_t) -2) + break; + j += rc - 1; + if ((width = wcwidth(wch)) < 0) + break; + if ((width > 0 && l > 0) || l == CCHARW_MAX) { + wstr[l] = L'\0'; + l = 0; + if (setcchar(dst + k, wstr, 0, 0, NULL) != OK) + break; + ++k; } + if (width == 0 && l == 0) + wstr[l++] = L' '; + wstr[l++] = wch; +#else + dst[k++] = src[j]; +#endif } +#if USE_WIDEC_SUPPORT + if (l > 0) { + wstr[l] = L'\0'; + if (setcchar(dst + k, wstr, 0, 0, NULL) == OK) + ++k; + } + setcchar(dst + k, L"", 0, 0, NULL); +#else dst[k] = 0; +#endif return dst; } @@ -191,22 +179,44 @@ main(int argc, char *argv[]) FILE *fp; char buf[BUFSIZ]; int i; - chtype **olptr; - int done = FALSE; + int my_delay = 0; + NCURSES_CH_T **olptr; int length = 0; + int value = 0; + bool done = FALSE; + bool got_number = FALSE; #if CAN_RESIZE - bool use_resize = TRUE; + bool nonposix_resize = FALSE; +#endif + const char *my_label = "Input"; + + setlocale(LC_ALL, ""); + +#ifndef NCURSES_VERSION + /* + * We know ncurses will catch SIGINT if we don't establish our own handler. + * Other versions of curses may/may not catch it. + */ + (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ #endif - while ((i = getopt(argc, argv, "n:rtT:u")) != EOF) { + while ((i = getopt(argc, argv, "cin:rtT:")) != EOF) { switch (i) { + case 'c': + try_color = TRUE; + break; + case 'i': + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGTERM, SIG_IGN); + break; case 'n': if ((MAXLINES = atoi(optarg)) < 1) usage(); break; #if CAN_RESIZE case 'r': - use_resize = FALSE; + nonposix_resize = TRUE; break; #endif #ifdef TRACE @@ -217,9 +227,6 @@ main(int argc, char *argv[]) trace(TRACE_CALLS); break; #endif - case 'u': - utf8_mode = TRUE; - break; default: usage(); } @@ -227,23 +234,21 @@ main(int argc, char *argv[]) if (optind + 1 != argc) usage(); - if ((lines = typeMalloc(chtype *, MAXLINES + 2)) == 0) + if ((my_lines = typeMalloc(NCURSES_CH_T *, MAXLINES + 2)) == 0) usage(); fname = argv[optind]; if ((fp = fopen(fname, "r")) == 0) { perror(fname); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } - - (void) signal(SIGINT, finish); /* arrange interrupts to terminate */ #if CAN_RESIZE - if (use_resize) + if (nonposix_resize) (void) signal(SIGWINCH, adjust); /* arrange interrupts to resize */ #endif /* slurp the file */ - for (lptr = &lines[0]; (lptr - lines) < MAXLINES; lptr++) { + for (lptr = &my_lines[0]; (lptr - my_lines) < MAXLINES; lptr++) { char temp[BUFSIZ], *s, *d; int col; @@ -259,40 +264,57 @@ main(int argc, char *argv[]) col = (col | 7) + 1; while ((d - temp) != col) *d++ = ' '; - } else if (isprint(*d) || utf8_mode) { + } else +#if USE_WIDEC_SUPPORT + col++, d++; +#else + if (isprint(UChar(*d))) { col++; d++; } else { - sprintf(d, "\\%03o", *s & 0xff); + sprintf(d, "\\%03o", UChar(*s)); d += strlen(d); col = (d - temp); } +#endif } *lptr = ch_dup(temp); } (void) fclose(fp); - length = lptr - lines; + length = lptr - my_lines; (void) initscr(); /* initialize the curses library */ keypad(stdscr, TRUE); /* enable keyboard mapping */ (void) nonl(); /* tell curses not to do NL->CR/NL on output */ (void) cbreak(); /* take input chars one at a time, no wait for \n */ (void) noecho(); /* don't echo input */ + nodelay(stdscr, TRUE); idlok(stdscr, TRUE); /* allow use of insert/delete line */ - lptr = lines; + if (try_color) { + if (has_colors()) { + start_color(); + init_pair(my_pair, COLOR_WHITE, COLOR_BLUE); + bkgd(COLOR_PAIR(my_pair)); + } else { + try_color = FALSE; + } + } + + lptr = my_lines; while (!done) { int n, c; - bool got_number; - show_all(); + if (!got_number) + show_all(my_label); - got_number = FALSE; n = 0; for (;;) { #if CAN_RESIZE - if (interrupted) + if (interrupted) { adjust(0); + my_label = "interrupt"; + } #endif waiting = TRUE; c = getch(); @@ -303,20 +325,25 @@ main(int argc, char *argv[]) clrtoeol(); } addch(c); - n = 10 * n + (c - '0'); + value = 10 * value + (c - '0'); got_number = TRUE; } else break; } - if (!got_number && n == 0) + if (got_number && value) { + n = value; + } else { n = 1; + } + if (c != ERR) + my_label = keyname(c); switch (c) { case KEY_DOWN: case 'n': olptr = lptr; for (i = 0; i < n; i++) - if ((lptr - lines) < (length - LINES + 1)) + if ((lptr - my_lines) < (length - LINES + 1)) lptr++; else break; @@ -327,7 +354,7 @@ main(int argc, char *argv[]) case 'p': olptr = lptr; for (i = 0; i < n; i++) - if (lptr > lines) + if (lptr > my_lines) lptr--; else break; @@ -336,28 +363,29 @@ main(int argc, char *argv[]) case 'h': case KEY_HOME: - lptr = lines; + lptr = my_lines; break; case 'e': case KEY_END: if (length > LINES) - lptr = lines + length - LINES + 1; + lptr = my_lines + length - LINES + 1; else - lptr = lines; + lptr = my_lines; break; case 'r': case KEY_RIGHT: - shift++; + shift += n; break; case 'l': case KEY_LEFT: - if (shift) - shift--; - else + shift -= n; + if (shift < 0) { + shift = 0; beep(); + } break; case 'q': @@ -368,12 +396,29 @@ main(int argc, char *argv[]) case KEY_RESIZE: /* ignore this; ncurses will repaint */ break; #endif -#if CAN_RESIZE + case 's': + if (got_number) { + halfdelay(my_delay = n); + } else { + nodelay(stdscr, FALSE); + my_delay = -1; + } + break; + case ' ': + nodelay(stdscr, TRUE); + my_delay = 0; + break; case ERR: + if (!my_delay) + napms(50); break; -#endif default: beep(); + break; + } + if (c >= KEY_MIN || (c > 0 && !isdigit(c))) { + got_number = FALSE; + value = 0; } } @@ -384,14 +429,20 @@ static RETSIGTYPE finish(int sig) { endwin(); - exit(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS); + ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS); } #if CAN_RESIZE /* * This uses functions that are "unsafe", but it seems to work on SunOS and - * Linux. The 'wrefresh(curscr)' is needed to force the refresh to start from - * the top of the screen -- some xterms mangle the bitmap while resizing. + * Linux. Usually: the "unsafe" refers to the functions that POSIX lists + * which may be called from a signal handler. Those do not include buffered + * I/O, which is used for instance in wrefresh(). To be really portable, you + * should use the KEY_RESIZE return (which relies on ncurses' sigwinch + * handler). + * + * The 'wrefresh(curscr)' is needed to force the refresh to start from the top + * of the screen -- some xterms mangle the bitmap while resizing. */ static RETSIGTYPE adjust(int sig) @@ -400,9 +451,9 @@ adjust(int sig) struct winsize size; if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { - resizeterm(size.ws_row, size.ws_col); + resize_term(size.ws_row, size.ws_col); wrefresh(curscr); /* Linux needs this */ - show_all(); + show_all(sig ? "SIGWINCH" : "interrupt"); } interrupted = FALSE; } else { @@ -413,14 +464,15 @@ adjust(int sig) #endif /* CAN_RESIZE */ static void -show_all(void) +show_all(const char *tag) { int i; char temp[BUFSIZ]; - chtype *s; + NCURSES_CH_T *s; + time_t this_time; #if CAN_RESIZE - sprintf(temp, "(%3dx%3d) col %d ", LINES, COLS, shift); + sprintf(temp, "%s (%3dx%3d) col %d ", tag, LINES, COLS, shift); i = strlen(temp); sprintf(temp + i, "view %.*s", (int) (sizeof(temp) - 7 - i), fname); #else @@ -429,16 +481,29 @@ show_all(void) move(0, 0); printw("%.*s", COLS, temp); clrtoeol(); + this_time = time((time_t *) 0); + strcpy(temp, ctime(&this_time)); + if ((i = strlen(temp)) != 0) { + temp[--i] = 0; + if (move(0, COLS - i - 2) != ERR) + printw(" %s", temp); + } scrollok(stdscr, FALSE); /* prevent screen from moving */ for (i = 1; i < LINES; i++) { move(i, 0); - printw("%3ld:", (long) (lptr + i - lines)); + printw("%3ld:", (long) (lptr + i - my_lines)); clrtoeol(); if ((s = lptr[i - 1]) != 0) { int len = ch_len(s); if (len > shift) +#if USE_WIDEC_SUPPORT + add_wchstr(s + shift); +#else addchstr(s + shift); +#endif + if (try_color) + wchgat(stdscr, -1, A_NORMAL, my_pair, NULL); } } setscrreg(1, LINES - 1); diff --git a/test/worm.c b/test/worm.c index 142982ae..651ccc15 100644 --- a/test/worm.c +++ b/test/worm.c @@ -34,18 +34,15 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.31 2000/09/02 18:41:01 tom Exp $ + $Id: worm.c,v 1.37 2002/06/29 23:32:18 tom Exp $ */ #include -#include - static chtype flavor[] = { 'O', '*', '#', '$', '%', '0', '@', }; -#define MAXWORMS (sizeof(flavor)/sizeof(chtype)) static const short xinc[] = { 1, 1, 1, 0, -1, -1, -1, 0 @@ -166,7 +163,7 @@ static RETSIGTYPE onsig(int sig GCC_UNUSED) { cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float @@ -188,6 +185,8 @@ main(int argc, char *argv[]) short *ip; int last, bottom; + setlocale(LC_ALL, ""); + for (x = 1; x < argc; x++) { char *p; p = argv[x]; @@ -202,7 +201,7 @@ main(int argc, char *argv[]) goto usage; if ((length = atoi(argv[x])) < 2 || length > 1024) { fprintf(stderr, "%s: Invalid length\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 'n': @@ -210,7 +209,7 @@ main(int argc, char *argv[]) goto usage; if ((number = atoi(argv[x])) < 1 || number > 40) { fprintf(stderr, "%s: Invalid number of worms\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } break; case 't': @@ -231,8 +230,8 @@ main(int argc, char *argv[]) default: usage: fprintf(stderr, - "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv); - return EXIT_FAILURE; + "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv); + ExitProgram(EXIT_FAILURE); } } @@ -287,14 +286,14 @@ main(int argc, char *argv[]) w->orientation = w->head = 0; if (!(ip = typeMalloc(short, (length + 1)))) { fprintf(stderr, "%s: out of memory\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } w->xpos = ip; for (x = length; --x >= 0;) *ip++ = -1; if (!(ip = typeMalloc(short, (length + 1)))) { fprintf(stderr, "%s: out of memory\n", *argv); - return EXIT_FAILURE; + ExitProgram(EXIT_FAILURE); } w->ypos = ip; for (y = length; --y >= 0;) @@ -366,7 +365,7 @@ main(int argc, char *argv[]) */ if (ch == 'q') { cleanup(); - return (EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); } else if (ch == 's') { nodelay(stdscr, FALSE); } else if (ch == ' ') { @@ -378,7 +377,7 @@ main(int argc, char *argv[]) for (n = 0, w = &worm[0]; n < number; n++, w++) { if ((x = w->xpos[h = w->head]) < 0) { move(y = w->ypos[h] = bottom, x = w->xpos[h] = 0); - addch(flavor[n % MAXWORMS]); + addch(flavor[n % SIZEOF(flavor)]); ref[y][x]++; } else { y = w->ypos[h]; @@ -401,14 +400,14 @@ main(int argc, char *argv[]) } } op = &(x == 0 ? (y == 0 ? upleft : (y == bottom ? lowleft : - left)) : - (x == last ? (y == 0 ? upright : (y == bottom ? lowright : - right)) : + left)) : + (x == last ? (y == 0 ? upright : (y == bottom ? lowright : + right)) : (y == 0 ? upper : (y == bottom ? lower : normal))))[w->orientation]; switch (op->nopts) { case 0: cleanup(); - return EXIT_SUCCESS; + ExitProgram(EXIT_SUCCESS); case 1: w->orientation = op->opts[0]; break; @@ -419,7 +418,7 @@ main(int argc, char *argv[]) if (y < 0) y = 0; - addch(flavor[n % MAXWORMS]); + addch(flavor[n % SIZEOF(flavor)]); ref[w->ypos[h] = y][w->xpos[h] = x]++; } napms(10); diff --git a/test/xmas.c b/test/xmas.c index d99b8219..c9f338c0 100644 --- a/test/xmas.c +++ b/test/xmas.c @@ -92,12 +92,10 @@ /******************************************************************************/ /* - * $Id: xmas.c,v 1.15 2000/09/02 18:45:53 tom Exp $ + * $Id: xmas.c,v 1.19 2002/06/29 23:32:18 tom Exp $ */ #include -#include - #define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)" static int my_bg = COLOR_BLACK; @@ -149,11 +147,10 @@ static int strng5(void); static int reindeer(void); static int blinkit(void); -static RETSIGTYPE -done(int sig) GCC_NORETURN; +static RETSIGTYPE done(int sig) GCC_NORETURN; - static void - set_color(WINDOW *win, chtype color) +static void +set_color(WINDOW *win, chtype color) { if (has_colors()) { static bool *pairs; @@ -191,6 +188,8 @@ main(int argc GCC_UNUSED, char **argv GCC_UNUSED) { int loopy; + setlocale(LC_ALL, ""); + initscr(); noecho(); nonl(); @@ -1156,5 +1155,5 @@ done(int sig GCC_UNUSED) refresh(); endwin(); curs_set(1); - exit(EXIT_SUCCESS); + ExitProgram(EXIT_SUCCESS); }