Import ncurses 5.6-20061217 onto the vender branch
Approved by: delphij
This commit is contained in:
parent
555c9cae3c
commit
4a1a95108d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/ncurses/dist/; revision=166124
@ -1,486 +1,463 @@
|
||||
Announcing ncurses 5.6
|
||||
|
||||
Announcing ncurses 5.2
|
||||
|
||||
The ncurses (new curses) library is a free software emulation of
|
||||
curses in System V Release 4.0, and more. It uses terminfo format,
|
||||
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
|
||||
ncurses.
|
||||
In mid-June 1995, the maintainer of 4.4BSD curses declared that he
|
||||
considered 4.4BSD curses obsolete, and encouraged the keepers of Unix
|
||||
releases such as BSD/OS, FreeBSD and NetBSD to switch over to ncurses.
|
||||
|
||||
The ncurses code was developed under GNU/Linux. It 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
|
||||
distribution site [1]ftp://ftp.gnu.org/pub/gnu/ncurses.
|
||||
It is also available at [2]ftp://dickey.his.com/ncurses.
|
||||
The ncurses distribution is available via anonymous FTP at the GNU
|
||||
distribution site [1]ftp://ftp.gnu.org/gnu/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
|
||||
through 5.5; very few applications will require recompilation,
|
||||
depending on the platform. These are the highlights from the
|
||||
change-log since ncurses 5.5 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.
|
||||
* generate linkable stubs for some macros:
|
||||
getbegx, getbegy, getcurx, getcury, getmaxx, getmaxy, getparx,
|
||||
getpary, getpary,
|
||||
and (for libncursesw)
|
||||
wgetbkgrnd
|
||||
|
||||
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.
|
||||
* library
|
||||
+ support hashed databases for the terminal descriptions. This
|
||||
uses the Berkeley database, has been tested for several
|
||||
versions on different platforms.
|
||||
+ add use_legacy_coding() function to support lynx's
|
||||
font-switching feature.
|
||||
+ add extension nofilter(), to cancel a prior filter() call.
|
||||
+ add/install a package config script, e.g., ncurses5-config or
|
||||
ncursesw5-config, according to configuration options.
|
||||
+ provide ifdef for NCURSES_NOMACROS which suppresses most
|
||||
macro definitions from curses.h, i.e., where a macro is
|
||||
defined to override a function to improve performance.
|
||||
+ make ifdef's consistent in curses.h for the extended colors
|
||||
so the header file can be used for the normal curses library.
|
||||
The header file installed for extended colors is a variation
|
||||
of the wide-character configuration.
|
||||
+ improve tgetstr() by making the return value point into the
|
||||
user's buffer, if provided.
|
||||
+ add ifdef's allowing ncurses to be built with tparm() using
|
||||
either varargs (the existing status), or using a
|
||||
fixed-parameter list (to match X/Open).
|
||||
+ widen the test for xterm kmous a little to allow for other
|
||||
strings than "\E[M", e.g., for xterm-sco functionality in
|
||||
xterm.
|
||||
+ modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs.
|
||||
+ move prototypes for wide-character trace functions from
|
||||
curses.tail to curses.wide to avoid accidental reference to
|
||||
those if _XOPEN_SOURCE_EXTENDED is defined without ensuring
|
||||
that <wchar.h> is included.
|
||||
+ change the way shared libraries (other than libtool) are
|
||||
installed. Rather than copying the build-tree's libraries,
|
||||
link the shared objects into the install directory. This
|
||||
makes the --with-rpath option work except with $(DESTDIR).
|
||||
+ several improvements for rendering in hpterm. These are only
|
||||
available if the library is configured using
|
||||
--enable-xmc-glitch.
|
||||
+ Add NCURSES_NO_HARD_TABS and NCURSES_NO_MAGIC_COOKIE
|
||||
environment variables to allow runtime suppression of the
|
||||
related hard-tabs and xmc-glitch features.
|
||||
* programs:
|
||||
+ add new test programs: chgat.c, demo_altkeys.c, echochar.c,
|
||||
foldkeys.c, movewindow.c, redraw.c, (noting that existing
|
||||
test programs also were modified to test additional
|
||||
features).
|
||||
+ modify tack to test extended capability function-key strings.
|
||||
+ modify toe to access termcap data, e.g., via cgetent()
|
||||
functions, or as a text file if those are not available.
|
||||
+ improve infocmp/tic -f option formatting.
|
||||
+ add toe -a option, to show all databases. This uses new
|
||||
private interfaces in the ncurses library for iterating
|
||||
through the list of databases.
|
||||
+ modify MKfallback.sh to use tic -x when constructing fallback
|
||||
tables to allow extended capabilities to be retrieved from a
|
||||
fallback entry.
|
||||
* terminal database
|
||||
+ add terminfo entries for xfce terminal (xfce) and multi gnome
|
||||
terminal (mgt)
|
||||
+ add nsterm-16color entry
|
||||
+ updated mlterm terminfo entry
|
||||
+ add kon, kon2 and jfbterm terminfo entry
|
||||
+ remove invis capability from klone+sgr, mainly used by linux
|
||||
entry, since it does not really do this
|
||||
+ add ka2, kb1, kb3, kc2 to vt220-keypad as an extension
|
||||
+ add shifted up/down arrow codes to xterm-new as kind/kri
|
||||
strings
|
||||
+ add hpterm-color terminfo entry
|
||||
+ add 256color variants of terminfo entries for programs which
|
||||
are reported to implement this feature
|
||||
+ correct order of use-clauses in rxvt-basic entry which made
|
||||
codes for f1-f4 vt100-style rather than vt220-style.
|
||||
|
||||
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 <string.h> in several places,
|
||||
including the C++ binding. This is not noted by gcc unless we
|
||||
use the -fno-builtin option.
|
||||
* several fixes for tic:
|
||||
+ add a check for empty buffers returned by fgets() in
|
||||
comp_scan.c next_char() function, in case tic is run on a
|
||||
non-text file (fixes a core dump).
|
||||
+ modify tic to verify that its inputs are really files, in
|
||||
case someone tries to read a directory (or /dev/zero).
|
||||
+ correct an uninitialized parameter to open_tempfile() in
|
||||
tic.c which made "tic -I" give an ambiguous error message
|
||||
about tmpnam.
|
||||
+ correct logic in adjust_cancels(), which did not check both
|
||||
alternatives when reclassifying an extended name between
|
||||
boolean, number and string, causing an infinite loop in tic.
|
||||
* using new checks in tic for parameter counts in capability
|
||||
strings, found/fixed several errors both in the terminfo database
|
||||
and in the include/Caps file.
|
||||
+ modified several terminfo capability strings, including the
|
||||
definitions for setaf, setab, in include/Caps to indicate
|
||||
that the entries are parameterized. This information is used
|
||||
to tell which strings are translated when converting to
|
||||
termcap. This fixes a problem where the generated termcap
|
||||
would contain a spurious "%p1" for the terminfo "%p1%d".
|
||||
+ correct parameter counts in include/Caps for dclk as well as
|
||||
some printer-specific capabilities: csnm, defc, scs, scsd,
|
||||
smgtp, smglp.
|
||||
* various fixes for install scripts used to support configure
|
||||
--srcdir and --with-install-prefix.
|
||||
* correct several mismatches between manpage filename and ".TH"
|
||||
directives, renaming dft_fgbg.3x to default_colors.3x and
|
||||
menu_attribs.3x to menu_attributes.3x.
|
||||
* correct a typo in configure --with-bool option for the case where
|
||||
--without-cxx is used.
|
||||
* move assignment from environment variable ESCDELAY from initscr()
|
||||
down to newterm() so the environment variable affects timeouts for
|
||||
terminals opened with newterm() as well.
|
||||
* modify werase to clear multicolumn characters that extend into a
|
||||
derived window.
|
||||
* modify wchgat() to mark updated cells as changed so a refresh will
|
||||
repaint those cells.
|
||||
* correct logic in wadd_wch() and wecho_wch(), which did not guard
|
||||
against passing the multi-column attribute into a call on
|
||||
waddch(), e.g., using data returned by win_wch()
|
||||
* fix redrawing of windows other than stdscr using wredrawln() by
|
||||
touching the corresponding rows in curscr.
|
||||
* reduce memory leaks in repeated calls to tgetent() by remembering
|
||||
the last TERMINAL* value allocated to hold the corresponding data
|
||||
and freeing that if the tgetent() result buffer is the same as the
|
||||
previous call.
|
||||
* modify read_termtype() so the term_names data is always allocated
|
||||
as part of the str_table, a better fix for a memory leak.
|
||||
* fix wins_nwstr(), which did not handle single-column non-8bit
|
||||
codes.
|
||||
* modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits
|
||||
since those record the state of multicolumn characters.
|
||||
* improve SIGWINCH handling by postponing its effect during
|
||||
newterm(), etc., when allocating screens.
|
||||
* remove 970913 feature for copying subwindows as they are moved in
|
||||
mvwin().
|
||||
* add checks in waddchnstr() and wadd_wchnstr() to stop copying when
|
||||
a null character is found.
|
||||
* add some checks to ensure current position is within scrolling
|
||||
region before scrolling on a new line.
|
||||
* add a workaround to ACS mapping to allow applications such as
|
||||
test/blue.c to use the "PC ROM" characters by masking them with
|
||||
A_ALTCHARSET. This worked up til 5.5, but was lost in the revision
|
||||
of legacy coding.
|
||||
|
||||
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
|
||||
+ new options:
|
||||
|
||||
--with-hashed-db
|
||||
Use Berkeley hashed database for storing terminfo
|
||||
data rather than storing each compiled entry in a
|
||||
separate binary file within a directory tree.
|
||||
|
||||
--without-dlsym
|
||||
Do not use dlsym() to load GPM dynamically.
|
||||
|
||||
--with-valgrind
|
||||
Simplify building for testing with valgrind.
|
||||
|
||||
--enable-wgetch-events
|
||||
Compile with experimental wgetch-events code.
|
||||
|
||||
--enable-signed-char
|
||||
Store booleans in "signed char" rather than "char".
|
||||
|
||||
+ improved options:
|
||||
|
||||
--disable-largefile
|
||||
make the option work both ways.
|
||||
|
||||
--with-gpm
|
||||
The option now accepts a parameter, i.e., the name
|
||||
of the dynamic GPM library to load via dlopen()
|
||||
|
||||
--disable-symlinks
|
||||
The option now allows one to disable symlink() in
|
||||
tic even when link() does not work.
|
||||
|
||||
* other configure/build issues:
|
||||
+ remove special case for Darwin in CF_XOPEN_SOURCE configure
|
||||
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.
|
||||
+ add configure check to ensure that SIGWINCH is defined on
|
||||
platforms such as OS X which exclude that when _XOPEN_SOURCE,
|
||||
etc., are defined
|
||||
+ use ld's -search_paths_first option on Darwin to work around
|
||||
odd search rules on that platform.
|
||||
+ improve ifdef's for _POSIX_VDISABLE in tset to work with Mac
|
||||
OS X.
|
||||
+ modify configure script to ensure that if the C compiler is
|
||||
used rather than the loader in making shared libraries, the
|
||||
$(CFLAGS) variable is also used.
|
||||
+ use ${CC} rather than ${LD} in shared library rules for
|
||||
IRIX64, Solaris to help ensure that initialization sections
|
||||
are provided for extra linkage requirements, e.g., of C++
|
||||
applications.
|
||||
+ improve some shared-library configure scripting for Linux,
|
||||
FreeBSD and NetBSD to make --with-shlib-version work.
|
||||
+ split up dependency of names.c and codes.c in
|
||||
ncurses/Makefile to work with parallel make.
|
||||
+ modify MKlib_gen.sh to change preprocessor-expanded _Bool
|
||||
back to bool.
|
||||
+ modify progs/Makefile.in to make tput init work properly with
|
||||
cygwin, i.e., do not pass a .exe in the reference string used
|
||||
in check_aliases.
|
||||
* library:
|
||||
+ replaced case-statement in _nc_tracebits() for CSIZE with a
|
||||
table to simplify working around implementations that define
|
||||
random combinations of the related macros to zero.
|
||||
+ improved OS/2 mouse support by retrying as a 2-button mouse
|
||||
if code fails to set up a 3-button mouse.
|
||||
+ added private entrypoint _nc_basename(), used to consolidate
|
||||
related code in progs, as well as accommodating OS/2 EMX
|
||||
pathnames.
|
||||
+ alter definition of NCURSES_CONST to make it non-empty.
|
||||
+ redefine 'TEXT' in menu.h for AMIGA, since it is reported to
|
||||
have an (unspecified) symbol conflict.
|
||||
* programs:
|
||||
+ modified progs/tset.c and tack/sysdep.c to build with sgttyb
|
||||
interface if neither termio or termios is available. Tested
|
||||
this with FreeBSD 2.1.5 (which does have termios - but the
|
||||
sgttyb does work).
|
||||
+ ignore wide-acs line-drawing characters that wcwidth() claims
|
||||
are not one-column. This is a workaround for Solaris' broken
|
||||
locale support.
|
||||
+ reduce name-pollution in term.h by removing #define's for
|
||||
HAVE_xxx symbols.
|
||||
+ fix #ifdef in c++/internal.h for QNX 6.1
|
||||
* test programs:
|
||||
+ modify test/configure script to allow building test programs
|
||||
with PDCurses/X11.
|
||||
+ modified test programs to allow some to work with NetBSD
|
||||
curses. Several do not because NetBSD curses implements a
|
||||
subset of X/Open curses, and also lacks much of SVr4
|
||||
additions. But it is enough for comparison.
|
||||
+ improved test/configure to build test/ncurses on HPUX 11
|
||||
using the vendor curses.
|
||||
+ change configure script to produce test/Makefile from data
|
||||
file.
|
||||
|
||||
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
|
||||
EXTENDED-level features not directly concerned with wide-character
|
||||
support are implemented, including many function calls not
|
||||
supported under SVr4 curses (but portability of all calls is
|
||||
documented so you can use the SVr4 subset only).
|
||||
* Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
|
||||
corner of the screen if your terminal has an insert-character
|
||||
* 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, and most EXTENDED features). It includes many
|
||||
function calls not supported under SVr4 curses (but portability of
|
||||
all calls is documented so you can use the SVr4 subset only).
|
||||
* Unlike SVr3 curses, ncurses can write to the rightmost-bottommost
|
||||
corner of the screen if your terminal has an insert-character
|
||||
capability.
|
||||
* Ada95 and C++ bindings.
|
||||
* Support for mouse event reporting with X Window xterm and OS/2
|
||||
console windows.
|
||||
* Support for mouse event reporting with X Window xterm and FreeBSD
|
||||
and OS/2 console windows.
|
||||
* Extended mouse support via Alessandro Rubini's gpm package.
|
||||
* The function wresize() allows you to resize windows, preserving
|
||||
* 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
|
||||
* Support for 16-color terminals, such as aixterm and modern xterm.
|
||||
* Better cursor-movement optimization. The package now features a
|
||||
cursor-local-movement computation more efficient than either BSD's
|
||||
or System V's.
|
||||
* 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/products/CDK/
|
||||
|
||||
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.
|
||||
[7]http://lynx.isc.org/release/
|
||||
|
||||
Midnight Commander 4.1
|
||||
Midnight Commander
|
||||
file manager
|
||||
[8]www.gnome.org/mc/.
|
||||
[8]http://www.ibiblio.org/mc/
|
||||
|
||||
mutt
|
||||
mail utility
|
||||
[9]http://www.mutt.org.
|
||||
[9]http://www.mutt.org/
|
||||
|
||||
ncftp
|
||||
file-transfer utility
|
||||
[10]http://www.ncftp.com.
|
||||
[10]http://www.ncftp.com/
|
||||
|
||||
nvi
|
||||
New vi versions 1.50 are able to use ncurses versions 1.9.7 and
|
||||
later.
|
||||
[11]http://www.bostic.com/vi/.
|
||||
[11]http://www.bostic.com/vi/
|
||||
|
||||
pinfo
|
||||
Lynx-like info browser.
|
||||
[12]http://dione.ids.pl/~pborys/software/pinfo/
|
||||
|
||||
tin
|
||||
newsreader, supporting color, MIME
|
||||
[12]http://www.tin.org.
|
||||
|
||||
taper
|
||||
tape archive utility
|
||||
[13]http://members.iinet.net.au/~yusuf/taper/.
|
||||
newsreader, supporting color, MIME [13]http://www.tin.org/
|
||||
|
||||
vh-1.6
|
||||
Volks-Hypertext browser for the Jargon File
|
||||
[14]http://www.bg.debian.org/Packages/unstable/text/vh.html.
|
||||
[14]http://www.debian.org/Packages/unstable/text/vh.html
|
||||
|
||||
as well as some that use ncurses for the terminfo support alone:
|
||||
|
||||
minicom
|
||||
terminal emulator
|
||||
[15]http://www.pp.clinet.fi/~walker/minicom.html.
|
||||
[15]http://alioth.debian.org/projects/minicom/
|
||||
|
||||
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.
|
||||
Contact the current maintainers at [22]bug-ncurses@gnu.org.
|
||||
Zeyd Ben-Halim started it from a previous package pcurses, written by
|
||||
Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer
|
||||
wrote most of the form and menu libraries. Ongoing work is being done
|
||||
by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the
|
||||
Free Software Foundation, which holds the copyright on ncurses.
|
||||
Contact the current maintainers at [18]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 <name>@<host.domain>
|
||||
|
||||
This list is open to anyone interested in helping with the development
|
||||
and testing of this package.
|
||||
|
||||
Beta versions of ncurses and patches to the current release are made
|
||||
available at [23]ftp://dickey.his.com/ncurses.
|
||||
Beta versions of ncurses and patches to the current release are made
|
||||
available at [19]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.
|
||||
[24]http://earthspace.net/~esr/terminfo.
|
||||
The distribution provides a newer version of the terminfo-format
|
||||
terminal description file once maintained by [20]Eric Raymond . Unlike
|
||||
the older version, the termcap and terminfo data are provided in the
|
||||
same file, and provides several user-definable extensions beyond the
|
||||
X/Open specification.
|
||||
|
||||
You can find lots of information on terminal-related topics not
|
||||
covered in the terminfo file at [25]Richard Shuford's archive.
|
||||
You can find lots of information on terminal-related topics not
|
||||
covered in the terminfo file at [21]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
|
||||
1. ftp://ftp.gnu.org/gnu/ncurses/
|
||||
2. ftp://invisible-island.net/ncurses/
|
||||
3. http://invisible-island.net/cdk/
|
||||
4. http://www.vexus.ca/products/CDK/
|
||||
5. http://invisible-island.net/ded/
|
||||
6. http://invisible-island.net/dialog/
|
||||
7. http://lynx.isc.org/release/
|
||||
8. file://localhost/usr/build/ncurses/ncurses-5.2-20001021/doc/html/www.gnome.org/mc/
|
||||
8. http://www.ibiblio.org/mc/
|
||||
9. http://www.mutt.org/
|
||||
10. http://www.ncftp.com/
|
||||
11. http://www.bostic.com/vi/
|
||||
12. http://www.tin.org/
|
||||
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
|
||||
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
|
||||
21. mailto:dickey@herndon4.his.com
|
||||
22. mailto:bug-ncurses@gnu.org
|
||||
23. ftp://dickey.his.com/ncurses
|
||||
24. http://earthspace.net/~esr/terminfo
|
||||
25. http://www.cs.utk.edu/~shuford/terminal_index.html
|
||||
12. http://dione.ids.pl/~pborys/software/pinfo/
|
||||
13. http://www.tin.org/
|
||||
14. http://www.debian.org/Packages/unstable/text/vh.html
|
||||
15. http://alioth.debian.org/projects/minicom/
|
||||
16. http://invisible-island.net/vile/
|
||||
17. mailto:dickey@invisible-island.net
|
||||
18. mailto:bug-ncurses@gnu.org
|
||||
19. ftp://invisible-island.net/ncurses/
|
||||
20. http://www.catb.org/~esr/terminfo/
|
||||
21. http://www.cs.utk.edu/~shuford/terminal_index.html
|
||||
|
38
contrib/ncurses/AUTHORS
Normal file
38
contrib/ncurses/AUTHORS
Normal file
@ -0,0 +1,38 @@
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright (c) 2006 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
-- "Software"), to deal in the Software without restriction, including --
|
||||
-- without limitation the rights to use, copy, modify, merge, publish, --
|
||||
-- distribute, distribute with modifications, sublicense, and/or sell copies --
|
||||
-- of the Software, and to permit persons to whom the Software is furnished --
|
||||
-- to do so, subject to the following conditions: --
|
||||
-- --
|
||||
-- The above copyright notice and this permission notice shall be included --
|
||||
-- in all copies or substantial portions of the Software. --
|
||||
-- --
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
|
||||
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
|
||||
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
|
||||
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
|
||||
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
|
||||
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
|
||||
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-- --
|
||||
-- Except as contained in this notice, the name(s) of the above copyright --
|
||||
-- holders shall not be used in advertising or otherwise to promote the --
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: AUTHORS,v 1.2 2006/10/28 21:44:52 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
These are the principal authors/contributors of ncurses since 1.9.9e,
|
||||
in decreasing order of their contribution:
|
||||
|
||||
TD Thomas E. Dickey
|
||||
JPF Juergen Pfeifer
|
||||
ESR Eric S Raymond
|
||||
AVL Alexander V Lukyanov
|
||||
PB Philippe Blain
|
||||
SV Sven Verdoolaege
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
./ANNOUNCE
|
||||
./AUTHORS
|
||||
./Ada95/Makefile.in
|
||||
./Ada95/README
|
||||
./Ada95/TODO
|
||||
@ -166,13 +167,11 @@
|
||||
./Ada95/src/terminal_interface.ads
|
||||
./INSTALL
|
||||
./MANIFEST
|
||||
./Makefile.glibc
|
||||
./Makefile.in
|
||||
./Makefile.os2
|
||||
./NEWS
|
||||
./README
|
||||
./README.emx
|
||||
./README.glibc
|
||||
./TO-DO
|
||||
./aclocal.m4
|
||||
./announce.html.in
|
||||
@ -208,6 +207,7 @@
|
||||
./dist.mk
|
||||
./doc/hackguide.doc
|
||||
./doc/html/Ada95.html
|
||||
./doc/html/NCURSES-Programming-HOWTO.html
|
||||
./doc/html/ada/files.htm
|
||||
./doc/html/ada/files/T.htm
|
||||
./doc/html/ada/funcs.htm
|
||||
@ -392,10 +392,13 @@
|
||||
./doc/html/man/form_requestname.3x.html
|
||||
./doc/html/man/form_userptr.3x.html
|
||||
./doc/html/man/form_win.3x.html
|
||||
./doc/html/man/index.html
|
||||
./doc/html/man/infocmp.1m.html
|
||||
./doc/html/man/infotocap.1m.html
|
||||
./doc/html/man/key_defined.3x.html
|
||||
./doc/html/man/keybound.3x.html
|
||||
./doc/html/man/keyok.3x.html
|
||||
./doc/html/man/legacy_coding.3x.html
|
||||
./doc/html/man/menu.3x.html
|
||||
./doc/html/man/menu_attributes.3x.html
|
||||
./doc/html/man/menu_cursor.3x.html
|
||||
@ -434,6 +437,7 @@
|
||||
./doc/ncurses-intro.doc
|
||||
./form/Makefile.in
|
||||
./form/READ.ME
|
||||
./form/f_trace.c
|
||||
./form/fld_arg.c
|
||||
./form/fld_attr.c
|
||||
./form/fld_current.c
|
||||
@ -477,9 +481,11 @@
|
||||
./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
|
||||
@ -494,9 +500,11 @@
|
||||
./include/curses.tail
|
||||
./include/curses.wide
|
||||
./include/edit_cfg.sh
|
||||
./include/hashed_db.h
|
||||
./include/headers
|
||||
./include/nc_alloc.h
|
||||
./include/nc_panel.h
|
||||
./include/nc_tparm.h
|
||||
./include/ncurses_cfg.hin
|
||||
./include/ncurses_defs
|
||||
./include/ncurses_dll.h
|
||||
@ -591,8 +599,10 @@
|
||||
./man/form_win.3x
|
||||
./man/infocmp.1m
|
||||
./man/infotocap.1m
|
||||
./man/key_defined.3x
|
||||
./man/keybound.3x
|
||||
./man/keyok.3x
|
||||
./man/legacy_coding.3x
|
||||
./man/make_sed.sh
|
||||
./man/man_db.renames
|
||||
./man/manlinks.sed
|
||||
@ -636,6 +646,7 @@
|
||||
./menu/eti.h
|
||||
./menu/headers
|
||||
./menu/llib-lmenu
|
||||
./menu/llib-lmenuw
|
||||
./menu/m_attribs.c
|
||||
./menu/m_cursor.c
|
||||
./menu/m_driver.c
|
||||
@ -660,6 +671,7 @@
|
||||
./menu/m_scale.c
|
||||
./menu/m_spacing.c
|
||||
./menu/m_sub.c
|
||||
./menu/m_trace.c
|
||||
./menu/m_userptr.c
|
||||
./menu/m_win.c
|
||||
./menu/menu.h
|
||||
@ -670,14 +682,18 @@
|
||||
./misc/chkdef.cmd
|
||||
./misc/cleantic.cmd
|
||||
./misc/cmpdef.cmd
|
||||
./misc/csort
|
||||
./misc/emx.src
|
||||
./misc/form.def
|
||||
./misc/form.ref
|
||||
./misc/indent.pro
|
||||
./misc/gen_edit.sh
|
||||
./misc/jpf-indent
|
||||
./misc/makedef.cmd
|
||||
./misc/makellib
|
||||
./misc/menu.def
|
||||
./misc/menu.ref
|
||||
./misc/ncu-indent
|
||||
./misc/ncurses-config.in
|
||||
./misc/ncurses.def
|
||||
./misc/ncurses.ref
|
||||
./misc/panel.def
|
||||
@ -696,14 +712,17 @@
|
||||
./mkinstalldirs
|
||||
./ncurses/Makefile.in
|
||||
./ncurses/README
|
||||
./ncurses/README.IZ
|
||||
./ncurses/SigAction.h
|
||||
./ncurses/base/MKkeyname.awk
|
||||
./ncurses/base/MKlib_gen.sh
|
||||
./ncurses/base/MKunctrl.awk
|
||||
./ncurses/base/README
|
||||
./ncurses/base/define_key.c
|
||||
./ncurses/base/key_defined.c
|
||||
./ncurses/base/keybound.c
|
||||
./ncurses/base/keyok.c
|
||||
./ncurses/base/legacy_coding.c
|
||||
./ncurses/base/lib_addch.c
|
||||
./ncurses/base/lib_addstr.c
|
||||
./ncurses/base/lib_beep.c
|
||||
@ -732,7 +751,7 @@
|
||||
./ncurses/base/lib_initscr.c
|
||||
./ncurses/base/lib_insch.c
|
||||
./ncurses/base/lib_insdel.c
|
||||
./ncurses/base/lib_insstr.c
|
||||
./ncurses/base/lib_insnstr.c
|
||||
./ncurses/base/lib_instr.c
|
||||
./ncurses/base/lib_isendwin.c
|
||||
./ncurses/base/lib_leaveok.c
|
||||
@ -803,9 +822,11 @@
|
||||
./ncurses/tinfo/comp_hash.c
|
||||
./ncurses/tinfo/comp_parse.c
|
||||
./ncurses/tinfo/comp_scan.c
|
||||
./ncurses/tinfo/db_iterator.c
|
||||
./ncurses/tinfo/doalloc.c
|
||||
./ncurses/tinfo/free_ttype.c
|
||||
./ncurses/tinfo/getenv_num.c
|
||||
./ncurses/tinfo/hashed_db.c
|
||||
./ncurses/tinfo/home_terminfo.c
|
||||
./ncurses/tinfo/init_keytry.c
|
||||
./ncurses/tinfo/lib_acs.c
|
||||
@ -834,6 +855,7 @@
|
||||
./ncurses/tinfo/read_termcap.c
|
||||
./ncurses/tinfo/setbuf.c
|
||||
./ncurses/tinfo/strings.c
|
||||
./ncurses/tinfo/trim_sgr0.c
|
||||
./ncurses/tinfo/write_entry.c
|
||||
./ncurses/trace/README
|
||||
./ncurses/trace/lib_trace.c
|
||||
@ -857,6 +879,8 @@
|
||||
./ncurses/tty/tty_display.h
|
||||
./ncurses/tty/tty_input.h
|
||||
./ncurses/tty/tty_update.c
|
||||
./ncurses/widechar/charable.c
|
||||
./ncurses/widechar/lib_add_wch.c
|
||||
./ncurses/widechar/lib_box_set.c
|
||||
./ncurses/widechar/lib_cchar.c
|
||||
./ncurses/widechar/lib_erasewchar.c
|
||||
@ -865,9 +889,10 @@
|
||||
./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_pecho_wchar.c
|
||||
./ncurses/widechar/lib_slk_wset.c
|
||||
./ncurses/widechar/lib_unget_wch.c
|
||||
./ncurses/widechar/lib_vid_attr.c
|
||||
./ncurses/widechar/lib_vline_set.c
|
||||
@ -876,6 +901,7 @@
|
||||
./panel/Makefile.in
|
||||
./panel/headers
|
||||
./panel/llib-lpanel
|
||||
./panel/llib-lpanelw
|
||||
./panel/modules
|
||||
./panel/p_above.c
|
||||
./panel/p_below.c
|
||||
@ -908,12 +934,6 @@
|
||||
./progs/toe.c
|
||||
./progs/tput.c
|
||||
./progs/tset.c
|
||||
./sysdeps/unix/sysv/linux/Makefile
|
||||
./sysdeps/unix/sysv/linux/alpha/configure
|
||||
./sysdeps/unix/sysv/linux/configure
|
||||
./sysdeps/unix/sysv/linux/edit_man.sed
|
||||
./sysdeps/unix/sysv/linux/edit_man.sh
|
||||
./sysdeps/unix/sysv/linux/run_tic.sh
|
||||
./tack/COPYING
|
||||
./tack/HISTORY
|
||||
./tack/Makefile.in
|
||||
@ -940,31 +960,56 @@
|
||||
./tar-copy.sh
|
||||
./test/Makefile.in
|
||||
./test/README
|
||||
./test/aclocal.m4
|
||||
./test/background.c
|
||||
./test/blue.c
|
||||
./test/bs.6
|
||||
./test/bs.c
|
||||
./test/bulgarian-utf8.txt
|
||||
./test/cardfile.c
|
||||
./test/cardfile.dat
|
||||
./test/chgat.c
|
||||
./test/color_set.c
|
||||
./test/configure
|
||||
./test/configure.in
|
||||
./test/demo_altkeys.c
|
||||
./test/demo_defkey.c
|
||||
./test/demo_forms.c
|
||||
./test/demo_keyok.c
|
||||
./test/demo_menus.c
|
||||
./test/demo_panels.c
|
||||
./test/demo_termcap.c
|
||||
./test/ditto.c
|
||||
./test/dots.c
|
||||
./test/echochar.c
|
||||
./test/edit_field.c
|
||||
./test/edit_field.h
|
||||
./test/filter.c
|
||||
./test/firework.c
|
||||
./test/firstlast.c
|
||||
./test/foldkeys.c
|
||||
./test/gdc.6
|
||||
./test/gdc.c
|
||||
./test/hanoi.c
|
||||
./test/hashtest.c
|
||||
./test/ins_wide.c
|
||||
./test/inserts.c
|
||||
./test/keynames.c
|
||||
./test/knight.c
|
||||
./test/linux-color.dat
|
||||
./test/listused.sh
|
||||
./test/lrtest.c
|
||||
./test/mk-test.awk
|
||||
./test/modules
|
||||
./test/movewindow.c
|
||||
./test/ncurses.c
|
||||
./test/ncurses_tst.hin
|
||||
./test/newdemo.c
|
||||
./test/programs
|
||||
./test/railroad.c
|
||||
./test/rain.c
|
||||
./test/redraw.c
|
||||
./test/savescreen.c
|
||||
./test/tclock.c
|
||||
./test/test.priv.h
|
||||
./test/testaddch.c
|
||||
@ -972,5 +1017,8 @@
|
||||
./test/testscanw.c
|
||||
./test/tracemunch
|
||||
./test/view.c
|
||||
./test/widechars-utf8.txt
|
||||
./test/worm.c
|
||||
./test/xmas.c
|
||||
./test/xterm-16color.dat
|
||||
./test/xterm-88color.dat
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.22 2001/10/27 18:17:22 tom Exp $
|
||||
# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2004,2005 Free 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"), #
|
||||
@ -65,6 +65,9 @@ preinstall :
|
||||
@ echo ''
|
||||
@ echo '** Configuration summary for NCURSES $(NCURSES_MAJOR).$(NCURSES_MINOR) $(NCURSES_PATCH):'
|
||||
@ echo ''
|
||||
@ echo ' extended funcs: '`test @NCURSES_EXT_FUNCS@ != 0 && echo yes || echo no`
|
||||
@ echo ' xterm terminfo: '@WHICH_XTERM@
|
||||
@ echo ''
|
||||
@ echo ' bin directory: '$(bindir)
|
||||
@ echo ' lib directory: '$(libdir)
|
||||
@ echo ' include directory: '$(includedir)
|
||||
@ -89,5 +92,6 @@ mostlyclean \
|
||||
realclean \
|
||||
depend \
|
||||
sources \
|
||||
tags \
|
||||
uninstall \
|
||||
install ::
|
||||
|
@ -1,8 +1,33 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
################################################################################
|
||||
# Wrapper Makefile for ncurses library under OS/2.
|
||||
################################################################################
|
||||
# $Id: Makefile.os2,v 1.10 2000/10/09 23:53:57 Ilya.Zakharevich Exp $
|
||||
# $Id: Makefile.os2,v 1.11 2006/04/22 21:46:17 tom Exp $
|
||||
#
|
||||
# Wrapper Makefile for ncurses library under OS/2.
|
||||
# Author: Juan Jose Garcia Ripoll <worm@arrakis.es>.
|
||||
# Webpage: http://www.arrakis.es/~worm/
|
||||
################################################################################
|
||||
|
2763
contrib/ncurses/NEWS
2763
contrib/ncurses/NEWS
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,31 @@
|
||||
-- $Id: README,v 1.20 2000/08/12 23:31:21 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
-- "Software"), to deal in the Software without restriction, including --
|
||||
-- without limitation the rights to use, copy, modify, merge, publish, --
|
||||
-- distribute, distribute with modifications, sublicense, and/or sell copies --
|
||||
-- of the Software, and to permit persons to whom the Software is furnished --
|
||||
-- to do so, subject to the following conditions: --
|
||||
-- --
|
||||
-- The above copyright notice and this permission notice shall be included --
|
||||
-- in all copies or substantial portions of the Software. --
|
||||
-- --
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
|
||||
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
|
||||
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
|
||||
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
|
||||
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
|
||||
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
|
||||
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-- --
|
||||
-- Except as contained in this notice, the name(s) of the above copyright --
|
||||
-- holders shall not be used in advertising or otherwise to promote the --
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: README,v 1.23 2006/04/22 22:19:37 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
README file for the ncurses package
|
||||
|
||||
@ -43,6 +70,14 @@ The libraries are:
|
||||
libform.so (shared)
|
||||
libform_g.a (debug enabled)
|
||||
|
||||
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.
|
||||
|
||||
The ncurses libraries implement the curses API. The panel, menu and forms
|
||||
libraries implement clones of the SVr4 panel, menu and forms APIs. The source
|
||||
code for these lives in the `ncurses', `panel', `menu', and `form' directories
|
||||
@ -56,7 +91,7 @@ install.libs' rule as libncurses++.
|
||||
In the `Ada95' directory, you'll find code and documentation for an
|
||||
Ada95 binding of the curses API, to be used with the GNAT compiler.
|
||||
This binding is built by a normal top-level `make' if configure detects
|
||||
an usable version of GNAT (3.10 or above). It is not installed automatically.
|
||||
an usable version of GNAT (3.11 or above). It is not installed automatically.
|
||||
See the Ada95 directory for more build and installation instructions and
|
||||
for documentation of the binding.
|
||||
|
||||
|
@ -1,4 +1,31 @@
|
||||
-- $Id: README.emx,v 1.4 2000/09/16 19:28:28 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
-- "Software"), to deal in the Software without restriction, including --
|
||||
-- without limitation the rights to use, copy, modify, merge, publish, --
|
||||
-- distribute, distribute with modifications, sublicense, and/or sell copies --
|
||||
-- of the Software, and to permit persons to whom the Software is furnished --
|
||||
-- to do so, subject to the following conditions: --
|
||||
-- --
|
||||
-- The above copyright notice and this permission notice shall be included --
|
||||
-- in all copies or substantial portions of the Software. --
|
||||
-- --
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
|
||||
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
|
||||
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
|
||||
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
|
||||
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
|
||||
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
|
||||
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-- --
|
||||
-- Except as contained in this notice, the name(s) of the above copyright --
|
||||
-- holders shall not be used in advertising or otherwise to promote the --
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: README.emx,v 1.8 2006/04/22 22:19:37 tom Exp $
|
||||
-- Author: Thomas Dickey
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@ -16,13 +43,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-20030927.patch.gz
|
||||
autoconf-2.13-20030927-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,
|
||||
|
@ -1,87 +1,103 @@
|
||||
-- $Id: TO-DO,v 1.39 1998/07/12 00:25:39 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
-- "Software"), to deal in the Software without restriction, including --
|
||||
-- without limitation the rights to use, copy, modify, merge, publish, --
|
||||
-- distribute, distribute with modifications, sublicense, and/or sell copies --
|
||||
-- of the Software, and to permit persons to whom the Software is furnished --
|
||||
-- to do so, subject to the following conditions: --
|
||||
-- --
|
||||
-- The above copyright notice and this permission notice shall be included --
|
||||
-- in all copies or substantial portions of the Software. --
|
||||
-- --
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
|
||||
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
|
||||
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
|
||||
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
|
||||
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
|
||||
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
|
||||
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-- --
|
||||
-- Except as contained in this notice, the name(s) of the above copyright --
|
||||
-- holders shall not be used in advertising or otherwise to promote the --
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: TO-DO,v 1.48 2006/10/28 19:49:16 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
SHORT-TERM TO-DO ITEMS:
|
||||
|
||||
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.
|
||||
+ libtool does not work with GNAT.
|
||||
|
||||
* 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
|
||||
+ The screen optimization has been tested only in an ad hoc manner. We should
|
||||
develop a good set of regression tests to cover lib_doupdate.c and
|
||||
lib_mvcur.c.
|
||||
|
||||
* Magic cookie support does not work, since the logic does not take into account
|
||||
refresh. Also, the initial optimize does not adjust the current location
|
||||
when a cookie is emitted.
|
||||
+ Magic cookie support (for nonzero xmc values) does not work, since the logic
|
||||
does not take into account refresh. Also, the initial optimize does not
|
||||
adjust the current location when a cookie is emitted.
|
||||
|
||||
* Scrolling optimization has holes: for example, it forces repaints of the
|
||||
+ Scrolling optimization has holes: for example, it forces repaints of the
|
||||
screen between calls to refresh().
|
||||
|
||||
* SVr4 uses slightly different rules for determining when softkeys are shown.
|
||||
+ SVr4 uses slightly different rules for determining when softkeys are shown.
|
||||
For example, they are initially displayed (before the ncurses 'e' test
|
||||
activates them), and a touchwin can apparently also force them to be
|
||||
displayed.
|
||||
|
||||
+ The code departs from perfect 8-bit cleanness in one respect; you cannot
|
||||
specify a character \200 as part of a capability string, because the terminfo
|
||||
library interprets \200 as a request to embed NUL (\000) at that point. This
|
||||
is a legacy terminfo property we can't mess with.
|
||||
specify a character \200 as part of a capability string, because the
|
||||
terminfo library interprets \200 as a request to embed NUL (\000) at that
|
||||
point. This is a legacy terminfo property we can't mess with.
|
||||
|
||||
* The window classes defined in the c++ subdirectory need documentation.
|
||||
Some C++ programmer could earn a lot of good karma by doing this...
|
||||
+ The window classes defined in the c++ subdirectory need documentation. Some
|
||||
C++ programmer could earn a lot of good karma by doing this...
|
||||
|
||||
+ The resizeterm() function does not handle ripped-off lines such as that done
|
||||
for the slk_XXX functions.
|
||||
|
||||
+ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
|
||||
There appear to be no terminals that require that functionality.
|
||||
|
||||
Portability (or lack thereof):
|
||||
|
||||
* Users of older System V UNIXes (but not Solaris, and probably not SVr4)
|
||||
may trip over a known problem with the signal-handling code which causes
|
||||
abrupt termination of ncurses applications following resume from a ^Z
|
||||
suspend (this problem was first seen running lynx). You will not see
|
||||
this problem if you are running Linux or one of the 4.4BSD derivatives
|
||||
like FreeBSD, NetBSD, or BSDI. For details, see the analysis in the
|
||||
header comment of ncurses/lib_tstp.c.
|
||||
+ Users of older System V UNIXes (but not Solaris, and probably not SVr4) may
|
||||
trip over a known problem with the signal-handling code which causes abrupt
|
||||
termination of ncurses applications following resume from a ^Z suspend (this
|
||||
problem was first seen running lynx). You will not see this problem if you
|
||||
are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or
|
||||
BSDI. For details, see the analysis in the header comment of
|
||||
ncurses/tty/lib_tstp.c .
|
||||
|
||||
* In theory, vwprintw and vwscanf are supposed to use the older varargs.h
|
||||
+ In theory, vwprintw and vwscanf are supposed to use the older varargs.h
|
||||
interface for handling variadic argument lists. Linux doesn't have
|
||||
varargs.h, it has the newer X/Open-standard stdargs.h equivalent. So
|
||||
these functions use stdargs instead. This is unlikely to be a problem
|
||||
unless you're building ncurses on a System V old enough to only have
|
||||
varargs.h. (Solaris 2.5.1 uses the stdarg.h binding as well).
|
||||
varargs.h, it has the newer X/Open-standard stdargs.h equivalent. So these
|
||||
functions use stdargs instead. This is unlikely to be a problem unless
|
||||
you're building ncurses on a System V old enough to only have varargs.h.
|
||||
(Solaris 2.5.1 uses the stdarg.h binding as well).
|
||||
|
||||
* If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to
|
||||
have a native vsscanf(3) in its library, vwscanw() will not work. You lose.
|
||||
(It should work on any System V, however). If you want to fix this, add
|
||||
an implementation to ncurses/vsscanf.c.
|
||||
+ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have
|
||||
a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It
|
||||
should work on any System V, however). If you want to fix this, add an
|
||||
implementation to ncurses/vsscanf.c.
|
||||
|
||||
* The demo build for the c++ library craps out with many link errors under gcc
|
||||
2.6.3. We're told the C++ support in 2.6.3 is broken and that the right
|
||||
fix is to upgrade to 2.7.0. This demo is also known to not build with
|
||||
the Sun SPARCworks 4.1 C++ compiler, due to a problem resolving templates.
|
||||
|
||||
* Under Ultrix, configure craps out (Ultrix sh is lame). Run it under ksh.
|
||||
|
||||
* We've not tested the configure script with cross-compilers. The autoconf
|
||||
tests are supposed to be able to support this (please report bugs). You will
|
||||
have to configure and build in two steps. The first step must create the
|
||||
automatically-generated sources (e.g., comp_captab.c) on your host machine.
|
||||
Then, run "make mostlyclean", remove config.* from the top-level directory
|
||||
and configure for the cross-compiler.
|
||||
+ The C++ binding fails to build with a few C++ compilers, mainly with
|
||||
configure script problems with vsscanf().
|
||||
|
||||
+ terminfo.5 does not format with the SunOS (and most other platform's) tbl
|
||||
utility because it relies on a diversion for each table entry. Get the groff
|
||||
package.
|
||||
utility because it relies on a diversion for each table entry. Get the
|
||||
groff package.
|
||||
|
||||
Untested features:
|
||||
|
||||
* The code for the HP color model using set_color_pair is untested.
|
||||
+ The code for the HP color model using set_color_pair is untested.
|
||||
|
||||
* The code for handling soft labels on a terminal type with built-in support
|
||||
+ The code for handling soft labels on a terminal type with built-in support
|
||||
for them (num_labels > 0, label_height, label_width, label_format, label_off,
|
||||
label_on, plab_norm, lab_f*) has not been tested. The label_format and
|
||||
lab_f* capabilities aren't presently used.
|
||||
@ -95,72 +111,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.
|
||||
|
||||
2. DOS port
|
||||
|
||||
Only 16 of the 55 files in the library depend on the terminfo format.
|
||||
Only a few of the files in the library depend on the terminfo format.
|
||||
It should be possible to further kernelize the package, then rewrite
|
||||
a small number of core files to produce a functionally-compatible
|
||||
port that would do updates to a memory-mapped screen area. The first
|
||||
@ -248,4 +201,4 @@ These are the potentially important ones for ncurses. Notes:
|
||||
ii) We probably don't care about dest_tabs_magic_smso; only
|
||||
Telerays used it and they're all long obsolete.
|
||||
|
||||
|
||||
-- vile:txtmode
|
||||
|
2724
contrib/ncurses/aclocal.m4
vendored
2724
contrib/ncurses/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,39 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<!--
|
||||
$Id: announce.html.in,v 1.41 2000/10/28 21:43:25 tom Exp $
|
||||
$Id: announce.html.in,v 1.64 2006/12/17 23:31:26 tom Exp $
|
||||
****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Announcing ncurses @VERSION@</TITLE>
|
||||
<link rev=made href="mailto:bug-ncurses@gnu.org">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
@ -18,8 +46,8 @@ and multiple highlights and forms characters and function-key mapping,
|
||||
and has all the other SYSV-curses enhancements over BSD curses.<P>
|
||||
|
||||
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
|
||||
considered 4.4BSD curses obsolete, and encouraged the keepers of
|
||||
Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to
|
||||
ncurses.<P>
|
||||
|
||||
The ncurses code was developed under GNU/Linux.
|
||||
@ -35,333 +63,305 @@ the library and tools.<P>
|
||||
|
||||
The ncurses distribution is available via anonymous FTP at
|
||||
the GNU distribution site
|
||||
<A HREF="ftp://ftp.gnu.org/pub/gnu/ncurses">ftp://ftp.gnu.org/pub/gnu/ncurses</A>.
|
||||
<A HREF="ftp://ftp.gnu.org/gnu/ncurses/">ftp://ftp.gnu.org/gnu/ncurses/</A> .
|
||||
<br>It is also available at
|
||||
<A HREF="ftp://dickey.his.com/ncurses">ftp://dickey.his.com/ncurses</A>.
|
||||
<A HREF="ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</A> .
|
||||
|
||||
<H1>Release Notes</H1>
|
||||
|
||||
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 through 5.5;
|
||||
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.5 release.
|
||||
<p>
|
||||
Interface changes:
|
||||
<ul>
|
||||
<li>change type of <code>ospeed</code> variable back to
|
||||
<code>short</code> to match its use in legacy applications. It was
|
||||
altered after ncurses 4.2 to <code>speed_t</code> to repair a type
|
||||
mismatch which was introduced after 1.9.4 in 1995. The principal
|
||||
users of termcap continued to use <code>short</code>, which is
|
||||
not the same size.
|
||||
<p>
|
||||
<em>NOTE</em>: 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 <code>nm</code> or <code>strings</code>.
|
||||
<li>generate linkable stubs for some macros:
|
||||
<br>
|
||||
getbegx, getbegy, getcurx, getcury, getmaxx, getmaxy, getparx,
|
||||
getpary, getpary,
|
||||
<br>
|
||||
and (for libncursesw)
|
||||
<br>
|
||||
wgetbkgrnd
|
||||
|
||||
<li>remove a private function <code>_nc_can_clear_with()</code>, which
|
||||
was built with the configure --enable-expanded option but not used.
|
||||
|
||||
<li>add several private functions (prefixed with "_nc_") for tracing
|
||||
<code>chtype</code> values in the debug library, and for better
|
||||
access and buffer limit checking.
|
||||
</ul>
|
||||
New features and improvements:
|
||||
<ul>
|
||||
<li>rewrote <code>tgoto()</code> 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, <code>tgoto()</code>
|
||||
will interpret it as termcap. Otherwise, as before, it will use
|
||||
<code>tparm()</code>.
|
||||
|
||||
<li>to ensure that the <code>tgoto()</code> changes work properly,
|
||||
added checks to <code>tic</code> which report capabilities that do
|
||||
not reference the expected number of parameters.
|
||||
|
||||
<li>new configure script options:
|
||||
<li>library
|
||||
<ul>
|
||||
<li>option <code>--disable-root-environ</code> adds runtime checks
|
||||
which tell ncurses to disregard $TERMINFO and similar environment
|
||||
variables if the current user is root, or running setuid/setgid.
|
||||
<li>support hashed databases for the terminal descriptions.
|
||||
This uses the Berkeley database, has been tested for
|
||||
several versions on different platforms.
|
||||
|
||||
<li>option <code>--disable-assumed-color</code> allows you to use the
|
||||
pre-5.1 convention of default colors used for color-pair 0 to be
|
||||
configured (see assume_default_colors()).
|
||||
<li>add <code>use_legacy_coding()</code> function to support
|
||||
lynx's font-switching feature.
|
||||
|
||||
<li>implement configure script options that transform installed
|
||||
program names, e.g., <code>--program-prefix</code>, including the
|
||||
manpage names and cross references.
|
||||
<li>add extension <code>nofilter()</code>, to cancel a prior
|
||||
<code>filter()</code> call.
|
||||
|
||||
<li>option <code>--with-database</code> 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
|
||||
<li>add/install a package config script, e.g.,
|
||||
<code>ncurses5-config</code> or
|
||||
<code>ncursesw5-config</code>, according to
|
||||
configuration options.
|
||||
|
||||
<li>option <code>--with-default-terminfo-dir</code> allows you to
|
||||
specify the default terminfo database directory.
|
||||
<li>provide ifdef for <code>NCURSES_NOMACROS</code> which
|
||||
suppresses most macro definitions from curses.h, i.e.,
|
||||
where a macro is defined to override a function to improve
|
||||
performance.
|
||||
|
||||
<li>option <code>--with-libtool</code> allows you to build with
|
||||
<code>libtool</code>. <p> <em>NOTE</em>: <code>libtool</code>
|
||||
uses a different notation for numbering shared library versions
|
||||
from the existing ncurses configuration.
|
||||
<li>make ifdef's consistent in <code>curses.h</code> for the
|
||||
extended colors so the header file can be used for the
|
||||
normal curses library. The header file installed for
|
||||
extended colors is a variation of the wide-character
|
||||
configuration.
|
||||
|
||||
<li>option <code>--with-manpage-tbl</code> causes the manpages to be
|
||||
preprocessed by tbl(1) prior to installation,
|
||||
<li>improve <code>tgetstr()</code> by making the return value
|
||||
point into the user's buffer, if provided.
|
||||
|
||||
<li>option <code>--without-curses-h</code> causes the installation
|
||||
process to install curses.h as ncurses.h and make appropriate
|
||||
changes to headers and manpages.
|
||||
<li>add ifdef's allowing ncurses to be built with
|
||||
<code>tparm()</code> using either varargs (the existing
|
||||
status), or using a fixed-parameter list (to match X/Open).
|
||||
|
||||
<li>widen the test for xterm <code>kmous</code> a little to
|
||||
<code>allow</code> for other
|
||||
strings than "\E[M", e.g., for <code>xterm-sco</code>
|
||||
functionality in xterm.
|
||||
|
||||
<li>modify <code>wgetnstr()</code> to return
|
||||
<code>KEY_RESIZE</code> if a sigwinch occurs.
|
||||
|
||||
<li>move prototypes for wide-character trace functions from
|
||||
curses.tail to curses.wide to avoid accidental reference to
|
||||
those if <code>_XOPEN_SOURCE_EXTENDED</code> is defined
|
||||
without ensuring that <wchar.h> is included.
|
||||
|
||||
<li>change the way shared libraries (other than libtool) are
|
||||
installed. Rather than copying the build-tree's libraries,
|
||||
link the shared objects into the install directory. This
|
||||
makes the <code>--with-rpath</code> option work except with
|
||||
<code>$(DESTDIR)</code>.
|
||||
|
||||
<li>several improvements for rendering in hpterm. These are
|
||||
only available if the library is configured using
|
||||
<code>--enable-xmc-glitch</code>.
|
||||
|
||||
<li>Add <code>NCURSES_NO_HARD_TABS</code> and
|
||||
<code>NCURSES_NO_MAGIC_COOKIE</code> environment variables
|
||||
to allow runtime suppression of the related hard-tabs and
|
||||
xmc-glitch features.
|
||||
</ul>
|
||||
|
||||
<li>modified configure script options:
|
||||
<li>programs:
|
||||
<ul>
|
||||
<li>change symbol used by the <code>--install-prefix</code> configure
|
||||
option from <code>INSTALL_PREFIX</code> to <code>DESTDIR</code>
|
||||
(the latter has become common usage although the name is
|
||||
misleading).
|
||||
<li>add new test programs: chgat.c, demo_altkeys.c,
|
||||
echochar.c, foldkeys.c, movewindow.c, redraw.c, (noting
|
||||
that existing test programs also were modified to test
|
||||
additional features).
|
||||
|
||||
<li>modify <code>ld -rpath</code> 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.
|
||||
<li>modify tack to test extended capability function-key
|
||||
strings.
|
||||
|
||||
<li>modified <code>misc/run_tic.in</code> to use
|
||||
<code>tic -o</code>, to eliminate dependency on
|
||||
<code>$TERMINFO</code> variable for installs.
|
||||
<li>modify toe to access termcap data, e.g., via <code>cgetent()</code>
|
||||
functions, or as a text file if those are not available.
|
||||
|
||||
<li>improve infocmp/tic <code>-f</code> option formatting.
|
||||
|
||||
<li>add <code>toe -a</code> option, to show all databases.
|
||||
This uses new private interfaces in the ncurses library for
|
||||
iterating through the list of databases.
|
||||
|
||||
<li>modify <code>MKfallback.sh</code> to use
|
||||
<code>tic -x</code> when constructing fallback tables to
|
||||
allow extended capabilities to be retrieved from a fallback entry.
|
||||
</ul>
|
||||
|
||||
<li>terminfo database:
|
||||
<li>terminal database
|
||||
<ul>
|
||||
<li>updated xterm terminfo entries to match XFree86 xterm patch #146.
|
||||
|
||||
<li>added amiga-vnc,
|
||||
Matrix Orbital, and
|
||||
QNX qansi to misc/terminfo.src.
|
||||
|
||||
<li>added os2 entry to misc/emx.src.
|
||||
|
||||
<li>add S0 and E0 extensions to <code>screen</code>'s terminfo entry
|
||||
since otherwise the FreeBSD port makes it pass termcap equivalents
|
||||
to <code>tgoto</code>, which would be misinterpreted by older
|
||||
versions of ncurses.
|
||||
<li>add terminfo entries for xfce terminal (xfce) and multi gnome terminal (mgt)
|
||||
<li>add nsterm-16color entry
|
||||
<li>updated mlterm terminfo entry
|
||||
<li>add kon, kon2 and jfbterm terminfo entry
|
||||
<li>remove invis capability from klone+sgr, mainly used by linux entry, since it does not really do this
|
||||
<li>add ka2, kb1, kb3, kc2 to vt220-keypad as an extension
|
||||
<li>add shifted up/down arrow codes to xterm-new as kind/kri strings
|
||||
<li>add hpterm-color terminfo entry
|
||||
<li>add 256color variants of terminfo entries for programs which are reported to implement this feature
|
||||
<li>correct order of use-clauses in rxvt-basic entry which made codes for f1-f4 vt100-style rather than vt220-style.
|
||||
</ul>
|
||||
|
||||
<li>improvements to program usability:
|
||||
<ul>
|
||||
<li>modify programs to use <code>curses_version()</code> 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.
|
||||
|
||||
<li>modify <code>tput</code> program so it can be renamed or invoked via a link as
|
||||
'reset' or 'init', producing the same effect as <code>tput reset</code> or <code>tput init</code>.
|
||||
|
||||
<li>add error checking to infocmp's -v and -m options to ensure that
|
||||
the option value is indeed a number.
|
||||
</ul>
|
||||
|
||||
<li>improved performance:
|
||||
<ul>
|
||||
<li>replace a lookup table in lib_vidattr.c used to decode
|
||||
<code>no_color_video</code> with a logic expression which is faster.
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
Major bug fixes:
|
||||
<ul>
|
||||
<li>correct <code>manlinks.sed</code> script introduced in ncurses 5.1
|
||||
to avoid using ERE "\+", which is not understood by standard versions
|
||||
of <code>sed</code>. This happens to work with GNU <code>sed</code>,
|
||||
but is not portable, and was the initial motivation for this release.
|
||||
<li>correct a typo in configure <code>--with-bool</code> option for the
|
||||
case where <code>--without-cxx</code> is used.
|
||||
|
||||
<li>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.
|
||||
<li>move assignment from environment variable <code>ESCDELAY</code>
|
||||
from <code>initscr()</code> down to <code>newterm()</code> so the
|
||||
environment variable affects timeouts for terminals opened with
|
||||
newterm() as well.
|
||||
|
||||
<li>guard against corrupt terminfo data:
|
||||
<ul>
|
||||
<li>modify <code>tparm()</code> to disallow arithmetic on strings,
|
||||
analyze the varargs list to read strings as strings and numbers as
|
||||
numbers.
|
||||
<li>modify <code>werase</code> to clear multicolumn characters that
|
||||
extend into a derived window.
|
||||
|
||||
<li>modify <code>tparm()</code>'s internal function
|
||||
<code>spop()</code> to treat a null pointer as an empty string.
|
||||
<li>modify <code>wchgat()</code> to mark updated cells as changed so a
|
||||
refresh will repaint those cells.
|
||||
|
||||
<li>modify <code>parse_format()</code> in lib_tparm.c to ignore
|
||||
precision if it is longer than 10000.
|
||||
<li>correct logic in <code>wadd_wch()</code> and
|
||||
<code>wecho_wch()</code>, which did not guard against passing the
|
||||
multi-column attribute into a call on <code>waddch()</code>, e.g.,
|
||||
using data returned by <code>win_wch()</code>
|
||||
|
||||
<li>rewrote limit checks in lib_mvcur.c using new functions
|
||||
<code>_nc_safe_strcat()</code>, etc. Made other related changes to
|
||||
check lengths used for <code>strcat()</code> and
|
||||
<code>strcpy()</code>.
|
||||
</ul>
|
||||
<li>fix redrawing of windows other than <code>stdscr</code> using
|
||||
<code>wredrawln()</code> by touching the corresponding rows in
|
||||
<code>curscr</code>.
|
||||
|
||||
<li>corrections to screen optimization:
|
||||
<ul>
|
||||
<li>added special case in lib_vidattr.c to reset underline and
|
||||
standout for devices that have no sgr0 defined.
|
||||
<li>reduce memory leaks in repeated calls to <code>tgetent()</code> by
|
||||
remembering the last <code>TERMINAL*</code> value allocated to hold
|
||||
the corresponding data and freeing that if the
|
||||
<code>tgetent()</code> result buffer is the same as the previous
|
||||
call.
|
||||
|
||||
<li>change handling of <code>non_dest_scroll_region</code> in
|
||||
tty_update.c to clear text after it is shifted in rather than before
|
||||
shifting out. Also correct row computation.
|
||||
<li>modify <code>read_termtype()</code> so the <code>term_names</code>
|
||||
data is always allocated as part of the <code>str_table</code>, a
|
||||
better fix for a memory leak.
|
||||
|
||||
<li>modify <code>rs2</code> capability in xterm-r6 and similar entries
|
||||
where cursor save/restore bracketed the sequence for resetting video
|
||||
attributes. The cursor restore would undo that.
|
||||
</ul>
|
||||
<li>fix <code>wins_nwstr(),</code> which did not handle single-column
|
||||
non-8bit codes.
|
||||
|
||||
<li>UTF-8 support:
|
||||
<ul>
|
||||
<li>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.
|
||||
<li>modify <code>wbkgrnd()</code> to avoid clearing the
|
||||
<code>A_CHARTEXT</code> attribute bits since those record the state
|
||||
of multicolumn characters.
|
||||
|
||||
<li>encode 0xFFFD in UTF-8 with 3 bytes, not 2.
|
||||
<li>improve <code>SIGWINCH</code> handling by postponing its effect
|
||||
during <code>newterm()</code>, etc., when allocating screens.
|
||||
|
||||
<li>modify <code>_nc_utf8_outch()</code> to avoid sign-extension when
|
||||
checking for out-of-range value.
|
||||
</ul>
|
||||
<li>remove 970913 feature for copying subwindows as they are moved in
|
||||
<code>mvwin()</code>.
|
||||
|
||||
<li>other library fixes:
|
||||
<ul>
|
||||
<li>added checks for an empty <code>$HOME</code> environment
|
||||
variable, to avoid retrieving terminfo descriptions from
|
||||
<code>./.terminfo</code> .
|
||||
<li>add checks in <code>waddchnstr()</code> and
|
||||
<code>wadd_wchnstr()</code> to stop copying when a null character
|
||||
is found.
|
||||
|
||||
<li>change functions <code>_nc_parse_entry()</code> and
|
||||
<code>postprocess_termcap()</code> to avoid using
|
||||
<code>strtok()</code>, because it is non-reentrant.
|
||||
<li>add some checks to ensure current position is within scrolling
|
||||
region before scrolling on a new line.
|
||||
|
||||
<li>initialize <code>fds[]</code> array to 0's in
|
||||
<code>_nc_timed_wait()</code>; apparently <code>poll()</code> only
|
||||
sets the <code>revents</code> members of that array when there is
|
||||
activity corresponding to the related file.
|
||||
|
||||
<li>add a check for null pointer in <code>Make_Enum_Type()</code>.
|
||||
|
||||
<li>fix a heap problem with the c++ binding.
|
||||
|
||||
<li>correct missing includes for <string.h> in several places,
|
||||
including the C++ binding. This is not noted by gcc unless we use
|
||||
the <code>-fno-builtin</code> option.
|
||||
</ul>
|
||||
|
||||
<li>several fixes for tic:
|
||||
<ul>
|
||||
<li>add a check for empty buffers returned by <code>fgets()</code> in
|
||||
comp_scan.c <code>next_char()</code> function, in case
|
||||
<code>tic</code> is run on a non-text file (fixes a core dump).
|
||||
|
||||
<li>modify <code>tic</code> to verify that its inputs are really files,
|
||||
in case someone tries to read a directory (or
|
||||
<code>/dev/zero</code>).
|
||||
|
||||
<li>correct an uninitialized parameter to <code>open_tempfile()</code>
|
||||
in tic.c which made "tic -I" give an ambiguous error message about
|
||||
<code>tmpnam</code>.
|
||||
|
||||
<li>correct logic in <code>adjust_cancels()</code>, which did not check
|
||||
both alternatives when reclassifying an extended name between
|
||||
boolean, number and string, causing an infinite loop in
|
||||
<code>tic</code>.
|
||||
</ul>
|
||||
|
||||
<li>using new checks in <code>tic</code> for parameter counts in
|
||||
capability strings, found/fixed several errors both in the
|
||||
terminfo database and in the include/Caps file.
|
||||
<ul>
|
||||
<li>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".
|
||||
|
||||
<li>correct parameter counts in include/Caps for dclk as well as some
|
||||
printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp.
|
||||
</ul>
|
||||
|
||||
<li>various fixes for install scripts used to support configure
|
||||
<code>--srcdir</code> and <code>--with-install-prefix</code>.
|
||||
|
||||
<li>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.
|
||||
<li>add a workaround to ACS mapping to allow applications such as
|
||||
test/blue.c to use the "PC ROM" characters by masking them with
|
||||
A_ALTCHARSET. This worked up til 5.5, but was lost in the revision
|
||||
of legacy coding.
|
||||
</ul>
|
||||
|
||||
Portability:
|
||||
<ul>
|
||||
<li>configure script:
|
||||
<ul>
|
||||
<li>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.
|
||||
<li>configure script:
|
||||
<ul>
|
||||
<li>new options:
|
||||
<dl>
|
||||
|
||||
<li>make configure script checks on variables <code>$GCC</code> and
|
||||
<code>$GXX</code> 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.
|
||||
<dt>--with-hashed-db
|
||||
<dd>Use Berkeley hashed database for storing terminfo data rather than storing
|
||||
each compiled entry in a separate binary file within a directory
|
||||
tree.
|
||||
|
||||
<li>change configure script to use AC_CANONICAL_SYSTEM rather than
|
||||
AC_CANONICAL_HOST, which means that <code>configure --target</code>
|
||||
will set a default program-prefix.
|
||||
<dt>--without-dlsym
|
||||
<dd>Do not use <code>dlsym()</code> to load GPM dynamically.
|
||||
|
||||
<li>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).
|
||||
<dt>--with-valgrind
|
||||
<dd>Simplify building for testing with valgrind.
|
||||
|
||||
<li>modify configure test for <code>tcgetattr()</code> to allow for
|
||||
old implementations, e.g., on BeOS, which only defined it as a
|
||||
macro.
|
||||
<dt>--enable-wgetch-events
|
||||
<dd>Compile with experimental wgetch-events code.
|
||||
|
||||
<li>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.
|
||||
<dt>--enable-signed-char
|
||||
<dd>Store booleans in "signed char" rather than "char".
|
||||
|
||||
<li>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".
|
||||
</dl>
|
||||
|
||||
<li>change most remaining unquoted parameters of <code>test</code> in
|
||||
configure script to use quotes, for instance fixing a problem in the
|
||||
<code>--disable-database</code> option.
|
||||
<li>improved options:
|
||||
<dl>
|
||||
|
||||
<li>modify scripts so that "make install.data" works on OS/2 EMX.
|
||||
<dt>--disable-largefile
|
||||
<dd>make the option work both ways.
|
||||
|
||||
<li>modify scripts and makefiles so the Ada95 directory builds on
|
||||
OS/2 EMX.
|
||||
<dt>--with-gpm
|
||||
<dd>The option now accepts a parameter,
|
||||
i.e., the name of the dynamic GPM library to load via
|
||||
<code>dlopen()</code>
|
||||
|
||||
<dt>--disable-symlinks
|
||||
<dd>The option now allows one to
|
||||
disable <code>symlink()</code> in <code>tic</code> even when
|
||||
<code>link()</code> does not work.
|
||||
|
||||
</dl>
|
||||
|
||||
</ul>
|
||||
|
||||
<li>other configure/build issues: <ul> <li>remove special case for
|
||||
Darwin in <code>CF_XOPEN_SOURCE</code> configure macro.
|
||||
|
||||
<li>add configure check to ensure that <code>SIGWINCH</code> is
|
||||
defined on platforms such as OS X which exclude that when
|
||||
<code>_XOPEN_SOURCE,</code> etc., are defined
|
||||
|
||||
<li>use ld's <code>-search_paths_first</code> option on Darwin
|
||||
to work around odd search rules on that platform.
|
||||
|
||||
<li>improve ifdef's for <code>_POSIX_VDISABLE</code> in tset to
|
||||
work with Mac OS X.
|
||||
|
||||
<li>modify configure script to ensure that if the C compiler is
|
||||
used rather than the loader in making shared libraries, the
|
||||
<code>$(CFLAGS)</code> variable is also used.
|
||||
|
||||
<li>use <code>${CC}</code> rather than <code>${LD}</code> in
|
||||
shared library rules for IRIX64, Solaris to help ensure
|
||||
that initialization sections are provided for extra linkage
|
||||
requirements, e.g., of C++ applications.
|
||||
|
||||
<li>improve some shared-library configure scripting for Linux,
|
||||
FreeBSD and NetBSD to make
|
||||
<code>--with-shlib-version</code> work.
|
||||
|
||||
<li>split up dependency of <code>names.c</code> and
|
||||
<code>codes.c</code> in <code>ncurses/Makefile</code> to
|
||||
work with parallel make.
|
||||
|
||||
<li>modify <code>MKlib_gen.sh</code> to change
|
||||
preprocessor-expanded <code>_Bool</code> back to <code>bool</code>.
|
||||
|
||||
<li>modify <code>progs/Makefile.in</code> to make
|
||||
<code>tput init</code> work properly with cygwin,
|
||||
i.e., do not pass a <code>.exe</code> in the reference
|
||||
string used in check_aliases.
|
||||
</ul>
|
||||
|
||||
<li>library:
|
||||
<ul>
|
||||
<li>replaced case-statement in <code>_nc_tracebits()</code> for CSIZE
|
||||
with a table to simplify working around implementations that define
|
||||
random combinations of the related macros to zero.
|
||||
<li>ignore wide-acs line-drawing characters that
|
||||
<code>wcwidth()</code> claims are not one-column. This is
|
||||
a workaround for Solaris' broken locale support.
|
||||
|
||||
<li>improved OS/2 mouse support by retrying as a 2-button mouse if code
|
||||
fails to set up a 3-button mouse.
|
||||
<li>reduce name-pollution in <code>term.h</code> by removing
|
||||
<code>#define</code>'s for HAVE_xxx symbols.
|
||||
|
||||
<li>added private entrypoint <code>_nc_basename()</code>, used to
|
||||
consolidate related code in progs, as well as accommodating OS/2 EMX
|
||||
pathnames.
|
||||
|
||||
<li>alter definition of NCURSES_CONST to make it non-empty.
|
||||
|
||||
<li>redefine 'TEXT' in menu.h for AMIGA, since it is reported to have
|
||||
an (unspecified) symbol conflict.
|
||||
<li>fix <code>#ifdef</code> in <code>c++/internal.h</code> for
|
||||
QNX 6.1
|
||||
</ul>
|
||||
|
||||
<li>programs:
|
||||
<ul>
|
||||
<li>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).
|
||||
</ul>
|
||||
<li>test programs: <ul> <li>modify <code>test/configure</code> script
|
||||
to allow building test programs with PDCurses/X11.
|
||||
|
||||
<li>modified test programs to allow some to work with NetBSD
|
||||
curses. Several do not because NetBSD curses implements a
|
||||
subset of X/Open curses, and also lacks much of SVr4
|
||||
additions. But it is enough for comparison.
|
||||
|
||||
<li>improved <code>test/configure</code> to build test/ncurses
|
||||
on HPUX 11 using the vendor curses.
|
||||
|
||||
<li>change configure script to produce
|
||||
<code>test/Makefile</code> from data file.
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<H1>Features of Ncurses</H1>
|
||||
@ -390,14 +390,15 @@ The ncurses package also has many useful extensions over SVr4:
|
||||
<UL>
|
||||
<LI>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
|
||||
and most EXTENDED features).
|
||||
It includes many function calls not supported under SVr4 curses
|
||||
(but portability of all
|
||||
calls is documented so you can use the SVr4 subset only).
|
||||
<LI>Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner
|
||||
of the screen if your terminal has an insert-character capability.
|
||||
<LI>Ada95 and C++ bindings.
|
||||
<LI>Support for mouse event reporting with X Window xterm and OS/2 console windows.
|
||||
<LI>Support for mouse event reporting with X Window xterm
|
||||
and FreeBSD and OS/2 console windows.
|
||||
<LI>Extended mouse support via Alessandro Rubini's gpm package.
|
||||
<LI>The function <CODE>wresize()</CODE> allows you to resize windows, preserving
|
||||
their data.
|
||||
@ -409,7 +410,7 @@ and <CODE>define_key()</CODE> allow
|
||||
you to better control the use of function keys,
|
||||
e.g., disabling the ncurses KEY_MOUSE,
|
||||
or by defining more than one control sequence to map to a given key code.
|
||||
<LI>Support for 16-color terminals, such as aixterm and XFree86 xterm.
|
||||
<LI>Support for 16-color terminals, such as aixterm and modern xterm.
|
||||
<LI>Better cursor-movement optimization. The package now features a
|
||||
cursor-local-movement computation more efficient than either BSD's
|
||||
or System V's.
|
||||
@ -477,61 +478,61 @@ including (versions starting with those noted):
|
||||
<DT> cdk
|
||||
<DD> Curses Development Kit
|
||||
<br>
|
||||
<A HREF="http://www.vexus.ca/CDK.html">http://www.vexus.ca/CDK.html</a>
|
||||
<A HREF="http://invisible-island.net/cdk/">http://invisible-island.net/cdk/</A>
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/cdk/cdk.html">http://dickey.his.com/cdk</A>.
|
||||
<A HREF="http://www.vexus.ca/products/CDK/">http://www.vexus.ca/products/CDK/</a>
|
||||
<DT> ded
|
||||
<DD> directory-editor
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/ded/ded.html">http://dickey.his.com/ded</A>.
|
||||
<A HREF="http://invisible-island.net/ded/">http://invisible-island.net/ded/</A>
|
||||
<DT> dialog
|
||||
<DD> the underlying application used in Slackware's setup, and the basis
|
||||
for similar applications on GNU/Linux.
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/dialog/dialog.html">http://dickey.his.com/dialog</A>.
|
||||
<A HREF="http://invisible-island.net/dialog/">http://invisible-island.net/dialog/</A>
|
||||
<DT> lynx
|
||||
<DD> the character-screen WWW browser
|
||||
<br>
|
||||
<A HREF="http://lynx.isc.org/release/">http://lynx.isc.org/release</A>.
|
||||
<DT> Midnight Commander 4.1
|
||||
<A HREF="http://lynx.isc.org/release/">http://lynx.isc.org/release/</A>
|
||||
<DT> Midnight Commander
|
||||
<DD> file manager
|
||||
<br>
|
||||
<A HREF="www.gnome.org/mc/">www.gnome.org/mc/</A>.
|
||||
<A HREF="http://www.ibiblio.org/mc/">http://www.ibiblio.org/mc/</A>
|
||||
<DT> mutt
|
||||
<DD> mail utility
|
||||
<br>
|
||||
<A HREF="http://www.mutt.org">http://www.mutt.org</A>.
|
||||
<A HREF="http://www.mutt.org/">http://www.mutt.org/</A>
|
||||
<DT> ncftp
|
||||
<DD> file-transfer utility
|
||||
<br>
|
||||
<A HREF="http://www.ncftp.com">http://www.ncftp.com</A>.
|
||||
<A HREF="http://www.ncftp.com/">http://www.ncftp.com/</A>
|
||||
<DT> nvi
|
||||
<DD> New vi versions 1.50 are able to use ncurses versions 1.9.7 and later.
|
||||
<br>
|
||||
<A HREF="http://www.bostic.com/vi/">http://www.bostic.com/vi/</A>.
|
||||
<A HREF="http://www.bostic.com/vi/">http://www.bostic.com/vi/</A>
|
||||
<br>
|
||||
<DT> pinfo
|
||||
<DD> Lynx-like info browser.
|
||||
<A HREF="http://dione.ids.pl/~pborys/software/pinfo/">http://dione.ids.pl/~pborys/software/pinfo/</A>
|
||||
<DT> tin
|
||||
<DD> newsreader, supporting color, MIME
|
||||
<br>
|
||||
<A HREF="http://www.tin.org">http://www.tin.org</A>.
|
||||
<DT> taper
|
||||
<DD> tape archive utility
|
||||
<br>
|
||||
<A HREF="http://members.iinet.net.au/~yusuf/taper/">http://members.iinet.net.au/~yusuf/taper/</A>.
|
||||
<A HREF="http://www.tin.org/">http://www.tin.org/</A>
|
||||
<DT> vh-1.6
|
||||
<DD> Volks-Hypertext browser for the Jargon File
|
||||
<br>
|
||||
<A HREF="http://www.bg.debian.org/Packages/unstable/text/vh.html">http://www.bg.debian.org/Packages/unstable/text/vh.html</A>.
|
||||
<A HREF="http://www.debian.org/Packages/unstable/text/vh.html">http://www.debian.org/Packages/unstable/text/vh.html</A>
|
||||
</DL>
|
||||
as well as some that use ncurses for the terminfo support alone:
|
||||
<DL>
|
||||
<DT> minicom
|
||||
<DD> terminal emulator
|
||||
<br>
|
||||
<A HREF="http://www.pp.clinet.fi/~walker/minicom.html">http://www.pp.clinet.fi/~walker/minicom.html</A>.
|
||||
<A HREF="http://alioth.debian.org/projects/minicom/">
|
||||
http://alioth.debian.org/projects/minicom/</A>
|
||||
<DT> vile
|
||||
<DD> vi-like-emacs
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/vile/vile.html">http://dickey.his.com/vile</A>.
|
||||
<A HREF="http://invisible-island.net/vile/">http://invisible-island.net/vile/</A>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
@ -540,16 +541,16 @@ a few games).
|
||||
|
||||
<H2>Who's Who and What's What</H2>
|
||||
|
||||
The original developers of ncurses are <A
|
||||
HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim</A> and
|
||||
<A HREF="http://www.ccil.org/~esr/home.html">Eric S. Raymond</A>.
|
||||
Zeyd Ben-Halim
|
||||
started it from a previous package pcurses, written by Pavel Curtis.
|
||||
Eric S. Raymond
|
||||
continued development.
|
||||
Jürgen Pfeifer wrote most of the form and menu libraries.
|
||||
Ongoing work is being done by
|
||||
<A HREF="mailto:dickey@herndon4.his.com">Thomas Dickey</A>
|
||||
and
|
||||
<A HREF="mailto:juergen.pfeifer@gmx.net">Jürgen Pfeifer</A>.
|
||||
<A HREF="mailto:dickey@herndon4.his.com">Thomas Dickey</A>
|
||||
acts as the maintainer for the Free Software Foundation, which holds the
|
||||
copyright on ncurses.
|
||||
<A HREF="mailto:dickey@invisible-island.net">Thomas Dickey</A>.
|
||||
Thomas Dickey
|
||||
acts as the maintainer for the Free Software Foundation,
|
||||
which holds the copyright on ncurses.
|
||||
Contact the current maintainers at
|
||||
<A HREF="mailto:bug-ncurses@gnu.org">bug-ncurses@gnu.org</A>.
|
||||
<P>
|
||||
@ -564,7 +565,7 @@ This list is open to anyone interested in helping with the development and
|
||||
testing of this package.<P>
|
||||
|
||||
Beta versions of ncurses and patches to the current release are made available at
|
||||
<A HREF="ftp://dickey.his.com/ncurses">ftp://dickey.his.com/ncurses</A>.
|
||||
<A HREF="ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</A> .
|
||||
|
||||
<H2>Future Plans</H2>
|
||||
<UL>
|
||||
@ -576,14 +577,17 @@ on them, please join the ncurses list.
|
||||
|
||||
<H2>Other Related Resources</H2>
|
||||
|
||||
The distribution includes and uses a version of the terminfo-format
|
||||
terminal description file maintained by Eric Raymond.
|
||||
<A HREF="http://earthspace.net/~esr/terminfo">http://earthspace.net/~esr/terminfo</A>.<P>
|
||||
The distribution provides a newer version of the terminfo-format
|
||||
terminal description file once maintained by
|
||||
<A HREF="http://www.catb.org/~esr/terminfo/">Eric Raymond</A> .
|
||||
Unlike the older version, the termcap and terminfo data are provided
|
||||
in the same file, and provides several user-definable extensions
|
||||
beyond the X/Open specification.<P>
|
||||
|
||||
You can find lots of information on terminal-related topics
|
||||
not covered in the terminfo file at
|
||||
<A HREF="http://www.cs.utk.edu/~shuford/terminal_index.html">Richard Shuford's
|
||||
archive</A>.
|
||||
archive</A> .
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!--
|
||||
|
843
contrib/ncurses/config.guess
vendored
843
contrib/ncurses/config.guess
vendored
File diff suppressed because it is too large
Load Diff
363
contrib/ncurses/config.sub
vendored
363
contrib/ncurses/config.sub
vendored
@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2002-04-26'
|
||||
timestamp='2006-08-14'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@ -21,14 +22,15 @@ timestamp='2002-04-26'
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
#
|
||||
@ -70,7 +72,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
@ -83,11 +85,11 @@ Try \`$me --help' for more information."
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
--time-stamp | --time* | -t )
|
||||
echo "$timestamp" ; exit 0 ;;
|
||||
echo "$timestamp" ; exit ;;
|
||||
--version | -v )
|
||||
echo "$version" ; exit 0 ;;
|
||||
echo "$version" ; exit ;;
|
||||
--help | --h* | -h )
|
||||
echo "$usage"; exit 0 ;;
|
||||
echo "$usage"; exit ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
- ) # Use stdin as input.
|
||||
@ -99,7 +101,7 @@ while test $# -gt 0 ; do
|
||||
*local*)
|
||||
# First pass through any local machine types.
|
||||
echo $1
|
||||
exit 0;;
|
||||
exit ;;
|
||||
|
||||
* )
|
||||
break ;;
|
||||
@ -118,7 +120,9 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@ -144,7 +148,7 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis)
|
||||
-apple | -axis | -knuth | -cray)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
@ -169,6 +173,10 @@ case $os in
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco6)
|
||||
os=-sco5v6
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco5)
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@ -185,6 +193,10 @@ case $os in
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco5v6*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@ -228,31 +240,51 @@ case $basic_machine in
|
||||
| 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 \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dsp16xx \
|
||||
| fr30 \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
|
||||
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
|
||||
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
|
||||
| mipsisa32 | mipsisa64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc | or32 \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
@ -263,6 +295,9 @@ case $basic_machine in
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||
;;
|
||||
ms1)
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
@ -281,38 +316,59 @@ case $basic_machine in
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c54x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| m32r-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
|
||||
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
|
||||
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
| mips64vr5900-* | mips64vr5900el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
| xtensa-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
@ -332,6 +388,9 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
@ -346,6 +405,12 @@ case $basic_machine in
|
||||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amd64-*)
|
||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
@ -405,12 +470,27 @@ case $basic_machine in
|
||||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
craynv)
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
crisv32 | crisv32-* | etraxfs*)
|
||||
basic_machine=crisv32-axis
|
||||
;;
|
||||
cris | cris-* | etrax*)
|
||||
basic_machine=cris-axis
|
||||
;;
|
||||
crx)
|
||||
basic_machine=crx-unknown
|
||||
os=-elf
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
@ -433,6 +513,10 @@ case $basic_machine in
|
||||
basic_machine=m88k-motorola
|
||||
os=-sysv3
|
||||
;;
|
||||
djgpp)
|
||||
basic_machine=i586-pc
|
||||
os=-msdosdjgpp
|
||||
;;
|
||||
dpx20 | dpx20-*)
|
||||
basic_machine=rs6000-bull
|
||||
os=-bosx
|
||||
@ -611,10 +695,6 @@ case $basic_machine in
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
mmix*)
|
||||
basic_machine=mmix-knuth
|
||||
os=-mmixware
|
||||
;;
|
||||
monitor)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
@ -627,6 +707,9 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
;;
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
@ -702,9 +785,12 @@ case $basic_machine in
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
or32 | or32-*)
|
||||
openrisc | openrisc-*)
|
||||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
os400)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-os400
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
@ -728,49 +814,61 @@ case $basic_machine in
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pc98)
|
||||
basic_machine=i386-pc
|
||||
;;
|
||||
pc98-*)
|
||||
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
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)
|
||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium4)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
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-*)
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
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/^[^-]*-//'`
|
||||
;;
|
||||
@ -781,6 +879,10 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
@ -801,6 +903,20 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sb1)
|
||||
basic_machine=mipsisa64sb1-unknown
|
||||
;;
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sde)
|
||||
basic_machine=mipsisa32-sde
|
||||
os=-elf
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@ -808,6 +924,9 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
@ -866,7 +985,7 @@ case $basic_machine in
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
sv1)
|
||||
sv1)
|
||||
basic_machine=sv1-cray
|
||||
os=-unicos
|
||||
;;
|
||||
@ -874,10 +993,6 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
t3d)
|
||||
basic_machine=alpha-cray
|
||||
os=-unicos
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=alphaev5-cray
|
||||
os=-unicos
|
||||
@ -890,6 +1005,14 @@ case $basic_machine in
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@ -903,6 +1026,10 @@ case $basic_machine in
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
tpf)
|
||||
basic_machine=s390x-ibm
|
||||
os=-tpf
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
@ -924,8 +1051,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
|
||||
@ -946,11 +1073,11 @@ case $basic_machine in
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
windows32)
|
||||
basic_machine=i386-pc
|
||||
os=-windows32-msvcrt
|
||||
xbox)
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
xps | xps100)
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
ymp)
|
||||
@ -980,6 +1107,9 @@ case $basic_machine in
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
mmix)
|
||||
basic_machine=mmix-knuth
|
||||
;;
|
||||
rs6000)
|
||||
basic_machine=rs6000-ibm
|
||||
;;
|
||||
@ -996,16 +1126,13 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb)
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
@ -1020,10 +1147,6 @@ case $basic_machine in
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
@ -1079,18 +1202,23 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -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* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* )
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1102,16 +1230,21 @@ case $os in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-nto-qnx*)
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
|
||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux-dietlibc)
|
||||
os=-linux-dietlibc
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@ -1124,6 +1257,9 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
@ -1145,6 +1281,9 @@ case $os in
|
||||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-syllable*)
|
||||
os=-syllable
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
@ -1155,7 +1294,7 @@ case $os in
|
||||
os=-rtmk-nova
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk*)
|
||||
os=-nsk
|
||||
@ -1167,6 +1306,9 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
@ -1194,8 +1336,17 @@ case $os in
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
@ -1219,6 +1370,9 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@ -1228,11 +1382,14 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
;;
|
||||
pdp11-*)
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
@ -1271,9 +1428,15 @@ case $basic_machine in
|
||||
*-be)
|
||||
os=-beos
|
||||
;;
|
||||
*-haiku)
|
||||
os=-haiku
|
||||
;;
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-knuth)
|
||||
os=-mmixware
|
||||
;;
|
||||
*-wec)
|
||||
os=-proelf
|
||||
;;
|
||||
@ -1325,19 +1488,19 @@ 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)
|
||||
@ -1406,9 +1569,15 @@ case $basic_machine in
|
||||
-mvs* | -opened*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-os400*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-tpf*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
@ -1433,7 +1602,7 @@ case $basic_machine in
|
||||
esac
|
||||
|
||||
echo $basic_machine$os
|
||||
exit 0
|
||||
exit
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
|
17015
contrib/ncurses/configure
vendored
17015
contrib/ncurses/configure
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,34 @@
|
||||
extproc perl -S -w
|
||||
|
||||
# $Id: convert_configure.pl,v 1.3 2006/04/22 23:04:06 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
|
||||
# The converted script is written to stdout, so run this script as
|
||||
# convert_configure configure > configure.cmd
|
||||
#
|
||||
|
@ -1,4 +1,31 @@
|
||||
# $Id: dist.mk,v 1.306 2002/06/15 17:13:40 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.567 2006/12/17 19:58:35 tom Exp $
|
||||
# Makefile for creating ncurses distributions.
|
||||
#
|
||||
# This only needs to be used directly as a makefile by developers, but
|
||||
@ -9,13 +36,18 @@ SHELL = /bin/sh
|
||||
|
||||
# These define the major/minor/patch versions of ncurses.
|
||||
NCURSES_MAJOR = 5
|
||||
NCURSES_MINOR = 2
|
||||
NCURSES_PATCH = 20020615
|
||||
NCURSES_MINOR = 6
|
||||
NCURSES_PATCH = 20061217
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
||||
DUMP = lynx -dump
|
||||
# The most recent html files were generated with lynx 2.8.6, using ncurses
|
||||
# configured with
|
||||
# --without-manpage-renames
|
||||
# on Debian/testing. The -scrollbar and -width options are used to make lynx
|
||||
# use 79 columns as it did in 2.8.5 and before.
|
||||
DUMP = lynx -dump -scrollbar=0 -width=79
|
||||
DUMP2 = $(DUMP) -nolist
|
||||
|
||||
GNATHTML= `type -p gnathtml || type -p gnathtml.pl`
|
||||
@ -24,8 +56,10 @@ GNATHTML= `type -p gnathtml || type -p gnathtml.pl`
|
||||
# Not all man programs agree with this assumption; some use half-spacing, which
|
||||
# has the effect of lengthening the text portion of the page -- so man2html
|
||||
# would remove some text. The man program on Redhat 6.1 appears to work with
|
||||
# man2html if we set the top/bottom margins to 6 (the default is 7).
|
||||
MAN2HTML= man2html -botm=6 -topm=6 -cgiurl '$$title.$$section$$subsection.html'
|
||||
# man2html if we set the top/bottom margins to 6 (the default is 7). Newer
|
||||
# versions of 'man' on Linux leave no margin (and make it harder to sync with
|
||||
# pages).
|
||||
MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html'
|
||||
|
||||
ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml
|
||||
|
||||
@ -35,7 +69,7 @@ dist: $(ALL)
|
||||
(cd ..; tar cvf ncurses-$(VERSION).tar `sed <ncurses-$(VERSION)/MANIFEST 's/^./ncurses-$(VERSION)/'`; gzip ncurses-$(VERSION).tar)
|
||||
|
||||
distclean:
|
||||
rm -f $(ALL) subst.tmp subst.sed MANIFEST.tmp
|
||||
rm -f $(ALL) subst.tmp subst.sed
|
||||
|
||||
# Don't mess with announce.html.in unless you have lynx available!
|
||||
doc/html/announce.html: announce.html.in
|
||||
@ -49,9 +83,17 @@ doc/ncurses-intro.doc: doc/html/ncurses-intro.html
|
||||
doc/hackguide.doc: doc/html/hackguide.html
|
||||
$(DUMP2) doc/html/hackguide.html > $@
|
||||
|
||||
MANPROG = tbl | nroff -man
|
||||
# This is the original command:
|
||||
# MANPROG = tbl | nroff -man
|
||||
#
|
||||
# This happens to work for groff 1.18.1 on Debian. At some point groff's
|
||||
# maintainer changed the line-length (we do not want/need that here).
|
||||
#
|
||||
# The distributed html files are formatted using
|
||||
# configure --without-manpage-renames
|
||||
MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii
|
||||
|
||||
manhtml: MANIFEST
|
||||
manhtml:
|
||||
@rm -f doc/html/man/*.html
|
||||
@mkdir -p doc/html/man
|
||||
@rm -f subst.tmp ;
|
||||
@ -68,8 +110,10 @@ manhtml: MANIFEST
|
||||
@echo 's/<\/B>/<\/STRONG>/g' >> subst.tmp
|
||||
@echo 's/<I>/<EM>/g' >> subst.tmp
|
||||
@echo 's/<\/I>/<\/EM>/g' >> subst.tmp
|
||||
@echo 's/<\/TITLE>/<\/TITLE><link rev=made href="mailto:bug-ncurses@gnu.org">/' >> subst.tmp
|
||||
@sort < subst.tmp | uniq > subst.sed
|
||||
@misc/csort < subst.tmp | uniq > subst.sed
|
||||
@echo '/<\/TITLE>/a\' >> subst.sed
|
||||
@echo '<link rev=made href="mailto:bug-ncurses@gnu.org">\' >> subst.sed
|
||||
@echo '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">' >> subst.sed
|
||||
@rm -f subst.tmp
|
||||
@for f in man/*.[0-9]* ; do \
|
||||
m=`basename $$f` ;\
|
||||
@ -86,47 +130,28 @@ manhtml: MANIFEST
|
||||
-e 's/>/\>/g' \
|
||||
>> doc/html/man/$$g ;\
|
||||
echo '-->' >> doc/html/man/$$g ;\
|
||||
man/edit_man.sh editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \
|
||||
./edit_man.sh normal editing /usr/man man $$f | $(MANPROG) | tr '\255' '-' | $(MAN2HTML) -title "$$T" | \
|
||||
sed -f subst.sed |\
|
||||
sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \
|
||||
>> doc/html/man/$$g ;\
|
||||
done
|
||||
@rm -f subst.sed
|
||||
@sed -e "\%./doc/html/man/%d" < MANIFEST > MANIFEST.tmp
|
||||
@find ./doc/html/man -type f -print >> MANIFEST.tmp
|
||||
@chmod u+w MANIFEST
|
||||
@sort -u < MANIFEST.tmp > MANIFEST
|
||||
@rm -f MANIFEST.tmp
|
||||
|
||||
#
|
||||
# Please note that this target can only be properly built if the build of the
|
||||
# Ada95 subdir has been done. The reason is, that the gnathtml tool uses the
|
||||
# .ali files generated by the Ada95 compiler during the build process. These
|
||||
# .ali files contain cross referencing information required by gnathtml.
|
||||
adahtml: MANIFEST
|
||||
adahtml:
|
||||
if [ ! -z "$(GNATHTML)" ]; then \
|
||||
(cd ./Ada95/gen ; make html) ;\
|
||||
sed -e "\%./doc/html/ada/%d" < MANIFEST > MANIFEST.tmp ;\
|
||||
find ./doc/html/ada -type f -print >> MANIFEST.tmp ;\
|
||||
sort -u < MANIFEST.tmp > MANIFEST ;\
|
||||
rm -f MANIFEST.tmp ;\
|
||||
fi
|
||||
|
||||
# Prepare distribution for version control
|
||||
vcprepare:
|
||||
find . -type d -exec mkdir {}/RCS \;
|
||||
|
||||
# Write-lock almost all files not under version control.
|
||||
ADA_EXCEPTIONS=$(shell eval 'a="\\\\\|";for x in Ada95/gen/terminal*.m4; do echo -n $${a}Ada95/ada_include/`basename $${x} .m4`; done')
|
||||
EXCEPTIONS = 'announce.html$\\|ANNOUNCE\\|misc/.*\\.doc\\|man/terminfo.5\\|lib_gen.c'$(ADA_EXCEPTIONS)
|
||||
writelock:
|
||||
for x in `grep -v $(EXCEPTIONS) MANIFEST`; do if [ ! -f `dirname $$x`/RCS/`basename $$x`,v ]; then chmod a-w $${x}; fi; done
|
||||
|
||||
# This only works on a clean source tree, of course.
|
||||
MANIFEST:
|
||||
-rm -f $@
|
||||
touch $@
|
||||
find . -type f -print |sort | fgrep -v .lsm |fgrep -v .spec >$@
|
||||
find . -type f -print |misc/csort | fgrep -v .lsm |fgrep -v .spec >$@
|
||||
|
||||
TAGS:
|
||||
etags */*.[ch]
|
||||
|
File diff suppressed because it is too large
Load Diff
6413
contrib/ncurses/doc/html/NCURSES-Programming-HOWTO.html
Normal file
6413
contrib/ncurses/doc/html/NCURSES-Programming-HOWTO.html
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<!--
|
||||
$Id: announce.html,v 1.39 2000/10/20 10:47:16 tom Exp $
|
||||
$Id: announce.html,v 1.51 2006/12/17 23:32:42 tom Exp $
|
||||
****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Announcing ncurses 5.2</TITLE>
|
||||
<TITLE>Announcing ncurses 5.6</TITLE>
|
||||
<link rev=made href="mailto:bug-ncurses@gnu.org">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H1>Announcing ncurses 5.2</H1>
|
||||
<H1>Announcing ncurses 5.6</H1>
|
||||
|
||||
The ncurses (new curses) library is a free software emulation of
|
||||
curses in System V Release 4.0, and more. It uses terminfo format,
|
||||
@ -18,12 +46,15 @@ and multiple highlights and forms characters and function-key mapping,
|
||||
and has all the other SYSV-curses enhancements over BSD curses.<P>
|
||||
|
||||
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
|
||||
considered 4.4BSD curses obsolete, and encouraged the keepers of
|
||||
Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to
|
||||
ncurses.<P>
|
||||
|
||||
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!<P>
|
||||
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!<P>
|
||||
|
||||
The distribution includes the library and support utilities, including a
|
||||
terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1),
|
||||
@ -32,333 +63,305 @@ the library and tools.<P>
|
||||
|
||||
The ncurses distribution is available via anonymous FTP at
|
||||
the GNU distribution site
|
||||
<A HREF="ftp://ftp.gnu.org/pub/gnu/ncurses">ftp://ftp.gnu.org/pub/gnu/ncurses</A>.
|
||||
<A HREF="ftp://ftp.gnu.org/gnu/ncurses/">ftp://ftp.gnu.org/gnu/ncurses/</A> .
|
||||
<br>It is also available at
|
||||
<A HREF="ftp://dickey.his.com/ncurses">ftp://dickey.his.com/ncurses</A>.
|
||||
<A HREF="ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</A> .
|
||||
|
||||
<H1>Release Notes</H1>
|
||||
|
||||
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 through 5.5;
|
||||
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.5 release.
|
||||
<p>
|
||||
Interface changes:
|
||||
<ul>
|
||||
<li>change type of <code>ospeed</code> variable back to
|
||||
<code>short</code> to match its use in legacy applications. It was
|
||||
altered after ncurses 4.2 to <code>speed_t</code> to repair a type
|
||||
mismatch which was introduced after 1.9.4 in 1995. The principal
|
||||
users of termcap continued to use <code>short</code>, which is
|
||||
not the same size.
|
||||
<p>
|
||||
<em>NOTE</em>: 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 <code>nm</code> or <code>strings</code>.
|
||||
<li>generate linkable stubs for some macros:
|
||||
<br>
|
||||
getbegx, getbegy, getcurx, getcury, getmaxx, getmaxy, getparx,
|
||||
getpary, getpary,
|
||||
<br>
|
||||
and (for libncursesw)
|
||||
<br>
|
||||
wgetbkgrnd
|
||||
|
||||
<li>remove a private function <code>_nc_can_clear_with()</code>, which
|
||||
was built with the configure --enable-expanded option but not used.
|
||||
|
||||
<li>add several private functions (prefixed with "_nc_") for tracing
|
||||
<code>chtype</code> values in the debug library, and for better
|
||||
access and buffer limit checking.
|
||||
</ul>
|
||||
New features and improvements:
|
||||
<ul>
|
||||
<li>rewrote <code>tgoto()</code> 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, <code>tgoto()</code>
|
||||
will interpret it as termcap. Otherwise, as before, it will use
|
||||
<code>tparm()</code>.
|
||||
|
||||
<li>to ensure that the <code>tgoto()</code> changes work properly,
|
||||
added checks to <code>tic</code> which report capabilities that do
|
||||
not reference the expected number of parameters.
|
||||
|
||||
<li>new configure script options:
|
||||
<li>library
|
||||
<ul>
|
||||
<li>option <code>--disable-root-environ</code> adds runtime checks
|
||||
which tell ncurses to disregard $TERMINFO and similar environment
|
||||
variables if the current user is root, or running setuid/setgid.
|
||||
<li>support hashed databases for the terminal descriptions.
|
||||
This uses the Berkeley database, has been tested for
|
||||
several versions on different platforms.
|
||||
|
||||
<li>option <code>--disable-assumed-color</code> allows you to use the
|
||||
pre-5.1 convention of default colors used for color-pair 0 to be
|
||||
configured (see assume_default_colors()).
|
||||
<li>add <code>use_legacy_coding()</code> function to support
|
||||
lynx's font-switching feature.
|
||||
|
||||
<li>implement configure script options that transform installed
|
||||
program names, e.g., <code>--program-prefix</code>, including the
|
||||
manpage names and cross references.
|
||||
<li>add extension <code>nofilter()</code>, to cancel a prior
|
||||
<code>filter()</code> call.
|
||||
|
||||
<li>option <code>--with-database</code> 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
|
||||
<li>add/install a package config script, e.g.,
|
||||
<code>ncurses5-config</code> or
|
||||
<code>ncursesw5-config</code>, according to
|
||||
configuration options.
|
||||
|
||||
<li>option <code>--with-default-terminfo-dir</code> allows you to
|
||||
specify the default terminfo database directory.
|
||||
<li>provide ifdef for <code>NCURSES_NOMACROS</code> which
|
||||
suppresses most macro definitions from curses.h, i.e.,
|
||||
where a macro is defined to override a function to improve
|
||||
performance.
|
||||
|
||||
<li>option <code>--with-libtool</code> allows you to build with
|
||||
<code>libtool</code>. <p> <em>NOTE</em>: <code>libtool</code>
|
||||
uses a different notation for numbering shared library versions
|
||||
from the existing ncurses configuration.
|
||||
<li>make ifdef's consistent in <code>curses.h</code> for the
|
||||
extended colors so the header file can be used for the
|
||||
normal curses library. The header file installed for
|
||||
extended colors is a variation of the wide-character
|
||||
configuration.
|
||||
|
||||
<li>option <code>--with-manpage-tbl</code> causes the manpages to be
|
||||
preprocessed by tbl(1) prior to installation,
|
||||
<li>improve <code>tgetstr()</code> by making the return value
|
||||
point into the user's buffer, if provided.
|
||||
|
||||
<li>option <code>--without-curses-h</code> causes the installation
|
||||
process to install curses.h as ncurses.h and make appropriate
|
||||
changes to headers and manpages.
|
||||
<li>add ifdef's allowing ncurses to be built with
|
||||
<code>tparm()</code> using either varargs (the existing
|
||||
status), or using a fixed-parameter list (to match X/Open).
|
||||
|
||||
<li>widen the test for xterm <code>kmous</code> a little to
|
||||
<code>allow</code> for other
|
||||
strings than "\E[M", e.g., for <code>xterm-sco</code>
|
||||
functionality in xterm.
|
||||
|
||||
<li>modify <code>wgetnstr()</code> to return
|
||||
<code>KEY_RESIZE</code> if a sigwinch occurs.
|
||||
|
||||
<li>move prototypes for wide-character trace functions from
|
||||
curses.tail to curses.wide to avoid accidental reference to
|
||||
those if <code>_XOPEN_SOURCE_EXTENDED</code> is defined
|
||||
without ensuring that <wchar.h> is included.
|
||||
|
||||
<li>change the way shared libraries (other than libtool) are
|
||||
installed. Rather than copying the build-tree's libraries,
|
||||
link the shared objects into the install directory. This
|
||||
makes the <code>--with-rpath</code> option work except with
|
||||
<code>$(DESTDIR)</code>.
|
||||
|
||||
<li>several improvements for rendering in hpterm. These are
|
||||
only available if the library is configured using
|
||||
<code>--enable-xmc-glitch</code>.
|
||||
|
||||
<li>Add <code>NCURSES_NO_HARD_TABS</code> and
|
||||
<code>NCURSES_NO_MAGIC_COOKIE</code> environment variables
|
||||
to allow runtime suppression of the related hard-tabs and
|
||||
xmc-glitch features.
|
||||
</ul>
|
||||
|
||||
<li>modified configure script options:
|
||||
<li>programs:
|
||||
<ul>
|
||||
<li>change symbol used by the <code>--install-prefix</code> configure
|
||||
option from <code>INSTALL_PREFIX</code> to <code>DESTDIR</code>
|
||||
(the latter has become common usage although the name is
|
||||
misleading).
|
||||
<li>add new test programs: chgat.c, demo_altkeys.c,
|
||||
echochar.c, foldkeys.c, movewindow.c, redraw.c, (noting
|
||||
that existing test programs also were modified to test
|
||||
additional features).
|
||||
|
||||
<li>modify <code>ld -rpath</code> 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.
|
||||
<li>modify tack to test extended capability function-key
|
||||
strings.
|
||||
|
||||
<li>modified <code>misc/run_tic.in</code> to use
|
||||
<code>tic -o</code>, to eliminate dependency on
|
||||
<code>$TERMINFO</code> variable for installs.
|
||||
<li>modify toe to access termcap data, e.g., via <code>cgetent()</code>
|
||||
functions, or as a text file if those are not available.
|
||||
|
||||
<li>improve infocmp/tic <code>-f</code> option formatting.
|
||||
|
||||
<li>add <code>toe -a</code> option, to show all databases.
|
||||
This uses new private interfaces in the ncurses library for
|
||||
iterating through the list of databases.
|
||||
|
||||
<li>modify <code>MKfallback.sh</code> to use
|
||||
<code>tic -x</code> when constructing fallback tables to
|
||||
allow extended capabilities to be retrieved from a fallback entry.
|
||||
</ul>
|
||||
|
||||
<li>terminfo database:
|
||||
<li>terminal database
|
||||
<ul>
|
||||
<li>updated xterm terminfo entries to match XFree86 xterm patch #146.
|
||||
|
||||
<li>added amiga-vnc,
|
||||
Matrix Orbital, and
|
||||
QNX qansi to misc/terminfo.src.
|
||||
|
||||
<li>added os2 entry to misc/emx.src.
|
||||
|
||||
<li>add S0 and E0 extensions to <code>screen</code>'s terminfo entry
|
||||
since otherwise the FreeBSD port makes it pass termcap equivalents
|
||||
to <code>tgoto</code>, which would be misinterpreted by older
|
||||
versions of ncurses.
|
||||
<li>add terminfo entries for xfce terminal (xfce) and multi gnome terminal (mgt)
|
||||
<li>add nsterm-16color entry
|
||||
<li>updated mlterm terminfo entry
|
||||
<li>add kon, kon2 and jfbterm terminfo entry
|
||||
<li>remove invis capability from klone+sgr, mainly used by linux entry, since it does not really do this
|
||||
<li>add ka2, kb1, kb3, kc2 to vt220-keypad as an extension
|
||||
<li>add shifted up/down arrow codes to xterm-new as kind/kri strings
|
||||
<li>add hpterm-color terminfo entry
|
||||
<li>add 256color variants of terminfo entries for programs which are reported to implement this feature
|
||||
<li>correct order of use-clauses in rxvt-basic entry which made codes for f1-f4 vt100-style rather than vt220-style.
|
||||
</ul>
|
||||
|
||||
<li>improvements to program usability:
|
||||
<ul>
|
||||
<li>modify programs to use <code>curses_version()</code> 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.
|
||||
|
||||
<li>modify <code>tput</code> program so it can be renamed or invoked via a link as
|
||||
'reset' or 'init', producing the same effect as <code>tput reset</code> or <code>tput init</code>.
|
||||
|
||||
<li>add error checking to infocmp's -v and -m options to ensure that
|
||||
the option value is indeed a number.
|
||||
</ul>
|
||||
|
||||
<li>improved performance:
|
||||
<ul>
|
||||
<li>replace a lookup table in lib_vidattr.c used to decode
|
||||
<code>no_color_video</code> with a logic expression which is faster.
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
Major bug fixes:
|
||||
<ul>
|
||||
<li>correct <code>manlinks.sed</code> script introduced in ncurses 5.1
|
||||
to avoid using ERE "\+", which is not understood by standard versions
|
||||
of <code>sed</code>. This happens to work with GNU <code>sed</code>,
|
||||
but is not portable, and was the initial motivation for this release.
|
||||
<li>correct a typo in configure <code>--with-bool</code> option for the
|
||||
case where <code>--without-cxx</code> is used.
|
||||
|
||||
<li>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.
|
||||
<li>move assignment from environment variable <code>ESCDELAY</code>
|
||||
from <code>initscr()</code> down to <code>newterm()</code> so the
|
||||
environment variable affects timeouts for terminals opened with
|
||||
newterm() as well.
|
||||
|
||||
<li>guard against corrupt terminfo data:
|
||||
<ul>
|
||||
<li>modify <code>tparm()</code> to disallow arithmetic on strings,
|
||||
analyze the varargs list to read strings as strings and numbers as
|
||||
numbers.
|
||||
<li>modify <code>werase</code> to clear multicolumn characters that
|
||||
extend into a derived window.
|
||||
|
||||
<li>modify <code>tparm()</code>'s internal function
|
||||
<code>spop()</code> to treat a null pointer as an empty string.
|
||||
<li>modify <code>wchgat()</code> to mark updated cells as changed so a
|
||||
refresh will repaint those cells.
|
||||
|
||||
<li>modify <code>parse_format()</code> in lib_tparm.c to ignore
|
||||
precision if it is longer than 10000.
|
||||
<li>correct logic in <code>wadd_wch()</code> and
|
||||
<code>wecho_wch()</code>, which did not guard against passing the
|
||||
multi-column attribute into a call on <code>waddch()</code>, e.g.,
|
||||
using data returned by <code>win_wch()</code>
|
||||
|
||||
<li>rewrote limit checks in lib_mvcur.c using new functions
|
||||
<code>_nc_safe_strcat()</code>, etc. Made other related changes to
|
||||
check lengths used for <code>strcat()</code> and
|
||||
<code>strcpy()</code>.
|
||||
</ul>
|
||||
<li>fix redrawing of windows other than <code>stdscr</code> using
|
||||
<code>wredrawln()</code> by touching the corresponding rows in
|
||||
<code>curscr</code>.
|
||||
|
||||
<li>corrections to screen optimization:
|
||||
<ul>
|
||||
<li>added special case in lib_vidattr.c to reset underline and
|
||||
standout for devices that have no sgr0 defined.
|
||||
<li>reduce memory leaks in repeated calls to <code>tgetent()</code> by
|
||||
remembering the last <code>TERMINAL*</code> value allocated to hold
|
||||
the corresponding data and freeing that if the
|
||||
<code>tgetent()</code> result buffer is the same as the previous
|
||||
call.
|
||||
|
||||
<li>change handling of <code>non_dest_scroll_region</code> in
|
||||
tty_update.c to clear text after it is shifted in rather than before
|
||||
shifting out. Also correct row computation.
|
||||
<li>modify <code>read_termtype()</code> so the <code>term_names</code>
|
||||
data is always allocated as part of the <code>str_table</code>, a
|
||||
better fix for a memory leak.
|
||||
|
||||
<li>modify <code>rs2</code> capability in xterm-r6 and similar entries
|
||||
where cursor save/restore bracketed the sequence for resetting video
|
||||
attributes. The cursor restore would undo that.
|
||||
</ul>
|
||||
<li>fix <code>wins_nwstr(),</code> which did not handle single-column
|
||||
non-8bit codes.
|
||||
|
||||
<li>UTF-8 support:
|
||||
<ul>
|
||||
<li>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.
|
||||
<li>modify <code>wbkgrnd()</code> to avoid clearing the
|
||||
<code>A_CHARTEXT</code> attribute bits since those record the state
|
||||
of multicolumn characters.
|
||||
|
||||
<li>encode 0xFFFD in UTF-8 with 3 bytes, not 2.
|
||||
<li>improve <code>SIGWINCH</code> handling by postponing its effect
|
||||
during <code>newterm()</code>, etc., when allocating screens.
|
||||
|
||||
<li>modify <code>_nc_utf8_outch()</code> to avoid sign-extension when
|
||||
checking for out-of-range value.
|
||||
</ul>
|
||||
<li>remove 970913 feature for copying subwindows as they are moved in
|
||||
<code>mvwin()</code>.
|
||||
|
||||
<li>other library fixes:
|
||||
<ul>
|
||||
<li>added checks for an empty <code>$HOME</code> environment
|
||||
variable, to avoid retrieving terminfo descriptions from
|
||||
<code>./.terminfo</code> .
|
||||
<li>add checks in <code>waddchnstr()</code> and
|
||||
<code>wadd_wchnstr()</code> to stop copying when a null character
|
||||
is found.
|
||||
|
||||
<li>change functions <code>_nc_parse_entry()</code> and
|
||||
<code>postprocess_termcap()</code> to avoid using
|
||||
<code>strtok()</code>, because it is non-reentrant.
|
||||
<li>add some checks to ensure current position is within scrolling
|
||||
region before scrolling on a new line.
|
||||
|
||||
<li>initialize <code>fds[]</code> array to 0's in
|
||||
<code>_nc_timed_wait()</code>; apparently <code>poll()</code> only
|
||||
sets the <code>revents</code> members of that array when there is
|
||||
activity corresponding to the related file.
|
||||
|
||||
<li>add a check for null pointer in <code>Make_Enum_Type()</code>.
|
||||
|
||||
<li>fix a heap problem with the c++ binding.
|
||||
|
||||
<li>correct missing includes for <string.h> in several places,
|
||||
including the C++ binding. This is not noted by gcc unless we use
|
||||
the <code>-fno-builtin</code> option.
|
||||
</ul>
|
||||
|
||||
<li>several fixes for tic:
|
||||
<ul>
|
||||
<li>add a check for empty buffers returned by <code>fgets()</code> in
|
||||
comp_scan.c <code>next_char()</code> function, in case
|
||||
<code>tic</code> is run on a non-text file (fixes a core dump).
|
||||
|
||||
<li>modify <code>tic</code> to verify that its inputs are really files,
|
||||
in case someone tries to read a directory (or
|
||||
<code>/dev/zero</code>).
|
||||
|
||||
<li>correct an uninitialized parameter to <code>open_tempfile()</code>
|
||||
in tic.c which made "tic -I" give an ambiguous error message about
|
||||
<code>tmpnam</code>.
|
||||
|
||||
<li>correct logic in <code>adjust_cancels()</code>, which did not check
|
||||
both alternatives when reclassifying an extended name between
|
||||
boolean, number and string, causing an infinite loop in
|
||||
<code>tic</code>.
|
||||
</ul>
|
||||
|
||||
<li>using new checks in <code>tic</code> for parameter counts in
|
||||
capability strings, found/fixed several errors both in the
|
||||
terminfo database and in the include/Caps file.
|
||||
<ul>
|
||||
<li>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".
|
||||
|
||||
<li>correct parameter counts in include/Caps for dclk as well as some
|
||||
printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp.
|
||||
</ul>
|
||||
|
||||
<li>various fixes for install scripts used to support configure
|
||||
<code>--srcdir</code> and <code>--with-install-prefix</code>.
|
||||
|
||||
<li>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.
|
||||
<li>add a workaround to ACS mapping to allow applications such as
|
||||
test/blue.c to use the "PC ROM" characters by masking them with
|
||||
A_ALTCHARSET. This worked up til 5.5, but was lost in the revision
|
||||
of legacy coding.
|
||||
</ul>
|
||||
|
||||
Portability:
|
||||
<ul>
|
||||
<li>configure script:
|
||||
<ul>
|
||||
<li>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.
|
||||
<li>configure script:
|
||||
<ul>
|
||||
<li>new options:
|
||||
<dl>
|
||||
|
||||
<li>make configure script checks on variables <code>$GCC</code> and
|
||||
<code>$GXX</code> 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.
|
||||
<dt>--with-hashed-db
|
||||
<dd>Use Berkeley hashed database for storing terminfo data rather than storing
|
||||
each compiled entry in a separate binary file within a directory
|
||||
tree.
|
||||
|
||||
<li>change configure script to use AC_CANONICAL_SYSTEM rather than
|
||||
AC_CANONICAL_HOST, which means that <code>configure --target</code>
|
||||
will set a default program-prefix.
|
||||
<dt>--without-dlsym
|
||||
<dd>Do not use <code>dlsym()</code> to load GPM dynamically.
|
||||
|
||||
<li>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).
|
||||
<dt>--with-valgrind
|
||||
<dd>Simplify building for testing with valgrind.
|
||||
|
||||
<li>modify configure test for <code>tcgetattr()</code> to allow for
|
||||
old implementations, e.g., on BeOS, which only defined it as a
|
||||
macro.
|
||||
<dt>--enable-wgetch-events
|
||||
<dd>Compile with experimental wgetch-events code.
|
||||
|
||||
<li>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.
|
||||
<dt>--enable-signed-char
|
||||
<dd>Store booleans in "signed char" rather than "char".
|
||||
|
||||
<li>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".
|
||||
</dl>
|
||||
|
||||
<li>change most remaining unquoted parameters of <code>test</code> in
|
||||
configure script to use quotes, for instance fixing a problem in the
|
||||
<code>--disable-database</code> option.
|
||||
<li>improved options:
|
||||
<dl>
|
||||
|
||||
<li>modify scripts so that "make install.data" works on OS/2 EMX.
|
||||
<dt>--disable-largefile
|
||||
<dd>make the option work both ways.
|
||||
|
||||
<li>modify scripts and makefiles so the Ada95 directory builds on
|
||||
OS/2 EMX.
|
||||
<dt>--with-gpm
|
||||
<dd>The option now accepts a parameter,
|
||||
i.e., the name of the dynamic GPM library to load via
|
||||
<code>dlopen()</code>
|
||||
|
||||
<dt>--disable-symlinks
|
||||
<dd>The option now allows one to
|
||||
disable <code>symlink()</code> in <code>tic</code> even when
|
||||
<code>link()</code> does not work.
|
||||
|
||||
</dl>
|
||||
|
||||
</ul>
|
||||
|
||||
<li>other configure/build issues: <ul> <li>remove special case for
|
||||
Darwin in <code>CF_XOPEN_SOURCE</code> configure macro.
|
||||
|
||||
<li>add configure check to ensure that <code>SIGWINCH</code> is
|
||||
defined on platforms such as OS X which exclude that when
|
||||
<code>_XOPEN_SOURCE,</code> etc., are defined
|
||||
|
||||
<li>use ld's <code>-search_paths_first</code> option on Darwin
|
||||
to work around odd search rules on that platform.
|
||||
|
||||
<li>improve ifdef's for <code>_POSIX_VDISABLE</code> in tset to
|
||||
work with Mac OS X.
|
||||
|
||||
<li>modify configure script to ensure that if the C compiler is
|
||||
used rather than the loader in making shared libraries, the
|
||||
<code>$(CFLAGS)</code> variable is also used.
|
||||
|
||||
<li>use <code>${CC}</code> rather than <code>${LD}</code> in
|
||||
shared library rules for IRIX64, Solaris to help ensure
|
||||
that initialization sections are provided for extra linkage
|
||||
requirements, e.g., of C++ applications.
|
||||
|
||||
<li>improve some shared-library configure scripting for Linux,
|
||||
FreeBSD and NetBSD to make
|
||||
<code>--with-shlib-version</code> work.
|
||||
|
||||
<li>split up dependency of <code>names.c</code> and
|
||||
<code>codes.c</code> in <code>ncurses/Makefile</code> to
|
||||
work with parallel make.
|
||||
|
||||
<li>modify <code>MKlib_gen.sh</code> to change
|
||||
preprocessor-expanded <code>_Bool</code> back to <code>bool</code>.
|
||||
|
||||
<li>modify <code>progs/Makefile.in</code> to make
|
||||
<code>tput init</code> work properly with cygwin,
|
||||
i.e., do not pass a <code>.exe</code> in the reference
|
||||
string used in check_aliases.
|
||||
</ul>
|
||||
|
||||
<li>library:
|
||||
<ul>
|
||||
<li>replaced case-statement in <code>_nc_tracebits()</code> for CSIZE
|
||||
with a table to simplify working around implementations that define
|
||||
random combinations of the related macros to zero.
|
||||
<li>ignore wide-acs line-drawing characters that
|
||||
<code>wcwidth()</code> claims are not one-column. This is
|
||||
a workaround for Solaris' broken locale support.
|
||||
|
||||
<li>improved OS/2 mouse support by retrying as a 2-button mouse if code
|
||||
fails to set up a 3-button mouse.
|
||||
<li>reduce name-pollution in <code>term.h</code> by removing
|
||||
<code>#define</code>'s for HAVE_xxx symbols.
|
||||
|
||||
<li>added private entrypoint <code>_nc_basename()</code>, used to
|
||||
consolidate related code in progs, as well as accommodating OS/2 EMX
|
||||
pathnames.
|
||||
|
||||
<li>alter definition of NCURSES_CONST to make it non-empty.
|
||||
|
||||
<li>redefine 'TEXT' in menu.h for AMIGA, since it is reported to have
|
||||
an (unspecified) symbol conflict.
|
||||
<li>fix <code>#ifdef</code> in <code>c++/internal.h</code> for
|
||||
QNX 6.1
|
||||
</ul>
|
||||
|
||||
<li>programs:
|
||||
<ul>
|
||||
<li>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).
|
||||
</ul>
|
||||
<li>test programs: <ul> <li>modify <code>test/configure</code> script
|
||||
to allow building test programs with PDCurses/X11.
|
||||
|
||||
<li>modified test programs to allow some to work with NetBSD
|
||||
curses. Several do not because NetBSD curses implements a
|
||||
subset of X/Open curses, and also lacks much of SVr4
|
||||
additions. But it is enough for comparison.
|
||||
|
||||
<li>improved <code>test/configure</code> to build test/ncurses
|
||||
on HPUX 11 using the vendor curses.
|
||||
|
||||
<li>change configure script to produce
|
||||
<code>test/Makefile</code> from data file.
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<H1>Features of Ncurses</H1>
|
||||
@ -387,14 +390,15 @@ The ncurses package also has many useful extensions over SVr4:
|
||||
<UL>
|
||||
<LI>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
|
||||
and most EXTENDED features).
|
||||
It includes many function calls not supported under SVr4 curses
|
||||
(but portability of all
|
||||
calls is documented so you can use the SVr4 subset only).
|
||||
<LI>Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner
|
||||
of the screen if your terminal has an insert-character capability.
|
||||
<LI>Ada95 and C++ bindings.
|
||||
<LI>Support for mouse event reporting with X Window xterm and OS/2 console windows.
|
||||
<LI>Support for mouse event reporting with X Window xterm
|
||||
and FreeBSD and OS/2 console windows.
|
||||
<LI>Extended mouse support via Alessandro Rubini's gpm package.
|
||||
<LI>The function <CODE>wresize()</CODE> allows you to resize windows, preserving
|
||||
their data.
|
||||
@ -406,7 +410,7 @@ and <CODE>define_key()</CODE> allow
|
||||
you to better control the use of function keys,
|
||||
e.g., disabling the ncurses KEY_MOUSE,
|
||||
or by defining more than one control sequence to map to a given key code.
|
||||
<LI>Support for 16-color terminals, such as aixterm and XFree86 xterm.
|
||||
<LI>Support for 16-color terminals, such as aixterm and modern xterm.
|
||||
<LI>Better cursor-movement optimization. The package now features a
|
||||
cursor-local-movement computation more efficient than either BSD's
|
||||
or System V's.
|
||||
@ -474,61 +478,61 @@ including (versions starting with those noted):
|
||||
<DT> cdk
|
||||
<DD> Curses Development Kit
|
||||
<br>
|
||||
<A HREF="http://www.vexus.ca/CDK.html">http://www.vexus.ca/CDK.html</a>
|
||||
<A HREF="http://invisible-island.net/cdk/">http://invisible-island.net/cdk/</A>
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/cdk/cdk.html">http://dickey.his.com/cdk</A>.
|
||||
<A HREF="http://www.vexus.ca/products/CDK/">http://www.vexus.ca/products/CDK/</a>
|
||||
<DT> ded
|
||||
<DD> directory-editor
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/ded/ded.html">http://dickey.his.com/ded</A>.
|
||||
<A HREF="http://invisible-island.net/ded/">http://invisible-island.net/ded/</A>
|
||||
<DT> dialog
|
||||
<DD> the underlying application used in Slackware's setup, and the basis
|
||||
for similar applications on GNU/Linux.
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/dialog/dialog.html">http://dickey.his.com/dialog</A>.
|
||||
<A HREF="http://invisible-island.net/dialog/">http://invisible-island.net/dialog/</A>
|
||||
<DT> lynx
|
||||
<DD> the character-screen WWW browser
|
||||
<br>
|
||||
<A HREF="http://lynx.isc.org/release/">http://lynx.isc.org/release</A>.
|
||||
<DT> Midnight Commander 4.1
|
||||
<A HREF="http://lynx.isc.org/release/">http://lynx.isc.org/release/</A>
|
||||
<DT> Midnight Commander
|
||||
<DD> file manager
|
||||
<br>
|
||||
<A HREF="www.gnome.org/mc/">www.gnome.org/mc/</A>.
|
||||
<A HREF="http://www.ibiblio.org/mc/">http://www.ibiblio.org/mc/</A>
|
||||
<DT> mutt
|
||||
<DD> mail utility
|
||||
<br>
|
||||
<A HREF="http://www.mutt.org">http://www.mutt.org</A>.
|
||||
<A HREF="http://www.mutt.org/">http://www.mutt.org/</A>
|
||||
<DT> ncftp
|
||||
<DD> file-transfer utility
|
||||
<br>
|
||||
<A HREF="http://www.ncftp.com">http://www.ncftp.com</A>.
|
||||
<A HREF="http://www.ncftp.com/">http://www.ncftp.com/</A>
|
||||
<DT> nvi
|
||||
<DD> New vi versions 1.50 are able to use ncurses versions 1.9.7 and later.
|
||||
<br>
|
||||
<A HREF="http://www.bostic.com/vi/">http://www.bostic.com/vi/</A>.
|
||||
<A HREF="http://www.bostic.com/vi/">http://www.bostic.com/vi/</A>
|
||||
<br>
|
||||
<DT> pinfo
|
||||
<DD> Lynx-like info browser.
|
||||
<A HREF="http://dione.ids.pl/~pborys/software/pinfo/">http://dione.ids.pl/~pborys/software/pinfo/</A>
|
||||
<DT> tin
|
||||
<DD> newsreader, supporting color, MIME
|
||||
<br>
|
||||
<A HREF="http://www.tin.org">http://www.tin.org</A>.
|
||||
<DT> taper
|
||||
<DD> tape archive utility
|
||||
<br>
|
||||
<A HREF="http://members.iinet.net.au/~yusuf/taper/">http://members.iinet.net.au/~yusuf/taper/</A>.
|
||||
<A HREF="http://www.tin.org/">http://www.tin.org/</A>
|
||||
<DT> vh-1.6
|
||||
<DD> Volks-Hypertext browser for the Jargon File
|
||||
<br>
|
||||
<A HREF="http://www.bg.debian.org/Packages/unstable/text/vh.html">http://www.bg.debian.org/Packages/unstable/text/vh.html</A>.
|
||||
<A HREF="http://www.debian.org/Packages/unstable/text/vh.html">http://www.debian.org/Packages/unstable/text/vh.html</A>
|
||||
</DL>
|
||||
as well as some that use ncurses for the terminfo support alone:
|
||||
<DL>
|
||||
<DT> minicom
|
||||
<DD> terminal emulator
|
||||
<br>
|
||||
<A HREF="http://www.pp.clinet.fi/~walker/minicom.html">http://www.pp.clinet.fi/~walker/minicom.html</A>.
|
||||
<A HREF="http://alioth.debian.org/projects/minicom/">
|
||||
http://alioth.debian.org/projects/minicom/</A>
|
||||
<DT> vile
|
||||
<DD> vi-like-emacs
|
||||
<br>
|
||||
<A HREF="http://dickey.his.com/vile/vile.html">http://dickey.his.com/vile</A>.
|
||||
<A HREF="http://invisible-island.net/vile/">http://invisible-island.net/vile/</A>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
@ -537,16 +541,16 @@ a few games).
|
||||
|
||||
<H2>Who's Who and What's What</H2>
|
||||
|
||||
The original developers of ncurses are <A
|
||||
HREF="mailto:zmbenhal@netcom.com">Zeyd Ben-Halim</A> and
|
||||
<A HREF="http://www.ccil.org/~esr/home.html">Eric S. Raymond</A>.
|
||||
Zeyd Ben-Halim
|
||||
started it from a previous package pcurses, written by Pavel Curtis.
|
||||
Eric S. Raymond
|
||||
continued development.
|
||||
Jürgen Pfeifer wrote most of the form and menu libraries.
|
||||
Ongoing work is being done by
|
||||
<A HREF="mailto:dickey@herndon4.his.com">Thomas Dickey</A>
|
||||
and
|
||||
<A HREF="mailto:juergen.pfeifer@gmx.net">Jürgen Pfeifer</A>.
|
||||
<A HREF="mailto:dickey@herndon4.his.com">Thomas Dickey</A>
|
||||
acts as the maintainer for the Free Software Foundation, which holds the
|
||||
copyright on ncurses.
|
||||
<A HREF="mailto:dickey@invisible-island.net">Thomas Dickey</A>.
|
||||
Thomas Dickey
|
||||
acts as the maintainer for the Free Software Foundation,
|
||||
which holds the copyright on ncurses.
|
||||
Contact the current maintainers at
|
||||
<A HREF="mailto:bug-ncurses@gnu.org">bug-ncurses@gnu.org</A>.
|
||||
<P>
|
||||
@ -561,7 +565,7 @@ This list is open to anyone interested in helping with the development and
|
||||
testing of this package.<P>
|
||||
|
||||
Beta versions of ncurses and patches to the current release are made available at
|
||||
<A HREF="ftp://dickey.his.com/ncurses">ftp://dickey.his.com/ncurses</A>.
|
||||
<A HREF="ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</A> .
|
||||
|
||||
<H2>Future Plans</H2>
|
||||
<UL>
|
||||
@ -573,14 +577,17 @@ on them, please join the ncurses list.
|
||||
|
||||
<H2>Other Related Resources</H2>
|
||||
|
||||
The distribution includes and uses a version of the terminfo-format
|
||||
terminal description file maintained by Eric Raymond.
|
||||
<A HREF="http://earthspace.net/~esr/terminfo">http://earthspace.net/~esr/terminfo</A>.<P>
|
||||
The distribution provides a newer version of the terminfo-format
|
||||
terminal description file once maintained by
|
||||
<A HREF="http://www.catb.org/~esr/terminfo/">Eric Raymond</A> .
|
||||
Unlike the older version, the termcap and terminfo data are provided
|
||||
in the same file, and provides several user-definable extensions
|
||||
beyond the X/Open specification.<P>
|
||||
|
||||
You can find lots of information on terminal-related topics
|
||||
not covered in the terminfo file at
|
||||
<A HREF="http://www.cs.utk.edu/~shuford/terminal_index.html">Richard Shuford's
|
||||
archive</A>.
|
||||
archive</A> .
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!--
|
||||
|
@ -1,11 +1,39 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<!--
|
||||
$Id: hackguide.html,v 1.25 2000/03/25 18:45:21 tom Exp $
|
||||
$Id: hackguide.html,v 1.27 2005/12/24 15:37:13 tom Exp $
|
||||
****************************************************************************
|
||||
* Copyright (c) 1998-2003,2005 Free 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. *
|
||||
****************************************************************************
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>A Hacker's Guide to Ncurses Internals</TITLE>
|
||||
<link rev="made" href="mailto:bugs-ncurses@gnu.org">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<!--
|
||||
This document is self-contained, *except* that there is one relative link to
|
||||
the ncurses-intro.html document, expected to be in the same directory with
|
||||
@ -286,10 +314,6 @@ header comments of <CODE>hardscroll.c</CODE> and <CODE>hashmap.c</CODE>; then tr
|
||||
it out. You can also test the hardware-scrolling optimization separately
|
||||
with <CODE>hardscroll</CODE>. <P>
|
||||
|
||||
There's one other interactive tester, <CODE>tctest</CODE>, that exercises
|
||||
translation between termcap and terminfo formats. If you have a serious
|
||||
need to run this, you probably belong on our development team!
|
||||
|
||||
<H1><A NAME="ncurslib">A Tour of the Ncurses Library</A></H1>
|
||||
|
||||
<H2><A NAME="loverview">Library Overview</A></H2>
|
||||
@ -377,7 +401,7 @@ trace_buf.c
|
||||
</code>
|
||||
</blockquote>
|
||||
It is rather unlikely you will ever need to change these, unless
|
||||
you want to introduce a new debug trace level for some reasoon.<P>
|
||||
you want to introduce a new debug trace level for some reason.<P>
|
||||
|
||||
There is another group of files that do direct I/O via <EM>tputs()</EM>,
|
||||
computations on the terminal capabilities, or queries to the OS
|
||||
@ -558,7 +582,7 @@ Then <CODE>lib_doupdate.c</CODE> goes to work. Its job is to do line-by-line
|
||||
transformations of <CODE>curscr</CODE> lines to <CODE>newscr</CODE> lines. Its main
|
||||
tool is the routine <CODE>mvcur()</CODE> in <CODE>lib_mvcur.c</CODE>. This routine
|
||||
does cursor-movement optimization, attempting to get from given screen
|
||||
location A to given location B in the fewest output characters posible. <P>
|
||||
location A to given location B in the fewest output characters possible. <P>
|
||||
|
||||
If you want to work on screen optimizations, you should use the fact
|
||||
that (in the trace-enabled version of the library) enabling the
|
||||
|
@ -1,11 +1,39 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<!--
|
||||
$Id: ncurses-intro.html,v 1.35 2001/09/02 00:23:11 tom Exp $
|
||||
$Id: ncurses-intro.html,v 1.41 2005/12/24 15:47:05 tom Exp $
|
||||
****************************************************************************
|
||||
* Copyright (c) 1998-2004,2005 Free 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. *
|
||||
****************************************************************************
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Writing Programs with NCURSES</TITLE>
|
||||
<link rev="made" href="mailto:bugs-ncurses@gnu.org">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
@ -221,16 +249,11 @@ 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.
|
||||
<A HREF="mailto:juergen.pfeifer@gmx.net">Jürgen Pfeifer</A>
|
||||
Jürgen Pfeifer
|
||||
wrote all of the menu and forms code as well as the
|
||||
<A HREF="http://www.adahome.com">Ada95</A> binding.
|
||||
Ongoing work is being done by
|
||||
<A HREF="mailto:dickey@herndon4.his.com">Thomas Dickey</A>
|
||||
and
|
||||
<A HREF="mailto:juergen.pfeifer@gmx.net">Jürgen Pfeifer</A>.
|
||||
<A HREF="mailto:florian@gnu.org">Florian La Roche</A>
|
||||
acts as the maintainer for the Free Software Foundation, which holds the
|
||||
copyright on ncurses.
|
||||
<A HREF="mailto:dickey@invisible-island.net">Thomas Dickey</A> (maintainer).
|
||||
Contact the current maintainers at
|
||||
<A HREF="mailto:bug-ncurses@gnu.org">bug-ncurses@gnu.org</A>.
|
||||
<P>
|
||||
@ -613,6 +636,7 @@ Presently, mouse event reporting works in the following environments:
|
||||
<li>xterm and similar programs such as rxvt.
|
||||
<li>Linux console, when configured with <CODE>gpm</CODE>(1), Alessandro
|
||||
Rubini's mouse server.
|
||||
<li>FreeBSD sysmouse (console)
|
||||
<li>OS/2 EMX
|
||||
</ul>
|
||||
<P>
|
||||
@ -690,7 +714,7 @@ the first call to <CODE>refresh()</CODE> 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 (<CODE>slk_init()</CODE>, <CODE>filter()</CODE>,
|
||||
<CODE>ripofflines()</CODE>, <CODE>use_env()</CODE>, and, if you are using multiple
|
||||
<CODE>ripoffline()</CODE>, <CODE>use_env()</CODE>, and, if you are using multiple
|
||||
terminals, <CODE>newterm()</CODE>.)
|
||||
<DT> <CODE>endwin()</CODE>
|
||||
<DD> Your program should always call <CODE>endwin()</CODE> before exiting or
|
||||
@ -732,7 +756,7 @@ the terminal, as other routines merely manipulate data
|
||||
structures. <CODE>wrefresh()</CODE> copies the named window to the physical
|
||||
terminal screen, taking into account what is already
|
||||
there in order to do optimizations. <CODE>refresh()</CODE> does a
|
||||
refresh of <CODE>stdscr()</CODE>. Unless <CODE>leaveok()</CODE> has been
|
||||
refresh of <CODE>stdscr</CODE>. Unless <CODE>leaveok()</CODE> has been
|
||||
enabled, the physical cursor of the terminal is left at the
|
||||
location of the window's cursor.
|
||||
<DT> <CODE>doupdate()</CODE> and <CODE>wnoutrefresh(win)</CODE>
|
||||
@ -982,7 +1006,7 @@ on and refresh them, the changes made to the overlapping region under historic
|
||||
|
||||
To understand why this is a problem, remember that screen updates are
|
||||
calculated between two representations of the <EM>entire</EM> display. The
|
||||
documentation says that when you refresh a window, it is first copied to to the
|
||||
documentation says that when you refresh a window, it is first copied 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
|
||||
@ -1020,7 +1044,7 @@ guarantee an entire-contents copy anywhere. <P>
|
||||
|
||||
The really clean way to handle this is to use the panels library. If,
|
||||
when you want a screen update, you do <CODE>update_panels()</CODE>, it will
|
||||
do all the necessary <CODE>wnoutrfresh()</CODE> calls for whatever panel
|
||||
do all the necessary <CODE>wnoutrefresh()</CODE> calls for whatever panel
|
||||
stacking order you have defined. Then you can do one <CODE>doupdate()</CODE>
|
||||
and there will be a <EM>single</EM> burst of physical I/O that will do
|
||||
all your updates.
|
||||
@ -1222,10 +1246,10 @@ The general flow of control of a menu program looks like this:
|
||||
<LI>Initialize <CODE>curses</CODE>.
|
||||
<LI>Create the menu items, using <CODE>new_item()</CODE>.
|
||||
<LI>Create the menu using <CODE>new_menu()</CODE>.
|
||||
<LI>Post the menu using <CODE>menu_post()</CODE>.
|
||||
<LI>Post the menu using <CODE>post_menu()</CODE>.
|
||||
<LI>Refresh the screen.
|
||||
<LI>Process user requests via an input loop.
|
||||
<LI>Unpost the menu using <CODE>menu_unpost()</CODE>.
|
||||
<LI>Unpost the menu using <CODE>unpost_menu()</CODE>.
|
||||
<LI>Free the menu, using <CODE>free_menu()</CODE>.
|
||||
<LI>Free the items using <CODE>free_item()</CODE>.
|
||||
<LI>Terminate <CODE>curses</CODE>.
|
||||
@ -1308,8 +1332,8 @@ refreshed or erased at post/unpost time. The inner window or
|
||||
By default, both windows are <CODE>stdscr</CODE>. You can set them with the
|
||||
functions in <CODE>menu_win(3x)</CODE>. <P>
|
||||
|
||||
When you call <CODE>menu_post()</CODE>, you write the menu to its
|
||||
subwindow. When you call <CODE>menu_unpost()</CODE>, you erase the
|
||||
When you call <CODE>post_menu()</CODE>, you write the menu to its
|
||||
subwindow. When you call <CODE>unpost_menu()</CODE>, you erase the
|
||||
subwindow, However, neither of these actually modifies the screen. To
|
||||
do that, call <CODE>wrefresh()</CODE> or some equivalent.
|
||||
|
||||
@ -1441,10 +1465,10 @@ The general flow of control of a form program looks like this:
|
||||
<LI>Initialize <CODE>curses</CODE>.
|
||||
<LI>Create the form fields, using <CODE>new_field()</CODE>.
|
||||
<LI>Create the form using <CODE>new_form()</CODE>.
|
||||
<LI>Post the form using <CODE>form_post()</CODE>.
|
||||
<LI>Post the form using <CODE>post_form()</CODE>.
|
||||
<LI>Refresh the screen.
|
||||
<LI>Process user requests via an input loop.
|
||||
<LI>Unpost the form using <CODE>form_unpost()</CODE>.
|
||||
<LI>Unpost the form using <CODE>unpost_form()</CODE>.
|
||||
<LI>Free the form, using <CODE>free_form()</CODE>.
|
||||
<LI>Free the fields using <CODE>free_field()</CODE>.
|
||||
<LI>Terminate <CODE>curses</CODE>.
|
||||
@ -1480,7 +1504,7 @@ 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 <CODE>stdscr</CODE> by default but
|
||||
need not be <CODE>stdscr</CODE> if you've done an explicit
|
||||
<CODE>set_form_window()</CODE> call. <P>
|
||||
<CODE>set_form_win()</CODE> call. <P>
|
||||
|
||||
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
|
||||
@ -2519,13 +2543,13 @@ By default, all options are on. Here are the available option bits:
|
||||
<DL>
|
||||
<DT> O_NL_OVERLOAD
|
||||
<DD> Enable overloading of <CODE>REQ_NEW_LINE</CODE> as described in <A
|
||||
NAME="fedit">Editing Requests</A>. The value of this option is
|
||||
href="#fedit">Editing Requests</A>. 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
|
||||
<CODE>REQ_NEXT_FIELD</CODE> never arise.
|
||||
<DT> O_BS_OVERLOAD
|
||||
<DD> Enable overloading of <CODE>REQ_DEL_PREV</CODE> as described in
|
||||
<A NAME="fedit">Editing Requests</A>.
|
||||
<A href="#fedit">Editing Requests</A>.
|
||||
</DL>
|
||||
|
||||
The option values are bit-masks and can be composed with logical-or in
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.36 2002/01/20 01:49:17 tom Exp $
|
||||
# $Id: Makefile.in,v 1.42 2006/10/14 20:40:36 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -45,6 +45,9 @@
|
||||
SHELL = /bin/sh
|
||||
THIS = Makefile
|
||||
|
||||
x = @EXEEXT@
|
||||
o = .@OBJEXT@
|
||||
|
||||
MODEL = @DFT_LWR_MODEL@
|
||||
DESTDIR = @DESTDIR@
|
||||
srcdir = @srcdir@
|
||||
@ -55,10 +58,15 @@ libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_CLEAN = @LIB_CLEAN@
|
||||
LIBTOOL_COMPILE = @LIB_COMPILE@
|
||||
LIBTOOL_LINK = @LIB_LINK@
|
||||
LIBTOOL_INSTALL = @LIB_INSTALL@
|
||||
LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
|
||||
INSTALL_PROG = @INSTALL_PROG@
|
||||
INSTALL_PROG = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
AR = @AR@
|
||||
@ -71,8 +79,7 @@ CC = @CC@
|
||||
CPP = @CPP@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@ \
|
||||
-DHAVE_CONFIG_H
|
||||
CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
|
||||
|
||||
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
@ -84,7 +91,7 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
|
||||
|
||||
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
|
||||
|
||||
LINK = $(LIBTOOL) $(CC)
|
||||
LINK = $(LIBTOOL_LINK) $(CC)
|
||||
LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
|
||||
|
||||
SHLIB_DIRS = -L../lib
|
||||
@ -97,7 +104,7 @@ NCURSES_MINOR = @NCURSES_MINOR@
|
||||
REL_VERSION = @cf_cv_rel_version@
|
||||
ABI_VERSION = @cf_cv_abi_version@
|
||||
|
||||
RANLIB = @RANLIB@
|
||||
RANLIB = @LIB_PREP@
|
||||
|
||||
IMPORT_LIB = @IMPORT_LIB@
|
||||
SHARED_LIB = @SHARED_LIB@
|
||||
@ -108,7 +115,7 @@ LINT_OPTS = @LINT_OPTS@
|
||||
LINT_LIBS = -lform -lncurses @LIBS@
|
||||
|
||||
AUTO_SRC = \
|
||||
../include/form.h
|
||||
../include/form.h
|
||||
|
||||
################################################################################
|
||||
all \
|
||||
|
@ -1,3 +1,33 @@
|
||||
-------------------------------------------------------------------------------
|
||||
-- Copyright (c) 1998-2003,2006 Free Software Foundation, Inc. --
|
||||
-- --
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a --
|
||||
-- copy of this software and associated documentation files (the --
|
||||
-- "Software"), to deal in the Software without restriction, including --
|
||||
-- without limitation the rights to use, copy, modify, merge, publish, --
|
||||
-- distribute, distribute with modifications, sublicense, and/or sell copies --
|
||||
-- of the Software, and to permit persons to whom the Software is furnished --
|
||||
-- to do so, subject to the following conditions: --
|
||||
-- --
|
||||
-- The above copyright notice and this permission notice shall be included --
|
||||
-- in all copies or substantial portions of the Software. --
|
||||
-- --
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
|
||||
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
|
||||
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
|
||||
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
|
||||
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
|
||||
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
|
||||
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
|
||||
-- --
|
||||
-- Except as contained in this notice, the name(s) of the above copyright --
|
||||
-- holders shall not be used in advertising or otherwise to promote the --
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: READ.ME,v 0.7 2006/04/22 23:13:05 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a clone of the form library that is available with typical
|
||||
System V curses implementations (ETI).
|
||||
|
||||
@ -10,6 +40,3 @@ For things that still need doing, see the TO-DO file in the top-level
|
||||
directory.
|
||||
|
||||
Juergen Pfeifer
|
||||
|
||||
eMail: juergen.pfeifer@gmx.net
|
||||
|
||||
|
70
contrib/ncurses/form/f_trace.c
Normal file
70
contrib/ncurses/form/f_trace.c
Normal file
@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: f_trace.c,v 1.1 2004/12/25 23:28:49 tom Exp $")
|
||||
|
||||
NCURSES_EXPORT(FIELD **)
|
||||
_nc_retrace_field_ptr(FIELD **code)
|
||||
{
|
||||
T((T_RETURN("%p"), code));
|
||||
return code;
|
||||
}
|
||||
|
||||
NCURSES_EXPORT(FIELD *)
|
||||
_nc_retrace_field(FIELD *code)
|
||||
{
|
||||
T((T_RETURN("%p"), code));
|
||||
return code;
|
||||
}
|
||||
|
||||
NCURSES_EXPORT(FIELDTYPE *)
|
||||
_nc_retrace_field_type(FIELDTYPE *code)
|
||||
{
|
||||
T((T_RETURN("%p"), code));
|
||||
return code;
|
||||
}
|
||||
|
||||
NCURSES_EXPORT(FORM *)
|
||||
_nc_retrace_form(FORM *code)
|
||||
{
|
||||
T((T_RETURN("%p"), code));
|
||||
return code;
|
||||
}
|
||||
|
||||
NCURSES_EXPORT(Form_Hook)
|
||||
_nc_retrace_form_hook(Form_Hook code)
|
||||
{
|
||||
T((T_RETURN("%p"), code));
|
||||
return code;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,21 +27,21 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_arg.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: fld_arg.c,v 1.11 2004/12/25 22:20:18 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_fieldtype_arg(
|
||||
| FIELDTYPE *typ,
|
||||
| void * (* const make_arg)(va_list *),
|
||||
| void * (* const copy_arg)(const void *),
|
||||
| void (* const free_arg)(void *) )
|
||||
|
|
||||
|
|
||||
| Description : Connects to the type additional arguments necessary
|
||||
| for a set_field_type call. The various function pointer
|
||||
| arguments are:
|
||||
@ -61,34 +61,38 @@ MODULE_ID("$Id: fld_arg.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid argument
|
||||
+--------------------------------------------------------------------------*/
|
||||
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 *))
|
||||
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);
|
||||
T((T_CALLED("set_fieldtype_arg(%p,%p,%p,%p)"),
|
||||
typ, make_arg, copy_arg, free_arg));
|
||||
|
||||
typ->status |= _HAS_ARGS;
|
||||
typ->makearg = make_arg;
|
||||
typ->copyarg = copy_arg;
|
||||
typ->freearg = free_arg;
|
||||
RETURN(E_OK);
|
||||
if (typ != 0 && make_arg != (void *)0)
|
||||
{
|
||||
typ->status |= _HAS_ARGS;
|
||||
typ->makearg = make_arg;
|
||||
typ->copyarg = copy_arg;
|
||||
typ->freearg = free_arg;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : void *field_arg(const FIELD *field)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve pointer to the fields argument structure.
|
||||
|
|
||||
| Return Values : Pointer to structure or NULL if none is defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(void *)
|
||||
field_arg (const FIELD * field)
|
||||
field_arg(const FIELD *field)
|
||||
{
|
||||
return Normalize_Field(field)->arg;
|
||||
T((T_CALLED("field_arg(%p)"), field));
|
||||
returnVoidPtr(Normalize_Field(field)->arg);
|
||||
}
|
||||
|
||||
/* fld_arg.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,11 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_attr.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_attr.c,v 1.10 2004/12/11 21:33:15 tom Exp $")
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Field-Attribute manipulation routines
|
||||
@ -41,16 +42,22 @@ MODULE_ID("$Id: fld_attr.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
|
||||
{\
|
||||
int res = E_BAD_ARGUMENT;\
|
||||
T((T_CALLED("set_field_" #name "(%p,%s)"), field, _traceattr(attr)));\
|
||||
if ( attr==A_NORMAL || ((attr & A_ATTRIBUTES)==attr) )\
|
||||
{\
|
||||
Normalize_Field( field );\
|
||||
if ((field -> name) != attr)\
|
||||
{\
|
||||
field -> name = attr;\
|
||||
res = _nc_Synchronize_Attributes( field );\
|
||||
}\
|
||||
else\
|
||||
res = E_OK;\
|
||||
if (field != 0) \
|
||||
{ \
|
||||
if ((field -> name) != attr)\
|
||||
{\
|
||||
field -> name = attr;\
|
||||
res = _nc_Synchronize_Attributes( field );\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
res = E_OK;\
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
RETURN(res);\
|
||||
}
|
||||
@ -59,13 +66,14 @@ NCURSES_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
|
||||
#define GEN_FIELD_ATTR_GET_FCT( name ) \
|
||||
NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
|
||||
{\
|
||||
return ( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\
|
||||
T((T_CALLED("field_" #name "(%p)"), field));\
|
||||
returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_field_fore(FIELD *field, chtype attr)
|
||||
|
|
||||
|
|
||||
| Description : Sets the foreground of the field used to display the
|
||||
| field contents.
|
||||
|
|
||||
@ -73,22 +81,22 @@ NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
|
||||
| E_BAD_ARGUMENT - invalid attributes
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_FIELD_ATTR_SET_FCT( fore )
|
||||
GEN_FIELD_ATTR_SET_FCT(fore)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : chtype field_fore(const FIELD *)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve fields foreground attribute
|
||||
|
|
||||
| Return Values : The foreground attribute
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_FIELD_ATTR_GET_FCT( fore )
|
||||
GEN_FIELD_ATTR_GET_FCT(fore)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_field_back(FIELD *field, chtype attr)
|
||||
|
|
||||
|
|
||||
| Description : Sets the background of the field used to display the
|
||||
| fields extend.
|
||||
|
|
||||
@ -96,16 +104,16 @@ GEN_FIELD_ATTR_GET_FCT( fore )
|
||||
| E_BAD_ARGUMENT - invalid attributes
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_FIELD_ATTR_SET_FCT( back )
|
||||
GEN_FIELD_ATTR_SET_FCT(back)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : chtype field_back(const
|
||||
|
|
||||
| Function : chtype field_back(const
|
||||
|
|
||||
| Description : Retrieve fields background attribute
|
||||
|
|
||||
| Return Values : The background attribute
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_FIELD_ATTR_GET_FCT( back )
|
||||
GEN_FIELD_ATTR_GET_FCT(back)
|
||||
|
||||
/* fld_attr.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,16 +27,17 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_current.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_current.c,v 1.11 2004/12/25 22:40:13 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_current_field(FORM * form,FIELD * field)
|
||||
|
|
||||
|
|
||||
| Description : Set the current field of the form to the specified one.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
@ -47,46 +48,53 @@ MODULE_ID("$Id: fld_current.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_current_field (FORM * form, FIELD * field)
|
||||
set_current_field(FORM *form, FIELD *field)
|
||||
{
|
||||
int err = E_OK;
|
||||
|
||||
if ( !form || !field )
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if ( (form != field->form) || Field_Is_Not_Selectable(field) )
|
||||
RETURN(E_REQUEST_DENIED);
|
||||
|
||||
if (!(form->status & _POSTED))
|
||||
T((T_CALLED("set_current_field(%p,%p)"), form, field));
|
||||
if (form == 0 || field == 0)
|
||||
{
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
}
|
||||
else if ((form != field->form) || Field_Is_Not_Selectable(field))
|
||||
{
|
||||
RETURN(E_REQUEST_DENIED);
|
||||
}
|
||||
else if ((form->status & _POSTED) == 0)
|
||||
{
|
||||
form->current = field;
|
||||
form->curpage = field->page;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (form->status & _IN_DRIVER)
|
||||
err = E_BAD_STATE;
|
||||
if ((form->status & _IN_DRIVER) != 0)
|
||||
{
|
||||
err = E_BAD_STATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (form->current != field)
|
||||
{
|
||||
if (!_nc_Internal_Validation(form))
|
||||
err = E_INVALID_FIELD;
|
||||
if (!_nc_Internal_Validation(form))
|
||||
{
|
||||
err = E_INVALID_FIELD;
|
||||
}
|
||||
else
|
||||
{
|
||||
Call_Hook(form,fieldterm);
|
||||
Call_Hook(form, fieldterm);
|
||||
if (field->page != form->curpage)
|
||||
{
|
||||
Call_Hook(form,formterm);
|
||||
err = _nc_Set_Form_Page(form,field->page,field);
|
||||
Call_Hook(form,forminit);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = _nc_Set_Current_Field(form,field);
|
||||
Call_Hook(form, formterm);
|
||||
err = _nc_Set_Form_Page(form, (int)field->page, field);
|
||||
Call_Hook(form, forminit);
|
||||
}
|
||||
Call_Hook(form,fieldinit);
|
||||
_nc_Refresh_Current_Field(form);
|
||||
else
|
||||
{
|
||||
err = _nc_Set_Current_Field(form, field);
|
||||
}
|
||||
Call_Hook(form, fieldinit);
|
||||
(void)_nc_Refresh_Current_Field(form);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -95,23 +103,24 @@ set_current_field (FORM * form, FIELD * field)
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : FIELD *current_field(const FORM * form)
|
||||
|
|
||||
|
|
||||
| Description : Return the current field.
|
||||
|
|
||||
| Return Values : Pointer to the current field.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELD *)
|
||||
current_field (const FORM * form)
|
||||
current_field(const FORM *form)
|
||||
{
|
||||
return Normalize_Form(form)->current;
|
||||
T((T_CALLED("current_field(%p)"), form));
|
||||
returnField(Normalize_Form(form)->current);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int field_index(const FIELD * field)
|
||||
|
|
||||
|
|
||||
| Description : Return the index of the field in the field-array of
|
||||
| the form.
|
||||
|
|
||||
@ -119,9 +128,10 @@ current_field (const FORM * form)
|
||||
| -1 : fieldpointer invalid or field not connected
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_index (const FIELD * field)
|
||||
field_index(const FIELD *field)
|
||||
{
|
||||
return ( (field && field->form) ? field->index : -1 );
|
||||
T((T_CALLED("field_index(%p)"), field));
|
||||
returnCode((field != 0 && field->form != 0) ? (int)field->index : -1);
|
||||
}
|
||||
|
||||
/* fld_current.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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,296 +27,324 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_def.c,v 1.13 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_def.c,v 1.33 2005/04/16 17:31:17 tom Exp $")
|
||||
|
||||
/* this can't be readonly */
|
||||
static FIELD default_field = {
|
||||
0, /* status */
|
||||
0, /* rows */
|
||||
0, /* cols */
|
||||
0, /* frow */
|
||||
0, /* fcol */
|
||||
0, /* drows */
|
||||
0, /* dcols */
|
||||
0, /* maxgrow*/
|
||||
0, /* nrow */
|
||||
0, /* nbuf */
|
||||
NO_JUSTIFICATION, /* just */
|
||||
0, /* page */
|
||||
0, /* index */
|
||||
(int)' ', /* pad */
|
||||
A_NORMAL, /* fore */
|
||||
A_NORMAL, /* back */
|
||||
ALL_FIELD_OPTS, /* opts */
|
||||
(FIELD *)0, /* snext */
|
||||
(FIELD *)0, /* sprev */
|
||||
(FIELD *)0, /* link */
|
||||
(FORM *)0, /* form */
|
||||
(FIELDTYPE *)0, /* type */
|
||||
(char *)0, /* arg */
|
||||
(char *)0, /* buf */
|
||||
(char *)0 /* usrptr */
|
||||
static FIELD default_field =
|
||||
{
|
||||
0, /* status */
|
||||
0, /* rows */
|
||||
0, /* cols */
|
||||
0, /* frow */
|
||||
0, /* fcol */
|
||||
0, /* drows */
|
||||
0, /* dcols */
|
||||
0, /* maxgrow */
|
||||
0, /* nrow */
|
||||
0, /* nbuf */
|
||||
NO_JUSTIFICATION, /* just */
|
||||
0, /* page */
|
||||
0, /* index */
|
||||
(int)' ', /* pad */
|
||||
A_NORMAL, /* fore */
|
||||
A_NORMAL, /* back */
|
||||
ALL_FIELD_OPTS, /* opts */
|
||||
(FIELD *)0, /* snext */
|
||||
(FIELD *)0, /* sprev */
|
||||
(FIELD *)0, /* link */
|
||||
(FORM *)0, /* form */
|
||||
(FIELDTYPE *)0, /* type */
|
||||
(char *)0, /* arg */
|
||||
(FIELD_CELL *)0, /* buf */
|
||||
(char *)0 /* usrptr */
|
||||
NCURSES_FIELD_EXTENSION
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELD *)
|
||||
_nc_Default_Field = &default_field;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : TypeArgument *_nc_Make_Argument(
|
||||
| const FIELDTYPE *typ,
|
||||
| va_list *ap,
|
||||
| int *err )
|
||||
|
|
||||
|
|
||||
| Description : Create an argument structure for the specified type.
|
||||
| Use the type-dependant argument list to construct
|
||||
| Use the type-dependent argument list to construct
|
||||
| it.
|
||||
|
|
||||
| Return Values : Pointer to argument structure. Maybe NULL.
|
||||
| In case of an error in *err an errorcounter is increased.
|
||||
| In case of an error in *err an error counter is increased.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(TypeArgument*)
|
||||
_nc_Make_Argument
|
||||
(const FIELDTYPE *typ, va_list *ap, int *err)
|
||||
{
|
||||
TypeArgument *res = (TypeArgument *)0;
|
||||
TypeArgument *p;
|
||||
|
||||
if (typ && (typ->status & _HAS_ARGS))
|
||||
{
|
||||
assert(err && ap);
|
||||
if (typ->status & _LINKED_TYPE)
|
||||
{
|
||||
p = (TypeArgument *)malloc(sizeof(TypeArgument));
|
||||
if (p)
|
||||
{
|
||||
p->left = _nc_Make_Argument(typ->left ,ap,err);
|
||||
p->right = _nc_Make_Argument(typ->right,ap,err);
|
||||
return p;
|
||||
}
|
||||
else
|
||||
*err += 1;
|
||||
} else
|
||||
{
|
||||
assert(typ->makearg);
|
||||
if ( !(res=(TypeArgument *)typ->makearg(ap)) )
|
||||
*err += 1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : TypeArgument *_nc_Copy_Argument(const FIELDTYPE *typ,
|
||||
| const TypeArgument *argp,
|
||||
| int *err )
|
||||
|
|
||||
| Description : Create a copy of an argument structure for the specified
|
||||
| type.
|
||||
|
|
||||
| Return Values : Pointer to argument structure. Maybe NULL.
|
||||
| In case of an error in *err an errorcounter is increased.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(TypeArgument*)
|
||||
_nc_Copy_Argument
|
||||
(const FIELDTYPE *typ,
|
||||
const TypeArgument *argp, int *err)
|
||||
NCURSES_EXPORT(TypeArgument *)
|
||||
_nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
|
||||
{
|
||||
TypeArgument *res = (TypeArgument *)0;
|
||||
TypeArgument *p;
|
||||
|
||||
if ( typ && (typ->status & _HAS_ARGS) )
|
||||
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
|
||||
{
|
||||
assert(err && argp);
|
||||
if (typ->status & _LINKED_TYPE)
|
||||
assert(err != 0 && ap != (va_list *)0);
|
||||
if ((typ->status & _LINKED_TYPE) != 0)
|
||||
{
|
||||
p = (TypeArgument *)malloc(sizeof(TypeArgument));
|
||||
if (p)
|
||||
|
||||
if (p != 0)
|
||||
{
|
||||
p->left = _nc_Copy_Argument(typ,argp->left ,err);
|
||||
p->right = _nc_Copy_Argument(typ,argp->right,err);
|
||||
p->left = _nc_Make_Argument(typ->left, ap, err);
|
||||
p->right = _nc_Make_Argument(typ->right, ap, err);
|
||||
return p;
|
||||
}
|
||||
*err += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typ->copyarg)
|
||||
{
|
||||
if (!(res = (TypeArgument *)(typ->copyarg((const void *)argp))))
|
||||
*err += 1;
|
||||
}
|
||||
else
|
||||
res = (TypeArgument *)argp;
|
||||
{
|
||||
*err += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(typ->makearg != (void *)0);
|
||||
if (!(res = (TypeArgument *)typ->makearg(ap)))
|
||||
{
|
||||
*err += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : TypeArgument *_nc_Copy_Argument(const FIELDTYPE *typ,
|
||||
| const TypeArgument *argp,
|
||||
| int *err )
|
||||
|
|
||||
| Description : Create a copy of an argument structure for the specified
|
||||
| type.
|
||||
|
|
||||
| Return Values : Pointer to argument structure. Maybe NULL.
|
||||
| In case of an error in *err an error counter is increased.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(TypeArgument *)
|
||||
_nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
|
||||
{
|
||||
TypeArgument *res = (TypeArgument *)0;
|
||||
TypeArgument *p;
|
||||
|
||||
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
|
||||
{
|
||||
assert(err != 0 && argp != 0);
|
||||
if ((typ->status & _LINKED_TYPE) != 0)
|
||||
{
|
||||
p = (TypeArgument *)malloc(sizeof(TypeArgument));
|
||||
|
||||
if (p != 0)
|
||||
{
|
||||
p->left = _nc_Copy_Argument(typ, argp->left, err);
|
||||
p->right = _nc_Copy_Argument(typ, argp->right, err);
|
||||
return p;
|
||||
}
|
||||
*err += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typ->copyarg != (void *)0)
|
||||
{
|
||||
if (!(res = (TypeArgument *)(typ->copyarg((const void *)argp))))
|
||||
{
|
||||
*err += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = (TypeArgument *)argp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : void _nc_Free_Argument(const FIELDTYPE *typ,
|
||||
| TypeArgument * argp )
|
||||
|
|
||||
|
|
||||
| Description : Release memory associated with the argument structure
|
||||
| for the given fieldtype.
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(void)
|
||||
_nc_Free_Argument
|
||||
(const FIELDTYPE * typ, TypeArgument * argp)
|
||||
_nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *argp)
|
||||
{
|
||||
if (!typ || !(typ->status & _HAS_ARGS))
|
||||
return;
|
||||
|
||||
if (typ->status & _LINKED_TYPE)
|
||||
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
|
||||
{
|
||||
assert(argp);
|
||||
_nc_Free_Argument(typ->left ,argp->left );
|
||||
_nc_Free_Argument(typ->right,argp->right);
|
||||
free(argp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typ->freearg)
|
||||
typ->freearg((void *)argp);
|
||||
if ((typ->status & _LINKED_TYPE) != 0)
|
||||
{
|
||||
assert(argp != 0);
|
||||
_nc_Free_Argument(typ->left, argp->left);
|
||||
_nc_Free_Argument(typ->right, argp->right);
|
||||
free(argp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typ->freearg != (void *)0)
|
||||
{
|
||||
typ->freearg((void *)argp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : bool _nc_Copy_Type( FIELD *dst, FIELD const *src )
|
||||
|
|
||||
|
|
||||
| Description : Copy argument structure of field src to field dst
|
||||
|
|
||||
| Return Values : TRUE - copy worked
|
||||
| FALSE - error occured
|
||||
| FALSE - error occurred
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(bool)
|
||||
_nc_Copy_Type
|
||||
(FIELD *dst, FIELD const *src)
|
||||
_nc_Copy_Type(FIELD *dst, FIELD const *src)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
assert(dst && src);
|
||||
assert(dst != 0 && src != 0);
|
||||
|
||||
dst->type = src->type;
|
||||
dst->arg = (void *)_nc_Copy_Argument(src->type,(TypeArgument *)(src->arg),&err);
|
||||
dst->arg = (void *)_nc_Copy_Argument(src->type, (TypeArgument *)(src->arg), &err);
|
||||
|
||||
if (err)
|
||||
if (err != 0)
|
||||
{
|
||||
_nc_Free_Argument(dst->type,(TypeArgument *)(dst->arg));
|
||||
_nc_Free_Argument(dst->type, (TypeArgument *)(dst->arg));
|
||||
dst->type = (FIELDTYPE *)0;
|
||||
dst->arg = (void *)0;
|
||||
dst->arg = (void *)0;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dst->type)
|
||||
dst->type->ref++;
|
||||
if (dst->type != 0)
|
||||
{
|
||||
dst->type->ref++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : void _nc_Free_Type( FIELD *field )
|
||||
|
|
||||
|
|
||||
| Description : Release Argument structure for this field
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(void)
|
||||
_nc_Free_Type (FIELD *field)
|
||||
_nc_Free_Type(FIELD *field)
|
||||
{
|
||||
assert(field);
|
||||
if (field->type)
|
||||
field->type->ref--;
|
||||
_nc_Free_Argument(field->type,(TypeArgument *)(field->arg));
|
||||
assert(field != 0);
|
||||
if (field->type != 0)
|
||||
{
|
||||
field->type->ref--;
|
||||
}
|
||||
_nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : FIELD *new_field( int rows, int cols,
|
||||
| Facility : libnform
|
||||
| Function : FIELD *new_field( int rows, int cols,
|
||||
| int frow, int fcol,
|
||||
| int nrow, int nbuf )
|
||||
|
|
||||
|
|
||||
| Description : Create a new field with this many 'rows' and 'cols',
|
||||
| starting at 'frow/fcol' in the subwindow of the form.
|
||||
| Allocate 'nrow' off-screen rows and 'nbuf' additional
|
||||
| buffers. If an error occurs, errno is set to
|
||||
|
|
||||
|
|
||||
| E_BAD_ARGUMENT - invalid argument
|
||||
| E_SYSTEM_ERROR - system error
|
||||
|
|
||||
| Return Values : Pointer to the new field or NULL if failure.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELD *)
|
||||
new_field
|
||||
(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
|
||||
new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
|
||||
{
|
||||
static const FIELD_CELL blank = BLANK;
|
||||
static const FIELD_CELL zeros = ZEROS;
|
||||
|
||||
FIELD *New_Field = (FIELD *)0;
|
||||
int err = E_BAD_ARGUMENT;
|
||||
|
||||
if (rows>0 &&
|
||||
cols>0 &&
|
||||
frow>=0 &&
|
||||
fcol>=0 &&
|
||||
nrow>=0 &&
|
||||
nbuf>=0 &&
|
||||
((err = E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error */
|
||||
(New_Field=(FIELD *)malloc(sizeof(FIELD))) )
|
||||
T((T_CALLED("new_field(%d,%d,%d,%d,%d,%d)"), rows, cols, frow, fcol, nrow, nbuf));
|
||||
if (rows > 0 &&
|
||||
cols > 0 &&
|
||||
frow >= 0 &&
|
||||
fcol >= 0 &&
|
||||
nrow >= 0 &&
|
||||
nbuf >= 0 &&
|
||||
((err = E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error */
|
||||
(New_Field = (FIELD *)malloc(sizeof(FIELD))) != 0)
|
||||
{
|
||||
*New_Field = default_field;
|
||||
New_Field->rows = rows;
|
||||
New_Field->cols = cols;
|
||||
*New_Field = default_field;
|
||||
New_Field->rows = rows;
|
||||
New_Field->cols = cols;
|
||||
New_Field->drows = rows + nrow;
|
||||
New_Field->dcols = cols;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
New_Field->nrow = nrow;
|
||||
New_Field->nbuf = nbuf;
|
||||
New_Field->link = New_Field;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
New_Field->nrow = nrow;
|
||||
New_Field->nbuf = nbuf;
|
||||
New_Field->link = New_Field;
|
||||
|
||||
if (_nc_Copy_Type(New_Field,&default_field))
|
||||
#if USE_WIDEC_SUPPORT
|
||||
New_Field->working = newpad(1, Buffer_Length(New_Field) + 1);
|
||||
New_Field->expanded = (char **)calloc(1 + (unsigned)rows, sizeof(char *));
|
||||
#endif
|
||||
|
||||
if (_nc_Copy_Type(New_Field, &default_field))
|
||||
{
|
||||
size_t len;
|
||||
|
||||
len = Total_Buffer_Size(New_Field);
|
||||
if ((New_Field->buf = (char *)malloc(len)))
|
||||
if ((New_Field->buf = (FIELD_CELL *)malloc(len)))
|
||||
{
|
||||
/* Prefill buffers with blanks and insert terminating zeroes
|
||||
between buffers */
|
||||
int i;
|
||||
between buffers */
|
||||
int i, j;
|
||||
int cells = Buffer_Length(New_Field);
|
||||
|
||||
memset(New_Field->buf,' ',len);
|
||||
for(i=0;i<=New_Field->nbuf;i++)
|
||||
for (i = 0; i <= New_Field->nbuf; i++)
|
||||
{
|
||||
New_Field->buf[(New_Field->drows*New_Field->cols+1)*(i+1)-1]
|
||||
= '\0';
|
||||
FIELD_CELL *buffer = &(New_Field->buf[(cells + 1) * i]);
|
||||
|
||||
for (j = 0; j < cells; ++j)
|
||||
{
|
||||
buffer[j] = blank;
|
||||
}
|
||||
buffer[j] = zeros;
|
||||
}
|
||||
return New_Field;
|
||||
returnField(New_Field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (New_Field)
|
||||
if (New_Field)
|
||||
free_field(New_Field);
|
||||
|
||||
SET_ERROR( err );
|
||||
return (FIELD *)0;
|
||||
|
||||
SET_ERROR(err);
|
||||
returnField((FIELD *)0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int free_field( FIELD *field )
|
||||
|
|
||||
|
|
||||
| Description : Frees the storage allocated for the field.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
@ -324,28 +352,45 @@ new_field
|
||||
| E_CONNECTED - field is connected
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
free_field (FIELD * field)
|
||||
free_field(FIELD *field)
|
||||
{
|
||||
if (!field)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (field->form)
|
||||
RETURN(E_CONNECTED);
|
||||
|
||||
if (field == field->link)
|
||||
T((T_CALLED("free_field(%p)"), field));
|
||||
if (!field)
|
||||
{
|
||||
if (field->buf)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
}
|
||||
else if (field->form != 0)
|
||||
{
|
||||
RETURN(E_CONNECTED);
|
||||
}
|
||||
else if (field == field->link)
|
||||
{
|
||||
if (field->buf != 0)
|
||||
free(field->buf);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
FIELD *f;
|
||||
|
||||
for(f=field;f->link != field;f = f->link)
|
||||
{}
|
||||
for (f = field; f->link != field; f = f->link)
|
||||
{
|
||||
}
|
||||
f->link = field->link;
|
||||
}
|
||||
_nc_Free_Type(field);
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (field->expanded != 0)
|
||||
{
|
||||
int n;
|
||||
|
||||
for (n = 0; n <= field->nbuf; ++n)
|
||||
{
|
||||
FreeIfNeeded(field->expanded[n]);
|
||||
}
|
||||
free(field->expanded);
|
||||
(void)delwin(field->working);
|
||||
}
|
||||
#endif
|
||||
free(field);
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,72 +27,74 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_dup.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_dup.c,v 1.10 2004/12/25 22:24:10 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : FIELD *dup_field(FIELD *field, int frow, int fcol)
|
||||
|
|
||||
|
|
||||
| Description : Duplicates the field at the specified position. All
|
||||
| field attributes and the buffers are copied.
|
||||
| If an error occurs, errno is set to
|
||||
|
|
||||
|
|
||||
| E_BAD_ARGUMENT - invalid argument
|
||||
| E_SYSTEM_ERROR - system error
|
||||
|
|
||||
| Return Values : Pointer to the new field or NULL if failure
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELD *)
|
||||
dup_field (FIELD * field, int frow, int fcol)
|
||||
dup_field(FIELD *field, int frow, int fcol)
|
||||
{
|
||||
FIELD *New_Field = (FIELD *)0;
|
||||
int err = E_BAD_ARGUMENT;
|
||||
|
||||
if (field && (frow>=0) && (fcol>=0) &&
|
||||
((err=E_SYSTEM_ERROR) != 0) && /* trick : this resets the default error */
|
||||
(New_Field=(FIELD *)malloc(sizeof(FIELD))) )
|
||||
T((T_CALLED("dup_field(%p,%d,%d)"), field, frow, fcol));
|
||||
if (field && (frow >= 0) && (fcol >= 0) &&
|
||||
((err = E_SYSTEM_ERROR) != 0) && /* trick : this resets the default error */
|
||||
(New_Field = (FIELD *)malloc(sizeof(FIELD))))
|
||||
{
|
||||
*New_Field = *_nc_Default_Field;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
New_Field->link = New_Field;
|
||||
New_Field->rows = field->rows;
|
||||
New_Field->cols = field->cols;
|
||||
New_Field->nrow = field->nrow;
|
||||
New_Field->drows = field->drows;
|
||||
New_Field->dcols = field->dcols;
|
||||
*New_Field = *_nc_Default_Field;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
New_Field->link = New_Field;
|
||||
New_Field->rows = field->rows;
|
||||
New_Field->cols = field->cols;
|
||||
New_Field->nrow = field->nrow;
|
||||
New_Field->drows = field->drows;
|
||||
New_Field->dcols = field->dcols;
|
||||
New_Field->maxgrow = field->maxgrow;
|
||||
New_Field->nbuf = field->nbuf;
|
||||
New_Field->just = field->just;
|
||||
New_Field->fore = field->fore;
|
||||
New_Field->back = field->back;
|
||||
New_Field->pad = field->pad;
|
||||
New_Field->opts = field->opts;
|
||||
New_Field->usrptr = field->usrptr;
|
||||
New_Field->nbuf = field->nbuf;
|
||||
New_Field->just = field->just;
|
||||
New_Field->fore = field->fore;
|
||||
New_Field->back = field->back;
|
||||
New_Field->pad = field->pad;
|
||||
New_Field->opts = field->opts;
|
||||
New_Field->usrptr = field->usrptr;
|
||||
|
||||
if (_nc_Copy_Type(New_Field,field))
|
||||
if (_nc_Copy_Type(New_Field, field))
|
||||
{
|
||||
size_t len;
|
||||
size_t i, len;
|
||||
|
||||
len = Total_Buffer_Size(New_Field);
|
||||
if ( (New_Field->buf=(char *)malloc(len)) )
|
||||
if ((New_Field->buf = (FIELD_CELL *)malloc(len)))
|
||||
{
|
||||
memcpy(New_Field->buf,field->buf,len);
|
||||
return New_Field;
|
||||
for (i = 0; i < len; ++i)
|
||||
New_Field->buf[i] = field->buf[i];
|
||||
returnField(New_Field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (New_Field)
|
||||
if (New_Field)
|
||||
free_field(New_Field);
|
||||
|
||||
SET_ERROR(err);
|
||||
return (FIELD *)0;
|
||||
returnField((FIELD *)0);
|
||||
}
|
||||
|
||||
/* fld_dup.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_ftchoice.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_ftchoice.c,v 1.9 2004/12/11 21:44:57 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -47,12 +47,13 @@ MODULE_ID("$Id: fld_ftchoice.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid arguments
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_fieldtype_choice
|
||||
(FIELDTYPE * typ,
|
||||
bool (* const next_choice) (FIELD *,const void *),
|
||||
bool (* const prev_choice) (FIELD *,const void *))
|
||||
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 )
|
||||
T((T_CALLED("set_fieldtype_choice(%p,%p,%p)"), typ, next_choice, prev_choice));
|
||||
|
||||
if (!typ || !next_choice || !prev_choice)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
typ->status |= _HAS_CHOICE;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_ftlink.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_ftlink.c,v 1.11 2004/12/25 22:24:10 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -46,40 +46,41 @@ MODULE_ID("$Id: fld_ftlink.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid arguments
|
||||
| E_SYSTEM_ERROR - system error (no memory)
|
||||
|
|
||||
| Return Values : Fieldtype pointer or NULL if error occured.
|
||||
| Return Values : Fieldtype pointer or NULL if error occurred.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELDTYPE *)
|
||||
link_fieldtype
|
||||
(FIELDTYPE * type1, FIELDTYPE * type2)
|
||||
link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2)
|
||||
{
|
||||
FIELDTYPE *nftyp = (FIELDTYPE *)0;
|
||||
|
||||
if ( type1 && type2 )
|
||||
T((T_CALLED("link_fieldtype(%p,%p)"), type1, type2));
|
||||
if (type1 && type2)
|
||||
{
|
||||
nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE));
|
||||
|
||||
if (nftyp)
|
||||
{
|
||||
*nftyp = *_nc_Default_FieldType;
|
||||
nftyp->status |= _LINKED_TYPE;
|
||||
if ((type1->status & _HAS_ARGS) || (type2->status & _HAS_ARGS) )
|
||||
if ((type1->status & _HAS_ARGS) || (type2->status & _HAS_ARGS))
|
||||
nftyp->status |= _HAS_ARGS;
|
||||
if ((type1->status & _HAS_CHOICE) || (type2->status & _HAS_CHOICE) )
|
||||
if ((type1->status & _HAS_CHOICE) || (type2->status & _HAS_CHOICE))
|
||||
nftyp->status |= _HAS_CHOICE;
|
||||
nftyp->left = type1;
|
||||
nftyp->right = type2;
|
||||
nftyp->left = type1;
|
||||
nftyp->right = type2;
|
||||
type1->ref++;
|
||||
type2->ref++;
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_ERROR( E_SYSTEM_ERROR );
|
||||
SET_ERROR(E_SYSTEM_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_ERROR( E_BAD_ARGUMENT );
|
||||
SET_ERROR(E_BAD_ARGUMENT);
|
||||
}
|
||||
return nftyp;
|
||||
returnFieldType(nftyp);
|
||||
}
|
||||
|
||||
/* fld_ftlink.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_info.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_info.c,v 1.10 2004/12/11 22:24:57 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -47,24 +47,35 @@ MODULE_ID("$Id: fld_info.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid field pointer
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_info
|
||||
(const FIELD *field,
|
||||
int *rows, int *cols,
|
||||
int *frow, int *fcol,
|
||||
int *nrow, int *nbuf)
|
||||
field_info(const FIELD *field,
|
||||
int *rows, int *cols,
|
||||
int *frow, int *fcol,
|
||||
int *nrow, int *nbuf)
|
||||
{
|
||||
if (!field)
|
||||
T((T_CALLED("field_info(%p,%p,%p,%p,%p,%p,%p)"),
|
||||
field,
|
||||
rows, cols,
|
||||
frow, fcol,
|
||||
nrow, nbuf));
|
||||
|
||||
if (!field)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (rows) *rows = field->rows;
|
||||
if (cols) *cols = field->cols;
|
||||
if (frow) *frow = field->frow;
|
||||
if (fcol) *fcol = field->fcol;
|
||||
if (nrow) *nrow = field->nrow;
|
||||
if (nbuf) *nbuf = field->nbuf;
|
||||
if (rows)
|
||||
*rows = field->rows;
|
||||
if (cols)
|
||||
*cols = field->cols;
|
||||
if (frow)
|
||||
*frow = field->frow;
|
||||
if (fcol)
|
||||
*fcol = field->fcol;
|
||||
if (nrow)
|
||||
*nrow = field->nrow;
|
||||
if (nbuf)
|
||||
*nbuf = field->nbuf;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : int dynamic_field_info(const FIELD *field,
|
||||
@ -78,15 +89,19 @@ field_info
|
||||
| E_BAD_ARGUMENT - invalid argument
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
dynamic_field_info
|
||||
(const FIELD *field, int *drows, int *dcols, int *maxgrow)
|
||||
dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow)
|
||||
{
|
||||
T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"), field, drows, dcols, maxgrow));
|
||||
|
||||
if (!field)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (drows) *drows = field->drows;
|
||||
if (dcols) *dcols = field->dcols;
|
||||
if (maxgrow) *maxgrow = field->maxgrow;
|
||||
if (drows)
|
||||
*drows = field->drows;
|
||||
if (dcols)
|
||||
*dcols = field->dcols;
|
||||
if (maxgrow)
|
||||
*maxgrow = field->maxgrow;
|
||||
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_just.c,v 1.6 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_just.c,v 1.11 2004/12/11 22:55:48 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,20 +45,22 @@ MODULE_ID("$Id: fld_just.c,v 1.6 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_just (FIELD * field, int just)
|
||||
set_field_just(FIELD *field, int just)
|
||||
{
|
||||
int res = E_BAD_ARGUMENT;
|
||||
|
||||
if ((just==NO_JUSTIFICATION) ||
|
||||
(just==JUSTIFY_LEFT) ||
|
||||
(just==JUSTIFY_CENTER) ||
|
||||
(just==JUSTIFY_RIGHT) )
|
||||
T((T_CALLED("set_field_just(%p,%d)"), field, just));
|
||||
|
||||
if ((just == NO_JUSTIFICATION) ||
|
||||
(just == JUSTIFY_LEFT) ||
|
||||
(just == JUSTIFY_CENTER) ||
|
||||
(just == JUSTIFY_RIGHT))
|
||||
{
|
||||
Normalize_Field( field );
|
||||
Normalize_Field(field);
|
||||
if (field->just != just)
|
||||
{
|
||||
field->just = just;
|
||||
res = _nc_Synchronize_Attributes( field );
|
||||
res = _nc_Synchronize_Attributes(field);
|
||||
}
|
||||
else
|
||||
res = E_OK;
|
||||
@ -75,9 +77,10 @@ set_field_just (FIELD * field, int just)
|
||||
| Return Values : The justification type.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_just (const FIELD * field)
|
||||
field_just(const FIELD *field)
|
||||
{
|
||||
return Normalize_Field( field )->just;
|
||||
T((T_CALLED("field_just(%p)"), field));
|
||||
returnCode(Normalize_Field(field)->just);
|
||||
}
|
||||
|
||||
/* fld_just.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_link.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_link.c,v 1.9 2004/12/25 22:24:10 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -49,43 +49,47 @@ MODULE_ID("$Id: fld_link.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| Return Values : Pointer to the new field or NULL if failure
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELD *)
|
||||
link_field (FIELD * field, int frow, int fcol)
|
||||
link_field(FIELD *field, int frow, int fcol)
|
||||
{
|
||||
FIELD *New_Field = (FIELD *)0;
|
||||
int err = E_BAD_ARGUMENT;
|
||||
|
||||
if (field && (frow>=0) && (fcol>=0) &&
|
||||
((err=E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error */
|
||||
(New_Field = (FIELD *)malloc(sizeof(FIELD))) )
|
||||
T((T_CALLED("link_field(%p,%d,%d)"), field, frow, fcol));
|
||||
if (field && (frow >= 0) && (fcol >= 0) &&
|
||||
((err = E_SYSTEM_ERROR) != 0) && /* trick: this resets the default error */
|
||||
(New_Field = (FIELD *)malloc(sizeof(FIELD))))
|
||||
{
|
||||
*New_Field = *_nc_Default_Field;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
New_Field->link = field->link;
|
||||
field->link = New_Field;
|
||||
New_Field->buf = field->buf;
|
||||
New_Field->rows = field->rows;
|
||||
New_Field->cols = field->cols;
|
||||
New_Field->nrow = field->nrow;
|
||||
New_Field->nbuf = field->nbuf;
|
||||
New_Field->drows = field->drows;
|
||||
New_Field->dcols = field->dcols;
|
||||
New_Field->maxgrow= field->maxgrow;
|
||||
New_Field->just = field->just;
|
||||
New_Field->fore = field->fore;
|
||||
New_Field->back = field->back;
|
||||
New_Field->pad = field->pad;
|
||||
New_Field->opts = field->opts;
|
||||
*New_Field = *_nc_Default_Field;
|
||||
New_Field->frow = frow;
|
||||
New_Field->fcol = fcol;
|
||||
|
||||
New_Field->link = field->link;
|
||||
field->link = New_Field;
|
||||
|
||||
New_Field->buf = field->buf;
|
||||
New_Field->rows = field->rows;
|
||||
New_Field->cols = field->cols;
|
||||
New_Field->nrow = field->nrow;
|
||||
New_Field->nbuf = field->nbuf;
|
||||
New_Field->drows = field->drows;
|
||||
New_Field->dcols = field->dcols;
|
||||
New_Field->maxgrow = field->maxgrow;
|
||||
New_Field->just = field->just;
|
||||
New_Field->fore = field->fore;
|
||||
New_Field->back = field->back;
|
||||
New_Field->pad = field->pad;
|
||||
New_Field->opts = field->opts;
|
||||
New_Field->usrptr = field->usrptr;
|
||||
if (_nc_Copy_Type(New_Field,field))
|
||||
return New_Field;
|
||||
|
||||
if (_nc_Copy_Type(New_Field, field))
|
||||
returnField(New_Field);
|
||||
}
|
||||
|
||||
if (New_Field)
|
||||
if (New_Field)
|
||||
free_field(New_Field);
|
||||
|
||||
SET_ERROR( err );
|
||||
return (FIELD *)0;
|
||||
SET_ERROR(err);
|
||||
returnField((FIELD *)0);
|
||||
}
|
||||
|
||||
/* fld_link.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_max.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_max.c,v 1.9 2004/12/11 21:51:54 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,17 +45,19 @@ MODULE_ID("$Id: fld_max.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid argument
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_max_field (FIELD *field, int maxgrow)
|
||||
set_max_field(FIELD *field, int maxgrow)
|
||||
{
|
||||
if (!field || (maxgrow<0))
|
||||
T((T_CALLED("set_max_field(%p,%d)"), field, maxgrow));
|
||||
|
||||
if (!field || (maxgrow < 0))
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
else
|
||||
{
|
||||
bool single_line_field = Single_Line_Field(field);
|
||||
|
||||
if (maxgrow>0)
|
||||
if (maxgrow > 0)
|
||||
{
|
||||
if (( single_line_field && (maxgrow < field->dcols)) ||
|
||||
if ((single_line_field && (maxgrow < field->dcols)) ||
|
||||
(!single_line_field && (maxgrow < field->drows)))
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
}
|
||||
@ -63,13 +65,13 @@ set_max_field (FIELD *field, int maxgrow)
|
||||
field->status &= ~_MAY_GROW;
|
||||
if (!(field->opts & O_STATIC))
|
||||
{
|
||||
if ((maxgrow==0) ||
|
||||
( single_line_field && (field->dcols < maxgrow)) ||
|
||||
if ((maxgrow == 0) ||
|
||||
(single_line_field && (field->dcols < maxgrow)) ||
|
||||
(!single_line_field && (field->drows < maxgrow)))
|
||||
field->status |= _MAY_GROW;
|
||||
}
|
||||
}
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
|
||||
/* fld_max.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_move.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_move.c,v 1.9 2004/12/11 21:52:44 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -46,12 +46,14 @@ MODULE_ID("$Id: fld_move.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_CONNECTED - field is connected
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
move_field (FIELD *field, int frow, int fcol)
|
||||
move_field(FIELD *field, int frow, int fcol)
|
||||
{
|
||||
if ( !field || (frow<0) || (fcol<0) )
|
||||
T((T_CALLED("move_field(%p,%d,%d)"), field, frow, fcol));
|
||||
|
||||
if (!field || (frow < 0) || (fcol < 0))
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (field->form)
|
||||
if (field->form)
|
||||
RETURN(E_CONNECTED);
|
||||
|
||||
field->frow = frow;
|
||||
@ -60,4 +62,3 @@ move_field (FIELD *field, int frow, int fcol)
|
||||
}
|
||||
|
||||
/* fld_move.c ends here */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,54 +27,57 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_newftyp.c,v 1.6 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_newftyp.c,v 1.13 2004/12/25 22:24:10 tom Exp $")
|
||||
|
||||
static FIELDTYPE const default_fieldtype = {
|
||||
0, /* status */
|
||||
0L, /* reference count */
|
||||
(FIELDTYPE *)0, /* pointer to left operand */
|
||||
(FIELDTYPE *)0, /* pointer to right operand */
|
||||
NULL, /* makearg function */
|
||||
NULL, /* copyarg function */
|
||||
NULL, /* freearg function */
|
||||
NULL, /* field validation function */
|
||||
NULL, /* Character check function */
|
||||
NULL, /* enumerate next function */
|
||||
NULL /* enumerate previous function */
|
||||
static FIELDTYPE const default_fieldtype =
|
||||
{
|
||||
0, /* status */
|
||||
0L, /* reference count */
|
||||
(FIELDTYPE *)0, /* pointer to left operand */
|
||||
(FIELDTYPE *)0, /* pointer to right operand */
|
||||
NULL, /* makearg function */
|
||||
NULL, /* copyarg function */
|
||||
NULL, /* freearg function */
|
||||
NULL, /* field validation function */
|
||||
NULL, /* Character check function */
|
||||
NULL, /* enumerate next function */
|
||||
NULL /* enumerate previous function */
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(const FIELDTYPE*) _nc_Default_FieldType = &default_fieldtype;
|
||||
|
||||
NCURSES_EXPORT_VAR(const FIELDTYPE *)
|
||||
_nc_Default_FieldType = &default_fieldtype;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : FIELDTYPE *new_fieldtype(
|
||||
| bool (* const field_check)(FIELD *,const void *),
|
||||
| bool (* const char_check) (int, const void *) )
|
||||
|
|
||||
| bool (* const char_check) (int, const void *) )
|
||||
|
|
||||
| Description : Create a new fieldtype. The application programmer must
|
||||
| write a field_check and a char_check function and give
|
||||
| them as input to this call.
|
||||
| If an error occurs, errno is set to
|
||||
| If an error occurs, errno is set to
|
||||
| E_BAD_ARGUMENT - invalid arguments
|
||||
| E_SYSTEM_ERROR - system error (no memory)
|
||||
|
|
||||
| Return Values : Fieldtype pointer or NULL if error occured
|
||||
| Return Values : Fieldtype pointer or NULL if error occurred
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELDTYPE *)
|
||||
new_fieldtype (
|
||||
bool (* const field_check)(FIELD *,const void *),
|
||||
bool (* const char_check) (int,const void *) )
|
||||
new_fieldtype(bool (*const field_check) (FIELD *, const void *),
|
||||
bool (*const char_check) (int, const void *))
|
||||
{
|
||||
FIELDTYPE *nftyp = (FIELDTYPE *)0;
|
||||
|
||||
if ( (field_check) || (char_check) )
|
||||
|
||||
T((T_CALLED("new_fieldtype(%p,%p)"), field_check, char_check));
|
||||
if ((field_check) || (char_check))
|
||||
{
|
||||
nftyp = (FIELDTYPE *)malloc(sizeof(FIELDTYPE));
|
||||
|
||||
if (nftyp)
|
||||
{
|
||||
*nftyp = default_fieldtype;
|
||||
@ -83,20 +86,20 @@ new_fieldtype (
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_ERROR( E_SYSTEM_ERROR );
|
||||
SET_ERROR(E_SYSTEM_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_ERROR( E_BAD_ARGUMENT );
|
||||
SET_ERROR(E_BAD_ARGUMENT);
|
||||
}
|
||||
return nftyp;
|
||||
returnFieldType(nftyp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int free_fieldtype(FIELDTYPE *typ)
|
||||
|
|
||||
|
|
||||
| Description : Release the memory associated with this fieldtype.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
@ -104,12 +107,14 @@ new_fieldtype (
|
||||
| E_BAD_ARGUMENT - invalid fieldtype pointer
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
free_fieldtype (FIELDTYPE *typ)
|
||||
free_fieldtype(FIELDTYPE *typ)
|
||||
{
|
||||
T((T_CALLED("free_fieldtype(%p)"), typ));
|
||||
|
||||
if (!typ)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (typ->ref!=0)
|
||||
if (typ->ref != 0)
|
||||
RETURN(E_CONNECTED);
|
||||
|
||||
if (typ->status & _RESIDENT)
|
||||
@ -117,8 +122,10 @@ free_fieldtype (FIELDTYPE *typ)
|
||||
|
||||
if (typ->status & _LINKED_TYPE)
|
||||
{
|
||||
if (typ->left ) typ->left->ref--;
|
||||
if (typ->right) typ->right->ref--;
|
||||
if (typ->left)
|
||||
typ->left->ref--;
|
||||
if (typ->right)
|
||||
typ->right->ref--;
|
||||
}
|
||||
free(typ);
|
||||
RETURN(E_OK);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,11 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_opts.c,v 1.7 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_opts.c,v 1.11 2004/12/11 21:55:46 tom Exp $")
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Field-Options manipulation routines
|
||||
@ -50,12 +51,15 @@ MODULE_ID("$Id: fld_opts.c,v 1.7 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_opts (FIELD * field, Field_Options opts)
|
||||
set_field_opts(FIELD *field, Field_Options opts)
|
||||
{
|
||||
int res = E_BAD_ARGUMENT;
|
||||
|
||||
T((T_CALLED("set_field_opts(%p,%d)"), field, opts));
|
||||
|
||||
opts &= ALL_FIELD_OPTS;
|
||||
if (!(opts & ~ALL_FIELD_OPTS))
|
||||
res = _nc_Synchronize_Options( Normalize_Field(field), opts );
|
||||
res = _nc_Synchronize_Options(Normalize_Field(field), opts);
|
||||
RETURN(res);
|
||||
}
|
||||
|
||||
@ -68,9 +72,11 @@ set_field_opts (FIELD * field, Field_Options opts)
|
||||
| Return Values : The options.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(Field_Options)
|
||||
field_opts (const FIELD * field)
|
||||
field_opts(const FIELD *field)
|
||||
{
|
||||
return ALL_FIELD_OPTS & Normalize_Field( field )->opts;
|
||||
T((T_CALLED("field_opts(%p)"), field));
|
||||
|
||||
returnCode(ALL_FIELD_OPTS & Normalize_Field(field)->opts);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -86,15 +92,17 @@ field_opts (const FIELD * field)
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_opts_on (FIELD * field, Field_Options opts)
|
||||
field_opts_on(FIELD *field, Field_Options opts)
|
||||
{
|
||||
int res = E_BAD_ARGUMENT;
|
||||
|
||||
T((T_CALLED("field_opts_on(%p,%d)"), field, opts));
|
||||
|
||||
opts &= ALL_FIELD_OPTS;
|
||||
if (!(opts & ~ALL_FIELD_OPTS))
|
||||
{
|
||||
Normalize_Field( field );
|
||||
res = _nc_Synchronize_Options( field, field->opts | opts );
|
||||
Normalize_Field(field);
|
||||
res = _nc_Synchronize_Options(field, field->opts | opts);
|
||||
}
|
||||
RETURN(res);
|
||||
}
|
||||
@ -112,17 +120,19 @@ field_opts_on (FIELD * field, Field_Options opts)
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_opts_off (FIELD * field, Field_Options opts)
|
||||
field_opts_off(FIELD *field, Field_Options opts)
|
||||
{
|
||||
int res = E_BAD_ARGUMENT;
|
||||
|
||||
T((T_CALLED("field_opts_off(%p,%d)"), field, opts));
|
||||
|
||||
opts &= ALL_FIELD_OPTS;
|
||||
if (!(opts & ~ALL_FIELD_OPTS))
|
||||
{
|
||||
Normalize_Field( field );
|
||||
res = _nc_Synchronize_Options( field, field->opts & ~opts );
|
||||
Normalize_Field(field);
|
||||
res = _nc_Synchronize_Options(field, field->opts & ~opts);
|
||||
}
|
||||
RETURN(res);
|
||||
}
|
||||
}
|
||||
|
||||
/* fld_opts.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,11 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_pad.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_pad.c,v 1.9 2004/12/11 21:56:49 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,17 +46,19 @@ MODULE_ID("$Id: fld_pad.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_pad (FIELD * field, int ch)
|
||||
set_field_pad(FIELD *field, int ch)
|
||||
{
|
||||
int res = E_BAD_ARGUMENT;
|
||||
|
||||
Normalize_Field( field );
|
||||
if (isprint((unsigned char)ch))
|
||||
T((T_CALLED("set_field_pad(%p,%d)"), field, ch));
|
||||
|
||||
Normalize_Field(field);
|
||||
if (isprint(UChar(ch)))
|
||||
{
|
||||
if (field->pad != ch)
|
||||
{
|
||||
field->pad = ch;
|
||||
res = _nc_Synchronize_Attributes( field );
|
||||
res = _nc_Synchronize_Attributes(field);
|
||||
}
|
||||
else
|
||||
res = E_OK;
|
||||
@ -72,9 +75,11 @@ set_field_pad (FIELD * field, int ch)
|
||||
| Return Values : The pad character.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_pad (const FIELD * field)
|
||||
field_pad(const FIELD *field)
|
||||
{
|
||||
return Normalize_Field( field )->pad;
|
||||
T((T_CALLED("field_pad(%p)"), field));
|
||||
|
||||
returnCode(Normalize_Field(field)->pad);
|
||||
}
|
||||
|
||||
/* fld_pad.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_page.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_page.c,v 1.9 2004/12/11 21:58:19 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,13 +45,15 @@ MODULE_ID("$Id: fld_page.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_CONNECTED - field is connected
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_new_page (FIELD * field, bool new_page_flag)
|
||||
set_new_page(FIELD *field, bool new_page_flag)
|
||||
{
|
||||
T((T_CALLED("set_new_page(%p,%d)"), field, new_page_flag));
|
||||
|
||||
Normalize_Field(field);
|
||||
if (field->form)
|
||||
if (field->form)
|
||||
RETURN(E_CONNECTED);
|
||||
|
||||
if (new_page_flag)
|
||||
if (new_page_flag)
|
||||
field->status |= _NEWPAGE;
|
||||
else
|
||||
field->status &= ~_NEWPAGE;
|
||||
@ -70,9 +72,11 @@ set_new_page (FIELD * field, bool new_page_flag)
|
||||
| FALSE - field doesn't start a new page
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(bool)
|
||||
new_page (const FIELD * field)
|
||||
new_page(const FIELD *field)
|
||||
{
|
||||
return (Normalize_Field(field)->status & _NEWPAGE) ? TRUE : FALSE;
|
||||
T((T_CALLED("new_page(%p)"), field));
|
||||
|
||||
returnBool((Normalize_Field(field)->status & _NEWPAGE) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
/* fld_page.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_stat.c,v 1.7 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_stat.c,v 1.11 2004/12/11 22:28:00 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -44,16 +44,18 @@ MODULE_ID("$Id: fld_stat.c,v 1.7 2000/12/10 02:09:38 tom Exp $")
|
||||
| Return Values : E_OK - success
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_status (FIELD * field, bool status)
|
||||
set_field_status(FIELD *field, bool status)
|
||||
{
|
||||
Normalize_Field( field );
|
||||
T((T_CALLED("set_field_status(%p,%d)"), field, status));
|
||||
|
||||
Normalize_Field(field);
|
||||
|
||||
if (status)
|
||||
field->status |= _CHANGED;
|
||||
else
|
||||
field->status &= ~_CHANGED;
|
||||
|
||||
return(E_OK);
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -67,9 +69,11 @@ set_field_status (FIELD * field, bool status)
|
||||
| FALSE - buffer has not been changed
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(bool)
|
||||
field_status (const FIELD * field)
|
||||
field_status(const FIELD *field)
|
||||
{
|
||||
return ((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE);
|
||||
T((T_CALLED("field_status(%p)"), field));
|
||||
|
||||
returnBool((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
/* fld_stat.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_type.c,v 1.10 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_type.c,v 1.15 2004/12/25 22:24:10 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -46,30 +46,32 @@ MODULE_ID("$Id: fld_type.c,v 1.10 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_type (FIELD *field,FIELDTYPE *type, ...)
|
||||
set_field_type(FIELD *field, FIELDTYPE *type,...)
|
||||
{
|
||||
va_list ap;
|
||||
int res = E_SYSTEM_ERROR;
|
||||
int err = 0;
|
||||
|
||||
va_start(ap,type);
|
||||
T((T_CALLED("set_field_type(%p,%p)"), field, type));
|
||||
|
||||
va_start(ap, type);
|
||||
|
||||
Normalize_Field(field);
|
||||
_nc_Free_Type(field);
|
||||
|
||||
field->type = type;
|
||||
field->arg = (void *)_nc_Make_Argument(field->type,&ap,&err);
|
||||
field->arg = (void *)_nc_Make_Argument(field->type, &ap, &err);
|
||||
|
||||
if (err)
|
||||
{
|
||||
_nc_Free_Argument(field->type,(TypeArgument *)(field->arg));
|
||||
_nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
|
||||
field->type = (FIELDTYPE *)0;
|
||||
field->arg = (void *)0;
|
||||
field->arg = (void *)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = E_OK;
|
||||
if (field->type)
|
||||
if (field->type)
|
||||
field->type->ref++;
|
||||
}
|
||||
|
||||
@ -86,9 +88,10 @@ set_field_type (FIELD *field,FIELDTYPE *type, ...)
|
||||
| Return Values : Pointer to fieldtype of NULL if none is defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELDTYPE *)
|
||||
field_type (const FIELD * field)
|
||||
field_type(const FIELD *field)
|
||||
{
|
||||
return Normalize_Field(field)->type;
|
||||
T((T_CALLED("field_type(%p)"), field));
|
||||
returnFieldType(Normalize_Field(field)->type);
|
||||
}
|
||||
|
||||
/* fld_type.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fld_user.c,v 1.9 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: fld_user.c,v 1.15 2004/12/25 22:24:50 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -44,9 +44,11 @@ MODULE_ID("$Id: fld_user.c,v 1.9 2000/12/10 02:09:38 tom Exp $")
|
||||
| Return Values : E_OK - on success
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_field_userptr (FIELD * field, void *usrptr)
|
||||
set_field_userptr(FIELD *field, void *usrptr)
|
||||
{
|
||||
Normalize_Field( field )->usrptr = usrptr;
|
||||
T((T_CALLED("set_field_userptr(%p,%p)"), field, usrptr));
|
||||
|
||||
Normalize_Field(field)->usrptr = usrptr;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
@ -61,9 +63,10 @@ set_field_userptr (FIELD * field, void *usrptr)
|
||||
| NULL is returned
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(void *)
|
||||
field_userptr (const FIELD *field)
|
||||
field_userptr(const FIELD *field)
|
||||
{
|
||||
return Normalize_Field( field )->usrptr;
|
||||
T((T_CALLED("field_userptr(%p)"), field));
|
||||
returnVoidPtr(Normalize_Field(field)->usrptr);
|
||||
}
|
||||
|
||||
/* fld_user.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,9 +27,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: form.h,v 0.20 2004/12/04 22:22:10 tom Exp $ */
|
||||
|
||||
#ifndef FORM_H
|
||||
#define FORM_H
|
||||
|
||||
@ -40,6 +42,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef FORM_PRIV_H
|
||||
typedef void *FIELD_CELL;
|
||||
#endif
|
||||
|
||||
#ifndef NCURSES_FIELD_INTERNALS
|
||||
#define NCURSES_FIELD_INTERNALS /* nothing */
|
||||
#endif
|
||||
|
||||
typedef int Form_Options;
|
||||
typedef int Field_Options;
|
||||
|
||||
@ -48,10 +58,10 @@ typedef int Field_Options;
|
||||
**********/
|
||||
|
||||
typedef struct {
|
||||
short pmin; /* index of first field on page */
|
||||
short pmax; /* index of last field on page */
|
||||
short smin; /* index of top leftmost field on page */
|
||||
short smax; /* index of bottom rightmost field on page */
|
||||
short pmin; /* index of first field on page */
|
||||
short pmax; /* index of last field on page */
|
||||
short smin; /* index of top leftmost field on page */
|
||||
short smax; /* index of bottom rightmost field on page */
|
||||
} _PAGE;
|
||||
|
||||
/**********
|
||||
@ -59,31 +69,40 @@ typedef struct {
|
||||
**********/
|
||||
|
||||
typedef struct fieldnode {
|
||||
unsigned short status; /* flags */
|
||||
short rows; /* size in rows */
|
||||
short cols; /* size in cols */
|
||||
short frow; /* first row */
|
||||
short fcol; /* first col */
|
||||
int drows; /* dynamic rows */
|
||||
int dcols; /* dynamic cols */
|
||||
int maxgrow; /* maximum field growth */
|
||||
int nrow; /* offscreen rows */
|
||||
short nbuf; /* additional buffers */
|
||||
short just; /* justification */
|
||||
short page; /* page on form */
|
||||
short index; /* into form -> field */
|
||||
int pad; /* pad character */
|
||||
chtype fore; /* foreground attribute */
|
||||
chtype back; /* background attribute */
|
||||
Field_Options opts; /* options */
|
||||
struct fieldnode * snext; /* sorted order pointer */
|
||||
struct fieldnode * sprev; /* sorted order pointer */
|
||||
struct fieldnode * link; /* linked field chain */
|
||||
struct formnode * form; /* containing form */
|
||||
struct typenode * type; /* field type */
|
||||
void * arg; /* argument for type */
|
||||
char * buf; /* field buffers */
|
||||
void * usrptr; /* user pointer */
|
||||
unsigned short status; /* flags */
|
||||
short rows; /* size in rows */
|
||||
short cols; /* size in cols */
|
||||
short frow; /* first row */
|
||||
short fcol; /* first col */
|
||||
int drows; /* dynamic rows */
|
||||
int dcols; /* dynamic cols */
|
||||
int maxgrow; /* maximum field growth */
|
||||
int nrow; /* off-screen rows */
|
||||
short nbuf; /* additional buffers */
|
||||
short just; /* justification */
|
||||
short page; /* page on form */
|
||||
short index; /* into form -> field */
|
||||
int pad; /* pad character */
|
||||
chtype fore; /* foreground attribute */
|
||||
chtype back; /* background attribute */
|
||||
Field_Options opts; /* options */
|
||||
struct fieldnode * snext; /* sorted order pointer */
|
||||
struct fieldnode * sprev; /* sorted order pointer */
|
||||
struct fieldnode * link; /* linked field chain */
|
||||
struct formnode * form; /* containing form */
|
||||
struct typenode * type; /* field type */
|
||||
void * arg; /* argument for type */
|
||||
FIELD_CELL * buf; /* field buffers */
|
||||
void * usrptr; /* user pointer */
|
||||
/*
|
||||
* The wide-character configuration requires extra information. Because
|
||||
* there are existing applications that manipulate the members of FIELD
|
||||
* directly, we cannot make the struct opaque. Offsets of members up to
|
||||
* this point are the same in the narrow- and wide-character configuration.
|
||||
* But note that the type of buf depends on the configuration, and is made
|
||||
* opaque for that reason.
|
||||
*/
|
||||
NCURSES_FIELD_INTERNALS
|
||||
} FIELD;
|
||||
|
||||
/**************
|
||||
@ -91,20 +110,20 @@ typedef struct fieldnode {
|
||||
**************/
|
||||
|
||||
typedef struct typenode {
|
||||
unsigned short status; /* flags */
|
||||
long ref; /* reference count */
|
||||
struct typenode * left; /* ptr to operand for | */
|
||||
struct typenode * right; /* ptr to operand for | */
|
||||
unsigned short status; /* flags */
|
||||
long ref; /* reference count */
|
||||
struct typenode * left; /* ptr to operand for | */
|
||||
struct typenode * right; /* ptr to operand for | */
|
||||
|
||||
void* (*makearg)(va_list *); /* make fieldtype arg */
|
||||
void* (*copyarg)(const void *); /* copy fieldtype arg */
|
||||
void (*freearg)(void *); /* free fieldtype arg */
|
||||
void* (*makearg)(va_list *); /* make fieldtype arg */
|
||||
void* (*copyarg)(const void *); /* copy fieldtype arg */
|
||||
void (*freearg)(void *); /* free fieldtype arg */
|
||||
|
||||
bool (*fcheck)(FIELD *,const void *); /* field validation */
|
||||
bool (*ccheck)(int,const void *); /* character validation */
|
||||
bool (*fcheck)(FIELD *,const void *); /* field validation */
|
||||
bool (*ccheck)(int,const void *); /* character validation */
|
||||
|
||||
bool (*next)(FIELD *,const void *); /* enumerate next value */
|
||||
bool (*prev)(FIELD *,const void *); /* enumerate prev value */
|
||||
bool (*next)(FIELD *,const void *); /* enumerate next value */
|
||||
bool (*prev)(FIELD *,const void *); /* enumerate prev value */
|
||||
|
||||
} FIELDTYPE;
|
||||
|
||||
@ -113,29 +132,29 @@ typedef struct typenode {
|
||||
*********/
|
||||
|
||||
typedef struct formnode {
|
||||
unsigned short status; /* flags */
|
||||
short rows; /* size in rows */
|
||||
short cols; /* size in cols */
|
||||
int currow; /* current row in field window*/
|
||||
int curcol; /* current col in field window*/
|
||||
int toprow; /* in scrollable field window */
|
||||
int begincol; /* in horiz. scrollable field */
|
||||
short maxfield; /* number of fields */
|
||||
short maxpage; /* number of pages */
|
||||
short curpage; /* index into page */
|
||||
Form_Options opts; /* options */
|
||||
WINDOW * win; /* window */
|
||||
WINDOW * sub; /* subwindow */
|
||||
WINDOW * w; /* window for current field */
|
||||
FIELD ** field; /* field [maxfield] */
|
||||
FIELD * current; /* current field */
|
||||
_PAGE * page; /* page [maxpage] */
|
||||
void * usrptr; /* user pointer */
|
||||
unsigned short status; /* flags */
|
||||
short rows; /* size in rows */
|
||||
short cols; /* size in cols */
|
||||
int currow; /* current row in field window */
|
||||
int curcol; /* current col in field window */
|
||||
int toprow; /* in scrollable field window */
|
||||
int begincol; /* in horiz. scrollable field */
|
||||
short maxfield; /* number of fields */
|
||||
short maxpage; /* number of pages */
|
||||
short curpage; /* index into page */
|
||||
Form_Options opts; /* options */
|
||||
WINDOW * win; /* window */
|
||||
WINDOW * sub; /* subwindow */
|
||||
WINDOW * w; /* window for current field */
|
||||
FIELD ** field; /* field [maxfield] */
|
||||
FIELD * current; /* current field */
|
||||
_PAGE * page; /* page [maxpage] */
|
||||
void * usrptr; /* user pointer */
|
||||
|
||||
void (*forminit)(struct formnode *);
|
||||
void (*formterm)(struct formnode *);
|
||||
void (*fieldinit)(struct formnode *);
|
||||
void (*fieldterm)(struct formnode *);
|
||||
void (*forminit)(struct formnode *);
|
||||
void (*formterm)(struct formnode *);
|
||||
void (*fieldinit)(struct formnode *);
|
||||
void (*fieldterm)(struct formnode *);
|
||||
|
||||
} FORM;
|
||||
|
||||
@ -152,20 +171,20 @@ typedef void (*Form_Hook)(FORM *);
|
||||
#define JUSTIFY_RIGHT (3)
|
||||
|
||||
/* field options */
|
||||
#define O_VISIBLE (0x0001)
|
||||
#define O_ACTIVE (0x0002)
|
||||
#define O_PUBLIC (0x0004)
|
||||
#define O_EDIT (0x0008)
|
||||
#define O_WRAP (0x0010)
|
||||
#define O_BLANK (0x0020)
|
||||
#define O_AUTOSKIP (0x0040)
|
||||
#define O_NULLOK (0x0080)
|
||||
#define O_PASSOK (0x0100)
|
||||
#define O_STATIC (0x0200)
|
||||
#define O_VISIBLE (0x0001U)
|
||||
#define O_ACTIVE (0x0002U)
|
||||
#define O_PUBLIC (0x0004U)
|
||||
#define O_EDIT (0x0008U)
|
||||
#define O_WRAP (0x0010U)
|
||||
#define O_BLANK (0x0020U)
|
||||
#define O_AUTOSKIP (0x0040U)
|
||||
#define O_NULLOK (0x0080U)
|
||||
#define O_PASSOK (0x0100U)
|
||||
#define O_STATIC (0x0200U)
|
||||
|
||||
/* form options */
|
||||
#define O_NL_OVERLOAD (0x0001)
|
||||
#define O_BS_OVERLOAD (0x0002)
|
||||
#define O_NL_OVERLOAD (0x0001U)
|
||||
#define O_BS_OVERLOAD (0x0002U)
|
||||
|
||||
/* form driver commands */
|
||||
#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */
|
||||
@ -207,7 +226,7 @@ typedef void (*Form_Hook)(FORM *);
|
||||
#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */
|
||||
#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */
|
||||
#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */
|
||||
#define REQ_DEL_WORD (KEY_MAX + 37) /* delete line at cursor */
|
||||
#define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */
|
||||
#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */
|
||||
#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */
|
||||
#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */
|
||||
@ -217,14 +236,14 @@ typedef void (*Form_Hook)(FORM *);
|
||||
#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */
|
||||
#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */
|
||||
#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */
|
||||
#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
|
||||
#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
|
||||
#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
|
||||
#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
|
||||
#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
|
||||
#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
|
||||
#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
|
||||
#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
|
||||
#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */
|
||||
#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */
|
||||
#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */
|
||||
#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */
|
||||
#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */
|
||||
#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */
|
||||
#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */
|
||||
#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */
|
||||
|
||||
#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */
|
||||
#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */
|
||||
@ -253,15 +272,15 @@ 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 *
|
||||
* They are not defined in SVr4 *
|
||||
************************************/
|
||||
extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */
|
||||
|
||||
/***********************
|
||||
* Default objects *
|
||||
***********************/
|
||||
/***********************
|
||||
* Default objects *
|
||||
***********************/
|
||||
extern NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form;
|
||||
extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
|
||||
|
||||
@ -271,8 +290,9 @@ extern NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field;
|
||||
***********************/
|
||||
extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype (
|
||||
bool (* const field_check)(FIELD *,const void *),
|
||||
bool (* const char_check)(int,const void *)),
|
||||
*link_fieldtype(FIELDTYPE *,FIELDTYPE *);
|
||||
bool (* const char_check)(int,const void *));
|
||||
extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype(
|
||||
FIELDTYPE *, FIELDTYPE *);
|
||||
|
||||
extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *);
|
||||
extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *,
|
||||
@ -324,7 +344,7 @@ 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 *);
|
||||
extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *);
|
||||
|
||||
/******************
|
||||
* FORM routines *
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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,71 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: form.priv.h,v 0.26 2006/12/17 19:47:09 tom Exp $ */
|
||||
|
||||
#ifndef FORM_PRIV_H
|
||||
#define FORM_PRIV_H 1
|
||||
|
||||
#include "curses.priv.h"
|
||||
#include "mf_common.h"
|
||||
|
||||
#if USE_WIDEC_SUPPORT
|
||||
#include <wchar.h>
|
||||
|
||||
#if HAVE_WCTYPE_H
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */
|
||||
#endif
|
||||
|
||||
#define FIELD_CELL NCURSES_CH_T
|
||||
|
||||
#define NCURSES_FIELD_INTERNALS char** expanded; WINDOW *working;
|
||||
#define NCURSES_FIELD_EXTENSION , (char **)0, (WINDOW *)0
|
||||
|
||||
#else
|
||||
|
||||
#define FIELD_CELL char
|
||||
|
||||
#define NCURSES_FIELD_EXTENSION /* nothing */
|
||||
|
||||
#endif
|
||||
|
||||
#include "form.h"
|
||||
|
||||
/* form status values */
|
||||
#define _OVLMODE (0x04) /* Form is in overlay mode */
|
||||
#define _WINDOW_MODIFIED (0x10) /* Current field window has been modified */
|
||||
#define _FCHECK_REQUIRED (0x20) /* Current field needs validation */
|
||||
#define _OVLMODE (0x04U) /* Form is in overlay mode */
|
||||
#define _WINDOW_MODIFIED (0x10U) /* Current field window has been modified */
|
||||
#define _FCHECK_REQUIRED (0x20U) /* Current field needs validation */
|
||||
|
||||
/* field status values */
|
||||
#define _CHANGED (0x01) /* Field has been changed */
|
||||
#define _NEWTOP (0x02) /* Vertical scrolling occured */
|
||||
#define _NEWPAGE (0x04) /* field begins new page of form */
|
||||
#define _MAY_GROW (0x08) /* dynamic field may still grow */
|
||||
#define _CHANGED (0x01U) /* Field has been changed */
|
||||
#define _NEWTOP (0x02U) /* Vertical scrolling occurred */
|
||||
#define _NEWPAGE (0x04U) /* field begins new page of form */
|
||||
#define _MAY_GROW (0x08U) /* dynamic field may still grow */
|
||||
|
||||
/* fieldtype status values */
|
||||
#define _LINKED_TYPE (0x01) /* Type is a linked type */
|
||||
#define _HAS_ARGS (0x02) /* Type has arguments */
|
||||
#define _HAS_CHOICE (0x04) /* Type has choice methods */
|
||||
#define _RESIDENT (0x08) /* Type is builtin */
|
||||
#define _LINKED_TYPE (0x01U) /* Type is a linked type */
|
||||
#define _HAS_ARGS (0x02U) /* Type has arguments */
|
||||
#define _HAS_CHOICE (0x04U) /* Type has choice methods */
|
||||
#define _RESIDENT (0x08U) /* Type is built-in */
|
||||
|
||||
/* This are the field options required to be a selectable field in field
|
||||
navigation requests */
|
||||
#define O_SELECTABLE (O_ACTIVE | O_VISIBLE)
|
||||
|
||||
/* If form is NULL replace form argument by default-form */
|
||||
#define Normalize_Form(form) ((form)=(form)?(form):_nc_Default_Form)
|
||||
#define Normalize_Form(form) \
|
||||
((form) = (form != 0) ? (form) : _nc_Default_Form)
|
||||
|
||||
/* If field is NULL replace field argument by default-field */
|
||||
#define Normalize_Field(field) ((field)=(field)?(field):_nc_Default_Field)
|
||||
#define Normalize_Field(field) \
|
||||
((field) = (field != 0) ? (field) : _nc_Default_Field)
|
||||
|
||||
/* Retrieve forms window */
|
||||
#define Get_Form_Window(form) \
|
||||
@ -69,20 +102,22 @@
|
||||
|
||||
/* Calculate the total size of all buffers for this field */
|
||||
#define Total_Buffer_Size(field) \
|
||||
( (Buffer_Length(field) + 1) * (1+(field)->nbuf) )
|
||||
( (Buffer_Length(field) + 1) * (1+(field)->nbuf) * sizeof(FIELD_CELL) )
|
||||
|
||||
/* Logic to determine whether or not a field is single lined */
|
||||
#define Single_Line_Field(field) \
|
||||
(((field)->rows + (field)->nrow) == 1)
|
||||
|
||||
/* Logic to determine whether or not a field is selectable */
|
||||
#define Field_Is_Selectable(f) (((f)->opts & O_SELECTABLE)==O_SELECTABLE)
|
||||
#define Field_Is_Not_Selectable(f) (((f)->opts & O_SELECTABLE)!=O_SELECTABLE)
|
||||
#define Field_Is_Selectable(f) (((unsigned)((f)->opts) & O_SELECTABLE)==O_SELECTABLE)
|
||||
#define Field_Is_Not_Selectable(f) (((unsigned)((f)->opts) & O_SELECTABLE)!=O_SELECTABLE)
|
||||
|
||||
typedef struct typearg {
|
||||
struct typearg *left;
|
||||
struct typearg *right;
|
||||
} TypeArgument;
|
||||
typedef struct typearg
|
||||
{
|
||||
struct typearg *left;
|
||||
struct typearg *right;
|
||||
}
|
||||
TypeArgument;
|
||||
|
||||
/* This is a dummy request code (normally invalid) to be used internally
|
||||
with the form_driver() routine to position to the first active field
|
||||
@ -94,7 +129,7 @@ typedef struct typearg {
|
||||
O_NL_OVERLOAD |\
|
||||
O_BS_OVERLOAD )
|
||||
|
||||
#define ALL_FIELD_OPTS ( \
|
||||
#define ALL_FIELD_OPTS (Field_Options)( \
|
||||
O_VISIBLE |\
|
||||
O_ACTIVE |\
|
||||
O_PUBLIC |\
|
||||
@ -106,23 +141,112 @@ typedef struct typearg {
|
||||
O_PASSOK |\
|
||||
O_STATIC )
|
||||
|
||||
|
||||
#define C_BLANK ' '
|
||||
#define is_blank(c) ((c)==C_BLANK)
|
||||
|
||||
#define C_ZEROS '\0'
|
||||
|
||||
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(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_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_Set_Current_Field (FORM*, FIELD*);
|
||||
extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*);
|
||||
|
||||
#if USE_WIDEC_SUPPORT
|
||||
extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
|
||||
#endif
|
||||
|
||||
#ifdef TRACE
|
||||
|
||||
#define returnField(code) TRACE_RETURN(code,field)
|
||||
#define returnFieldPtr(code) TRACE_RETURN(code,field_ptr)
|
||||
#define returnForm(code) TRACE_RETURN(code,form)
|
||||
#define returnFieldType(code) TRACE_RETURN(code,field_type)
|
||||
#define returnFormHook(code) TRACE_RETURN(code,form_hook)
|
||||
|
||||
extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **);
|
||||
extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *);
|
||||
extern NCURSES_EXPORT(FIELDTYPE *) _nc_retrace_field_type (FIELDTYPE *);
|
||||
extern NCURSES_EXPORT(FORM *) _nc_retrace_form (FORM *);
|
||||
extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
|
||||
|
||||
#else /* !TRACE */
|
||||
|
||||
#define returnFieldPtr(code) return code
|
||||
#define returnFieldType(code) return code
|
||||
#define returnField(code) return code
|
||||
#define returnForm(code) return code
|
||||
#define returnFormHook(code) return code
|
||||
|
||||
#endif /* TRACE/!TRACE */
|
||||
|
||||
/*
|
||||
* Use Check_CTYPE_Field() to simplify FIELDTYPE's that use only the ccheck()
|
||||
* function.
|
||||
*/
|
||||
#if USE_WIDEC_SUPPORT
|
||||
#define Check_CTYPE_Field(result, buffer, width, ccheck) \
|
||||
while (*buffer && *buffer == ' ') \
|
||||
buffer++; \
|
||||
if (*buffer) \
|
||||
{ \
|
||||
bool blank = FALSE; \
|
||||
int len; \
|
||||
int n; \
|
||||
wchar_t *list = _nc_Widen_String((char *)buffer, &len); \
|
||||
if (list != 0) \
|
||||
{ \
|
||||
result = TRUE; \
|
||||
for (n = 0; n < len; ++n) \
|
||||
{ \
|
||||
if (blank) \
|
||||
{ \
|
||||
if (list[n] != ' ') \
|
||||
{ \
|
||||
result = FALSE; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
else if (list[n] == ' ') \
|
||||
{ \
|
||||
blank = TRUE; \
|
||||
result = (n + 1 >= width); \
|
||||
} \
|
||||
else if (!ccheck(list[n], NULL)) \
|
||||
{ \
|
||||
result = FALSE; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
free(list); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define Check_CTYPE_Field(result, buffer, width, ccheck) \
|
||||
while (*buffer && *buffer == ' ') \
|
||||
buffer++; \
|
||||
if (*buffer) \
|
||||
{ \
|
||||
unsigned char *s = buffer; \
|
||||
int l = -1; \
|
||||
while (*buffer && ccheck(*buffer, NULL)) \
|
||||
buffer++; \
|
||||
l = (int)(buffer - s); \
|
||||
while (*buffer && *buffer == ' ') \
|
||||
buffer++; \
|
||||
result = ((*buffer || (l < width)) ? FALSE : TRUE); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FORM_PRIV_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,11 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_cursor.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: frm_cursor.c,v 1.9 2004/12/11 22:01:03 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -48,16 +49,18 @@ MODULE_ID("$Id: frm_cursor.c,v 1.5 2000/12/10 02:09:38 tom Exp $")
|
||||
| E_NOT_POSTED - Form is not posted
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
pos_form_cursor (FORM * form)
|
||||
pos_form_cursor(FORM *form)
|
||||
{
|
||||
int res;
|
||||
|
||||
T((T_CALLED("pos_form_cursor(%p)"), form));
|
||||
|
||||
if (!form)
|
||||
res = E_BAD_ARGUMENT;
|
||||
res = E_BAD_ARGUMENT;
|
||||
else
|
||||
{
|
||||
if (!(form->status & _POSTED))
|
||||
res = E_NOT_POSTED;
|
||||
res = E_NOT_POSTED;
|
||||
else
|
||||
res = _nc_Position_Form_Cursor(form);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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,28 +27,30 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_data.c,v 1.7 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: frm_data.c,v 1.14 2005/11/26 15:34:01 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : bool data_behind(const FORM *form)
|
||||
|
|
||||
| Description : Check for off-screen data behind. This is nearly trivial
|
||||
| becose the begin of a field is fixed.
|
||||
| because the beginning of a field is fixed.
|
||||
|
|
||||
| Return Values : TRUE - there are off-screen data behind
|
||||
| FALSE - there are no off-screen data behind
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(bool)
|
||||
data_behind (const FORM *form)
|
||||
data_behind(const FORM *form)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
T((T_CALLED("data_behind(%p)"), form));
|
||||
|
||||
if (form && (form->status & _POSTED) && form->current)
|
||||
{
|
||||
FIELD *field;
|
||||
@ -56,42 +58,69 @@ data_behind (const FORM *form)
|
||||
field = form->current;
|
||||
if (!Single_Line_Field(field))
|
||||
{
|
||||
result = (form->toprow==0) ? FALSE : TRUE;
|
||||
result = (form->toprow == 0) ? FALSE : TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (form->begincol==0) ? FALSE : TRUE;
|
||||
result = (form->begincol == 0) ? FALSE : TRUE;
|
||||
}
|
||||
}
|
||||
return(result);
|
||||
returnBool(result);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static char * After_Last_Non_Pad_Position(
|
||||
| char *buffer,
|
||||
| Function : static char * Only_Padding(
|
||||
| WINDOW *w,
|
||||
| int len,
|
||||
| int pad)
|
||||
|
|
||||
| Description : Find the last position in the buffer that doesn't
|
||||
| Description : Test if 'length' cells starting at the current position
|
||||
| contain a padding character.
|
||||
|
|
||||
| Return Values : The pointer to this position
|
||||
| Return Values : true if only padding cells are found
|
||||
+--------------------------------------------------------------------------*/
|
||||
INLINE
|
||||
static char * After_Last_Non_Pad_Position(char *buffer, int len, int pad)
|
||||
NCURSES_INLINE static bool
|
||||
Only_Padding(WINDOW *w, int len, int pad)
|
||||
{
|
||||
char *end = buffer + len;
|
||||
bool result = TRUE;
|
||||
int y, x, j;
|
||||
FIELD_CELL cell;
|
||||
|
||||
assert(buffer && len>=0);
|
||||
while ( (buffer < end) && (*(end-1)==pad) )
|
||||
end--;
|
||||
|
||||
return end;
|
||||
getyx(w, y, x);
|
||||
for (j = 0; j < len; ++j)
|
||||
{
|
||||
if (wmove(w, y, x + j) != ERR)
|
||||
{
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (win_wch(w, &cell) != ERR)
|
||||
{
|
||||
if ((chtype)CharOf(cell) != ChCharOf(pad)
|
||||
|| cell.chars[1] != 0)
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
cell = winch(w);
|
||||
if (ChCharOf(cell) != ChCharOf(pad))
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
/* if an error, return true: no non-padding text found */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* no need to reset the cursor position; caller does this */
|
||||
return result;
|
||||
}
|
||||
|
||||
#define SMALL_BUFFER_SIZE (80)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : bool data_ahead(const FORM *form)
|
||||
@ -103,31 +132,21 @@ static char * After_Last_Non_Pad_Position(char *buffer, int len, int pad)
|
||||
| FALSE - there are no off-screen data ahead
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(bool)
|
||||
data_ahead (const FORM *form)
|
||||
data_ahead(const FORM *form)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
T((T_CALLED("data_ahead(%p)"), form));
|
||||
|
||||
if (form && (form->status & _POSTED) && form->current)
|
||||
{
|
||||
static char buffer[SMALL_BUFFER_SIZE + 1];
|
||||
FIELD *field;
|
||||
bool large_buffer;
|
||||
bool cursor_moved = FALSE;
|
||||
char *bp;
|
||||
char *found_content;
|
||||
int pos;
|
||||
|
||||
field = form->current;
|
||||
assert(form->w);
|
||||
|
||||
large_buffer = (field->cols > SMALL_BUFFER_SIZE);
|
||||
if (large_buffer)
|
||||
bp = (char *)malloc((size_t)(field->cols) + 1);
|
||||
else
|
||||
bp = buffer;
|
||||
|
||||
assert(bp);
|
||||
|
||||
if (Single_Line_Field(field))
|
||||
{
|
||||
int check_len;
|
||||
@ -136,15 +155,12 @@ data_ahead (const FORM *form)
|
||||
while (pos < field->dcols)
|
||||
{
|
||||
check_len = field->dcols - pos;
|
||||
if ( check_len >= field->cols )
|
||||
if (check_len >= field->cols)
|
||||
check_len = field->cols;
|
||||
cursor_moved = TRUE;
|
||||
wmove(form->w,0,pos);
|
||||
winnstr(form->w,bp,check_len);
|
||||
found_content =
|
||||
After_Last_Non_Pad_Position(bp,check_len,field->pad);
|
||||
if (found_content==bp)
|
||||
pos += field->cols;
|
||||
wmove(form->w, 0, pos);
|
||||
if (Only_Padding(form->w, check_len, field->pad))
|
||||
pos += field->cols;
|
||||
else
|
||||
{
|
||||
result = TRUE;
|
||||
@ -158,12 +174,9 @@ data_ahead (const FORM *form)
|
||||
while (pos < field->drows)
|
||||
{
|
||||
cursor_moved = TRUE;
|
||||
wmove(form->w,pos,0);
|
||||
wmove(form->w, pos, 0);
|
||||
pos++;
|
||||
winnstr(form->w,bp,field->cols);
|
||||
found_content =
|
||||
After_Last_Non_Pad_Position(bp,field->cols,field->pad);
|
||||
if (found_content!=bp)
|
||||
if (!Only_Padding(form->w, field->cols, field->pad))
|
||||
{
|
||||
result = TRUE;
|
||||
break;
|
||||
@ -171,13 +184,10 @@ data_ahead (const FORM *form)
|
||||
}
|
||||
}
|
||||
|
||||
if (large_buffer)
|
||||
free(bp);
|
||||
|
||||
if (cursor_moved)
|
||||
wmove(form->w,form->currow,form->curcol);
|
||||
wmove(form->w, form->currow, form->curcol);
|
||||
}
|
||||
return(result);
|
||||
returnBool(result);
|
||||
}
|
||||
|
||||
/* frm_data.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,37 +27,38 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_def.c,v 1.10 2000/12/10 02:09:38 tom Exp $")
|
||||
MODULE_ID("$Id: frm_def.c,v 1.20 2006/11/04 16:57:15 tom Exp $")
|
||||
|
||||
/* this can't be readonly */
|
||||
static FORM default_form = {
|
||||
0, /* status */
|
||||
0, /* rows */
|
||||
0, /* cols */
|
||||
0, /* currow */
|
||||
0, /* curcol */
|
||||
0, /* toprow */
|
||||
0, /* begincol */
|
||||
-1, /* maxfield */
|
||||
-1, /* maxpage */
|
||||
-1, /* curpage */
|
||||
ALL_FORM_OPTS, /* opts */
|
||||
(WINDOW *)0, /* win */
|
||||
(WINDOW *)0, /* sub */
|
||||
(WINDOW *)0, /* w */
|
||||
(FIELD **)0, /* field */
|
||||
(FIELD *)0, /* current */
|
||||
(_PAGE *)0, /* page */
|
||||
(char *)0, /* usrptr */
|
||||
NULL, /* forminit */
|
||||
NULL, /* formterm */
|
||||
NULL, /* fieldinit */
|
||||
NULL /* fieldterm */
|
||||
static FORM default_form =
|
||||
{
|
||||
0, /* status */
|
||||
0, /* rows */
|
||||
0, /* cols */
|
||||
0, /* currow */
|
||||
0, /* curcol */
|
||||
0, /* toprow */
|
||||
0, /* begincol */
|
||||
-1, /* maxfield */
|
||||
-1, /* maxpage */
|
||||
-1, /* curpage */
|
||||
ALL_FORM_OPTS, /* opts */
|
||||
(WINDOW *)0, /* win */
|
||||
(WINDOW *)0, /* sub */
|
||||
(WINDOW *)0, /* w */
|
||||
(FIELD **)0, /* field */
|
||||
(FIELD *)0, /* current */
|
||||
(_PAGE *) 0, /* page */
|
||||
(char *)0, /* usrptr */
|
||||
NULL, /* forminit */
|
||||
NULL, /* formterm */
|
||||
NULL, /* fieldinit */
|
||||
NULL /* fieldterm */
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
|
||||
@ -74,39 +75,40 @@ NCURSES_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
|
||||
|
|
||||
| Return Values : New head of sorted fieldlist
|
||||
+--------------------------------------------------------------------------*/
|
||||
static FIELD *Insert_Field_By_Position(FIELD *newfield, FIELD *head)
|
||||
static FIELD *
|
||||
Insert_Field_By_Position(FIELD *newfield, FIELD *head)
|
||||
{
|
||||
FIELD *current, *newhead;
|
||||
|
||||
|
||||
assert(newfield);
|
||||
|
||||
if (!head)
|
||||
{ /* empty list is trivial */
|
||||
{ /* empty list is trivial */
|
||||
newhead = newfield->snext = newfield->sprev = newfield;
|
||||
}
|
||||
else
|
||||
{
|
||||
newhead = current = head;
|
||||
while((current->frow < newfield->frow) ||
|
||||
((current->frow==newfield->frow) &&
|
||||
(current->fcol < newfield->fcol)) )
|
||||
while ((current->frow < newfield->frow) ||
|
||||
((current->frow == newfield->frow) &&
|
||||
(current->fcol < newfield->fcol)))
|
||||
{
|
||||
current = current->snext;
|
||||
if (current==head)
|
||||
{ /* We cycled through. Reset head to indicate that */
|
||||
if (current == head)
|
||||
{ /* We cycled through. Reset head to indicate that */
|
||||
head = (FIELD *)0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* we leave the loop with current pointing to the field after newfield*/
|
||||
newfield->snext = current;
|
||||
newfield->sprev = current->sprev;
|
||||
/* we leave the loop with current pointing to the field after newfield */
|
||||
newfield->snext = current;
|
||||
newfield->sprev = current->sprev;
|
||||
newfield->snext->sprev = newfield;
|
||||
newfield->sprev->snext = newfield;
|
||||
if (current==head)
|
||||
if (current == head)
|
||||
newhead = newfield;
|
||||
}
|
||||
return(newhead);
|
||||
return (newhead);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -117,25 +119,26 @@ static FIELD *Insert_Field_By_Position(FIELD *newfield, FIELD *head)
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Disconnect_Fields( FORM * form )
|
||||
static void
|
||||
Disconnect_Fields(FORM *form)
|
||||
{
|
||||
if (form->field)
|
||||
{
|
||||
FIELD **fields;
|
||||
|
||||
for(fields=form->field;*fields;fields++)
|
||||
for (fields = form->field; *fields; fields++)
|
||||
{
|
||||
if (form == (*fields)->form)
|
||||
if (form == (*fields)->form)
|
||||
(*fields)->form = (FORM *)0;
|
||||
}
|
||||
|
||||
|
||||
form->rows = form->cols = 0;
|
||||
form->maxfield = form->maxpage = -1;
|
||||
form->field = (FIELD **)0;
|
||||
if (form->page)
|
||||
if (form->page)
|
||||
free(form->page);
|
||||
form->page = (_PAGE *)0;
|
||||
}
|
||||
form->page = (_PAGE *) 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -149,82 +152,86 @@ static void Disconnect_Fields( FORM * form )
|
||||
| E_BAD_ARGUMENT - Invalid form pointer or field array
|
||||
| E_SYSTEM_ERROR - not enough memory
|
||||
+--------------------------------------------------------------------------*/
|
||||
static int Connect_Fields(FORM * form, FIELD ** fields)
|
||||
static int
|
||||
Connect_Fields(FORM *form, FIELD **fields)
|
||||
{
|
||||
int field_cnt, j;
|
||||
int page_nr;
|
||||
int maximum_row_in_field, maximum_col_in_field;
|
||||
_PAGE *pg;
|
||||
|
||||
|
||||
T((T_CALLED("Connect_Fields(%p,%p)"), form, fields));
|
||||
|
||||
assert(form);
|
||||
|
||||
form->field = fields;
|
||||
form->field = fields;
|
||||
form->maxfield = 0;
|
||||
form->maxpage = 0;
|
||||
form->maxpage = 0;
|
||||
|
||||
if (!fields)
|
||||
RETURN(E_OK);
|
||||
|
||||
|
||||
page_nr = 0;
|
||||
/* store formpointer in fields and count pages */
|
||||
for(field_cnt=0;fields[field_cnt];field_cnt++)
|
||||
for (field_cnt = 0; fields[field_cnt]; field_cnt++)
|
||||
{
|
||||
if (fields[field_cnt]->form)
|
||||
if (fields[field_cnt]->form)
|
||||
RETURN(E_CONNECTED);
|
||||
if ( field_cnt==0 ||
|
||||
(fields[field_cnt]->status & _NEWPAGE))
|
||||
if (field_cnt == 0 ||
|
||||
(fields[field_cnt]->status & _NEWPAGE))
|
||||
page_nr++;
|
||||
fields[field_cnt]->form = form;
|
||||
}
|
||||
if (field_cnt==0)
|
||||
}
|
||||
if (field_cnt == 0 || (short)field_cnt < 0)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
|
||||
/* allocate page structures */
|
||||
if ( (pg = (_PAGE *)malloc(page_nr * sizeof(_PAGE))) != (_PAGE *)0 )
|
||||
if ((pg = (_PAGE *) malloc(page_nr * sizeof(_PAGE))) != (_PAGE *) 0)
|
||||
{
|
||||
form->page = pg;
|
||||
}
|
||||
else
|
||||
RETURN(E_SYSTEM_ERROR);
|
||||
|
||||
|
||||
/* Cycle through fields and calculate page boundaries as well as
|
||||
size of the form */
|
||||
for(j=0;j<field_cnt;j++)
|
||||
for (j = 0; j < field_cnt; j++)
|
||||
{
|
||||
if (j==0)
|
||||
if (j == 0)
|
||||
pg->pmin = j;
|
||||
else
|
||||
{
|
||||
if (fields[j]->status & _NEWPAGE)
|
||||
{
|
||||
pg->pmax = j-1;
|
||||
pg->pmax = j - 1;
|
||||
pg++;
|
||||
pg->pmin = j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
maximum_row_in_field = fields[j]->frow + fields[j]->rows;
|
||||
maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
|
||||
|
||||
if (form->rows < maximum_row_in_field)
|
||||
|
||||
if (form->rows < maximum_row_in_field)
|
||||
form->rows = maximum_row_in_field;
|
||||
if (form->cols < maximum_col_in_field)
|
||||
if (form->cols < maximum_col_in_field)
|
||||
form->cols = maximum_col_in_field;
|
||||
}
|
||||
|
||||
pg->pmax = field_cnt-1;
|
||||
|
||||
pg->pmax = field_cnt - 1;
|
||||
form->maxfield = field_cnt;
|
||||
form->maxpage = page_nr;
|
||||
|
||||
form->maxpage = page_nr;
|
||||
|
||||
/* Sort fields on form pages */
|
||||
for(page_nr = 0;page_nr < form->maxpage; page_nr++)
|
||||
for (page_nr = 0; page_nr < form->maxpage; page_nr++)
|
||||
{
|
||||
FIELD *fld = (FIELD *)0;
|
||||
for(j = form->page[page_nr].pmin;j <= form->page[page_nr].pmax;j++)
|
||||
|
||||
for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
|
||||
{
|
||||
fields[j]->index = j;
|
||||
fields[j]->page = page_nr;
|
||||
fld = Insert_Field_By_Position(fields[j],fld);
|
||||
fields[j]->page = page_nr;
|
||||
fld = Insert_Field_By_Position(fields[j], fld);
|
||||
}
|
||||
form->page[page_nr].smin = fld->index;
|
||||
form->page[page_nr].smax = fld->sprev->index;
|
||||
@ -240,46 +247,56 @@ static int Connect_Fields(FORM * form, FIELD ** fields)
|
||||
| If there are fields, position to first active field.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
| any other - error occured
|
||||
| E_BAD_ARGUMENT - Invalid form pointer or field array
|
||||
| E_CONNECTED - a field is already connected
|
||||
| E_SYSTEM_ERROR - not enough memory
|
||||
+--------------------------------------------------------------------------*/
|
||||
INLINE static int Associate_Fields(FORM *form, FIELD **fields)
|
||||
NCURSES_INLINE static int
|
||||
Associate_Fields(FORM *form, FIELD **fields)
|
||||
{
|
||||
int res = Connect_Fields(form,fields);
|
||||
int res = Connect_Fields(form, fields);
|
||||
|
||||
if (res == E_OK)
|
||||
{
|
||||
if (form->maxpage>0)
|
||||
if (form->maxpage > 0)
|
||||
{
|
||||
form->curpage = 0;
|
||||
form_driver(form,FIRST_ACTIVE_MAGIC);
|
||||
form_driver(form, FIRST_ACTIVE_MAGIC);
|
||||
}
|
||||
else
|
||||
{
|
||||
form->curpage = -1;
|
||||
form->current = (FIELD *)0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return(res);
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : FORM *new_form( FIELD **fields )
|
||||
|
|
||||
| Description : Create new form with given array of fields.
|
||||
|
|
||||
| Return Values : Pointer to form. NULL if error occured.
|
||||
| Return Values : Pointer to form. NULL if error occurred.
|
||||
! Set errno:
|
||||
| E_OK - success
|
||||
| E_BAD_ARGUMENT - Invalid form pointer or field array
|
||||
| E_CONNECTED - a field is already connected
|
||||
| E_SYSTEM_ERROR - not enough memory
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FORM *)
|
||||
new_form (FIELD ** fields)
|
||||
{
|
||||
new_form(FIELD **fields)
|
||||
{
|
||||
int err = E_SYSTEM_ERROR;
|
||||
|
||||
FORM *form = (FORM *)malloc(sizeof(FORM));
|
||||
|
||||
|
||||
T((T_CALLED("new_form(%p)"), fields));
|
||||
if (form)
|
||||
{
|
||||
*form = *_nc_Default_Form;
|
||||
if ((err=Associate_Fields(form,fields))!=E_OK)
|
||||
if ((err = Associate_Fields(form, fields)) != E_OK)
|
||||
{
|
||||
free_form(form);
|
||||
form = (FORM *)0;
|
||||
@ -288,8 +305,8 @@ new_form (FIELD ** fields)
|
||||
|
||||
if (!form)
|
||||
SET_ERROR(err);
|
||||
|
||||
return(form);
|
||||
|
||||
returnForm(form);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -303,19 +320,21 @@ new_form (FIELD ** fields)
|
||||
| E_POSTED - form is posted
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
free_form (FORM * form)
|
||||
free_form(FORM *form)
|
||||
{
|
||||
if ( !form )
|
||||
T((T_CALLED("free_form(%p)"), form));
|
||||
|
||||
if (!form)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if ( form->status & _POSTED)
|
||||
if (form->status & _POSTED)
|
||||
RETURN(E_POSTED);
|
||||
|
||||
Disconnect_Fields( form );
|
||||
if (form->page)
|
||||
|
||||
Disconnect_Fields(form);
|
||||
if (form->page)
|
||||
free(form->page);
|
||||
free(form);
|
||||
|
||||
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
@ -325,31 +344,35 @@ free_form (FORM * form)
|
||||
|
|
||||
| Description : Set a new association of an array of fields to a form
|
||||
|
|
||||
| Return Values : E_OK - no error
|
||||
| E_BAD_ARGUMENT - invalid form pointer
|
||||
| E_POSTED - form is posted
|
||||
| Return Values : E_OK - no error
|
||||
| E_BAD_ARGUMENT - Invalid form pointer or field array
|
||||
| E_CONNECTED - a field is already connected
|
||||
| E_POSTED - form is posted
|
||||
| E_SYSTEM_ERROR - not enough memory
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_fields (FORM * form, FIELD ** fields)
|
||||
set_form_fields(FORM *form, FIELD **fields)
|
||||
{
|
||||
FIELD **old;
|
||||
int res;
|
||||
|
||||
if ( !form )
|
||||
|
||||
T((T_CALLED("set_form_fields(%p,%p)"), form, fields));
|
||||
|
||||
if (!form)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if ( form->status & _POSTED )
|
||||
if (form->status & _POSTED)
|
||||
RETURN(E_POSTED);
|
||||
|
||||
|
||||
old = form->field;
|
||||
Disconnect_Fields( form );
|
||||
|
||||
if( (res = Associate_Fields( form, fields )) != E_OK )
|
||||
Connect_Fields( form, old );
|
||||
|
||||
Disconnect_Fields(form);
|
||||
|
||||
if ((res = Associate_Fields(form, fields)) != E_OK)
|
||||
Connect_Fields(form, old);
|
||||
|
||||
RETURN(res);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : FIELD **form_fields( const FORM *form )
|
||||
@ -359,9 +382,10 @@ set_form_fields (FORM * form, FIELD ** fields)
|
||||
| Return Values : Pointer to field array
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(FIELD **)
|
||||
form_fields (const FORM * form)
|
||||
form_fields(const FORM *form)
|
||||
{
|
||||
return (Normalize_Form( form )->field);
|
||||
T((T_CALLED("form_field(%p)"), form));
|
||||
returnFieldPtr(Normalize_Form(form)->field);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -373,9 +397,11 @@ form_fields (const FORM * form)
|
||||
| Return Values : Number of fields, -1 if none are defined
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
field_count (const FORM * form)
|
||||
field_count(const FORM *form)
|
||||
{
|
||||
return (Normalize_Form( form )->maxfield);
|
||||
T((T_CALLED("field_count(%p)"), form));
|
||||
|
||||
returnCode(Normalize_Form(form)->maxfield);
|
||||
}
|
||||
|
||||
/* frm_def.c ends here */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,17 +27,18 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_hook.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_hook.c,v 1.14 2004/12/25 22:37:27 tom Exp $")
|
||||
|
||||
/* "Template" macro to generate function to set application specific hook */
|
||||
#define GEN_HOOK_SET_FUNCTION( typ, name ) \
|
||||
NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
|
||||
{\
|
||||
T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), form, func));\
|
||||
(Normalize_Form( form ) -> typ ## name) = func ;\
|
||||
RETURN(E_OK);\
|
||||
}
|
||||
@ -46,95 +47,96 @@ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook f
|
||||
#define GEN_HOOK_GET_FUNCTION( typ, name ) \
|
||||
NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\
|
||||
{\
|
||||
return ( Normalize_Form( form ) -> typ ## name );\
|
||||
T((T_CALLED(#typ "_" #name "(%p)"), form));\
|
||||
returnFormHook( Normalize_Form( form ) -> typ ## name );\
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_field_init(FORM *form, Form_Hook f)
|
||||
|
|
||||
|
|
||||
| Description : Assigns an application defined initialization function
|
||||
| to be called when the form is posted and just after
|
||||
| the current field changes.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_SET_FUNCTION(field,init)
|
||||
GEN_HOOK_SET_FUNCTION(field, init)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : Form_Hook field_init(const FORM *form)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve field initialization routine address.
|
||||
|
|
||||
| Return Values : The address or NULL if no hook defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_GET_FUNCTION(field,init)
|
||||
GEN_HOOK_GET_FUNCTION(field, init)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_field_term(FORM *form, Form_Hook f)
|
||||
|
|
||||
|
|
||||
| Description : Assigns an application defined finalization function
|
||||
| to be called when the form is unposted and just before
|
||||
| the current field changes.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_SET_FUNCTION(field,term)
|
||||
GEN_HOOK_SET_FUNCTION(field, term)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : Form_Hook field_term(const FORM *form)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve field finalization routine address.
|
||||
|
|
||||
| Return Values : The address or NULL if no hook defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_GET_FUNCTION(field,term)
|
||||
GEN_HOOK_GET_FUNCTION(field, term)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_form_init(FORM *form, Form_Hook f)
|
||||
|
|
||||
|
|
||||
| Description : Assigns an application defined initialization function
|
||||
| to be called when the form is posted and just after
|
||||
| a page change.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_SET_FUNCTION(form,init)
|
||||
GEN_HOOK_SET_FUNCTION(form, init)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : Form_Hook form_init(const FORM *form)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve form initialization routine address.
|
||||
|
|
||||
| Return Values : The address or NULL if no hook defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_GET_FUNCTION(form,init)
|
||||
GEN_HOOK_GET_FUNCTION(form, init)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : int set_form_term(FORM *form, Form_Hook f)
|
||||
|
|
||||
|
|
||||
| Description : Assigns an application defined finalization function
|
||||
| to be called when the form is unposted and just before
|
||||
| a page change.
|
||||
|
|
||||
| Return Values : E_OK - success
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_SET_FUNCTION(form,term)
|
||||
GEN_HOOK_SET_FUNCTION(form, term)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Facility : libnform
|
||||
| Function : Form_Hook form_term(const FORM *form)
|
||||
|
|
||||
|
|
||||
| Description : Retrieve form finalization routine address.
|
||||
|
|
||||
| Return Values : The address or NULL if no hook defined.
|
||||
+--------------------------------------------------------------------------*/
|
||||
GEN_HOOK_GET_FUNCTION(form,term)
|
||||
GEN_HOOK_GET_FUNCTION(form, term)
|
||||
|
||||
/* frm_hook.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_opts.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_opts.c,v 1.14 2005/04/16 16:59:18 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,14 +45,16 @@ MODULE_ID("$Id: frm_opts.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_BAD_ARGUMENT - invalid options
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_opts (FORM * form, Form_Options opts)
|
||||
set_form_opts(FORM *form, Form_Options opts)
|
||||
{
|
||||
T((T_CALLED("set_form_opts(%p,%d)"), form, opts));
|
||||
|
||||
opts &= ALL_FORM_OPTS;
|
||||
if (opts & ~ALL_FORM_OPTS)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
else
|
||||
{
|
||||
Normalize_Form( form )->opts = opts;
|
||||
Normalize_Form(form)->opts = opts;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
}
|
||||
@ -66,9 +68,10 @@ set_form_opts (FORM * form, Form_Options opts)
|
||||
| Return Values : The option flags.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(Form_Options)
|
||||
form_opts (const FORM * form)
|
||||
form_opts(const FORM *form)
|
||||
{
|
||||
return (Normalize_Form(form)->opts & ALL_FORM_OPTS);
|
||||
T((T_CALLED("form_opts(%p)"), form));
|
||||
returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -82,14 +85,16 @@ form_opts (const FORM * form)
|
||||
| E_BAD_ARGUMENT - invalid options
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
form_opts_on (FORM * form, Form_Options opts)
|
||||
form_opts_on(FORM *form, Form_Options opts)
|
||||
{
|
||||
T((T_CALLED("form_opts_on(%p,%d)"), form, opts));
|
||||
|
||||
opts &= ALL_FORM_OPTS;
|
||||
if (opts & ~ALL_FORM_OPTS)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
else
|
||||
{
|
||||
Normalize_Form( form )->opts |= opts;
|
||||
Normalize_Form(form)->opts |= opts;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
}
|
||||
@ -105,8 +110,10 @@ form_opts_on (FORM * form, Form_Options opts)
|
||||
| E_BAD_ARGUMENT - invalid options
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
form_opts_off (FORM * form, Form_Options opts)
|
||||
form_opts_off(FORM *form, Form_Options opts)
|
||||
{
|
||||
T((T_CALLED("form_opts_off(%p,%d)"), form, opts));
|
||||
|
||||
opts &= ALL_FORM_OPTS;
|
||||
if (opts & ~ALL_FORM_OPTS)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_page.c,v 1.6 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_page.c,v 1.10 2004/12/11 22:08:21 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -47,35 +47,37 @@ MODULE_ID("$Id: frm_page.c,v 1.6 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_page (FORM * form, int page)
|
||||
set_form_page(FORM *form, int page)
|
||||
{
|
||||
int err = E_OK;
|
||||
|
||||
if ( !form || (page<0) || (page>=form->maxpage) )
|
||||
T((T_CALLED("set_form_page(%p,%d)"), form, page));
|
||||
|
||||
if (!form || (page < 0) || (page >= form->maxpage))
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (!(form->status & _POSTED))
|
||||
{
|
||||
form->curpage = page;
|
||||
form->current = _nc_First_Active_Field(form);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (form->status & _IN_DRIVER)
|
||||
if (form->status & _IN_DRIVER)
|
||||
err = E_BAD_STATE;
|
||||
else
|
||||
{
|
||||
if (form->curpage != page)
|
||||
{
|
||||
if (!_nc_Internal_Validation(form))
|
||||
if (!_nc_Internal_Validation(form))
|
||||
err = E_INVALID_FIELD;
|
||||
else
|
||||
{
|
||||
Call_Hook(form,fieldterm);
|
||||
Call_Hook(form,formterm);
|
||||
err = _nc_Set_Form_Page(form,page,(FIELD *)0);
|
||||
Call_Hook(form,forminit);
|
||||
Call_Hook(form,fieldinit);
|
||||
Call_Hook(form, fieldterm);
|
||||
Call_Hook(form, formterm);
|
||||
err = _nc_Set_Form_Page(form, page, (FIELD *)0);
|
||||
Call_Hook(form, forminit);
|
||||
Call_Hook(form, fieldinit);
|
||||
_nc_Refresh_Current_Field(form);
|
||||
}
|
||||
}
|
||||
@ -94,9 +96,11 @@ set_form_page (FORM * form, int page)
|
||||
| -1 : invalid form pointer
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
form_page (const FORM * form)
|
||||
form_page(const FORM *form)
|
||||
{
|
||||
return Normalize_Form(form)->curpage;
|
||||
T((T_CALLED("form_page(%p)"), form));
|
||||
|
||||
returnCode(Normalize_Form(form)->curpage);
|
||||
}
|
||||
|
||||
/* frm_page.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,11 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_post.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_post.c,v 1.9 2004/12/11 22:19:06 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -47,37 +48,39 @@ MODULE_ID("$Id: frm_post.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_SYSTEM_ERROR - system error
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
post_form (FORM * form)
|
||||
post_form(FORM *form)
|
||||
{
|
||||
WINDOW *formwin;
|
||||
int err;
|
||||
int page;
|
||||
|
||||
T((T_CALLED("post_form(%p)"), form));
|
||||
|
||||
if (!form)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (form->status & _POSTED)
|
||||
if (form->status & _POSTED)
|
||||
RETURN(E_POSTED);
|
||||
|
||||
if (!(form->field))
|
||||
RETURN(E_NOT_CONNECTED);
|
||||
|
||||
|
||||
formwin = Get_Form_Window(form);
|
||||
if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
|
||||
if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
|
||||
RETURN(E_NO_ROOM);
|
||||
|
||||
/* reset form->curpage to an invald value. This forces Set_Form_Page
|
||||
to do the page initialization which is required by post_form.
|
||||
*/
|
||||
*/
|
||||
page = form->curpage;
|
||||
form->curpage = -1;
|
||||
if ((err = _nc_Set_Form_Page(form,page,form->current))!=E_OK)
|
||||
if ((err = _nc_Set_Form_Page(form, page, form->current)) != E_OK)
|
||||
RETURN(err);
|
||||
|
||||
form->status |= _POSTED;
|
||||
|
||||
Call_Hook(form,forminit);
|
||||
Call_Hook(form,fieldinit);
|
||||
Call_Hook(form, forminit);
|
||||
Call_Hook(form, fieldinit);
|
||||
|
||||
_nc_Refresh_Current_Field(form);
|
||||
RETURN(E_OK);
|
||||
@ -95,19 +98,21 @@ post_form (FORM * form)
|
||||
| E_BAD_STATE - called from a hook routine
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
unpost_form (FORM * form)
|
||||
unpost_form(FORM *form)
|
||||
{
|
||||
T((T_CALLED("unpost_form(%p)"), form));
|
||||
|
||||
if (!form)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if (!(form->status & _POSTED))
|
||||
if (!(form->status & _POSTED))
|
||||
RETURN(E_NOT_POSTED);
|
||||
|
||||
if (form->status & _IN_DRIVER)
|
||||
if (form->status & _IN_DRIVER)
|
||||
RETURN(E_BAD_STATE);
|
||||
|
||||
Call_Hook(form,fieldterm);
|
||||
Call_Hook(form,formterm);
|
||||
Call_Hook(form, fieldterm);
|
||||
Call_Hook(form, formterm);
|
||||
|
||||
werase(Get_Form_Window(form));
|
||||
delwin(form->w);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
@ -37,71 +37,73 @@
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_req_name.c,v 1.8 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_req_name.c,v 1.15 2005/04/16 16:59:27 tom Exp $")
|
||||
|
||||
static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = {
|
||||
"NEXT_PAGE" ,
|
||||
"PREV_PAGE" ,
|
||||
"FIRST_PAGE" ,
|
||||
"LAST_PAGE" ,
|
||||
static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] =
|
||||
{
|
||||
"NEXT_PAGE",
|
||||
"PREV_PAGE",
|
||||
"FIRST_PAGE",
|
||||
"LAST_PAGE",
|
||||
|
||||
"NEXT_FIELD" ,
|
||||
"PREV_FIELD" ,
|
||||
"FIRST_FIELD" ,
|
||||
"LAST_FIELD" ,
|
||||
"SNEXT_FIELD" ,
|
||||
"SPREV_FIELD" ,
|
||||
"SFIRST_FIELD" ,
|
||||
"SLAST_FIELD" ,
|
||||
"LEFT_FIELD" ,
|
||||
"RIGHT_FIELD" ,
|
||||
"UP_FIELD" ,
|
||||
"DOWN_FIELD" ,
|
||||
"NEXT_FIELD",
|
||||
"PREV_FIELD",
|
||||
"FIRST_FIELD",
|
||||
"LAST_FIELD",
|
||||
"SNEXT_FIELD",
|
||||
"SPREV_FIELD",
|
||||
"SFIRST_FIELD",
|
||||
"SLAST_FIELD",
|
||||
"LEFT_FIELD",
|
||||
"RIGHT_FIELD",
|
||||
"UP_FIELD",
|
||||
"DOWN_FIELD",
|
||||
|
||||
"NEXT_CHAR" ,
|
||||
"PREV_CHAR" ,
|
||||
"NEXT_LINE" ,
|
||||
"PREV_LINE" ,
|
||||
"NEXT_WORD" ,
|
||||
"PREV_WORD" ,
|
||||
"BEG_FIELD" ,
|
||||
"END_FIELD" ,
|
||||
"BEG_LINE" ,
|
||||
"END_LINE" ,
|
||||
"LEFT_CHAR" ,
|
||||
"RIGHT_CHAR" ,
|
||||
"UP_CHAR" ,
|
||||
"DOWN_CHAR" ,
|
||||
"NEXT_CHAR",
|
||||
"PREV_CHAR",
|
||||
"NEXT_LINE",
|
||||
"PREV_LINE",
|
||||
"NEXT_WORD",
|
||||
"PREV_WORD",
|
||||
"BEG_FIELD",
|
||||
"END_FIELD",
|
||||
"BEG_LINE",
|
||||
"END_LINE",
|
||||
"LEFT_CHAR",
|
||||
"RIGHT_CHAR",
|
||||
"UP_CHAR",
|
||||
"DOWN_CHAR",
|
||||
|
||||
"NEW_LINE" ,
|
||||
"INS_CHAR" ,
|
||||
"INS_LINE" ,
|
||||
"DEL_CHAR" ,
|
||||
"DEL_PREV" ,
|
||||
"DEL_LINE" ,
|
||||
"DEL_WORD" ,
|
||||
"CLR_EOL" ,
|
||||
"CLR_EOF" ,
|
||||
"CLR_FIELD" ,
|
||||
"OVL_MODE" ,
|
||||
"INS_MODE" ,
|
||||
"SCR_FLINE" ,
|
||||
"SCR_BLINE" ,
|
||||
"SCR_FPAGE" ,
|
||||
"SCR_BPAGE" ,
|
||||
"SCR_FHPAGE" ,
|
||||
"SCR_BHPAGE" ,
|
||||
"SCR_FCHAR" ,
|
||||
"SCR_BCHAR" ,
|
||||
"SCR_HFLINE" ,
|
||||
"SCR_HBLINE" ,
|
||||
"SCR_HFHALF" ,
|
||||
"SCR_HBHALF" ,
|
||||
"NEW_LINE",
|
||||
"INS_CHAR",
|
||||
"INS_LINE",
|
||||
"DEL_CHAR",
|
||||
"DEL_PREV",
|
||||
"DEL_LINE",
|
||||
"DEL_WORD",
|
||||
"CLR_EOL",
|
||||
"CLR_EOF",
|
||||
"CLR_FIELD",
|
||||
"OVL_MODE",
|
||||
"INS_MODE",
|
||||
"SCR_FLINE",
|
||||
"SCR_BLINE",
|
||||
"SCR_FPAGE",
|
||||
"SCR_BPAGE",
|
||||
"SCR_FHPAGE",
|
||||
"SCR_BHPAGE",
|
||||
"SCR_FCHAR",
|
||||
"SCR_BCHAR",
|
||||
"SCR_HFLINE",
|
||||
"SCR_HBLINE",
|
||||
"SCR_HFHALF",
|
||||
"SCR_HBHALF",
|
||||
|
||||
"VALIDATION" ,
|
||||
"NEXT_CHOICE" ,
|
||||
"PREV_CHOICE"
|
||||
"VALIDATION",
|
||||
"NEXT_CHOICE",
|
||||
"PREV_CHOICE"
|
||||
};
|
||||
|
||||
#define A_SIZE (sizeof(request_names)/sizeof(request_names[0]))
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -114,18 +116,19 @@ static const char *request_names[ MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1 ] = {
|
||||
| NULL - on invalid request code
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(const char *)
|
||||
form_request_name ( int request )
|
||||
form_request_name(int request)
|
||||
{
|
||||
if ( (request < MIN_FORM_COMMAND) || (request > MAX_FORM_COMMAND) )
|
||||
T((T_CALLED("form_request_name(%d)"), request));
|
||||
|
||||
if ((request < MIN_FORM_COMMAND) || (request > MAX_FORM_COMMAND))
|
||||
{
|
||||
SET_ERROR (E_BAD_ARGUMENT);
|
||||
return (const char *)0;
|
||||
SET_ERROR(E_BAD_ARGUMENT);
|
||||
returnCPtr((const char *)0);
|
||||
}
|
||||
else
|
||||
return request_names[ request - MIN_FORM_COMMAND ];
|
||||
returnCPtr(request_names[request - MIN_FORM_COMMAND]);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : int form_request_by_name (const char *str);
|
||||
@ -136,28 +139,30 @@ form_request_name ( int request )
|
||||
| E_NO_MATCH - request not found
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
form_request_by_name ( const char *str )
|
||||
{
|
||||
form_request_by_name(const char *str)
|
||||
{
|
||||
/* because the table is so small, it doesn't really hurt
|
||||
to run sequentially through it.
|
||||
*/
|
||||
*/
|
||||
unsigned int i = 0;
|
||||
char buf[16];
|
||||
|
||||
|
||||
T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
|
||||
|
||||
if (str)
|
||||
{
|
||||
strncpy(buf,str,sizeof(buf));
|
||||
while( (i<sizeof(buf)) && (buf[i] != '\0') )
|
||||
strncpy(buf, str, sizeof(buf));
|
||||
while ((i < sizeof(buf)) && (buf[i] != '\0'))
|
||||
{
|
||||
buf[i] = toupper(buf[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
for (i=0; i < A_SIZE; i++)
|
||||
|
||||
for (i = 0; i < A_SIZE; i++)
|
||||
{
|
||||
if (strncmp(request_names[i],buf,sizeof(buf))==0)
|
||||
return MIN_FORM_COMMAND + i;
|
||||
}
|
||||
if (strncmp(request_names[i], buf, sizeof(buf)) == 0)
|
||||
returnCode(MIN_FORM_COMMAND + (int) i);
|
||||
}
|
||||
}
|
||||
RETURN(E_NO_MATCH);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_scale.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_scale.c,v 1.9 2004/12/11 22:12:34 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -45,19 +45,21 @@ MODULE_ID("$Id: frm_scale.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_NOT_CONNECTED - no fields connected to form
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
scale_form (const FORM * form, int * rows, int * cols)
|
||||
scale_form(const FORM *form, int *rows, int *cols)
|
||||
{
|
||||
if ( !form )
|
||||
T((T_CALLED("scale_form(%p,%p,%p)"), form, rows, cols));
|
||||
|
||||
if (!form)
|
||||
RETURN(E_BAD_ARGUMENT);
|
||||
|
||||
if ( !(form->field) )
|
||||
if (!(form->field))
|
||||
RETURN(E_NOT_CONNECTED);
|
||||
|
||||
if (rows)
|
||||
|
||||
if (rows)
|
||||
*rows = form->rows;
|
||||
if (cols)
|
||||
if (cols)
|
||||
*cols = form->cols;
|
||||
|
||||
|
||||
RETURN(E_OK);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_sub.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_sub.c,v 1.9 2004/12/11 22:13:39 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -44,14 +44,16 @@ MODULE_ID("$Id: frm_sub.c,v 1.5 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_POSTED - form is posted
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_sub (FORM * form, WINDOW * win)
|
||||
set_form_sub(FORM *form, WINDOW *win)
|
||||
{
|
||||
if (form && (form->status & _POSTED))
|
||||
T((T_CALLED("set_form_sub(%p,%p)"), form, win));
|
||||
|
||||
if (form && (form->status & _POSTED))
|
||||
RETURN(E_POSTED);
|
||||
|
||||
Normalize_Form( form )->sub = win;
|
||||
Normalize_Form(form)->sub = win;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -62,10 +64,14 @@ set_form_sub (FORM * form, WINDOW * win)
|
||||
| Return Values : The pointer to the Subwindow.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(WINDOW *)
|
||||
form_sub (const FORM * form)
|
||||
form_sub(const FORM *form)
|
||||
{
|
||||
const FORM* f = Normalize_Form( form );
|
||||
return Get_Form_Window(f);
|
||||
const FORM *f;
|
||||
|
||||
T((T_CALLED("form_sub(%p)"), form));
|
||||
|
||||
f = Normalize_Form(form);
|
||||
returnWin(Get_Form_Window(f));
|
||||
}
|
||||
|
||||
/* frm_sub.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_user.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_user.c,v 1.14 2004/12/25 22:37:56 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -44,8 +44,10 @@ MODULE_ID("$Id: frm_user.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
| Return Values : E_OK - on success
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_userptr (FORM * form, void *usrptr)
|
||||
set_form_userptr(FORM *form, void *usrptr)
|
||||
{
|
||||
T((T_CALLED("set_form_userptr(%p,%p)"), form, usrptr));
|
||||
|
||||
Normalize_Form(form)->usrptr = usrptr;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
@ -61,9 +63,10 @@ set_form_userptr (FORM * form, void *usrptr)
|
||||
| NULL is returned
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(void *)
|
||||
form_userptr (const FORM * form)
|
||||
form_userptr(const FORM *form)
|
||||
{
|
||||
return Normalize_Form(form)->usrptr;
|
||||
T((T_CALLED("form_userptr(%p)"), form));
|
||||
returnVoidPtr(Normalize_Form(form)->usrptr);
|
||||
}
|
||||
|
||||
/* frm_user.c ends here */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -27,12 +27,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
|
||||
* Author: Juergen Pfeifer, 1995,1997 *
|
||||
****************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: frm_win.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
MODULE_ID("$Id: frm_win.c,v 1.13 2004/12/11 22:15:27 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -44,14 +44,16 @@ MODULE_ID("$Id: frm_win.c,v 1.9 2000/12/10 02:09:37 tom Exp $")
|
||||
| E_POSTED - form is posted
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(int)
|
||||
set_form_win (FORM * form, WINDOW * win)
|
||||
set_form_win(FORM *form, WINDOW *win)
|
||||
{
|
||||
if (form && (form->status & _POSTED))
|
||||
T((T_CALLED("set_form_win(%p,%p)"), form, win));
|
||||
|
||||
if (form && (form->status & _POSTED))
|
||||
RETURN(E_POSTED);
|
||||
|
||||
Normalize_Form( form )->win = win;
|
||||
Normalize_Form(form)->win = win;
|
||||
RETURN(E_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -62,11 +64,14 @@ set_form_win (FORM * form, WINDOW * win)
|
||||
| Return Values : The pointer to the Window or stdscr if there is none.
|
||||
+--------------------------------------------------------------------------*/
|
||||
NCURSES_EXPORT(WINDOW *)
|
||||
form_win (const FORM * form)
|
||||
form_win(const FORM *form)
|
||||
{
|
||||
const FORM* f = Normalize_Form( form );
|
||||
return (f->win ? f->win : stdscr);
|
||||
const FORM *f;
|
||||
|
||||
T((T_CALLED("form_win(%p)"), form));
|
||||
|
||||
f = Normalize_Form(form);
|
||||
returnWin(f->win ? f->win : stdscr);
|
||||
}
|
||||
|
||||
/* frm_win.c ends here */
|
||||
|
||||
|
@ -1,54 +1,81 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_alnum.c,v 1.10 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_alnum.c,v 1.19 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
} alnumARG;
|
||||
#define thisARG alnumARG
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
}
|
||||
thisARG;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_AlphaNumeric_Type(va_list *ap)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_This_Type(va_list *ap)
|
||||
|
|
||||
| Description : Allocate structure for alphanumeric type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_AlphaNumeric_Type(va_list * ap)
|
||||
static void *
|
||||
Make_This_Type(va_list *ap)
|
||||
{
|
||||
alnumARG *argp = (alnumARG *)malloc(sizeof(alnumARG));
|
||||
thisARG *argp = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (argp)
|
||||
argp->width = va_arg(*ap,int);
|
||||
argp->width = va_arg(*ap, int);
|
||||
|
||||
return ((void *)argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_AlphaNumericType(const void *argp)
|
||||
|
|
||||
| Description : Copy structure for alphanumeric type argument.
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_ThisType(const void *argp)
|
||||
|
|
||||
| Description : Copy structure for alphanumeric type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_AlphaNumeric_Type(const void *argp)
|
||||
static void *
|
||||
Copy_This_Type(const void *argp)
|
||||
{
|
||||
const alnumARG *ap = (const alnumARG *)argp;
|
||||
alnumARG *result = (alnumARG *)malloc(sizeof(alnumARG));
|
||||
const thisARG *ap = (const thisARG *)argp;
|
||||
thisARG *result = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (result)
|
||||
*result = *ap;
|
||||
@ -57,81 +84,78 @@ static void *Copy_AlphaNumeric_Type(const void *argp)
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void Free_AlphaNumeric_Type(void *argp)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void Free_This_Type(void *argp)
|
||||
|
|
||||
| Description : Free structure for alphanumeric type argument.
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_AlphaNumeric_Type(void * argp)
|
||||
static void
|
||||
Free_This_Type(void *argp)
|
||||
{
|
||||
if (argp)
|
||||
if (argp)
|
||||
free(argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_AlphaNumeric_Field(
|
||||
| FIELD *field,
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Character(
|
||||
| int c,
|
||||
| const void *argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid alphanumeric value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_AlphaNumeric_Field(FIELD * field, const void * argp)
|
||||
{
|
||||
int width = ((const alnumARG *)argp)->width;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
int l = -1;
|
||||
unsigned char *s;
|
||||
|
||||
while(*bp && *bp==' ')
|
||||
bp++;
|
||||
if (*bp)
|
||||
{
|
||||
s = bp;
|
||||
while(*bp && isalnum(*bp))
|
||||
bp++;
|
||||
l = (int)(bp-s);
|
||||
while(*bp && *bp==' ')
|
||||
bp++;
|
||||
}
|
||||
return ((*bp || (l < width)) ? FALSE : TRUE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_AlphaNumeric_Character(
|
||||
| int c,
|
||||
| const void *argp )
|
||||
|
|
||||
| Description : Check a character for the alphanumeric type.
|
||||
|
|
||||
| Return Values : TRUE - character is valid
|
||||
| FALSE - character is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_AlphaNumeric_Character(int c, const void * argp GCC_UNUSED)
|
||||
static bool
|
||||
Check_This_Character(int c, const void *argp GCC_UNUSED)
|
||||
{
|
||||
return (isalnum(c) ? TRUE : FALSE);
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (iswalnum((wint_t) c))
|
||||
return TRUE;
|
||||
#endif
|
||||
return (isalnum(UChar(c)) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeALNUM = {
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Field(
|
||||
| FIELD *field,
|
||||
| const void *argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid alphanumeric value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool
|
||||
Check_This_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
int width = ((const thisARG *)argp)->width;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
bool result = (width < 0);
|
||||
|
||||
Check_CTYPE_Field(result, bp, width, Check_This_Character);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeTHIS =
|
||||
{
|
||||
_HAS_ARGS | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_AlphaNumeric_Type,
|
||||
Copy_AlphaNumeric_Type,
|
||||
Free_AlphaNumeric_Type,
|
||||
Check_AlphaNumeric_Field,
|
||||
Check_AlphaNumeric_Character,
|
||||
Make_This_Type,
|
||||
Copy_This_Type,
|
||||
Free_This_Type,
|
||||
Check_This_Field,
|
||||
Check_This_Character,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeALNUM;
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS;
|
||||
|
||||
/* fty_alnum.c ends here */
|
||||
|
@ -1,138 +1,161 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_alpha.c,v 1.10 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_alpha.c,v 1.21 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
} alphaARG;
|
||||
#define thisARG alphaARG
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
}
|
||||
thisARG;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_Alpha_Type(va_list *ap)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_This_Type(va_list *ap)
|
||||
|
|
||||
| Description : Allocate structure for alpha type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_Alpha_Type(va_list * ap)
|
||||
static void *
|
||||
Make_This_Type(va_list *ap)
|
||||
{
|
||||
alphaARG *argp = (alphaARG *)malloc(sizeof(alphaARG));
|
||||
thisARG *argp = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (argp)
|
||||
{
|
||||
argp->width = va_arg(*ap,int);
|
||||
}
|
||||
argp->width = va_arg(*ap, int);
|
||||
|
||||
return ((void *)argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_Alpha_Type(const void * argp)
|
||||
|
|
||||
| Description : Copy structure for alpha type argument.
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_This_Type(const void * argp)
|
||||
|
|
||||
| Description : Copy structure for alpha type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_Alpha_Type(const void * argp)
|
||||
static void *
|
||||
Copy_This_Type(const void *argp)
|
||||
{
|
||||
const alphaARG *ap = (const alphaARG *)argp;
|
||||
alphaARG *result = (alphaARG *)malloc(sizeof(alphaARG));
|
||||
|
||||
const thisARG *ap = (const thisARG *)argp;
|
||||
thisARG *result = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (result)
|
||||
{
|
||||
*result = *ap;
|
||||
}
|
||||
*result = *ap;
|
||||
|
||||
return ((void *)result);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void Free_Alpha_Type( void * argp )
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void Free_This_Type(void *argp)
|
||||
|
|
||||
| Description : Free structure for alpha type argument.
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_Alpha_Type(void * argp)
|
||||
static void
|
||||
Free_This_Type(void *argp)
|
||||
{
|
||||
if (argp)
|
||||
if (argp)
|
||||
free(argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Alpha_Field(
|
||||
| FIELD * field,
|
||||
| const void * argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid alpha value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Alpha_Field(FIELD * field, const void * argp)
|
||||
{
|
||||
int width = ((const alphaARG *)argp)->width;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
int l = -1;
|
||||
unsigned char *s;
|
||||
|
||||
while(*bp && *bp==' ')
|
||||
bp++;
|
||||
if (*bp)
|
||||
{
|
||||
s = bp;
|
||||
while(*bp && isalpha(*bp))
|
||||
bp++;
|
||||
l = (int)(bp-s);
|
||||
while(*bp && *bp==' ')
|
||||
bp++;
|
||||
}
|
||||
return ((*bp || (l < width)) ? FALSE : TRUE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Alpha_Character(
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Character(
|
||||
| int c,
|
||||
| const void * argp)
|
||||
|
|
||||
| const void *argp)
|
||||
|
|
||||
| Description : Check a character for the alpha type.
|
||||
|
|
||||
| Return Values : TRUE - character is valid
|
||||
| FALSE - character is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Alpha_Character(int c, const void * argp GCC_UNUSED)
|
||||
static bool
|
||||
Check_This_Character(int c, const void *argp GCC_UNUSED)
|
||||
{
|
||||
return (isalpha(c) ? TRUE : FALSE);
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (iswalpha((wint_t) c))
|
||||
return TRUE;
|
||||
#endif
|
||||
return (isalpha(UChar(c)) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeALPHA = {
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Field(
|
||||
| FIELD *field,
|
||||
| const void *argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid alpha value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool
|
||||
Check_This_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
int width = ((const thisARG *)argp)->width;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
bool result = (width < 0);
|
||||
|
||||
Check_CTYPE_Field(result, bp, width, Check_This_Character);
|
||||
return (result);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeTHIS =
|
||||
{
|
||||
_HAS_ARGS | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_Alpha_Type,
|
||||
Copy_Alpha_Type,
|
||||
Free_Alpha_Type,
|
||||
Check_Alpha_Field,
|
||||
Check_Alpha_Character,
|
||||
Make_This_Type,
|
||||
Copy_This_Type,
|
||||
Free_This_Type,
|
||||
Check_This_Field,
|
||||
Check_This_Character,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeALPHA;
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS;
|
||||
|
||||
/* fty_alpha.c ends here */
|
||||
|
@ -1,26 +1,49 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_enum.c,v 1.15 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_enum.c,v 1.20 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
typedef struct {
|
||||
char **kwds;
|
||||
int count;
|
||||
bool checkcase;
|
||||
bool checkunique;
|
||||
} enumARG;
|
||||
typedef struct
|
||||
{
|
||||
char **kwds;
|
||||
int count;
|
||||
bool checkcase;
|
||||
bool checkunique;
|
||||
}
|
||||
enumARG;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -30,7 +53,8 @@ typedef struct {
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_Enum_Type(va_list * ap)
|
||||
static void *
|
||||
Make_Enum_Type(va_list *ap)
|
||||
{
|
||||
enumARG *argp = (enumARG *)malloc(sizeof(enumARG));
|
||||
|
||||
@ -40,14 +64,16 @@ static void *Make_Enum_Type(va_list * ap)
|
||||
char **kp = (char **)0;
|
||||
int ccase, cunique;
|
||||
|
||||
argp->kwds = va_arg(*ap,char **);
|
||||
ccase = va_arg(*ap,int);
|
||||
cunique = va_arg(*ap,int);
|
||||
argp->checkcase = ccase ? TRUE : FALSE;
|
||||
argp->kwds = va_arg(*ap, char **);
|
||||
ccase = va_arg(*ap, int);
|
||||
cunique = va_arg(*ap, int);
|
||||
|
||||
argp->checkcase = ccase ? TRUE : FALSE;
|
||||
argp->checkunique = cunique ? TRUE : FALSE;
|
||||
|
||||
kp = argp->kwds;
|
||||
while( kp && (*kp++) ) cnt++;
|
||||
while (kp && (*kp++))
|
||||
cnt++;
|
||||
argp->count = cnt;
|
||||
}
|
||||
return (void *)argp;
|
||||
@ -61,7 +87,8 @@ static void *Make_Enum_Type(va_list * ap)
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_Enum_Type(const void * argp)
|
||||
static void *
|
||||
Copy_Enum_Type(const void *argp)
|
||||
{
|
||||
enumARG *result = (enumARG *)0;
|
||||
|
||||
@ -70,6 +97,7 @@ static void *Copy_Enum_Type(const void * argp)
|
||||
const enumARG *ap = (const enumARG *)argp;
|
||||
|
||||
result = (enumARG *)malloc(sizeof(enumARG));
|
||||
|
||||
if (result)
|
||||
*result = *ap;
|
||||
}
|
||||
@ -84,9 +112,10 @@ static void *Copy_Enum_Type(const void * argp)
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_Enum_Type(void * argp)
|
||||
static void
|
||||
Free_Enum_Type(void *argp)
|
||||
{
|
||||
if (argp)
|
||||
if (argp)
|
||||
free(argp);
|
||||
}
|
||||
|
||||
@ -101,37 +130,40 @@ static void Free_Enum_Type(void * argp)
|
||||
| const unsigned char * buf,
|
||||
| bool ccase )
|
||||
|
|
||||
| Description : Check wether or not the text in 'buf' matches the
|
||||
| Description : Check whether or not the text in 'buf' matches the
|
||||
| text in 's', at least partial.
|
||||
|
|
||||
| Return Values : NOMATCH - buffer doesn't match
|
||||
| PARTIAL - buffer matches partially
|
||||
| EXACT - buffer matches exactly
|
||||
+--------------------------------------------------------------------------*/
|
||||
static int Compare(const unsigned char *s, const unsigned char *buf,
|
||||
bool ccase)
|
||||
static int
|
||||
Compare(const unsigned char *s, const unsigned char *buf,
|
||||
bool ccase)
|
||||
{
|
||||
SKIP_SPACE(buf); /* Skip leading spaces in both texts */
|
||||
SKIP_SPACE(buf); /* Skip leading spaces in both texts */
|
||||
SKIP_SPACE(s);
|
||||
|
||||
if (*buf=='\0')
|
||||
if (*buf == '\0')
|
||||
{
|
||||
return (((*s)!='\0') ? NOMATCH : EXACT);
|
||||
}
|
||||
else
|
||||
return (((*s) != '\0') ? NOMATCH : EXACT);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ccase)
|
||||
{
|
||||
while(*s++ == *buf)
|
||||
while (*s++ == *buf)
|
||||
{
|
||||
if (*buf++=='\0') return EXACT;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (*buf++ == '\0')
|
||||
return EXACT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(toupper(*s++)==toupper(*buf))
|
||||
while (toupper(*s++) == toupper(*buf))
|
||||
{
|
||||
if (*buf++=='\0') return EXACT;
|
||||
if (*buf++ == '\0')
|
||||
return EXACT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -139,12 +171,12 @@ static int Compare(const unsigned char *s, const unsigned char *buf,
|
||||
matches with s. So if only blanks are following, we have a partial
|
||||
match otherwise there is no match */
|
||||
SKIP_SPACE(buf);
|
||||
if (*buf)
|
||||
if (*buf)
|
||||
return NOMATCH;
|
||||
|
||||
/* If it happens that the reference buffer is at its end, the partial
|
||||
match is actually an exact match. */
|
||||
return ((s[-1]!='\0') ? PARTIAL : EXACT);
|
||||
return ((s[-1] != '\0') ? PARTIAL : EXACT);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -158,27 +190,28 @@ static int Compare(const unsigned char *s, const unsigned char *buf,
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Enum_Field(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Check_Enum_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
char **kwds = ((const enumARG *)argp)->kwds;
|
||||
bool ccase = ((const enumARG *)argp)->checkcase;
|
||||
bool unique = ((const enumARG *)argp)->checkunique;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
char **kwds = ((const enumARG *)argp)->kwds;
|
||||
bool ccase = ((const enumARG *)argp)->checkcase;
|
||||
bool unique = ((const enumARG *)argp)->checkunique;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
char *s, *t, *p;
|
||||
int res;
|
||||
|
||||
while( kwds && (s=(*kwds++)) )
|
||||
|
||||
while (kwds && (s = (*kwds++)))
|
||||
{
|
||||
if ((res=Compare((unsigned char *)s,bp,ccase))!=NOMATCH)
|
||||
if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
|
||||
{
|
||||
p=t=s; /* t is at least a partial match */
|
||||
if ((unique && res!=EXACT))
|
||||
p = t = s; /* t is at least a partial match */
|
||||
if ((unique && res != EXACT))
|
||||
{
|
||||
while( kwds && (p = *kwds++) )
|
||||
while (kwds && (p = *kwds++))
|
||||
{
|
||||
if ((res=Compare((unsigned char *)p,bp,ccase))!=NOMATCH)
|
||||
if ((res = Compare((unsigned char *)p, bp, ccase)) != NOMATCH)
|
||||
{
|
||||
if (res==EXACT)
|
||||
if (res == EXACT)
|
||||
{
|
||||
t = p;
|
||||
break;
|
||||
@ -187,10 +220,10 @@ static bool Check_Enum_Field(FIELD * field, const void * argp)
|
||||
t = (char *)0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t)
|
||||
{
|
||||
set_field_buffer(field,0,t);
|
||||
set_field_buffer(field, 0, t);
|
||||
return TRUE;
|
||||
}
|
||||
if (!p)
|
||||
@ -200,7 +233,8 @@ static bool Check_Enum_Field(FIELD * field, const void * argp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const char *dummy[] = { (char *)0 };
|
||||
static const char *dummy[] =
|
||||
{(char *)0};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -212,28 +246,30 @@ static const char *dummy[] = { (char *)0 };
|
||||
| Return Values : TRUE - next value found and loaded
|
||||
| FALSE - no next value loaded
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Next_Enum(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Next_Enum(FIELD *field, const void *argp)
|
||||
{
|
||||
const enumARG *args = (const enumARG *)argp;
|
||||
char **kwds = args->kwds;
|
||||
bool ccase = args->checkcase;
|
||||
int cnt = args->count;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
char **kwds = args->kwds;
|
||||
bool ccase = args->checkcase;
|
||||
int cnt = args->count;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
|
||||
if (kwds) {
|
||||
while(cnt--)
|
||||
{
|
||||
if (Compare((unsigned char *)(*kwds++),bp,ccase)==EXACT)
|
||||
break;
|
||||
}
|
||||
if (cnt<=0)
|
||||
kwds = args->kwds;
|
||||
if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
|
||||
{
|
||||
set_field_buffer(field,0,*kwds);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (kwds)
|
||||
{
|
||||
while (cnt--)
|
||||
{
|
||||
if (Compare((unsigned char *)(*kwds++), bp, ccase) == EXACT)
|
||||
break;
|
||||
}
|
||||
if (cnt <= 0)
|
||||
kwds = args->kwds;
|
||||
if ((cnt >= 0) || (Compare((const unsigned char *)dummy, bp, ccase) == EXACT))
|
||||
{
|
||||
set_field_buffer(field, 0, *kwds);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -248,37 +284,39 @@ static bool Next_Enum(FIELD * field, const void * argp)
|
||||
| Return Values : TRUE - previous value found and loaded
|
||||
| FALSE - no previous value loaded
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Previous_Enum(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Previous_Enum(FIELD *field, const void *argp)
|
||||
{
|
||||
const enumARG *args = (const enumARG *)argp;
|
||||
int cnt = args->count;
|
||||
char **kwds = &args->kwds[cnt-1];
|
||||
bool ccase = args->checkcase;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
int cnt = args->count;
|
||||
char **kwds = &args->kwds[cnt - 1];
|
||||
bool ccase = args->checkcase;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
|
||||
if (kwds) {
|
||||
while(cnt--)
|
||||
{
|
||||
if (Compare((unsigned char *)(*kwds--),bp,ccase)==EXACT)
|
||||
break;
|
||||
}
|
||||
|
||||
if (cnt<=0)
|
||||
kwds = &args->kwds[args->count-1];
|
||||
|
||||
if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
|
||||
{
|
||||
set_field_buffer(field,0,*kwds);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (kwds)
|
||||
{
|
||||
while (cnt--)
|
||||
{
|
||||
if (Compare((unsigned char *)(*kwds--), bp, ccase) == EXACT)
|
||||
break;
|
||||
}
|
||||
|
||||
if (cnt <= 0)
|
||||
kwds = &args->kwds[args->count - 1];
|
||||
|
||||
if ((cnt >= 0) || (Compare((const unsigned char *)dummy, bp, ccase) == EXACT))
|
||||
{
|
||||
set_field_buffer(field, 0, *kwds);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static FIELDTYPE typeENUM = {
|
||||
static FIELDTYPE typeENUM =
|
||||
{
|
||||
_HAS_ARGS | _HAS_CHOICE | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_Enum_Type,
|
||||
@ -290,6 +328,7 @@ static FIELDTYPE typeENUM = {
|
||||
Previous_Enum
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ENUM = &typeENUM;
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE *)
|
||||
TYPE_ENUM = &typeENUM;
|
||||
|
||||
/* fty_enum.c ends here */
|
||||
|
@ -1,63 +1,96 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_int.c,v 1.11 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_int.c,v 1.20 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
typedef struct {
|
||||
int precision;
|
||||
long low;
|
||||
long high;
|
||||
} integerARG;
|
||||
#if USE_WIDEC_SUPPORT
|
||||
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
|
||||
#else
|
||||
#define isDigit(c) isdigit(UChar(c))
|
||||
#endif
|
||||
|
||||
#define thisARG integerARG
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int precision;
|
||||
long low;
|
||||
long high;
|
||||
}
|
||||
thisARG;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_Integer_Type( va_list * ap )
|
||||
| Function : static void *Make_This_Type( va_list * ap )
|
||||
|
|
||||
| Description : Allocate structure for integer type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_Integer_Type(va_list * ap)
|
||||
static void *
|
||||
Make_This_Type(va_list *ap)
|
||||
{
|
||||
integerARG *argp = (integerARG *)malloc(sizeof(integerARG));
|
||||
thisARG *argp = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (argp)
|
||||
{
|
||||
argp->precision = va_arg(*ap,int);
|
||||
argp->low = va_arg(*ap,long);
|
||||
argp->high = va_arg(*ap,long);
|
||||
argp->precision = va_arg(*ap, int);
|
||||
argp->low = va_arg(*ap, long);
|
||||
argp->high = va_arg(*ap, long);
|
||||
}
|
||||
return (void *)argp;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_Integer_Type(const void * argp)
|
||||
| Function : static void *Copy_This_Type(const void * argp)
|
||||
|
|
||||
| Description : Copy structure for integer type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_Integer_Type(const void * argp)
|
||||
static void *
|
||||
Copy_This_Type(const void *argp)
|
||||
{
|
||||
const integerARG *ap = (const integerARG *)argp;
|
||||
integerARG *result = (integerARG *)0;
|
||||
const thisARG *ap = (const thisARG *)argp;
|
||||
thisARG *result = (thisARG *) 0;
|
||||
|
||||
if (argp)
|
||||
{
|
||||
result = (integerARG *)malloc(sizeof(integerARG));
|
||||
result = (thisARG *) malloc(sizeof(thisARG));
|
||||
if (result)
|
||||
*result = *ap;
|
||||
}
|
||||
@ -66,68 +99,115 @@ static void *Copy_Integer_Type(const void * argp)
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void Free_Integer_Type(void * argp)
|
||||
| Function : static void Free_This_Type(void * argp)
|
||||
|
|
||||
| Description : Free structure for integer type argument.
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_Integer_Type(void * argp)
|
||||
static void
|
||||
Free_This_Type(void *argp)
|
||||
{
|
||||
if (argp)
|
||||
if (argp)
|
||||
free(argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Integer_Field(
|
||||
| FIELD * field,
|
||||
| const void * argp)
|
||||
| Function : static bool Check_This_Field(
|
||||
| FIELD * field,
|
||||
| const void * argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid integer value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Integer_Field(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Check_This_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
const integerARG *argi = (const integerARG *)argp;
|
||||
long low = argi->low;
|
||||
long high = argi->high;
|
||||
int prec = argi->precision;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
char *s = (char *)bp;
|
||||
const thisARG *argi = (const thisARG *)argp;
|
||||
long low = argi->low;
|
||||
long high = argi->high;
|
||||
int prec = argi->precision;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
char *s = (char *)bp;
|
||||
long val;
|
||||
char buf[100];
|
||||
bool result = FALSE;
|
||||
|
||||
while( *bp && *bp==' ') bp++;
|
||||
while (*bp && *bp == ' ')
|
||||
bp++;
|
||||
if (*bp)
|
||||
{
|
||||
if (*bp=='-') bp++;
|
||||
if (*bp == '-')
|
||||
bp++;
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (*bp)
|
||||
{
|
||||
bool blank = FALSE;
|
||||
int len;
|
||||
int n;
|
||||
wchar_t *list = _nc_Widen_String((char *)bp, &len);
|
||||
|
||||
if (list != 0)
|
||||
{
|
||||
result = TRUE;
|
||||
for (n = 0; n < len; ++n)
|
||||
{
|
||||
if (blank)
|
||||
{
|
||||
if (list[n] != ' ')
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (list[n] == ' ')
|
||||
{
|
||||
blank = TRUE;
|
||||
}
|
||||
else if (!isDigit(list[n]))
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(list);
|
||||
}
|
||||
}
|
||||
#else
|
||||
while (*bp)
|
||||
{
|
||||
if (!isdigit(*bp)) break;
|
||||
if (!isdigit(UChar(*bp)))
|
||||
break;
|
||||
bp++;
|
||||
}
|
||||
while(*bp && *bp==' ') bp++;
|
||||
if (*bp=='\0')
|
||||
while (*bp && *bp == ' ')
|
||||
bp++;
|
||||
result = (*bp == '\0');
|
||||
#endif
|
||||
if (result)
|
||||
{
|
||||
val = atol(s);
|
||||
if (low<high)
|
||||
if (low < high)
|
||||
{
|
||||
if (val<low || val>high) return FALSE;
|
||||
if (val < low || val > high)
|
||||
result = FALSE;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
sprintf(buf, "%.*ld", (prec > 0 ? prec : 0), val);
|
||||
set_field_buffer(field, 0, buf);
|
||||
}
|
||||
sprintf(buf,"%.*ld",(prec>0?prec:0),val);
|
||||
set_field_buffer(field,0,buf);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Integer_Character(
|
||||
| Function : static bool Check_This_Character(
|
||||
| int c,
|
||||
| const void * argp)
|
||||
|
|
||||
@ -136,25 +216,27 @@ static bool Check_Integer_Field(FIELD * field, const void * argp)
|
||||
| Return Values : TRUE - character is valid
|
||||
| FALSE - character is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Integer_Character(int c, const void * argp GCC_UNUSED)
|
||||
static bool
|
||||
Check_This_Character(int c, const void *argp GCC_UNUSED)
|
||||
{
|
||||
return ((isdigit(c) || (c=='-')) ? TRUE : FALSE);
|
||||
return ((isDigit(UChar(c)) || (c == '-')) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeINTEGER = {
|
||||
static FIELDTYPE typeTHIS =
|
||||
{
|
||||
_HAS_ARGS | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_Integer_Type,
|
||||
Copy_Integer_Type,
|
||||
Free_Integer_Type,
|
||||
Check_Integer_Field,
|
||||
Check_Integer_Character,
|
||||
Make_This_Type,
|
||||
Copy_This_Type,
|
||||
Free_This_Type,
|
||||
Check_This_Field,
|
||||
Check_This_Character,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeINTEGER;
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS;
|
||||
|
||||
/* fty_int.c ends here */
|
||||
|
@ -1,10 +1,31 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Per Foreby, perf@efd.lth.se *
|
||||
@ -13,7 +34,7 @@
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_ipv4.c,v 1.4 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_ipv4.c,v 1.8 2006/12/02 19:33:02 tom Exp $")
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
@ -26,24 +47,25 @@ MODULE_ID("$Id: fty_ipv4.c,v 1.4 2000/12/09 23:46:12 tom Exp $")
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_IPV4_Field(FIELD * field, const void * argp GCC_UNUSED)
|
||||
static bool
|
||||
Check_IPV4_Field(FIELD *field, const void *argp GCC_UNUSED)
|
||||
{
|
||||
char *bp = field_buffer(field,0);
|
||||
char *bp = field_buffer(field, 0);
|
||||
int num = 0, len;
|
||||
unsigned int d1, d2, d3, d4;
|
||||
|
||||
if(isdigit((unsigned char)*bp)) /* Must start with digit */
|
||||
if (isdigit(UChar(*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((unsigned char)*bp))
|
||||
bp++; /* Allow trailing whitespace */
|
||||
}
|
||||
{
|
||||
bp += len; /* Make bp point to what sscanf() left */
|
||||
while (isspace(UChar(*bp)))
|
||||
bp++; /* Allow trailing whitespace */
|
||||
}
|
||||
}
|
||||
return ((num != 4 || *bp || d1 > 255 || d2 > 255
|
||||
|| d3 > 255 || d4 > 255) ? FALSE : TRUE);
|
||||
|| d3 > 255 || d4 > 255) ? FALSE : TRUE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
@ -57,14 +79,16 @@ static bool Check_IPV4_Field(FIELD * field, const void * argp GCC_UNUSED)
|
||||
| Return Values : TRUE - character is valid
|
||||
| FALSE - character is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_IPV4_Character(int c, const void * argp GCC_UNUSED)
|
||||
static bool
|
||||
Check_IPV4_Character(int c, const void *argp GCC_UNUSED)
|
||||
{
|
||||
return ((isdigit(c) || (c=='.')) ? TRUE : FALSE);
|
||||
return ((isdigit(UChar(c)) || (c == '.')) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeIPV4 = {
|
||||
static FIELDTYPE typeIPV4 =
|
||||
{
|
||||
_RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
NULL,
|
||||
|
@ -1,195 +1,286 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_num.c,v 1.14 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_num.c,v 1.23 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
#if HAVE_LOCALE_H
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int precision;
|
||||
double low;
|
||||
double high;
|
||||
struct lconv* L;
|
||||
} numericARG;
|
||||
#if HAVE_LOCALE_H
|
||||
#define isDecimalPoint(c) ((c) == ((L && L->decimal_point) ? *(L->decimal_point) : '.'))
|
||||
#else
|
||||
#define isDecimalPoint(c) ((c) == '.')
|
||||
#endif
|
||||
|
||||
#if USE_WIDEC_SUPPORT
|
||||
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
|
||||
#else
|
||||
#define isDigit(c) isdigit(UChar(c))
|
||||
#endif
|
||||
|
||||
#define thisARG numericARG
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int precision;
|
||||
double low;
|
||||
double high;
|
||||
struct lconv *L;
|
||||
}
|
||||
thisARG;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_Numeric_Type(va_list * ap)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void *Make_This_Type(va_list * ap)
|
||||
|
|
||||
| Description : Allocate structure for numeric type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_Numeric_Type(va_list * ap)
|
||||
static void *
|
||||
Make_This_Type(va_list *ap)
|
||||
{
|
||||
numericARG *argn = (numericARG *)malloc(sizeof(numericARG));
|
||||
thisARG *argn = (thisARG *) malloc(sizeof(thisARG));
|
||||
|
||||
if (argn)
|
||||
{
|
||||
argn->precision = va_arg(*ap,int);
|
||||
argn->low = va_arg(*ap,double);
|
||||
argn->high = va_arg(*ap,double);
|
||||
argn->precision = va_arg(*ap, int);
|
||||
argn->low = va_arg(*ap, double);
|
||||
argn->high = va_arg(*ap, double);
|
||||
|
||||
#if HAVE_LOCALE_H
|
||||
argn->L = localeconv();
|
||||
argn->L = localeconv();
|
||||
#else
|
||||
argn->L = NULL;
|
||||
argn->L = NULL;
|
||||
#endif
|
||||
}
|
||||
return (void *)argn;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_Numeric_Type(const void * argp)
|
||||
|
|
||||
| Description : Copy structure for numeric type argument.
|
||||
| Facility : libnform
|
||||
| Function : static void *Copy_This_Type(const void * argp)
|
||||
|
|
||||
| Description : Copy structure for numeric type argument.
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_Numeric_Type(const void * argp)
|
||||
static void *
|
||||
Copy_This_Type(const void *argp)
|
||||
{
|
||||
const numericARG *ap = (const numericARG *)argp;
|
||||
numericARG *result = (numericARG *)0;
|
||||
const thisARG *ap = (const thisARG *)argp;
|
||||
thisARG *result = (thisARG *) 0;
|
||||
|
||||
if (argp)
|
||||
{
|
||||
result = (numericARG *)malloc(sizeof(numericARG));
|
||||
result = (thisARG *) malloc(sizeof(thisARG));
|
||||
if (result)
|
||||
*result = *ap;
|
||||
*result = *ap;
|
||||
}
|
||||
return (void *)result;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static void Free_Numeric_Type(void * argp)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static void Free_This_Type(void * argp)
|
||||
|
|
||||
| Description : Free structure for numeric type argument.
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_Numeric_Type(void * argp)
|
||||
static void
|
||||
Free_This_Type(void *argp)
|
||||
{
|
||||
if (argp)
|
||||
if (argp)
|
||||
free(argp);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Numeric_Field(FIELD * field,
|
||||
| const void * argp)
|
||||
|
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Field(FIELD * field,
|
||||
| const void * argp)
|
||||
|
|
||||
| Description : Validate buffer content to be a valid numeric value
|
||||
|
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Numeric_Field(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Check_This_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
const numericARG *argn = (const numericARG *)argp;
|
||||
double low = argn->low;
|
||||
double high = argn->high;
|
||||
int prec = argn->precision;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field,0);
|
||||
char *s = (char *)bp;
|
||||
double val = 0.0;
|
||||
struct lconv* L = argn->L;
|
||||
const thisARG *argn = (const thisARG *)argp;
|
||||
double low = argn->low;
|
||||
double high = argn->high;
|
||||
int prec = argn->precision;
|
||||
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
|
||||
char *s = (char *)bp;
|
||||
double val = 0.0;
|
||||
struct lconv *L = argn->L;
|
||||
char buf[64];
|
||||
bool result = FALSE;
|
||||
|
||||
while(*bp && *bp==' ') bp++;
|
||||
while (*bp && *bp == ' ')
|
||||
bp++;
|
||||
if (*bp)
|
||||
{
|
||||
if (*bp=='-' || *bp=='+')
|
||||
if (*bp == '-' || *bp == '+')
|
||||
bp++;
|
||||
while(*bp)
|
||||
#if USE_WIDEC_SUPPORT
|
||||
if (*bp)
|
||||
{
|
||||
if (!isdigit(*bp)) break;
|
||||
bool blank = FALSE;
|
||||
int state = 0;
|
||||
int len;
|
||||
int n;
|
||||
wchar_t *list = _nc_Widen_String((char *)bp, &len);
|
||||
|
||||
if (list != 0)
|
||||
{
|
||||
result = TRUE;
|
||||
for (n = 0; n < len; ++n)
|
||||
{
|
||||
if (blank)
|
||||
{
|
||||
if (list[n] != ' ')
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (list[n] == ' ')
|
||||
{
|
||||
blank = TRUE;
|
||||
}
|
||||
else if (isDecimalPoint(list[n]))
|
||||
{
|
||||
if (++state > 1)
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!isDigit(list[n]))
|
||||
{
|
||||
result = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(list);
|
||||
}
|
||||
}
|
||||
#else
|
||||
while (*bp)
|
||||
{
|
||||
if (!isdigit(UChar(*bp)))
|
||||
break;
|
||||
bp++;
|
||||
}
|
||||
if (*bp==(
|
||||
#if HAVE_LOCALE_H
|
||||
(L && L->decimal_point) ? *(L->decimal_point) :
|
||||
#endif
|
||||
'.'))
|
||||
if (isDecimalPoint(*bp))
|
||||
{
|
||||
bp++;
|
||||
while(*bp)
|
||||
while (*bp)
|
||||
{
|
||||
if (!isdigit(*bp)) break;
|
||||
if (!isdigit(UChar(*bp)))
|
||||
break;
|
||||
bp++;
|
||||
}
|
||||
}
|
||||
while(*bp && *bp==' ') bp++;
|
||||
if (*bp=='\0')
|
||||
while (*bp && *bp == ' ')
|
||||
bp++;
|
||||
result = (*bp == '\0');
|
||||
#endif
|
||||
if (result)
|
||||
{
|
||||
val = atof(s);
|
||||
if (low<high)
|
||||
if (low < high)
|
||||
{
|
||||
if (val<low || val>high) return FALSE;
|
||||
if (val < low || val > high)
|
||||
result = FALSE;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
sprintf(buf, "%.*f", (prec > 0 ? prec : 0), val);
|
||||
set_field_buffer(field, 0, buf);
|
||||
}
|
||||
sprintf(buf,"%.*f",(prec>0?prec:0),val);
|
||||
set_field_buffer(field,0,buf);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_Numeric_Character(
|
||||
| Facility : libnform
|
||||
| Function : static bool Check_This_Character(
|
||||
| int c,
|
||||
| const void * argp)
|
||||
|
|
||||
|
|
||||
| Description : Check a character for the numeric type.
|
||||
|
|
||||
| Return Values : TRUE - character is valid
|
||||
| FALSE - character is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_Numeric_Character(int c, const void * argp)
|
||||
static bool
|
||||
Check_This_Character(int c, const void *argp)
|
||||
{
|
||||
const numericARG *argn = (const numericARG *)argp;
|
||||
struct lconv* L = argn->L;
|
||||
const thisARG *argn = (const thisARG *)argp;
|
||||
struct lconv *L = argn->L;
|
||||
|
||||
return (isdigit(c) ||
|
||||
c == '+' ||
|
||||
c == '-' ||
|
||||
c == (
|
||||
#if HAVE_LOCALE_H
|
||||
(L && L->decimal_point) ? *(L->decimal_point) :
|
||||
#endif
|
||||
'.')
|
||||
) ? TRUE : FALSE;
|
||||
return ((isDigit(c) ||
|
||||
c == '+' ||
|
||||
c == '-' ||
|
||||
isDecimalPoint(c))
|
||||
? TRUE
|
||||
: FALSE);
|
||||
}
|
||||
|
||||
static FIELDTYPE typeNUMERIC = {
|
||||
static FIELDTYPE typeTHIS =
|
||||
{
|
||||
_HAS_ARGS | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_Numeric_Type,
|
||||
Copy_Numeric_Type,
|
||||
Free_Numeric_Type,
|
||||
Check_Numeric_Field,
|
||||
Check_Numeric_Character,
|
||||
Make_This_Type,
|
||||
Copy_This_Type,
|
||||
Free_This_Type,
|
||||
Check_This_Field,
|
||||
Check_This_Character,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeNUMERIC;
|
||||
NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS;
|
||||
|
||||
/* fty_num.c ends here */
|
||||
|
@ -1,43 +1,67 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
|
||||
* You may freely copy it for use as a template for your own field types.
|
||||
* If you develop a field type that might be of general use, please send
|
||||
* it back to the ncurses maintainers for inclusion in the next version.
|
||||
*/
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net *
|
||||
* Author : Juergen Pfeifer *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
MODULE_ID("$Id: fty_regex.c,v 1.15 2000/12/09 23:46:12 tom Exp $")
|
||||
MODULE_ID("$Id: fty_regex.c,v 1.19 2006/04/22 21:33:05 tom Exp $")
|
||||
|
||||
#if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */
|
||||
#if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */
|
||||
#include <regex.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
regex_t *pRegExp;
|
||||
unsigned long *refCount;
|
||||
} RegExp_Arg;
|
||||
{
|
||||
regex_t *pRegExp;
|
||||
unsigned long *refCount;
|
||||
}
|
||||
RegExp_Arg;
|
||||
|
||||
#elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
|
||||
#undef RETURN
|
||||
static int reg_errno;
|
||||
|
||||
static char *RegEx_Init(char *instring)
|
||||
static char *
|
||||
RegEx_Init(char *instring)
|
||||
{
|
||||
reg_errno = 0;
|
||||
return instring;
|
||||
reg_errno = 0;
|
||||
return instring;
|
||||
}
|
||||
|
||||
static char *RegEx_Error(int code)
|
||||
static char *
|
||||
RegEx_Error(int code)
|
||||
{
|
||||
reg_errno = code;
|
||||
return 0;
|
||||
reg_errno = code;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define INIT register char *sp = RegEx_Init(instring);
|
||||
@ -57,7 +81,8 @@ typedef struct
|
||||
{
|
||||
char *compiled_expression;
|
||||
unsigned long *refCount;
|
||||
} RegExp_Arg;
|
||||
}
|
||||
RegExp_Arg;
|
||||
|
||||
/* Maximum Length we allow for a compiled regular expression */
|
||||
#define MAX_RX_LEN (2048)
|
||||
@ -73,20 +98,23 @@ typedef struct
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Make_RegularExpression_Type(va_list * ap)
|
||||
static void *
|
||||
Make_RegularExpression_Type(va_list *ap)
|
||||
{
|
||||
#if HAVE_REGEX_H_FUNCS
|
||||
char *rx = va_arg(*ap,char *);
|
||||
char *rx = va_arg(*ap, char *);
|
||||
RegExp_Arg *preg;
|
||||
|
||||
preg = (RegExp_Arg*)malloc(sizeof(RegExp_Arg));
|
||||
preg = (RegExp_Arg *)malloc(sizeof(RegExp_Arg));
|
||||
|
||||
if (preg)
|
||||
{
|
||||
if (((preg->pRegExp = (regex_t*)malloc(sizeof(regex_t))) != (regex_t*)0)
|
||||
&& !regcomp(preg->pRegExp,rx,
|
||||
(REG_EXTENDED | REG_NOSUB | REG_NEWLINE) ))
|
||||
if (((preg->pRegExp = (regex_t *) malloc(sizeof(regex_t))) != 0)
|
||||
&& !regcomp(preg->pRegExp, rx,
|
||||
(REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
|
||||
{
|
||||
preg->refCount = (unsigned long *)malloc(sizeof(unsigned long));
|
||||
|
||||
*(preg->refCount) = 1;
|
||||
}
|
||||
else
|
||||
@ -94,12 +122,12 @@ static void *Make_RegularExpression_Type(va_list * ap)
|
||||
if (preg->pRegExp)
|
||||
free(preg->pRegExp);
|
||||
free(preg);
|
||||
preg = (RegExp_Arg*)0;
|
||||
preg = (RegExp_Arg *)0;
|
||||
}
|
||||
}
|
||||
return((void *)preg);
|
||||
return ((void *)preg);
|
||||
#elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
|
||||
char *rx = va_arg(*ap,char *);
|
||||
char *rx = va_arg(*ap, char *);
|
||||
RegExp_Arg *pArg;
|
||||
|
||||
pArg = (RegExp_Arg *)malloc(sizeof(RegExp_Arg));
|
||||
@ -107,38 +135,44 @@ static void *Make_RegularExpression_Type(va_list * ap)
|
||||
if (pArg)
|
||||
{
|
||||
int blen = RX_INCREMENT;
|
||||
|
||||
pArg->compiled_expression = NULL;
|
||||
pArg->refCount = (unsigned long *)malloc(sizeof(unsigned long));
|
||||
|
||||
*(pArg->refCount) = 1;
|
||||
|
||||
do {
|
||||
char *buf = (char *)malloc(blen);
|
||||
if (buf)
|
||||
{
|
||||
do
|
||||
{
|
||||
char *buf = (char *)malloc(blen);
|
||||
|
||||
if (buf)
|
||||
{
|
||||
#if HAVE_REGEXP_H_FUNCS
|
||||
char *last_pos = compile (rx, buf, &buf[blen], '\0');
|
||||
char *last_pos = compile(rx, buf, &buf[blen], '\0');
|
||||
|
||||
#else /* HAVE_REGEXPR_H_FUNCS */
|
||||
char *last_pos = compile (rx, buf, &buf[blen]);
|
||||
char *last_pos = compile(rx, buf, &buf[blen]);
|
||||
#endif
|
||||
if (reg_errno)
|
||||
{
|
||||
free(buf);
|
||||
if (reg_errno==50)
|
||||
blen += RX_INCREMENT;
|
||||
else
|
||||
{
|
||||
free(pArg);
|
||||
pArg = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pArg->compiled_expression = buf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while( blen <= MAX_RX_LEN );
|
||||
if (reg_errno)
|
||||
{
|
||||
free(buf);
|
||||
if (reg_errno == 50)
|
||||
blen += RX_INCREMENT;
|
||||
else
|
||||
{
|
||||
free(pArg);
|
||||
pArg = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pArg->compiled_expression = buf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (blen <= MAX_RX_LEN);
|
||||
}
|
||||
if (pArg && !pArg->compiled_expression)
|
||||
{
|
||||
@ -160,7 +194,8 @@ static void *Make_RegularExpression_Type(va_list * ap)
|
||||
|
|
||||
| Return Values : Pointer to argument structure or NULL on error.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void *Copy_RegularExpression_Type(const void * argp)
|
||||
static void *
|
||||
Copy_RegularExpression_Type(const void *argp)
|
||||
{
|
||||
#if (HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS)
|
||||
const RegExp_Arg *ap = (const RegExp_Arg *)argp;
|
||||
@ -185,10 +220,12 @@ static void *Copy_RegularExpression_Type(const void * argp)
|
||||
|
|
||||
| Return Values : -
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void Free_RegularExpression_Type(void * argp)
|
||||
static void
|
||||
Free_RegularExpression_Type(void *argp)
|
||||
{
|
||||
#if HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
|
||||
RegExp_Arg *ap = (RegExp_Arg *)argp;
|
||||
|
||||
if (ap)
|
||||
{
|
||||
if (--(*(ap->refCount)) == 0)
|
||||
@ -223,24 +260,33 @@ static void Free_RegularExpression_Type(void * argp)
|
||||
| Return Values : TRUE - field is valid
|
||||
| FALSE - field is invalid
|
||||
+--------------------------------------------------------------------------*/
|
||||
static bool Check_RegularExpression_Field(FIELD * field, const void * argp)
|
||||
static bool
|
||||
Check_RegularExpression_Field(FIELD *field, const void *argp)
|
||||
{
|
||||
bool match = FALSE;
|
||||
|
||||
#if HAVE_REGEX_H_FUNCS
|
||||
const RegExp_Arg *ap = (const RegExp_Arg*)argp;
|
||||
const RegExp_Arg *ap = (const RegExp_Arg *)argp;
|
||||
|
||||
if (ap && ap->pRegExp)
|
||||
match = (regexec(ap->pRegExp,field_buffer(field,0),0,NULL,0) ? FALSE:TRUE);
|
||||
match = (regexec(ap->pRegExp, field_buffer(field, 0), 0, NULL, 0)
|
||||
? FALSE
|
||||
: TRUE);
|
||||
#elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
|
||||
RegExp_Arg *ap = (RegExp_Arg *)argp;
|
||||
|
||||
if (ap && ap->compiled_expression)
|
||||
match = (step(field_buffer(field,0),ap->compiled_expression) ? TRUE:FALSE);
|
||||
match = (step(field_buffer(field, 0), ap->compiled_expression)
|
||||
? TRUE
|
||||
: FALSE);
|
||||
#endif
|
||||
return match;
|
||||
}
|
||||
|
||||
static FIELDTYPE typeREGEXP = {
|
||||
static FIELDTYPE typeREGEXP =
|
||||
{
|
||||
_HAS_ARGS | _RESIDENT,
|
||||
1, /* this is mutable, so we can't be const */
|
||||
1, /* this is mutable, so we can't be const */
|
||||
(FIELDTYPE *)0,
|
||||
(FIELDTYPE *)0,
|
||||
Make_RegularExpression_Type,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2002,2005 Free 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,41 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 *
|
||||
* Author: Thomas E. Dickey 1996,1997,2002,2005 *
|
||||
****************************************************************************/
|
||||
/* LINTLIBRARY */
|
||||
|
||||
/* ./fld_arg.c */
|
||||
/* ./f_trace.c */
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
#undef _nc_retrace_field_ptr
|
||||
FIELD **_nc_retrace_field_ptr(
|
||||
FIELD **code)
|
||||
{ return(*(FIELD ***)0); }
|
||||
|
||||
#undef _nc_retrace_field
|
||||
FIELD *_nc_retrace_field(
|
||||
FIELD *code)
|
||||
{ return(*(FIELD **)0); }
|
||||
|
||||
#undef _nc_retrace_field_type
|
||||
FIELDTYPE *_nc_retrace_field_type(
|
||||
FIELDTYPE *code)
|
||||
{ return(*(FIELDTYPE **)0); }
|
||||
|
||||
#undef _nc_retrace_form
|
||||
FORM *_nc_retrace_form(
|
||||
FORM *code)
|
||||
{ return(*(FORM **)0); }
|
||||
|
||||
#undef _nc_retrace_form_hook
|
||||
Form_Hook _nc_retrace_form_hook(
|
||||
Form_Hook code)
|
||||
{ return(*(Form_Hook *)0); }
|
||||
|
||||
/* ./fld_arg.c */
|
||||
|
||||
#undef set_fieldtype_arg
|
||||
int set_fieldtype_arg(
|
||||
FIELDTYPE *typ,
|
||||
@ -119,10 +146,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 +185,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 +268,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 +324,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 +382,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 +452,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(
|
||||
@ -441,10 +468,12 @@ int _nc_Set_Form_Page(
|
||||
FIELD *field)
|
||||
{ return(*(int *)0); }
|
||||
|
||||
typedef struct {
|
||||
int keycode;
|
||||
int (*cmd)(FORM *);
|
||||
} Binding_Info;
|
||||
typedef struct
|
||||
{
|
||||
int keycode;
|
||||
int (*cmd) (FORM *);
|
||||
}
|
||||
Binding_Info;
|
||||
|
||||
#undef form_driver
|
||||
int form_driver(
|
||||
@ -623,41 +652,49 @@ WINDOW *form_win(
|
||||
|
||||
/* ./fty_alnum.c */
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
} alnumARG;
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
}
|
||||
alnumARG;
|
||||
|
||||
#undef TYPE_ALNUM
|
||||
FIELDTYPE *TYPE_ALNUM;
|
||||
|
||||
/* ./fty_alpha.c */
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
} alphaARG;
|
||||
typedef struct
|
||||
{
|
||||
int width;
|
||||
}
|
||||
alphaARG;
|
||||
|
||||
#undef TYPE_ALPHA
|
||||
FIELDTYPE *TYPE_ALPHA;
|
||||
|
||||
/* ./fty_enum.c */
|
||||
|
||||
typedef struct {
|
||||
char **kwds;
|
||||
int count;
|
||||
bool checkcase;
|
||||
bool checkunique;
|
||||
} enumARG;
|
||||
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;
|
||||
typedef struct
|
||||
{
|
||||
int precision;
|
||||
long low;
|
||||
long high;
|
||||
}
|
||||
integerARG;
|
||||
|
||||
#undef TYPE_INTEGER
|
||||
FIELDTYPE *TYPE_INTEGER;
|
||||
@ -670,12 +707,14 @@ FIELDTYPE *TYPE_IPV4;
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
typedef struct {
|
||||
int precision;
|
||||
double low;
|
||||
double high;
|
||||
struct lconv* L;
|
||||
} numericARG;
|
||||
typedef struct
|
||||
{
|
||||
int precision;
|
||||
double low;
|
||||
double high;
|
||||
struct lconv *L;
|
||||
}
|
||||
numericARG;
|
||||
|
||||
#undef TYPE_NUMERIC
|
||||
FIELDTYPE *TYPE_NUMERIC;
|
||||
@ -685,10 +724,11 @@ FIELDTYPE *TYPE_NUMERIC;
|
||||
#include <regex.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
regex_t *pRegExp;
|
||||
unsigned long *refCount;
|
||||
} RegExp_Arg;
|
||||
{
|
||||
regex_t *pRegExp;
|
||||
unsigned long *refCount;
|
||||
}
|
||||
RegExp_Arg;
|
||||
|
||||
#undef TYPE_REGEXP
|
||||
FIELDTYPE *TYPE_REGEXP;
|
||||
|
740
contrib/ncurses/form/llib-lformw
Normal file
740
contrib/ncurses/form/llib-lformw
Normal file
@ -0,0 +1,740 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2002,2005 Free 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,2005 *
|
||||
****************************************************************************/
|
||||
/* LINTLIBRARY */
|
||||
|
||||
/* ./f_trace.c */
|
||||
|
||||
#include "form.priv.h"
|
||||
|
||||
#undef _nc_retrace_field_ptr
|
||||
FIELD **_nc_retrace_field_ptr(
|
||||
FIELD **code)
|
||||
{ return(*(FIELD ***)0); }
|
||||
|
||||
#undef _nc_retrace_field
|
||||
FIELD *_nc_retrace_field(
|
||||
FIELD *code)
|
||||
{ return(*(FIELD **)0); }
|
||||
|
||||
#undef _nc_retrace_field_type
|
||||
FIELDTYPE *_nc_retrace_field_type(
|
||||
FIELDTYPE *code)
|
||||
{ return(*(FIELDTYPE **)0); }
|
||||
|
||||
#undef _nc_retrace_form
|
||||
FORM *_nc_retrace_form(
|
||||
FORM *code)
|
||||
{ return(*(FORM **)0); }
|
||||
|
||||
#undef _nc_retrace_form_hook
|
||||
Form_Hook _nc_retrace_form_hook(
|
||||
Form_Hook code)
|
||||
{ return(*(Form_Hook *)0); }
|
||||
|
||||
/* ./fld_arg.c */
|
||||
|
||||
#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); }
|
||||
|
||||
#undef _nc_Widen_String
|
||||
wchar_t *_nc_Widen_String(
|
||||
char *source,
|
||||
int *lengthp)
|
||||
{ return(*(wchar_t **)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 */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int precision;
|
||||
double low;
|
||||
double high;
|
||||
struct lconv *L;
|
||||
}
|
||||
numericARG;
|
||||
|
||||
#undef TYPE_NUMERIC
|
||||
FIELDTYPE *TYPE_NUMERIC;
|
||||
|
||||
/* ./fty_regex.c */
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
regex_t *pRegExp;
|
||||
unsigned long *refCount;
|
||||
}
|
||||
RegExp_Arg;
|
||||
|
||||
#undef TYPE_REGEXP
|
||||
FIELDTYPE *TYPE_REGEXP;
|
@ -1,6 +1,6 @@
|
||||
# $Id: modules,v 1.13 1999/02/19 00:27:47 juergen Exp $
|
||||
# $Id: modules,v 1.14 2004/12/25 23:29:22 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998,2004 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -27,11 +27,12 @@
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
|
||||
# Author: Thomas E. Dickey
|
||||
#
|
||||
|
||||
@ base
|
||||
# Library objects
|
||||
f_trace lib $(srcdir) $(FORM_PRIV_H)
|
||||
fld_arg lib $(srcdir) $(FORM_PRIV_H)
|
||||
fld_attr lib $(srcdir) $(FORM_PRIV_H)
|
||||
fld_current lib $(srcdir) $(FORM_PRIV_H)
|
||||
|
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 1998,2001 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -29,7 +29,7 @@
|
||||
# Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995
|
||||
# and: Eric S. Raymond <esr@snark.thyrsus.com>
|
||||
#
|
||||
# $Id: Caps,v 1.35 2002/04/20 15:43:34 tom Exp $
|
||||
# $Id: Caps,v 1.36 2006/05/27 15:33:04 tom Exp $
|
||||
#
|
||||
# This is the master termcap/terminfo capability table.
|
||||
#
|
||||
@ -967,8 +967,8 @@ 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
|
||||
memory_lock meml str ml - - ----K lock memory above cursor
|
||||
memory_unlock memu str mu - - ----K unlock memory
|
||||
#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
|
||||
|
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 2001 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -28,7 +28,7 @@
|
||||
#
|
||||
# Author: Thomas Dickey
|
||||
#
|
||||
# $Id: Caps.aix4,v 1.5 2002/04/20 15:43:42 tom Exp $
|
||||
# $Id: Caps.aix4,v 1.7 2006/05/27 15:33:04 tom Exp $
|
||||
#
|
||||
# This is an adaptation of ncurses' termcap/terminfo capability table, which
|
||||
# is designed to align with AIX 4.x's terminfo.
|
||||
@ -227,11 +227,11 @@ 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)
|
||||
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 won't work, xon/xoff required
|
||||
prtr_silent mc5i bool 5i - - ----- printer won't echo on screen
|
||||
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
|
||||
@ -275,7 +275,7 @@ 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
|
||||
no_color_video ncv num NC - - ----- video attributes that cannot be used with colors
|
||||
#%.TE
|
||||
#%.ad
|
||||
#%
|
||||
@ -1069,8 +1069,8 @@ 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
|
||||
memory_lock meml str ml - - ----K lock memory above cursor
|
||||
memory_unlock memu str mu - - ----K unlock memory
|
||||
#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
|
||||
|
1278
contrib/ncurses/include/Caps.hpux11
Normal file
1278
contrib/ncurses/include/Caps.hpux11
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 2001 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -29,7 +29,7 @@
|
||||
# Author: Thomas Dickey
|
||||
# and: Ilya Zakharevich
|
||||
#
|
||||
# $Id: Caps.keys,v 1.2 2002/04/20 15:43:49 tom Exp $
|
||||
# $Id: Caps.keys,v 1.3 2006/05/27 15:33:04 tom Exp $
|
||||
#
|
||||
# This is an adaptation of ncurses' termcap/terminfo capability table, which
|
||||
# is illustrates an experimental extension to describe alt-, shift- and
|
||||
@ -1057,8 +1057,8 @@ 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
|
||||
memory_lock meml str ml - - ----K lock memory above cursor
|
||||
memory_unlock memu str mu - - ----K unlock memory
|
||||
#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
|
||||
|
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 2002 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2002,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -28,7 +28,7 @@
|
||||
#
|
||||
# Author: Thomas Dickey
|
||||
#
|
||||
# $Id: Caps.osf1r5,v 1.2 2002/04/20 15:43:58 tom Exp $
|
||||
# $Id: Caps.osf1r5,v 1.4 2006/05/27 15:33:04 tom Exp $
|
||||
#
|
||||
# This is an adaptation of ncurses' termcap/terminfo capability table, which
|
||||
# is designed to align with OSF/1 version 5 (Tru64) terminfo.
|
||||
@ -227,7 +227,7 @@ 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)
|
||||
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
|
||||
@ -977,8 +977,8 @@ 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
|
||||
memory_lock meml str ml - - ----K lock memory above cursor
|
||||
memory_unlock memu str mu - - ----K unlock memory
|
||||
#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
|
||||
|
@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 2001 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -28,7 +28,7 @@
|
||||
#
|
||||
# Author: Thomas Dickey
|
||||
#
|
||||
# $Id: Caps.uwin,v 1.2 2002/04/20 15:44:04 tom Exp $
|
||||
# $Id: Caps.uwin,v 1.4 2006/05/27 15:33:04 tom Exp $
|
||||
#
|
||||
# This is an adaptation of ncurses' termcap/terminfo capability table, which
|
||||
# is designed to align with U/Win's terminfo.
|
||||
@ -227,11 +227,11 @@ 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)
|
||||
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 won't work, xon/xoff required
|
||||
prtr_silent mc5i bool 5i - - ----- printer won't echo on screen
|
||||
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
|
||||
@ -269,7 +269,7 @@ buttons btns num BT - - ----- number of buttons on mouse
|
||||
# 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
|
||||
no_color_video ncv num NC - - ----- video attributes that cannot be used with colors
|
||||
#%.TE
|
||||
#%.ad
|
||||
#%
|
||||
@ -793,8 +793,8 @@ 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
|
||||
memory_lock meml str ml - - ----K lock memory above cursor
|
||||
memory_unlock memu str mu - - ----K unlock memory
|
||||
#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
|
||||
|
@ -1,4 +1,32 @@
|
||||
#!/bin/sh
|
||||
##############################################################################
|
||||
# Copyright (c) 1998,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: MKhashsize.sh,v 1.7 2006/10/22 00:45:39 tom Exp $
|
||||
#
|
||||
# MKhashsize.sh --- generate size include for hash functions
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# $Id: MKkey_defs.sh,v 1.8 2002/06/01 17:24:28 tom Exp $
|
||||
# $Id: MKkey_defs.sh,v 1.14 2003/12/06 17:10:09 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 2001,2002 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2001-2002,2003 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -30,7 +30,7 @@
|
||||
#
|
||||
# MKkey_defs.sh -- generate function-key definitions for curses.h
|
||||
#
|
||||
# Author: Thomas E. Dickey <dickey@herndon4.his.com> 2001
|
||||
# Author: Thomas E. Dickey 2001
|
||||
#
|
||||
# Extract function-key definitions from the Caps file
|
||||
#
|
||||
@ -43,9 +43,26 @@ pass2=pass2_$$
|
||||
pass3=pass3_$$
|
||||
pass4=pass4_$$
|
||||
trap 'rm -f $data pass[1234]_$$' 0 1 2 5 15
|
||||
sed -e 's/[ ]\+/ /g' < $DATA |sort -n +5 >$data
|
||||
|
||||
# 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
|
||||
elif sort -n +5 $DATA >$data 2>/dev/null
|
||||
then
|
||||
# SunOS (and SVr4, marked as obsolete but still recognized)
|
||||
sed -e 's/[ ][ ]*/ /g' < $DATA |sort -n +5 >$data
|
||||
else
|
||||
echo "Your sort utility is broken. Please install one that works." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# add keys that we generate automatically:
|
||||
cat >>$data <<EOF
|
||||
key_resize kr1 str R1 KEY_RESIZE + ----- Terminal resize event
|
||||
key_event kv1 str V1 KEY_EVENT + ----- We were interrupted by an event
|
||||
EOF
|
||||
|
||||
cat <<EOF
|
||||
|
@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# $Id: MKncurses_def.sh,v 1.1 2000/09/02 17:37:35 tom Exp $
|
||||
# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 2000 Free Software Foundation, Inc. #
|
||||
# #
|
||||
@ -30,7 +30,7 @@
|
||||
#
|
||||
# MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h
|
||||
#
|
||||
# Author: Thomas E. Dickey <dickey@herndon4.his.com> 2000
|
||||
# Author: Thomas E. Dickey 2000
|
||||
#
|
||||
# Given the choice between constructs such as
|
||||
#
|
||||
|
@ -1,5 +1,32 @@
|
||||
#!/bin/sh
|
||||
# $Id: MKparametrized.sh,v 1.5 2000/10/01 00:57:24 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: MKparametrized.sh,v 1.6 2006/04/22 21:36:16 tom Exp $
|
||||
#
|
||||
# MKparametrized.sh -- generate indirection vectors for various sort methods
|
||||
#
|
||||
|
@ -1,6 +1,6 @@
|
||||
BEGIN {
|
||||
print "/****************************************************************************"
|
||||
print " * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *"
|
||||
print " * Copyright (c) 1998-2003,2006 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 *"
|
||||
@ -30,9 +30,10 @@ BEGIN {
|
||||
print "/****************************************************************************/"
|
||||
print "/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 */"
|
||||
print "/* and: Eric S. Raymond <esr@snark.thyrsus.com> */"
|
||||
print "/* and: Thomas E. Dickey 1995-on */"
|
||||
print "/****************************************************************************/"
|
||||
print ""
|
||||
print "/* $Id: MKterm.h.awk.in,v 1.41 2001/12/23 01:04:38 tom Exp $ */"
|
||||
print "/* $Id: MKterm.h.awk.in,v 1.47 2006/11/26 01:18:23 tom Exp $ */"
|
||||
print ""
|
||||
print "/*"
|
||||
print "** term.h -- Definition of struct term"
|
||||
@ -54,15 +55,12 @@ BEGIN {
|
||||
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_TCGETATTR"
|
||||
print "#define HAVE_TCGETATTR 1/*default*/"
|
||||
print ""
|
||||
print "#undef NCURSES_CONST"
|
||||
print "#define NCURSES_CONST @NCURSES_CONST@"
|
||||
print ""
|
||||
print "#undef NCURSES_SBOOL"
|
||||
print "#define NCURSES_SBOOL @NCURSES_SBOOL@"
|
||||
print ""
|
||||
print "#undef NCURSES_XNAMES"
|
||||
print "#define NCURSES_XNAMES @NCURSES_XNAMES@"
|
||||
print ""
|
||||
@ -74,7 +72,8 @@ BEGIN {
|
||||
print "#undef GET_TTY"
|
||||
print ""
|
||||
print "/* Assume POSIX termio if we have the header and function */"
|
||||
print "#if HAVE_TERMIOS_H && HAVE_TCGETATTR"
|
||||
print "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
|
||||
print "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@"
|
||||
print ""
|
||||
print "#undef TERMIOS"
|
||||
print "#define TERMIOS 1"
|
||||
@ -84,7 +83,8 @@ BEGIN {
|
||||
print ""
|
||||
print "#else /* !HAVE_TERMIOS_H */"
|
||||
print ""
|
||||
print "#if HAVE_TERMIO_H"
|
||||
print "/* #if HAVE_TERMIO_H */"
|
||||
print "#if @HAVE_TERMIO_H@"
|
||||
print ""
|
||||
print "#undef TERMIOS"
|
||||
print "#define TERMIOS 1"
|
||||
@ -199,7 +199,7 @@ END {
|
||||
print "typedef struct termtype { /* in-core form of terminfo data */"
|
||||
print " char *term_names; /* str_table offset of term names */"
|
||||
print " char *str_table; /* pointer to string table */"
|
||||
print " char *Booleans; /* array of boolean values */"
|
||||
print " NCURSES_SBOOL *Booleans; /* array of boolean values */"
|
||||
print " short *Numbers; /* array of integer values */"
|
||||
print " char **Strings; /* array of string offsets */"
|
||||
print ""
|
||||
@ -224,6 +224,7 @@ END {
|
||||
print " TTY Ottyb, /* original state of the terminal */"
|
||||
print " Nttyb; /* current state of the terminal */"
|
||||
print " int _baudrate; /* used to compute padding */"
|
||||
print " char * _termname; /* used for termname() */"
|
||||
print "} TERMINAL;"
|
||||
print ""
|
||||
print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
|
||||
@ -268,9 +269,9 @@ END {
|
||||
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(int) _nc_read_termtype (TERMTYPE *, char *, int);"
|
||||
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 */"
|
||||
@ -284,11 +285,18 @@ END {
|
||||
print "/* terminfo entry points, also declared in curses.h */"
|
||||
print "#if !defined(__NCURSES_H)"
|
||||
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 ""
|
||||
print "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
|
||||
print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* implemented */"
|
||||
print "#else"
|
||||
print "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* implemented */"
|
||||
print "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* implemented */"
|
||||
print "#endif"
|
||||
print ""
|
||||
print "#endif /* __NCURSES_H */"
|
||||
print ""
|
||||
print "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -29,10 +29,10 @@
|
||||
/****************************************************************************
|
||||
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
||||
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
||||
* and: Thomas E. Dickey 1996-on *
|
||||
* and: Thomas E. Dickey 1996-on *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: curses.h.in,v 1.129 2002/06/01 17:22:56 tom Exp $ */
|
||||
/* $Id: curses.h.in,v 1.167 2006/11/26 01:14:54 tom Exp $ */
|
||||
|
||||
#ifndef __NCURSES_H
|
||||
#define __NCURSES_H
|
||||
@ -41,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
|
||||
*/
|
||||
@ -55,29 +55,80 @@
|
||||
#undef NCURSES_VERSION
|
||||
#define NCURSES_VERSION "@NCURSES_MAJOR@.@NCURSES_MINOR@"
|
||||
|
||||
/*
|
||||
* Identify the mouse encoding version.
|
||||
*/
|
||||
#define NCURSES_MOUSE_VERSION @NCURSES_MOUSE_VERSION@
|
||||
|
||||
/*
|
||||
* Definitions to facilitate DLL's.
|
||||
*/
|
||||
#include <ncurses_dll.h>
|
||||
|
||||
/*
|
||||
* User-definable tweak to disable the include of <stdbool.h>.
|
||||
*/
|
||||
#ifndef NCURSES_ENABLE_STDBOOL_H
|
||||
#define NCURSES_ENABLE_STDBOOL_H @cf_cv_header_stdbool_h@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses
|
||||
* configured using --disable-macros.
|
||||
*/
|
||||
#ifdef NCURSES_NOMACROS
|
||||
#ifndef NCURSES_ATTR_T
|
||||
#define NCURSES_ATTR_T attr_t
|
||||
#endif
|
||||
#endif /* NCURSES_NOMACROS */
|
||||
|
||||
#ifndef NCURSES_ATTR_T
|
||||
#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@
|
||||
|
||||
#undef NCURSES_INLINE
|
||||
#define NCURSES_INLINE @NCURSES_INLINE@
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
/*
|
||||
* Control whether tparm() supports varargs or fixed-parameter list.
|
||||
*/
|
||||
#undef NCURSES_TPARM_VARARGS
|
||||
#define NCURSES_TPARM_VARARGS @NCURSES_TPARM_VARARGS@
|
||||
|
||||
/*
|
||||
* 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@
|
||||
|
||||
#if @cf_cv_enable_lp64@ && defined(_LP64)
|
||||
typedef unsigned chtype;
|
||||
typedef unsigned mmask_t;
|
||||
#else
|
||||
typedef unsigned @cf_cv_typeof_chtype@ chtype;
|
||||
typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t;
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unctrl.h>
|
||||
@ -106,24 +157,30 @@ typedef unsigned @cf_cv_typeof_chtype@ chtype;
|
||||
|
||||
typedef @cf_cv_type_of_bool@ NCURSES_BOOL;
|
||||
|
||||
#if (!defined(__cplusplus) || !@cf_cv_builtin_bool@) && (!@cf_cv_cc_bool_type@)
|
||||
#if @USE_CXX_BOOL@ /* __cplusplus, etc. */
|
||||
|
||||
#if @cf_cv_header_stdbool_h@
|
||||
/* use the C++ compiler's bool type */
|
||||
#define NCURSES_BOOL bool
|
||||
|
||||
#else /* c89, c99, etc. */
|
||||
|
||||
#if NCURSES_ENABLE_STDBOOL_H
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#undef bool
|
||||
|
||||
#if @cf_cv_header_stdbool_h@
|
||||
#define bool NCURSES_BOOL
|
||||
/* use whatever the C compiler decides bool really is */
|
||||
#define NCURSES_BOOL bool
|
||||
#else
|
||||
typedef @cf_cv_type_of_bool@ bool;
|
||||
/* there is no predefined bool - use our own */
|
||||
#undef bool
|
||||
#define bool NCURSES_BOOL
|
||||
#endif
|
||||
|
||||
#endif /* !__cplusplus, etc. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#define NCURSES_CAST(type,value) static_cast<type>(value)
|
||||
#else
|
||||
#define NCURSES_CAST(type,value) (type)(value)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -170,45 +227,47 @@ extern NCURSES_EXPORT_VAR(chtype*) _nc_acs_map(void);
|
||||
extern NCURSES_EXPORT_VAR(chtype) acs_map[];
|
||||
#endif
|
||||
|
||||
#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)])
|
||||
|
||||
/* VT100 symbols begin here */
|
||||
#define ACS_ULCORNER (acs_map['l']) /* upper left corner */
|
||||
#define ACS_LLCORNER (acs_map['m']) /* lower left corner */
|
||||
#define ACS_URCORNER (acs_map['k']) /* upper right corner */
|
||||
#define ACS_LRCORNER (acs_map['j']) /* lower right corner */
|
||||
#define ACS_LTEE (acs_map['t']) /* tee pointing right */
|
||||
#define ACS_RTEE (acs_map['u']) /* tee pointing left */
|
||||
#define ACS_BTEE (acs_map['v']) /* tee pointing up */
|
||||
#define ACS_TTEE (acs_map['w']) /* tee pointing down */
|
||||
#define ACS_HLINE (acs_map['q']) /* horizontal line */
|
||||
#define ACS_VLINE (acs_map['x']) /* vertical line */
|
||||
#define ACS_PLUS (acs_map['n']) /* large plus or crossover */
|
||||
#define ACS_S1 (acs_map['o']) /* scan line 1 */
|
||||
#define ACS_S9 (acs_map['s']) /* scan line 9 */
|
||||
#define ACS_DIAMOND (acs_map['`']) /* diamond */
|
||||
#define ACS_CKBOARD (acs_map['a']) /* checker board (stipple) */
|
||||
#define ACS_DEGREE (acs_map['f']) /* degree symbol */
|
||||
#define ACS_PLMINUS (acs_map['g']) /* plus/minus */
|
||||
#define ACS_BULLET (acs_map['~']) /* bullet */
|
||||
#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */
|
||||
#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */
|
||||
#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */
|
||||
#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */
|
||||
#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */
|
||||
#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */
|
||||
#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */
|
||||
#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */
|
||||
#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */
|
||||
#define ACS_VLINE NCURSES_ACS('x') /* vertical line */
|
||||
#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */
|
||||
#define ACS_S1 NCURSES_ACS('o') /* scan line 1 */
|
||||
#define ACS_S9 NCURSES_ACS('s') /* scan line 9 */
|
||||
#define ACS_DIAMOND NCURSES_ACS('`') /* diamond */
|
||||
#define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */
|
||||
#define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */
|
||||
#define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */
|
||||
#define ACS_BULLET NCURSES_ACS('~') /* bullet */
|
||||
/* Teletype 5410v1 symbols begin here */
|
||||
#define ACS_LARROW (acs_map[',']) /* arrow pointing left */
|
||||
#define ACS_RARROW (acs_map['+']) /* arrow pointing right */
|
||||
#define ACS_DARROW (acs_map['.']) /* arrow pointing down */
|
||||
#define ACS_UARROW (acs_map['-']) /* arrow pointing up */
|
||||
#define ACS_BOARD (acs_map['h']) /* board of squares */
|
||||
#define ACS_LANTERN (acs_map['i']) /* lantern symbol */
|
||||
#define ACS_BLOCK (acs_map['0']) /* solid square block */
|
||||
#define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */
|
||||
#define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */
|
||||
#define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */
|
||||
#define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */
|
||||
#define ACS_BOARD NCURSES_ACS('h') /* board of squares */
|
||||
#define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */
|
||||
#define ACS_BLOCK NCURSES_ACS('0') /* solid square block */
|
||||
/*
|
||||
* These aren't documented, but a lot of System Vs have them anyway
|
||||
* (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings).
|
||||
* The ACS_names may not match AT&T's, our source didn't know them.
|
||||
*/
|
||||
#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 */
|
||||
#define ACS_S3 NCURSES_ACS('p') /* scan line 3 */
|
||||
#define ACS_S7 NCURSES_ACS('r') /* scan line 7 */
|
||||
#define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */
|
||||
#define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */
|
||||
#define ACS_PI NCURSES_ACS('{') /* Pi */
|
||||
#define ACS_NEQUAL NCURSES_ACS('|') /* not equal */
|
||||
#define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */
|
||||
|
||||
/*
|
||||
* Line drawing ACS names are of the form ACS_trbl, where t is the top, r
|
||||
@ -228,21 +287,11 @@ extern NCURSES_EXPORT_VAR(chtype) acs_map[];
|
||||
#define ACS_SBSB ACS_VLINE
|
||||
#define ACS_SSSS ACS_PLUS
|
||||
|
||||
#if defined(ERR) && ((ERR) != -1)
|
||||
#undef ERR
|
||||
#endif
|
||||
|
||||
#if !defined(ERR)
|
||||
#define ERR (-1)
|
||||
#endif
|
||||
|
||||
#if defined(OK) && ((OK) != 0)
|
||||
#undef OK
|
||||
#endif
|
||||
|
||||
#if !defined(OK)
|
||||
#define OK (0)
|
||||
#endif
|
||||
|
||||
/* values for the _flags member */
|
||||
#define _SUBWIN 0x01 /* is this a sub-window? */
|
||||
@ -277,26 +326,28 @@ typedef chtype attr_t; /* ...must be at least as wide as chtype */
|
||||
#undef mblen
|
||||
#endif
|
||||
#include <libutf8.h>
|
||||
#define _WCHAR_T
|
||||
#define _WINT_T
|
||||
#endif
|
||||
|
||||
#if @NCURSES_MBSTATE_T@
|
||||
#if @NEED_WCHAR_H@
|
||||
#include <wchar.h> /* ...to get mbstate_t, etc. */
|
||||
#endif
|
||||
|
||||
#ifndef _WCHAR_T
|
||||
typedef unsigned long wchar_t;
|
||||
#endif /* _WCHAR_T */
|
||||
#ifndef _WINT_T
|
||||
typedef long int wint_t;
|
||||
#endif /* _WINT_T */
|
||||
#if @NCURSES_WCHAR_T@
|
||||
typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@;
|
||||
#endif
|
||||
|
||||
#if @NCURSES_WINT_T@
|
||||
typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@;
|
||||
#endif
|
||||
|
||||
#define CCHARW_MAX 5
|
||||
typedef struct
|
||||
{
|
||||
attr_t attr;
|
||||
wchar_t chars[CCHARW_MAX];
|
||||
#if @NCURSES_EXT_COLORS@
|
||||
int ext_color; /* color pair, must be more than 16-bits */
|
||||
#endif
|
||||
}
|
||||
cchar_t;
|
||||
|
||||
@ -353,6 +404,9 @@ struct _win_st
|
||||
|
||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||
cchar_t _bkgrnd; /* current background char/attribute pair */
|
||||
#if @NCURSES_EXT_COLORS@
|
||||
int _color; /* current color-pair for non-space character */
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -369,8 +423,6 @@ extern NCURSES_EXPORT_VAR(int) TABSIZE;
|
||||
*/
|
||||
extern NCURSES_EXPORT_VAR(int) ESCDELAY; /* ESC expire time in milliseconds */
|
||||
|
||||
extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
|
||||
|
||||
/*
|
||||
* These functions are extensions - not in XSI Curses.
|
||||
*/
|
||||
@ -379,41 +431,86 @@ 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) define_key (const char *, int);
|
||||
extern NCURSES_EXPORT(int) key_defined (const char *);
|
||||
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) use_legacy_coding (int);
|
||||
extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int);
|
||||
extern NCURSES_EXPORT(void) nofilter(void);
|
||||
#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
|
||||
* macro to alert the compiler to flag inconsistencies in printf/scanf-like
|
||||
* function calls. Just in case '__attribute__' isn't defined, make a dummy.
|
||||
* G++ doesn't accept it anyway.
|
||||
* Old versions of G++ do not accept it anyway, at least not consistently with
|
||||
* GCC.
|
||||
*/
|
||||
#if !defined(__GNUC__) && !defined(__attribute__)
|
||||
#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__))
|
||||
#define __attribute__(p) /* nothing */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For g++, turn off our macros that use __attribute__ (g++ recognizes some
|
||||
* of them, but not at the same version levels as gcc).
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#undef GCC_NORETURN
|
||||
#undef GCC_PRINTF
|
||||
#undef GCC_SCANF
|
||||
#undef GCC_UNUSED
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We cannot define these in ncurses_cfg.h, since they require parameters to be
|
||||
* passed (that's non-portable).
|
||||
* passed (that is non-portable). If you happen to be using gcc with warnings
|
||||
* enabled, define
|
||||
* GCC_PRINTF
|
||||
* GCC_SCANF
|
||||
* to improve checking of calls to printw(), etc.
|
||||
*/
|
||||
#ifndef GCC_PRINTFLIKE
|
||||
#if defined(GCC_PRINTF) && !defined(printf)
|
||||
@ -552,7 +649,7 @@ 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 */
|
||||
extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...) /* implemented */
|
||||
GCC_PRINTFLIKE(3,4);
|
||||
extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */
|
||||
GCC_SCANFLIKE(3,4);
|
||||
@ -577,7 +674,7 @@ 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 */
|
||||
extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */
|
||||
GCC_PRINTFLIKE(4,5);
|
||||
extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */
|
||||
GCC_SCANFLIKE(4,5);
|
||||
@ -601,9 +698,8 @@ 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 */
|
||||
extern NCURSES_EXPORT(int) printw (const char *,...) /* implemented */
|
||||
GCC_PRINTFLIKE(1,2);
|
||||
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 */
|
||||
@ -649,13 +745,9 @@ extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *,int,int,int,int); /* implemente
|
||||
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 */
|
||||
@ -663,23 +755,23 @@ 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) vwprintw (WINDOW *, const char *,va_list); /* implemented */
|
||||
extern NCURSES_EXPORT(int) vw_printw (WINDOW *, 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 *const,int); /* 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 *const,int); /* implemented */
|
||||
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 *, NCURSES_CONST attr_t, void *); /* implemented */
|
||||
extern NCURSES_EXPORT(int) wattr_off (WINDOW *, NCURSES_CONST attr_t, void *); /* implemented */
|
||||
extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */
|
||||
extern NCURSES_EXPORT(int) wbkgd (WINDOW *,const chtype); /* implemented */
|
||||
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 */
|
||||
@ -708,7 +800,7 @@ 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 */
|
||||
extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...) /* implemented */
|
||||
GCC_PRINTFLIKE(2,3);
|
||||
extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */
|
||||
extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */
|
||||
@ -725,7 +817,36 @@ extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */
|
||||
extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
|
||||
/*
|
||||
* vid_attr() was implemented originally based on the draft of XSI curses.
|
||||
* These are also declared in <term.h>:
|
||||
*/
|
||||
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(int) putp (const char *); /* implemented */
|
||||
|
||||
#if NCURSES_TPARM_VARARGS
|
||||
extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* implemented */
|
||||
#else
|
||||
extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* implemented */
|
||||
extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* implemented */
|
||||
#endif
|
||||
|
||||
extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
|
||||
|
||||
/*
|
||||
* These functions are not in X/Open, but we use them in macro definitions:
|
||||
*/
|
||||
extern NCURSES_EXPORT(int) getcurx (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getcury (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getbegx (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getbegy (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */
|
||||
extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
|
||||
|
||||
/*
|
||||
* vid_attr() was implemented originally based on a draft of XSI curses.
|
||||
*/
|
||||
#ifndef _XOPEN_SOURCE_EXTENDED
|
||||
#define vid_attr(a,pair,opts) vidattr(a)
|
||||
@ -736,7 +857,7 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#define NCURSES_ATTR_SHIFT 8
|
||||
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
|
||||
|
||||
#define A_NORMAL 0L
|
||||
#define A_NORMAL (@cf_cv_1UL@ - @cf_cv_1UL@)
|
||||
#define A_ATTRIBUTES NCURSES_BITS(~(@cf_cv_1UL@ - @cf_cv_1UL@),0)
|
||||
#define A_CHARTEXT (NCURSES_BITS(@cf_cv_1UL@,0) - @cf_cv_1UL@)
|
||||
#define A_COLOR NCURSES_BITS(((@cf_cv_1UL@) << 8) - @cf_cv_1UL@,0)
|
||||
@ -756,12 +877,34 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#define A_TOP NCURSES_BITS(@cf_cv_1UL@,21)
|
||||
#define A_VERTICAL NCURSES_BITS(@cf_cv_1UL@,22)
|
||||
|
||||
#define COLOR_PAIR(n) NCURSES_BITS(n, 0)
|
||||
#define PAIR_NUMBER(a) (((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)
|
||||
/*
|
||||
* Most of the pseudo functions are macros that either provide compatibility
|
||||
* with older versions of curses, or provide inline functionality to improve
|
||||
* performance.
|
||||
*/
|
||||
|
||||
/*
|
||||
* pseudo functions
|
||||
* These pseudo functions are always implemented as macros:
|
||||
*/
|
||||
|
||||
#define getyx(win,y,x) (y = getcury(win), x = getcurx(win))
|
||||
#define getbegyx(win,y,x) (y = getbegy(win), x = getbegx(win))
|
||||
#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win))
|
||||
#define getparyx(win,y,x) (y = getpary(win), x = getparx(win))
|
||||
|
||||
#define getsyx(y,x) do { if(newscr->_leaveok) (y)=(x)=-1; \
|
||||
else getyx(newscr,(y),(x)); \
|
||||
} while(0)
|
||||
#define setsyx(y,x) do { if((y)==-1 && (x)==-1) newscr->_leaveok=TRUE; \
|
||||
else {newscr->_leaveok=FALSE;wmove(newscr,(y),(x));} \
|
||||
} while(0)
|
||||
|
||||
#ifndef NCURSES_NOMACROS
|
||||
|
||||
/*
|
||||
* These miscellaneous pseudo functions are provided for compatibility:
|
||||
*/
|
||||
|
||||
#define wgetstr(w, s) wgetnstr(w, s, -1)
|
||||
#define getnstr(s, n) wgetnstr(stdscr, s, n)
|
||||
|
||||
@ -774,17 +917,6 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#define nocrmode() nocbreak()
|
||||
#define gettmode()
|
||||
|
||||
#define getyx(win,y,x) (y = (win)?(win)->_cury:ERR, x = (win)?(win)->_curx:ERR)
|
||||
#define getbegyx(win,y,x) (y = (win)?(win)->_begy:ERR, x = (win)?(win)->_begx:ERR)
|
||||
#define getmaxyx(win,y,x) (y = (win)?((win)->_maxy + 1):ERR, x = (win)?((win)->_maxx + 1):ERR)
|
||||
#define getparyx(win,y,x) (y = (win)?(win)->_pary:ERR, x = (win)?(win)->_parx:ERR)
|
||||
#define getsyx(y,x) do { if(newscr->_leaveok) (y)=(x)=-1; \
|
||||
else getyx(newscr,(y),(x)); \
|
||||
} while(0)
|
||||
#define setsyx(y,x) do { if((y)==-1 && (x)==-1) newscr->_leaveok=TRUE; \
|
||||
else {newscr->_leaveok=FALSE;wmove(newscr,(y),(x));} \
|
||||
} while(0)
|
||||
|
||||
/* It seems older SYSV curses versions define these */
|
||||
#define getattrs(win) ((win)?(win)->_attrs:A_NORMAL)
|
||||
#define getcurx(win) ((win)?(win)->_curx:ERR)
|
||||
@ -798,11 +930,16 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
|
||||
#define wstandout(win) (wattrset(win,A_STANDOUT))
|
||||
#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 wattron(win,at) wattr_on(win, NCURSES_CAST(attr_t, at), NULL)
|
||||
#define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
|
||||
|
||||
#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@
|
||||
#define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \
|
||||
(win)->_attrs = (at))
|
||||
#else
|
||||
#define wattrset(win,at) ((win)->_attrs = (at))
|
||||
#endif
|
||||
|
||||
#define scroll(win) wscrl(win,1)
|
||||
|
||||
@ -823,6 +960,12 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#define waddstr(win,str) waddnstr(win,str,-1)
|
||||
#define waddchstr(win,str) waddchnstr(win,str,-1)
|
||||
|
||||
/*
|
||||
* These apply to the first 256 color pairs.
|
||||
*/
|
||||
#define COLOR_PAIR(n) NCURSES_BITS(n, 0)
|
||||
#define PAIR_NUMBER(a) (NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
|
||||
|
||||
/*
|
||||
* pseudo functions for standard screen
|
||||
*/
|
||||
@ -887,7 +1030,7 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#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 mvwinch(win,y,x) (wmove(win,y,x) == ERR ? NCURSES_CAST(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))
|
||||
@ -919,16 +1062,26 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n)
|
||||
|
||||
/*
|
||||
* Some wide-character functions do not depend on the extensions.
|
||||
* Some wide-character functions can be implemented without the extensions.
|
||||
*/
|
||||
#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))
|
||||
|
||||
#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@
|
||||
#define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \
|
||||
(win)->_color = (p), \
|
||||
OK)
|
||||
#define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \
|
||||
(void)((p) != 0 && (*(p) = (win)->_color)), \
|
||||
OK)
|
||||
#else
|
||||
#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
|
||||
#define wattr_get(win,a,p,opts) ((void)((a) != 0 && (*(a) = (win)->_attrs)), \
|
||||
(void)((p) != 0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
|
||||
OK)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XSI curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use
|
||||
@ -947,6 +1100,8 @@ extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */
|
||||
NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#endif /* NCURSES_NOMACROS */
|
||||
|
||||
/*
|
||||
* Pseudo-character tokens outside ASCII range. The curses wgetch() function
|
||||
* will return any given one of these only if the corresponding k- capability
|
||||
|
@ -1,38 +1,81 @@
|
||||
/* $Id: curses.tail,v 1.5 2001/12/30 00:01:16 tom Exp $ */
|
||||
/*
|
||||
* This file is part of ncurses, designed to be appended after curses.h.in
|
||||
* (see that file for the relevant copyright).
|
||||
*/
|
||||
/* $Id: curses.tail,v 1.14 2006/05/27 16:28:29 tom Exp $ */
|
||||
|
||||
/* mouse interface */
|
||||
#define NCURSES_MOUSE_VERSION 1
|
||||
|
||||
#if NCURSES_MOUSE_VERSION > 1
|
||||
#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5))
|
||||
#else
|
||||
#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6))
|
||||
#endif
|
||||
|
||||
#define NCURSES_BUTTON_RELEASED 001L
|
||||
#define NCURSES_BUTTON_PRESSED 002L
|
||||
#define NCURSES_BUTTON_CLICKED 004L
|
||||
#define NCURSES_DOUBLE_CLICKED 010L
|
||||
#define NCURSES_TRIPLE_CLICKED 020L
|
||||
#define NCURSES_RESERVED_EVENT 040L
|
||||
|
||||
/* 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
|
||||
#define BUTTON1_RELEASED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED)
|
||||
#define BUTTON1_PRESSED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED)
|
||||
#define BUTTON1_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED)
|
||||
#define BUTTON1_DOUBLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED)
|
||||
#define BUTTON1_TRIPLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED)
|
||||
|
||||
#define BUTTON2_RELEASED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED)
|
||||
#define BUTTON2_PRESSED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED)
|
||||
#define BUTTON2_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED)
|
||||
#define BUTTON2_DOUBLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED)
|
||||
#define BUTTON2_TRIPLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED)
|
||||
|
||||
#define BUTTON3_RELEASED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED)
|
||||
#define BUTTON3_PRESSED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED)
|
||||
#define BUTTON3_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED)
|
||||
#define BUTTON3_DOUBLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED)
|
||||
#define BUTTON3_TRIPLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED)
|
||||
|
||||
#define BUTTON4_RELEASED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED)
|
||||
#define BUTTON4_PRESSED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED)
|
||||
#define BUTTON4_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED)
|
||||
#define BUTTON4_DOUBLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED)
|
||||
#define BUTTON4_TRIPLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED)
|
||||
|
||||
/*
|
||||
* In 32 bits the version-1 scheme does not provide enough space for a 5th
|
||||
* button, unless we choose to change the ABI by omitting the reserved-events.
|
||||
*/
|
||||
#if NCURSES_MOUSE_VERSION > 1
|
||||
|
||||
#define BUTTON5_RELEASED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED)
|
||||
#define BUTTON5_PRESSED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED)
|
||||
#define BUTTON5_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED)
|
||||
#define BUTTON5_DOUBLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED)
|
||||
#define BUTTON5_TRIPLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED)
|
||||
|
||||
#define BUTTON_CTRL NCURSES_MOUSE_MASK(6, 0001L)
|
||||
#define BUTTON_SHIFT NCURSES_MOUSE_MASK(6, 0002L)
|
||||
#define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L)
|
||||
#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L)
|
||||
|
||||
#else
|
||||
|
||||
#define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT)
|
||||
#define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT)
|
||||
#define BUTTON3_RESERVED_EVENT NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT)
|
||||
#define BUTTON4_RESERVED_EVENT NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT)
|
||||
|
||||
#define BUTTON_CTRL NCURSES_MOUSE_MASK(5, 0001L)
|
||||
#define BUTTON_SHIFT NCURSES_MOUSE_MASK(5, 0002L)
|
||||
#define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L)
|
||||
#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L)
|
||||
|
||||
#endif
|
||||
|
||||
#define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1)
|
||||
|
||||
/* macros to extract single event-bits from masks */
|
||||
#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1))))
|
||||
@ -42,8 +85,6 @@
|
||||
#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 */
|
||||
@ -57,7 +98,7 @@ 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) wmouse_trafo (const WINDOW*, int*, int*, bool);
|
||||
extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */
|
||||
|
||||
#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
|
||||
@ -105,13 +146,12 @@ extern NCURSES_EXPORT(void) trace (const unsigned int);
|
||||
#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 */
|
||||
|
||||
#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 */
|
||||
@ -121,6 +161,8 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#ifndef NCURSES_NOMACROS
|
||||
|
||||
/* these names conflict with STL */
|
||||
#undef box
|
||||
#undef clear
|
||||
@ -128,6 +170,8 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
|
||||
#undef move
|
||||
#undef refresh
|
||||
|
||||
#endif /* NCURSES_NOMACROS */
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,21 +1,26 @@
|
||||
|
||||
/*
|
||||
* This file is part of ncurses, designed to be appended after curses.h.in
|
||||
* (see that file for the relevant copyright).
|
||||
*/
|
||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||
|
||||
/* $Id: curses.wide,v 1.23 2002/05/11 22:25:33 tom Exp $ */
|
||||
/* $Id: curses.wide,v 1.32 2006/05/27 19:44:23 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 NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c])
|
||||
|
||||
#define WACS_BSSB NCURSES_WACS('l')
|
||||
#define WACS_SSBB NCURSES_WACS('m')
|
||||
#define WACS_BBSS NCURSES_WACS('k')
|
||||
#define WACS_SBBS NCURSES_WACS('j')
|
||||
#define WACS_SBSS NCURSES_WACS('u')
|
||||
#define WACS_SSSB NCURSES_WACS('t')
|
||||
#define WACS_SSBS NCURSES_WACS('v')
|
||||
#define WACS_BSSS NCURSES_WACS('w')
|
||||
#define WACS_BSBS NCURSES_WACS('q')
|
||||
#define WACS_SBSB NCURSES_WACS('x')
|
||||
#define WACS_SSSS NCURSES_WACS('n')
|
||||
|
||||
#define WACS_ULCORNER WACS_BSSB
|
||||
#define WACS_LLCORNER WACS_SSBB
|
||||
@ -29,31 +34,31 @@ extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
|
||||
#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 */
|
||||
#define WACS_S1 NCURSES_WACS('o') /* scan line 1 */
|
||||
#define WACS_S9 NCURSES_WACS('s') /* scan line 9 */
|
||||
#define WACS_DIAMOND NCURSES_WACS('`') /* diamond */
|
||||
#define WACS_CKBOARD NCURSES_WACS('a') /* checker board */
|
||||
#define WACS_DEGREE NCURSES_WACS('f') /* degree symbol */
|
||||
#define WACS_PLMINUS NCURSES_WACS('g') /* plus/minus */
|
||||
#define WACS_BULLET NCURSES_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 */
|
||||
#define WACS_LARROW NCURSES_WACS(',') /* arrow left */
|
||||
#define WACS_RARROW NCURSES_WACS('+') /* arrow right */
|
||||
#define WACS_DARROW NCURSES_WACS('.') /* arrow down */
|
||||
#define WACS_UARROW NCURSES_WACS('-') /* arrow up */
|
||||
#define WACS_BOARD NCURSES_WACS('h') /* board of squares */
|
||||
#define WACS_LANTERN NCURSES_WACS('i') /* lantern symbol */
|
||||
#define WACS_BLOCK NCURSES_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 */
|
||||
#define WACS_S3 NCURSES_WACS('p') /* scan line 3 */
|
||||
#define WACS_S7 NCURSES_WACS('r') /* scan line 7 */
|
||||
#define WACS_LEQUAL NCURSES_WACS('y') /* less/equal */
|
||||
#define WACS_GEQUAL NCURSES_WACS('z') /* greater/equal */
|
||||
#define WACS_PI NCURSES_WACS('{') /* Pi */
|
||||
#define WACS_NEQUAL NCURSES_WACS('|') /* not equal */
|
||||
#define WACS_STERLING NCURSES_WACS('}') /* UK pound sign */
|
||||
|
||||
/*
|
||||
* Function prototypes for wide-character operations.
|
||||
@ -74,23 +79,23 @@ extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* implemented:WIDEC */
|
||||
extern NCURSES_EXPORT(int) 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 (NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) in_wchnstr (NCURSES_CONST cchar_t *, int); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) in_wchstr (NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) 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(char*) key_name (wchar_t); /* implemented */
|
||||
extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* implemented: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 */
|
||||
@ -100,9 +105,9 @@ extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* generated:WIDEC *
|
||||
extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvin_wch (int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, NCURSES_CONST cchar_t *, int); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvin_wchstr (int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) 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 */
|
||||
@ -118,22 +123,22 @@ extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* generat
|
||||
extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, NCURSES_CONST cchar_t *,int); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) 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) pecho_wchar (WINDOW *, const cchar_t *); /* implemented */
|
||||
extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */
|
||||
extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* missing */
|
||||
extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented:WIDEC */
|
||||
extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented:WIDEC */
|
||||
extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented:WIDEC */
|
||||
extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented:WIDEC */
|
||||
extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* implemented */
|
||||
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 */
|
||||
@ -146,12 +151,12 @@ extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,c
|
||||
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) wgetbkgrnd (WINDOW *, cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* implemented */
|
||||
extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* implemented */
|
||||
extern NCURSES_EXPORT(int) win_wch (WINDOW *, NCURSES_CONST cchar_t *); /* implemented */
|
||||
extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, NCURSES_CONST cchar_t *, int); /* implemented */
|
||||
extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, NCURSES_CONST cchar_t *); /* generated:WIDEC */
|
||||
extern NCURSES_EXPORT(int) 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 */
|
||||
@ -160,6 +165,8 @@ 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 */
|
||||
|
||||
#ifndef NCURSES_NOMACROS
|
||||
|
||||
/*
|
||||
* XSI curses macros for XPG4 conformance.
|
||||
*/
|
||||
@ -186,11 +193,9 @@ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* imple
|
||||
#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)
|
||||
@ -234,4 +239,11 @@ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* imple
|
||||
#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 /* NCURSES_NOMACROS */
|
||||
|
||||
#if defined(TRACE) || defined(NCURSES_TEST)
|
||||
extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
|
||||
extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *);
|
||||
#endif
|
||||
|
||||
#endif /* _XOPEN_SOURCE_EXTENDED */
|
||||
|
67
contrib/ncurses/include/hashed_db.h
Normal file
67
contrib/ncurses/include/hashed_db.h
Normal file
@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey 2006 *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Id: hashed_db.h,v 1.5 2006/08/19 15:58:34 tom Exp $
|
||||
*/
|
||||
|
||||
#ifndef HASHED_DB_H
|
||||
#define HASHED_DB_H 1
|
||||
|
||||
#include <curses.h>
|
||||
|
||||
#if USE_HASHED_DB
|
||||
|
||||
#include <db.h>
|
||||
|
||||
#ifndef DBN_SUFFIX
|
||||
#define DBM_SUFFIX ".db"
|
||||
#endif
|
||||
|
||||
#ifdef DB_VERSION_MAJOR
|
||||
#define HASHED_DB_API DB_VERSION_MAJOR
|
||||
#else
|
||||
#define HASHED_DB_API 1 /* e.g., db 1.8.5 */
|
||||
#endif
|
||||
|
||||
extern NCURSES_EXPORT(DB *) _nc_db_open(const char * /* path */, bool /* modify */);
|
||||
extern NCURSES_EXPORT(bool) _nc_db_have_data(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */);
|
||||
extern NCURSES_EXPORT(bool) _nc_db_have_index(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */);
|
||||
extern NCURSES_EXPORT(int) _nc_db_close(DB * /* db */);
|
||||
extern NCURSES_EXPORT(int) _nc_db_first(DB * /* db */, DBT * /* key */, DBT * /* data */);
|
||||
extern NCURSES_EXPORT(int) _nc_db_next(DB * /* db */, DBT * /* key */, DBT * /* data */);
|
||||
extern NCURSES_EXPORT(int) _nc_db_get(DB * /* db */, DBT * /* key */, DBT * /* data */);
|
||||
extern NCURSES_EXPORT(int) _nc_db_put(DB * /* db */, DBT * /* key */, DBT * /* data */);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HASHED_DB_H */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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,15 @@
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1996,1997 *
|
||||
****************************************************************************/
|
||||
/* $Id: nc_alloc.h,v 1.10 2001/12/08 23:49:44 tom Exp $ */
|
||||
/* $Id: nc_alloc.h,v 1.13 2005/01/16 00:27:35 tom Exp $ */
|
||||
|
||||
#ifndef NC_ALLOC_included
|
||||
#define NC_ALLOC_included 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBDMALLOC
|
||||
#include <dmalloc.h> /* Gray Watson's library */
|
||||
#else
|
||||
@ -48,6 +52,13 @@
|
||||
#define HAVE_LIBDBMALLOC 0
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBMPATROL
|
||||
#include <mpatrol.h> /* Memory-Patrol library */
|
||||
#else
|
||||
#undef HAVE_LIBMPATROL
|
||||
#define HAVE_LIBMPATROL 0
|
||||
#endif
|
||||
|
||||
#ifndef NO_LEAKS
|
||||
#define NO_LEAKS 0
|
||||
#endif
|
||||
@ -55,9 +66,9 @@
|
||||
#if HAVE_LIBDBMALLOC || HAVE_LIBDMALLOC || NO_LEAKS
|
||||
#define HAVE_NC_FREEALL 1
|
||||
struct termtype;
|
||||
extern void _nc_free_and_exit(int) GCC_NORETURN;
|
||||
extern void _nc_free_tparm(void);
|
||||
extern void _nc_leaks_dump_entry(void);
|
||||
extern NCURSES_EXPORT(void) _nc_free_and_exit(int) GCC_NORETURN;
|
||||
extern NCURSES_EXPORT(void) _nc_free_tparm(void);
|
||||
extern NCURSES_EXPORT(void) _nc_leaks_dump_entry(void);
|
||||
#define ExitProgram(code) _nc_free_and_exit(code)
|
||||
#endif
|
||||
|
||||
@ -80,4 +91,8 @@ extern NCURSES_EXPORT(char *) _nc_strdup(const char *);
|
||||
#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 */
|
||||
|
65
contrib/ncurses/include/nc_tparm.h
Normal file
65
contrib/ncurses/include/nc_tparm.h
Normal file
@ -0,0 +1,65 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey 2006 *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: nc_tparm.h,v 1.4 2006/11/26 00:49:25 tom Exp $ */
|
||||
|
||||
/*
|
||||
* Cast parameters past the formatting-string for tparm() to match the
|
||||
* assumption of the varargs code.
|
||||
*/
|
||||
#define TPARM_ARG long
|
||||
#define TPARM_N(n) (TPARM_ARG)(n)
|
||||
|
||||
#define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
|
||||
|
||||
#if NCURSES_TPARM_VARARGS
|
||||
#define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i))
|
||||
#define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h))
|
||||
#define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g))
|
||||
#define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f))
|
||||
#define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e))
|
||||
#define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d))
|
||||
#define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c))
|
||||
#define TPARM_1(a,b) tparm(a,TPARM_N(b))
|
||||
#define TPARM_0(a) tparm(a)
|
||||
#else
|
||||
#define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0)
|
||||
#define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0)
|
||||
#define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0)
|
||||
#define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0)
|
||||
#define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0)
|
||||
#define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
|
||||
#define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
|
||||
#define TPARM_1(a,b) TPARM_2(a,b,0)
|
||||
#define TPARM_1(a,b) TPARM_2(a,b,0)
|
||||
#define TPARM_0(a) TPARM_1(a,0)
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2004,2005 Free 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,7 @@
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1997 *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: ncurses_cfg.hin,v 1.3 2000/09/02 17:13:32 tom Exp $
|
||||
* $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 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
|
||||
@ -57,6 +57,16 @@
|
||||
#undef inline
|
||||
#define inline /* nothing */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* On HP-UX, the C compiler doesn't grok mbstate_t without
|
||||
-D_XOPEN_SOURCE=500. However, this causes problems on
|
||||
IRIX. So, we #define mbstate_t to int in configure.in
|
||||
only for the C compiler if needed. */
|
||||
#ifndef __cplusplus
|
||||
#ifdef NEED_MBSTATE_T_DEF
|
||||
#define mbstate_t int
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* NC_CONFIG_H */
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: ncurses_defs,v 1.14 2002/05/11 19:18:32 tom Exp $
|
||||
# $Id: ncurses_defs,v 1.30 2006/08/05 19:27:02 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 2000-2001,2002 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 2000-2005,2006 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -45,53 +45,77 @@ GCC_NORETURN /* nothing */
|
||||
GCC_UNUSED /* nothing */
|
||||
HAVE_BIG_CORE
|
||||
HAVE_BSD_CGETENT
|
||||
HAVE_BSD_SIGNAL_H
|
||||
HAVE_BTOWC
|
||||
HAVE_BUILTIN_H
|
||||
HAVE_DIRENT_H
|
||||
HAVE_ERRNO
|
||||
HAVE_FCNTL_H
|
||||
HAVE_FILTER 1
|
||||
HAVE_FORM_H
|
||||
HAVE_GETBEGX 1
|
||||
HAVE_GETCURX 1
|
||||
HAVE_GETCWD
|
||||
HAVE_GETEGID
|
||||
HAVE_GETEUID
|
||||
HAVE_GETMAXX 1
|
||||
HAVE_GETNSTR
|
||||
HAVE_GETOPT_H
|
||||
HAVE_GETTIMEOFDAY
|
||||
HAVE_GETTTYNAM
|
||||
HAVE_GETWIN 1
|
||||
HAVE_GPM_H
|
||||
HAVE_GPP_BUILTIN_H
|
||||
HAVE_GXX_BUILTIN_H
|
||||
HAVE_HAS_KEY
|
||||
HAVE_ISASCII
|
||||
HAVE_ISSETUGID
|
||||
HAVE_LANGINFO_CODESET
|
||||
HAVE_LIBC_H
|
||||
HAVE_LIBDBMALLOC
|
||||
HAVE_LIBDMALLOC
|
||||
HAVE_LIBFORM
|
||||
HAVE_LIBGPM
|
||||
HAVE_LIBMENU
|
||||
HAVE_LIBMPATROL
|
||||
HAVE_LIBPANEL
|
||||
HAVE_LIMITS_H
|
||||
HAVE_LINK
|
||||
HAVE_LOCALE_H
|
||||
HAVE_LONG_FILE_NAMES
|
||||
HAVE_MEMCCPY
|
||||
HAVE_MBLEN
|
||||
HAVE_MBRLEN
|
||||
HAVE_MBRTOWC
|
||||
HAVE_MBTOWC
|
||||
HAVE_MENU_H
|
||||
HAVE_MKSTEMP
|
||||
HAVE_MVVLINE 1
|
||||
HAVE_MVWVLINE 1
|
||||
HAVE_NANOSLEEP
|
||||
HAVE_NC_ALLOC_H
|
||||
HAVE_PANEL_H
|
||||
HAVE_POLL
|
||||
HAVE_POLL_H
|
||||
HAVE_PURIFY
|
||||
HAVE_PUTWC
|
||||
HAVE_PUTWIN 1
|
||||
HAVE_REGEXPR_H_FUNCS
|
||||
HAVE_REGEXP_H_FUNCS
|
||||
HAVE_REGEX_H_FUNCS
|
||||
HAVE_REMOVE
|
||||
HAVE_RESIZETERM
|
||||
HAVE_RESIZE_TERM
|
||||
HAVE_RIPOFFLINE 1
|
||||
HAVE_SELECT
|
||||
HAVE_SETBUF
|
||||
HAVE_SETBUFFER
|
||||
HAVE_SETUPTERM 1
|
||||
HAVE_SETVBUF
|
||||
HAVE_SIGACTION
|
||||
HAVE_SIGVEC
|
||||
HAVE_SIZECHANGE
|
||||
HAVE_SLK_COLOR
|
||||
HAVE_SLK_INIT 1
|
||||
HAVE_STRDUP
|
||||
HAVE_STRSTR
|
||||
HAVE_SYMLINK
|
||||
@ -107,10 +131,17 @@ HAVE_SYS_TIME_SELECT
|
||||
HAVE_TCGETATTR
|
||||
HAVE_TCGETPGRP
|
||||
HAVE_TELL
|
||||
HAVE_TERMATTRS 1
|
||||
HAVE_TERMIOS_H
|
||||
HAVE_TERMIO_H
|
||||
HAVE_TERMNAME 1
|
||||
HAVE_TERM_H 1
|
||||
HAVE_TGETENT 1
|
||||
HAVE_TIGETNUM 1
|
||||
HAVE_TIGETSTR 1
|
||||
HAVE_TIMES
|
||||
HAVE_TTYENT_H
|
||||
HAVE_TYPEAHEAD 1
|
||||
HAVE_TYPEINFO
|
||||
HAVE_TYPE_ATTR_T
|
||||
HAVE_TYPE_SIGACTION
|
||||
@ -120,13 +151,17 @@ HAVE_USE_DEFAULT_COLORS
|
||||
HAVE_VFSCANF
|
||||
HAVE_VSNPRINTF
|
||||
HAVE_VSSCANF
|
||||
HAVE_WCTOB
|
||||
HAVE_WCTOMB
|
||||
HAVE_WCTYPE_H
|
||||
HAVE_WINSSTR 1
|
||||
HAVE_WORKING_POLL
|
||||
HAVE_WRESIZE
|
||||
HAVE__DOSCAN
|
||||
MIXEDCASE_FILENAMES
|
||||
NCURSES_EXPANDED
|
||||
NCURSES_EXT_COLORS
|
||||
NCURSES_EXT_FUNCS
|
||||
NCURSES_NOMACROS
|
||||
NCURSES_NO_PADDING
|
||||
NCURSES_PATHSEP ':'
|
||||
NDEBUG
|
||||
@ -147,7 +182,9 @@ USE_DATABASE
|
||||
USE_GETCAP
|
||||
USE_GETCAP_CACHE
|
||||
USE_HARD_TABS
|
||||
USE_HASHED_DB
|
||||
USE_HASHMAP
|
||||
USE_HOME_TERMINFO
|
||||
USE_LINKS
|
||||
USE_MY_MEMMOVE
|
||||
USE_OK_BCOPY
|
||||
@ -159,6 +196,7 @@ USE_STDIO_VSCAN
|
||||
USE_STRSTREAM_VSCAN
|
||||
USE_STRSTREAM_VSCAN_CAST
|
||||
USE_SYMLINKS
|
||||
USE_SYSMOUSE
|
||||
USE_TERMCAP
|
||||
USE_WIDEC_SUPPORT
|
||||
USE_XMC_SUPPORT
|
||||
|
@ -1,10 +1,41 @@
|
||||
/* $Id: ncurses_dll.h,v 1.2 2001/12/09 01:36:34 tom Exp $ */
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2004,2005 Free 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: ncurses_dll.h,v 1.5 2006/04/22 22:07:51 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 */
|
||||
/* no longer needed on cygwin or mingw, thanks to auto-import */
|
||||
/* but this structure may be useful at some point for an MSVC build */
|
||||
/* so, for now unconditionally define the important flags */
|
||||
/* "the right way" for proper static and dll+auto-import behavior */
|
||||
#undef NCURSES_DLL
|
||||
#define NCURSES_STATIC
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
# if defined(NCURSES_DLL)
|
||||
@ -14,8 +45,8 @@
|
||||
# endif
|
||||
# undef NCURSES_IMPEXP
|
||||
# undef NCURSES_API
|
||||
# undef NCURSES_EXPORT(type)
|
||||
# undef NCURSES_EXPORT_VAR(type)
|
||||
# undef NCURSES_EXPORT
|
||||
# undef NCURSES_EXPORT_VAR
|
||||
# if defined(NCURSES_DLL)
|
||||
/* building a DLL */
|
||||
# define NCURSES_IMPEXP __declspec(dllexport)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2001,2004 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -29,9 +29,10 @@
|
||||
/****************************************************************************
|
||||
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
||||
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
||||
* and: Thomas E. Dickey 1998-2004 *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: term_entry.h,v 1.32 2001/03/24 21:53:10 tom Exp $ */
|
||||
/* $Id: term_entry.h,v 1.34 2005/07/16 21:15:07 tom Exp $ */
|
||||
|
||||
/*
|
||||
* term_entry.h -- interface to entry-manipulation code
|
||||
@ -56,7 +57,7 @@ typedef struct entry {
|
||||
{
|
||||
char *name;
|
||||
struct entry *link;
|
||||
long line;
|
||||
long line;
|
||||
}
|
||||
uses[MAX_USES];
|
||||
int ncrosslinks;
|
||||
@ -133,6 +134,9 @@ extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *);
|
||||
/* lib_acs.c */
|
||||
extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
|
||||
|
||||
/* lib_termcap.c: trim sgr0 string for termcap users */
|
||||
extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE *);
|
||||
|
||||
/* parse_entry.c: entry-parsing code */
|
||||
#if NCURSES_XNAMES
|
||||
extern NCURSES_EXPORT_VAR(bool) _nc_user_definable;
|
||||
@ -148,9 +152,11 @@ extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const);
|
||||
/* comp_parse.c: entry list handling */
|
||||
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(int) _nc_resolve_uses (bool); /* obs 20040705 */
|
||||
extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool);
|
||||
extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *);
|
||||
extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *);
|
||||
extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */
|
||||
extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool);
|
||||
|
||||
/* trace_xnames.c */
|
||||
extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998-2000,2001 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
@ -29,10 +29,11 @@
|
||||
/****************************************************************************
|
||||
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
|
||||
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
|
||||
* and: Thomas E. Dickey 1996 on *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Id: tic.h,v 1.41 2002/06/01 19:07:02 tom Exp $
|
||||
* $Id: tic.h,v 1.55 2006/08/19 14:17:49 tom Exp $
|
||||
* tic.h - Global variables and structures for the terminfo
|
||||
* compiler.
|
||||
*/
|
||||
@ -76,6 +77,15 @@ extern "C" {
|
||||
|
||||
#define MAGIC 0432 /* first two bytes of a compiled entry */
|
||||
|
||||
#undef BYTE
|
||||
#define BYTE(p,n) (unsigned char)((p)[n])
|
||||
|
||||
#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377))
|
||||
#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377))
|
||||
#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1))
|
||||
|
||||
#define IS_TIC_MAGIC(p) (LOW_MSB(p) == MAGIC)
|
||||
|
||||
/*
|
||||
* The "maximum" here is misleading; XSI guarantees minimum values, which a
|
||||
* given implementation may exceed.
|
||||
@ -83,13 +93,14 @@ extern "C" {
|
||||
#define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */
|
||||
#define MAX_ENTRY_SIZE 4096 /* maximum legal entry size */
|
||||
|
||||
/* The maximum size of individual name or alias is guaranteed in XSI to
|
||||
* be 14, since that corresponds to the older filename lengths. Newer
|
||||
* systems allow longer aliases, though not many terminal descriptions
|
||||
* are written to use them.
|
||||
/*
|
||||
* The maximum size of individual name or alias is guaranteed in XSI to be at
|
||||
* least 14, since that corresponds to the older filename lengths. Newer
|
||||
* systems allow longer aliases, though not many terminal descriptions are
|
||||
* written to use them. The MAX_ALIAS symbol is used for warnings.
|
||||
*/
|
||||
#if HAVE_LONG_FILE_NAMES
|
||||
#define MAX_ALIAS 32 /* POSIX minimum for PATH_MAX */
|
||||
#define MAX_ALIAS 32 /* smaller than POSIX minimum for PATH_MAX */
|
||||
#else
|
||||
#define MAX_ALIAS 14 /* SVr3 filename length */
|
||||
#endif
|
||||
@ -104,10 +115,10 @@ 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), \
|
||||
_nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \
|
||||
_nc_tracing |= DEBUG_LEVEL(n)
|
||||
|
||||
#ifdef TRACE
|
||||
@ -203,8 +214,6 @@ struct alias
|
||||
const char *source;
|
||||
};
|
||||
|
||||
extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
|
||||
|
||||
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[];
|
||||
|
||||
@ -217,18 +226,18 @@ extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_tabl
|
||||
#define NOTFOUND ((struct name_table_entry *) 0)
|
||||
|
||||
/* out-of-band values for representing absent capabilities */
|
||||
#define ABSENT_BOOLEAN (-1) /* 255 */
|
||||
#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */
|
||||
#define ABSENT_NUMERIC (-1)
|
||||
#define ABSENT_STRING (char *)0
|
||||
|
||||
/* out-of-band values for representing cancels */
|
||||
#define CANCELLED_BOOLEAN (char)(-2) /* 254 */
|
||||
#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */
|
||||
#define CANCELLED_NUMERIC (-2)
|
||||
#define CANCELLED_STRING (char *)(-1)
|
||||
|
||||
#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)
|
||||
#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING)
|
||||
|
||||
/* termcap entries longer than this may break old binaries */
|
||||
#define MAX_TERMCAP_LENGTH 1023
|
||||
@ -241,6 +250,10 @@ extern NCURSES_EXPORT(const struct name_table_entry * const *) _nc_get_hash_tabl
|
||||
#endif
|
||||
|
||||
/* access.c */
|
||||
extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *);
|
||||
extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *);
|
||||
extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *);
|
||||
extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *);
|
||||
extern NCURSES_EXPORT(char *) _nc_basename (char *);
|
||||
extern NCURSES_EXPORT(char *) _nc_rootname (char *);
|
||||
|
||||
@ -266,11 +279,12 @@ extern NCURSES_EXPORT_VAR(long) _nc_start_line;
|
||||
#define SYN_TERMCAP 1
|
||||
|
||||
/* comp_error.c: warning & abort messages */
|
||||
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(const char *) _nc_get_source (void);
|
||||
extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
|
||||
extern NCURSES_EXPORT(void) _nc_get_type (char *name);
|
||||
extern NCURSES_EXPORT(void) _nc_set_source (const char *const);
|
||||
extern NCURSES_EXPORT(void) _nc_set_type (const char *const);
|
||||
extern NCURSES_EXPORT(void) _nc_syserr_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;
|
||||
|
||||
@ -278,20 +292,50 @@ extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings;
|
||||
extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int);
|
||||
|
||||
/* comp_scan.c: decode string from readable form */
|
||||
extern NCURSES_EXPORT(char) _nc_trans_string (char *, char *);
|
||||
extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *);
|
||||
|
||||
/* captoinfo.c: capability conversion */
|
||||
extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const);
|
||||
extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const);
|
||||
|
||||
/* home_terminfo.c */
|
||||
extern NCURSES_EXPORT(char *) _nc_home_terminfo (void);
|
||||
|
||||
/* lib_tparm.c */
|
||||
#define NUM_PARM 9
|
||||
|
||||
extern NCURSES_EXPORT_VAR(int) _nc_tparm_err;
|
||||
|
||||
extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *, char **, int *);
|
||||
|
||||
/* lib_tputs.c */
|
||||
extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */
|
||||
|
||||
/* comp_main.c: compiler main */
|
||||
extern const char * _nc_progname;
|
||||
|
||||
/* read_entry.c */
|
||||
/* db_iterator.c */
|
||||
typedef enum {
|
||||
dbdTIC = 0,
|
||||
#if USE_DATABASE
|
||||
dbdEnvOnce,
|
||||
dbdHome,
|
||||
dbdEnvList,
|
||||
dbdCfgList,
|
||||
dbdCfgOnce,
|
||||
#endif
|
||||
#if USE_TERMCAP
|
||||
dbdEnvOnce2,
|
||||
dbdEnvList2,
|
||||
dbdCfgList2,
|
||||
#endif
|
||||
dbdLAST
|
||||
} DBDIRS;
|
||||
|
||||
extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *);
|
||||
extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
|
||||
extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);
|
||||
extern NCURSES_EXPORT(void) _nc_last_db(void);
|
||||
|
||||
/* write_entry.c */
|
||||
extern NCURSES_EXPORT(int) _nc_tic_written (void);
|
||||
|
@ -109,38 +109,39 @@ then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
:
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
:
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
:
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
@ -150,7 +151,7 @@ else
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
:
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -162,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
@ -182,7 +183,7 @@ while [ $# -ne 0 ] ; do
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
:
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
@ -193,29 +194,29 @@ if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
:
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
@ -234,15 +235,15 @@ else
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.33 2002/01/19 22:49:44 tom Exp $
|
||||
# $Id: Makefile.in,v 1.39 2005/07/16 17:26:45 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 1998,2000,2001,2002 Free Software Foundation, Inc. #
|
||||
# Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
@ -27,7 +27,7 @@
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
|
||||
# Author: Thomas E. Dickey 1996,1997
|
||||
#
|
||||
# Makefile for ncurses manual pages.
|
||||
#
|
||||
@ -49,6 +49,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
all \
|
||||
sources : terminfo.5
|
||||
depend :
|
||||
tags :
|
||||
|
||||
$(DESTDIR)$(mandir) :
|
||||
sh $(srcdir)/../mkinstalldirs $@
|
||||
@ -56,10 +57,10 @@ $(DESTDIR)$(mandir) :
|
||||
EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]*
|
||||
|
||||
install install.man : terminfo.5 $(DESTDIR)$(mandir)
|
||||
sh ./edit_man.sh installing $(EDITARGS)
|
||||
sh ../edit_man.sh normal installing $(EDITARGS)
|
||||
|
||||
uninstall uninstall.man :
|
||||
-sh ./edit_man.sh removing $(EDITARGS)
|
||||
-sh ../edit_man.sh normal removing $(EDITARGS)
|
||||
|
||||
# We compose terminfo.5 from the real sources...
|
||||
CAPLIST=$(srcdir)/../include/@TERMINFO_CAPS@
|
||||
@ -72,8 +73,8 @@ mostlyclean :
|
||||
clean: mostlyclean
|
||||
rm -f terminfo.5
|
||||
|
||||
edit_man.sed : make_sed.sh @MANPAGE_RENAMES@
|
||||
sh $srcdir/make_sed.sh @MANPAGE_RENAMES@ >edit_man.sed
|
||||
../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.*
|
||||
rm -f Makefile ../edit_man.*
|
||||
|
@ -1,6 +1,6 @@
|
||||
'\" t
|
||||
.\"***************************************************************************
|
||||
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. *
|
||||
.\" *
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
.\" copy of this software and associated documentation files (the *
|
||||
@ -27,7 +27,7 @@
|
||||
.\" authorization. *
|
||||
.\"***************************************************************************
|
||||
.\"
|
||||
.\" $Id: captoinfo.1m,v 1.16 2000/08/13 01:56:49 tom Exp $
|
||||
.\" $Id: captoinfo.1m,v 1.20 2006/05/13 15:14:01 tom Exp $
|
||||
.TH captoinfo 1M ""
|
||||
.ds n 5
|
||||
.ds d @TERMINFO@
|
||||
@ -40,7 +40,7 @@
|
||||
one found, an equivalent \fBterminfo\fR description is written to standard
|
||||
output. Termcap \fBtc\fR capabilities are translated directly to terminfo
|
||||
\fBuse\fR capabilities.
|
||||
|
||||
.PP
|
||||
If no \fIfile\fR is given, then the environment variable \fBTERMCAP\fR is used
|
||||
for the filename or entry. If \fBTERMCAP\fR is a full pathname to a file, only
|
||||
the terminal whose name is specified in the environment variable \fBTERM\fR is
|
||||
@ -151,7 +151,6 @@ be composed into an \fBacsc\fR string. The double-line capabilities and
|
||||
IBM's AIX has a terminfo facility descended from SVr1 terminfo but incompatible
|
||||
with the SVr4 format. The following AIX extensions are automatically
|
||||
translated:
|
||||
.PP
|
||||
.TS
|
||||
c c
|
||||
l l.
|
||||
@ -174,11 +173,16 @@ These will be discarded with a warning message.
|
||||
.SH NOTES
|
||||
This utility is actually a link to \fItic\fR(1M), running in \fI-I\fR mode.
|
||||
You can use other \fItic\fR options such as \fB-f\fR and \fB-x\fR.
|
||||
|
||||
.PP
|
||||
The trace option isn't identical to SVr4's. Under SVr4, instead of following
|
||||
the -v with a trace level n, you repeat it n times.
|
||||
the \fB-v\fR with a trace level n, you repeat it n times.
|
||||
.SH SEE ALSO
|
||||
\fBcurses\fR(3X), \fB@INFOCMP@\fR(1M), \fBterminfo\fR(\*n)
|
||||
\fB@INFOCMP@\fR(1M),
|
||||
\fBcurses\fR(3X),
|
||||
\fBterminfo\fR(\*n)
|
||||
.PP
|
||||
This describes \fBncurses\fR
|
||||
version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
|
||||
.SH AUTHOR
|
||||
Eric S. Raymond <esr@snark.thyrsus.com>
|
||||
.\"#
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"***************************************************************************
|
||||
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
.\" Copyright (c) 1998-2000,2006 Free Software Foundation, Inc. *
|
||||
.\" *
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
.\" copy of this software and associated documentation files (the *
|
||||
@ -26,7 +26,7 @@
|
||||
.\" authorization. *
|
||||
.\"***************************************************************************
|
||||
.\"
|
||||
.\" $Id: clear.1,v 1.3 2000/07/15 23:59:35 china Exp $
|
||||
.\" $Id: clear.1,v 1.5 2006/07/01 21:55:09 tom Exp $
|
||||
.TH clear 1 ""
|
||||
.ds n 5
|
||||
.SH NAME
|
||||
@ -38,8 +38,13 @@
|
||||
\fBclear\fR clears your screen if this is possible. It looks in the
|
||||
environment for the terminal type and then in the \fBterminfo\fR database to
|
||||
figure out how to clear the screen.
|
||||
.PP
|
||||
\fBclear\fR ignores any command-line parameters that may be present.
|
||||
.SH SEE ALSO
|
||||
\fB@TPUT@\fR(1), \fBterminfo\fR(\*n)
|
||||
.PP
|
||||
This describes \fBncurses\fR
|
||||
version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
|
||||
.\"#
|
||||
.\"# The following sets edit modes for GNU EMACS
|
||||
.\"# Local Variables:
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"***************************************************************************
|
||||
.\" Copyright (c) 2001,2002 Free Software Foundation, Inc. *
|
||||
.\" Copyright (c) 2001-2002,2006 Free Software Foundation, Inc. *
|
||||
.\" *
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
.\" copy of this software and associated documentation files (the *
|
||||
@ -26,7 +26,7 @@
|
||||
.\" authorization. *
|
||||
.\"***************************************************************************
|
||||
.\"
|
||||
.\" $Id: curs_add_wch.3x,v 1.4 2002/02/16 22:28:43 tom Exp $
|
||||
.\" $Id: curs_add_wch.3x,v 1.5 2006/12/02 17:02:35 tom Exp $
|
||||
.TH curs_add_wch 3X ""
|
||||
.SH NAME
|
||||
\fBadd_wch\fP,
|
||||
@ -121,6 +121,7 @@ Those are not currently implemented in \fBncurses\fP.
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBcurses\fR(3X),
|
||||
\fBcurs_addch\fR(3X),
|
||||
\fBcurs_attr_get\fR(3X),
|
||||
\fBcurs_clear\fR(3X),
|
||||
\fBcurs_outopts\fR(3X),
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"***************************************************************************
|
||||
.\" Copyright (c) 2002 Free Software Foundation, Inc. *
|
||||
.\" Copyright (c) 2002-2004,2005 Free 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,9 @@
|
||||
.\" authorization. *
|
||||
.\"***************************************************************************
|
||||
.\"
|
||||
.\" $Id: curs_add_wchstr.3x,v 1.1 2002/02/23 22:15:55 tom Exp $
|
||||
.\" $Id: curs_add_wchstr.3x,v 1.6 2005/01/02 01:28:49 tom Exp $
|
||||
.TH curs_add_wchstr 3X ""
|
||||
.SH NAME
|
||||
.PP
|
||||
\fBadd_wchstr\fR,
|
||||
\fBadd_wchnstr\fR,
|
||||
\fBwadd_wchstr\fR,
|
||||
@ -40,7 +39,7 @@
|
||||
\fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window
|
||||
.SH SYNOPSIS
|
||||
.B #include <curses.h>
|
||||
|
||||
.PP
|
||||
.nf
|
||||
\fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR
|
||||
.br
|
||||
@ -73,7 +72,7 @@ On the other hand, they do not perform checking
|
||||
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.
|
||||
rather than wrapping it around to the new line.
|
||||
.PP
|
||||
These routines end successfully
|
||||
on encountering a null \fIcchar_t\fR, or
|
||||
@ -88,7 +87,7 @@ All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
|
||||
All these entry points are described in the XSI Curses standard, Issue 4.
|
||||
.SH SEE ALSO
|
||||
\fBcurses\fR(3X),
|
||||
\fBcurs_addchstr\fR(3X)
|
||||
\fBcurs_addchstr\fR(3X),
|
||||
\fBcurs_addwstr\fR(3X)
|
||||
.\"#
|
||||
.\"# The following sets edit modes for GNU EMACS
|
||||
|
@ -1,6 +1,6 @@
|
||||
'\" t
|
||||
.\"***************************************************************************
|
||||
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
|
||||
.\" *
|
||||
.\" Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
.\" copy of this software and associated documentation files (the *
|
||||
@ -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.25 2006/12/02 17:02:22 tom Exp $
|
||||
.TH curs_addch 3X ""
|
||||
.SH NAME
|
||||
\fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR,
|
||||
@ -35,18 +35,18 @@
|
||||
\fBwechochar\fR - add a character (with attributes) to a \fBcurses\fR window, then advance the cursor
|
||||
.SH SYNOPSIS
|
||||
\fB#include <curses.h>\fR
|
||||
|
||||
\fBint addch(chtype ch);\fR
|
||||
.PP
|
||||
\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
|
||||
@ -55,25 +55,29 @@ which is then advanced. They are analogous to \fBputchar\fR in \fBstdio\fR(3).
|
||||
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.
|
||||
|
||||
.PP
|
||||
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.
|
||||
.PP
|
||||
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
|
||||
control character does not return the character itself, but instead returns
|
||||
the ^-representation of the control character.
|
||||
|
||||
.PP
|
||||
Video attributes can be combined with a character argument passed to
|
||||
\fBaddch\fR or related functions by logical-ORing them into the character.
|
||||
(Thus, text, including attributes, can be copied from one place to another
|
||||
using \fBinch\fR and \fBaddch\fR.). See the \fBcurs_attr\fR(3X) page for
|
||||
using \fBinch\fR and \fBaddch\fR.) See the \fBcurs_attr\fR(3X) page for
|
||||
values of predefined video attribute constants that can be usefully OR'ed
|
||||
into characters.
|
||||
|
||||
.PP
|
||||
The \fBechochar\fR and \fBwechochar\fR routines are equivalent to a call to
|
||||
\fBaddch\fR followed by a call to \fBrefresh\fR, or a call to \fBwaddch\fR
|
||||
followed by a call to \fBwrefresh\fR. The knowledge that only a single
|
||||
@ -84,9 +88,9 @@ their equivalents.
|
||||
The following variables may be used to add line drawing characters to the
|
||||
screen with routines of the \fBaddch\fR family. The default character listed
|
||||
below is used if the \fBacsc\fR capability doesn't define a terminal-specific
|
||||
replacement for it (but see the EXTENSIONS section below). The names are
|
||||
taken from VT100 nomenclature.
|
||||
|
||||
replacement for it.
|
||||
The names are taken from VT100 nomenclature.
|
||||
.PP
|
||||
.TS
|
||||
l l l
|
||||
_ _ _
|
||||
@ -125,7 +129,6 @@ ACS_ULCORNER + upper left-hand corner
|
||||
ACS_URCORNER + upper right-hand corner
|
||||
ACS_VLINE | vertical line
|
||||
.TE
|
||||
|
||||
.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
|
||||
@ -137,7 +140,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,10 +154,25 @@ 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.
|
||||
.LP
|
||||
If \fIch\fR is a carriage return,
|
||||
the cursor is moved to the beginning of the current row of the window.
|
||||
This is true of other implementations, but is not documented.
|
||||
.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),
|
||||
\fBcurses\fR(3X),
|
||||
\fBcurs_attr\fR(3X),
|
||||
\fBcurs_clear\fR(3X),
|
||||
\fBcurs_inch\fR(3X),
|
||||
\fBcurs_outopts\fR(3X),
|
||||
\fBcurs_refresh\fR(3X),
|
||||
\fBputc\fR(3S).
|
||||
.PP
|
||||
Comparable functions in the wide-character (ncursesw) library are
|
||||
described in
|
||||
\fBcurs_add_wch\fR(3X).
|
||||
.\"#
|
||||
.\"# The following sets edit modes for GNU EMACS
|
||||
.\"# Local Variables:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user