MFV r262639: ncurses 5.9 20140222 snapshot.

Requested by:	bapt
This commit is contained in:
Xin LI 2014-03-02 08:58:21 +00:00
commit 73f0a83d68
289 changed files with 35808 additions and 16920 deletions

28
contrib/ncurses/COPYING Normal file
View File

@ -0,0 +1,28 @@
Copyright (c) 1998-2013,2014 Free 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.
-- vile:txtmode fc=72
-- $Id: COPYING,v 1.2 2014/01/18 23:59:29 tom Exp $

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $
-- $Id: INSTALL,v 1.168 2013/08/03 23:15:23 tom Exp $
---------------------------------------------------------------------
How to install Ncurses/Terminfo on your system
---------------------------------------------------------------------
@ -315,6 +315,10 @@ SUMMARY OF CONFIGURE OPTIONS:
programs are useful in this configuration, e.g., reset and tput versus
infocmp and tic.
--disable-db-install
Do not install the terminal database. This is used to omit features
for packages, as done with --without-progs.
--disable-ext-funcs
Disable function-extensions. Configure ncurses without the functions
that are not specified by XSI. See ncurses/modules for the exact
@ -407,13 +411,14 @@ SUMMARY OF CONFIGURE OPTIONS:
--disable-tic-depends
When building shared libraries, normally the tic library is linked to
depend upon the ncurses library (and in turn, on the term-library if
the --with-termlib option was given). The tic- and term-libraries
ABI does not depend on the --enable-widec option. Some packagers have
used this to reduce the number of library files which are packaged
by using only one copy of those libraries. To make this work properly,
depend upon the ncurses library (or equivalently, on the tinfo-library
if the --with-termlib option was given). The tic- and tinfo-library
ABIs do not depend on the --enable-widec option. Some packagers have
used this to reduce the number of library files which are packaged by
using only one copy of those libraries. To make this work properly,
the tic library must be built without an explicit dependency on the
ncurses (or ncursesw) library. Use this configure option to do that.
underlying library (ncurses vs ncursesw, tinfo vs tinfow). Use this
configure option to do that.
For example
configure --with-ticlib --with-shared --disable-tic-depends
@ -555,6 +560,9 @@ SUMMARY OF CONFIGURE OPTIONS:
library by reducing global and static variables. This option is also
set if --with-pthread is used.
Enabling this option adds a "t" to the library names, except for the
special case when --enable-weak-symbols is also used.
--enable-rpath
Use rpath option when generating shared libraries, and (with some
restrictions) when linking the corresponding programs. This originally
@ -595,6 +603,14 @@ SUMMARY OF CONFIGURE OPTIONS:
reducing the need for juggling the global SP value with set_term() and
delscreen().
--enable-string-hacks
Controls whether strlcat and strlcpy may be used. The same issue
applies to OpenBSD's warnings about snprintf, noting that this function
is weakly standardized.
Aside from stifling these warnings, there is no functional improvement
in ncurses.
--enable-symlinks
If your system supports symbolic links, make tic use symbolic links
rather than hard links to save diskspace when writing aliases in the
@ -616,6 +632,12 @@ SUMMARY OF CONFIGURE OPTIONS:
match is found in the terminfo database. See also the --enable-getcap
and --enable-getcap-cache options.
Termcap support requires run-time parsing rather than loading
predigested data. If you have specified --with-ticlib, then you
cannot have termcap support since run-time parsing is done in the
tic library, which is intentionally not part of normal linkage
dependencies.
--enable-warnings
Turn on GCC compiler warnings. There should be only a few.
@ -740,6 +762,12 @@ SUMMARY OF CONFIGURE OPTIONS:
executables, e.g., by setting "--with-chtype=long" (the configure
script supplies "unsigned").
--with-cxx-shared
When --with-shared is set, build libncurses++ as a shared library.
This implicitly relies upon building with gcc/g++, since other
compiler suites may have differences in the way shared libraries are
built. libtool by the way has similar limitations.
--with-database=XXX
Specify the terminfo source file to install. Usually you will wish
to install ncurses' default (misc/terminfo.src). Certain systems
@ -824,7 +852,17 @@ SUMMARY OF CONFIGURE OPTIONS:
NOTE: a few systems build shared libraries with fixed pathnames; this
option probably will not work for those configurations.
--with-libtool[=XXX]
--with-lib-prefix=XXX
OS/2 EMX used a different naming convention from most Unix-like
platforms. It required that the "lib" part of a library name was
omitted. Newer EMX as part of eComStation does not follow that
convention. Use this option to override the configure script's
assumptions about the library-prefix. If this option is omitted, it
uses the original OS/2 EMX convention for that platform. Use
"--with-lib-prefix=lib" for the newer EMX in eComStation. Use
"--without-lib-prefix" to suppress it for other odd platforms.
--with-libtool[=XXX]
Generate libraries with libtool. If this option is selected, then it
overrides all other library model specifications. Note that libtool
must already be installed, uses makefile rules dependent on GNU make,
@ -904,6 +942,10 @@ SUMMARY OF CONFIGURE OPTIONS:
--with-pkg-config=[DIR]
Check for pkg-config, optionally specifying its path.
--with-pkg-config-libdir=[DIR]
If pkg-config was found, override the automatic check for its library
path.
--with-profile
Generate profile-libraries These are named by adding "_p" to the root,
e.g., libncurses_p.a
@ -996,10 +1038,27 @@ SUMMARY OF CONFIGURE OPTIONS:
library dependencies for tic and other programs built with the tic
library.
--with-tparm-arg[=XXX]
Override the type used for tparm() arguments, which normally is a
"long". However the function must assume that its arguments can hold a
pointer to char's which is not always workable for 64-bit platforms. A
better choice would be intptr_t, which was not available at the time
tparm's interface was defined.
If the option is not given, this defaults to "long".
--with-trace
Configure the trace() function as part of the all models of the ncurses
library. Normally it is part of the debug (libncurses_g) library only.
--with-xterm-kbs=XXX
Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII
backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL
(or del, 127).
During installation, the makefile and scripts modifies the "xterm+kbs"
terminfo entry to use this setting.
--with-valgrind
For testing, compile with debug option.
This also sets the --disable-leaks option.
@ -1024,6 +1083,8 @@ SUMMARY OF CONFIGURE OPTIONS:
install as "ncurses.h" and modify the installed headers and manpages
accordingly.
Likewise, do not install an alias "curses" for the ncurses manpage.
--without-cxx
XSI curses declares "bool" as part of the interface. C++ also declares
"bool". Neither specifies the size and type of booleans, but both
@ -1726,20 +1787,37 @@ CONFIGURING FALLBACK ENTRIES:
By default, there are no entries on the fallback list. After you have
built the ncurses suite for the first time, you can change the list
(the process needs infocmp(1)). To do so, use the script
ncurses/tinfo/MKfallback.sh. A configure script option
ncurses/tinfo/MKfallback.sh. The configure script option
--with-fallbacks does this (it accepts a comma-separated list of the
names you wish, and does not require a rebuild).
If you wanted (say) to have linux, vt100, and xterm fallbacks, you
would use the commands
might use the commands
cd ncurses;
tinfo/MKfallback.sh linux vt100 xterm >fallback.c
tinfo/MKfallback.sh \
$TERMINFO \
../misc/terminfo.src \
`which tic` \
linux vt100 xterm >fallback.c
The first three parameters of the script are normally supplied by
the configured makefiles via the "--with-fallbacks" option. They
are
1) the location of the terminfo database
2) the source for the terminfo entries
3) the location of the tic program, used to create a terminfo
database.
Then just rebuild and reinstall the library as you would normally.
You can restore the default empty fallback list with
tinfo/MKfallback.sh >fallback.c
tinfo/MKfallback.sh \
$TERMINFO \
../misc/terminfo.src \
`which tic` \
>fallback.c
The overhead for an empty fallback list is one trivial stub function.
Any non-empty fallback list is const-ed and therefore lives in sharable

View File

@ -190,6 +190,7 @@
./Ada95/src/terminal_interface-curses-text_io.ads
./Ada95/src/terminal_interface-curses-trace.adb_p
./Ada95/src/terminal_interface.ads
./COPYING
./INSTALL
./MANIFEST
./Makefile.in
@ -545,6 +546,8 @@
./include/nc_alloc.h
./include/nc_mingw.h
./include/nc_panel.h
./include/nc_string.h
./include/nc_termios.h
./include/nc_tparm.h
./include/ncurses_cfg.hin
./include/ncurses_defs
@ -656,6 +659,8 @@
./man/legacy_coding.3x
./man/make_sed.sh
./man/man_db.renames
./man/manhtml.aliases
./man/manhtml.externs
./man/manlinks.sed
./man/menu.3x
./man/menu_attributes.3x
@ -764,7 +769,6 @@
./mk-0th.awk
./mk-1st.awk
./mk-2nd.awk
./mk-dlls.sh.in
./mk-hdr.awk
./ncurses/Makefile.in
./ncurses/README
@ -850,7 +854,6 @@
./ncurses/base/lib_wattron.c
./ncurses/base/lib_winch.c
./ncurses/base/lib_window.c
./ncurses/base/memmove.c
./ncurses/base/nc_panel.c
./ncurses/base/resizeterm.c
./ncurses/base/safe_sprintf.c
@ -867,6 +870,14 @@
./ncurses/llib-lncursest
./ncurses/llib-lncursestw
./ncurses/llib-lncursesw
./ncurses/llib-ltic
./ncurses/llib-ltict
./ncurses/llib-ltictw
./ncurses/llib-lticw
./ncurses/llib-ltinfo
./ncurses/llib-ltinfot
./ncurses/llib-ltinfotw
./ncurses/llib-ltinfow
./ncurses/modules
./ncurses/tinfo/MKcaptab.awk
./ncurses/tinfo/MKcaptab.sh
@ -915,10 +926,10 @@
./ncurses/tinfo/make_hash.c
./ncurses/tinfo/make_keys.c
./ncurses/tinfo/name_match.c
./ncurses/tinfo/obsolete.c
./ncurses/tinfo/parse_entry.c
./ncurses/tinfo/read_entry.c
./ncurses/tinfo/read_termcap.c
./ncurses/tinfo/setbuf.c
./ncurses/tinfo/strings.c
./ncurses/tinfo/tinfo_driver.c
./ncurses/tinfo/trim_sgr0.c
@ -943,8 +954,6 @@
./ncurses/tty/lib_tstp.c
./ncurses/tty/lib_twait.c
./ncurses/tty/lib_vidattr.c
./ncurses/tty/tty_display.h
./ncurses/tty/tty_input.h
./ncurses/tty/tty_update.c
./ncurses/wcwidth.h
./ncurses/widechar/charable.c
@ -967,9 +976,34 @@
./ncurses/widechar/lib_vline_set.c
./ncurses/widechar/lib_wacs.c
./ncurses/widechar/lib_wunctrl.c
./ncurses/widechar/widechars.c
./ncurses/win32con/gettimeofday.c
./ncurses/win32con/wcwidth.c
./ncurses/win32con/win_driver.c
./package/debian-mingw/changelog
./package/debian-mingw/compat
./package/debian-mingw/control
./package/debian-mingw/copyright
./package/debian-mingw/rules
./package/debian-mingw/source/format
./package/debian-mingw/watch
./package/debian-mingw64/changelog
./package/debian-mingw64/compat
./package/debian-mingw64/control
./package/debian-mingw64/copyright
./package/debian-mingw64/rules
./package/debian-mingw64/source/format
./package/debian-mingw64/watch
./package/debian/changelog
./package/debian/compat
./package/debian/control
./package/debian/copyright
./package/debian/rules
./package/debian/source/format
./package/debian/watch
./package/mingw-ncurses.nsi
./package/mingw-ncurses.spec
./package/ncurses.spec
./panel/Makefile.in
./panel/headers
./panel/llib-lpanel
@ -1022,12 +1056,14 @@
./test/cardfile.dat
./test/chgat.c
./test/clip_printw.c
./test/color_name.h
./test/color_set.c
./test/configure
./test/configure.in
./test/demo_altkeys.c
./test/demo_defkey.c
./test/demo_forms.c
./test/demo_forms.txt
./test/demo_keyok.c
./test/demo_menus.c
./test/demo_panels.c
@ -1036,6 +1072,7 @@
./test/ditto.c
./test/dots.c
./test/dots_mvcur.c
./test/dots_termcap.c
./test/echochar.c
./test/edit_field.c
./test/edit_field.h
@ -1043,6 +1080,7 @@
./test/firework.c
./test/firstlast.c
./test/foldkeys.c
./test/form_driver_w.c
./test/gdc.6
./test/gdc.c
./test/hanoi.c
@ -1073,6 +1111,7 @@
./test/package/debian/rules
./test/package/debian/source/format
./test/package/debian/watch
./test/package/mingw-ncurses-examples.spec
./test/package/ncurses-examples.spec
./test/programs
./test/railroad.c
@ -1092,12 +1131,15 @@
./test/test_instr.c
./test/test_inwstr.c
./test/test_opaque.c
./test/test_vid_puts.c
./test/test_vidputs.c
./test/testaddch.c
./test/testcurs.c
./test/testscanw.c
./test/tracemunch
./test/view.c
./test/widechars-utf8.txt
./test/widechars.h
./test/worm.c
./test/xmas.c
./test/xterm-16color.dat

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $
# $Id: Makefile.in,v 1.38 2014/01/18 20:19:45 tom Exp $
##############################################################################
# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2013,2014 Free 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-on
#
# Master Makefile for ncurses library.
@ -35,7 +35,8 @@ SHELL = /bin/sh
VPATH = @srcdir@
DESTDIR=@DESTDIR@
CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)"
RPATH_LIST=@RPATH_LIST@
TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)"
@SET_MAKE@
@ -48,13 +49,17 @@ srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
ticdir = @TERMINFO@
includedir = @includedir@
includesubdir = @includesubdir@
libdir = @libdir@
mandir = @mandir@
include_dir = ${includedir}${includesubdir}
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@ -74,25 +79,22 @@ preinstall :
@ echo ''
@ echo ' bin directory: '$(bindir)
@ echo ' lib directory: '$(libdir)
@ echo ' include directory: '$(includedir)
@ echo ' include directory: '$(include_dir)
@ echo ' man directory: '$(mandir)
@MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir)
@ echo ''
@ test "$(includedir)" = "$(prefix)/include" || \
@ test "$(include_dir)" = "$(prefix)/include" || \
echo '** Include-directory is not in a standard location'
@ test ! -f $(includedir)/termcap.h || \
fgrep NCURSES_VERSION $(includedir)/termcap.h >/dev/null || \
@ test ! -f $(include_dir)/termcap.h || \
fgrep NCURSES_VERSION $(include_dir)/termcap.h >/dev/null || \
echo '** Will overwrite non-ncurses termcap.h'
@ test ! -f $(includedir)/curses.h || \
fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \
@ test ! -f $(include_dir)/curses.h || \
fgrep NCURSES_VERSION $(include_dir)/curses.h >/dev/null || \
echo '** Will overwrite non-ncurses curses.h'
dlls: libs
$(SHELL) $(srcdir)/mk-dlls.sh
distclean \
realclean ::
-rm -f mk-dlls.sh mingw_arch
# Put the common rules here so that we can easily construct the list of
# directories to visit.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
-- Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,7 +25,7 @@
-- 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 $
-- $Id: README,v 1.25 2012/08/11 20:11:26 tom Exp $
-------------------------------------------------------------------------------
README file for the ncurses package
@ -78,6 +78,10 @@ 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.
If you configure using the --enable-reentrant option, a "t" is appended to the
library names (e.g., libncursest.a) and the resulting libraries have a
different binary interface which makes the ncurses interface more "opaque".
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
@ -122,8 +126,9 @@ The utilities are as follows:
tic -- terminfo source to binary compiler
infocmp -- terminfo binary to source decompiler/comparator
clear -- emits clear-screen for current terminal
tabs -- set tabs on a terminal
tput -- shell-script access to terminal capabilities.
toe -- table of entries utility
toe -- table of entries utility
tset -- terminal-initialization utility
The first two (tic and infocmp) are used for manipulating terminfo
@ -153,8 +158,10 @@ Thomas Dickey (maintainer for 1.9.9g through 4.1, resuming with FSF's 5.0):
configuration scripts, porting, mods to adhere to XSI Curses in the
areas of background color, terminal modes. Also memory leak testing,
the wresize, default colors and key definition extensions and numerous
bug fixes (more than half of those enumerated in NEWS beginning with
the internal release 1.8.9).
bug fixes -- more than half of those enumerated in NEWS beginning with
the internal release 1.8.9, see
http://invisible-island.net/personal/changelogs.html
Florian La Roche (official maintainer for FSF's ncurses 4.2)
Beginning with release 4.2, ncurses is distributed under an MIT-style

View File

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
-- Copyright (c) 2008-2010,2011 Free Software Foundation, Inc. --
-- Copyright (c) 2008-2011,2012 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $
-- $Id: README.MinGW,v 1.9 2012/09/22 17:46:04 tom Exp $
-- Author: Juergen Pfeifer
-------------------------------------------------------------------------------
@ -39,7 +39,7 @@ from http://www.mingw.org
To build ncurses for native Windows, you need the MinGW toolchain. The
original MinGW toolchain from the above site is only for 32-Bit Windows. As
Windows Server - and also regular workstations - are moving to 64-Bit, it
seems to be reasonable to have a toolchain that supports both architectures.
seems to be reasonable to have a toolchain that supports both architectures.
I recommend to use the TDM gcc toolchain which you can find at
http://tdm-gcc.tdragon.net/download. Go to the download section and select
the bundle installer for tdm64 (MinGW-w64). This installs a multilib version
@ -47,7 +47,7 @@ of the gcc toolchain that can compile for native 32- and 64-Bit Windows
versions. It also comes with a working pthread implementation.
The latest config and build scripts we use for MinGW have only been tested
for the gcc-4.4 compiler toolchain (or better).
for the gcc-4.6.1 compiler toolchain (or better).
Using MinGW is a pragmatic decision, it's the easiest way to port this
heavily UNIX based sourcebase to native Windows. The goal is of course
@ -55,22 +55,13 @@ to provide the includes, libraries and DLLs to be used with the more
common traditional development environments on Windows, mainly with
Microsoft Visual Studio.
If you start a bash from the MSYS environment, please make sure that the
Microsoft Development tools are in your PATH right after the MinGW
tools. The LIB.EXE tool is the only one needed. You need this only if
you want to build DLLs that work with native Windows programs. If you
don't have any Microsoft Development tools on your machine, consider
at least to get the free "Visual C++ 2010 Express Edition".
It contains the LIB.EXE tool. You may also use this compiler to test
writing native Windows programs using the ncurses DLLs without using
MinGW then for writing apps.
It is necessary to unset the TERM environment variable, to activate the
Windows console-driver.
The TERM environment variable must be set specially to active the Windows
console-driver. The driver checks if TERM is set to "#win32con" (explicit
use) or if TERM is unset or empty (implicit).
Please also make sure that MSYS links to the correct directory containing
your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows
CMD.EXE command shell go to the MSYS root directory (most probably
CMD.EXE command shell go to the MSYS root directory (most probably
C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw
that points to the MinGW toolchain directory. If not, delete the mingw
directory and use the mklink command (or the linkd.exe utility on older
@ -79,62 +70,60 @@ Windows) to create the junction point.
This code requires WindowsNT 5.1 or better, which means on the client
Windows XP or better, on the server Windows Server 2003 or better.
In order to build ncurses for the planned interop layer with .NET, we
recommend to use these options with configure
I recommend using libtool to build ncurses on MinGW, because libtool
knows exactly how to build dll's on Windows for use with MinGW.
To build a modern but still small footprint ncurses that provides
hooks for interop, I recommend using these options:
--with-libtool
--disable-home-terminfo
--enable-reentrant
--enable-database
--disable-termcap
--enable-sp-funcs
--enable-term-driver
--enable-interop
--with-pthread (if using TDM toolchain as recommended)
This is the configuration commandline as I'm using it at the moment:
This is the configuration commandline as I'm using it at the moment (assuming
environment variable MINGW_ROOT to hold the root directory name of your MinGW
build):
./configure \
--prefix=/mingw \
--without-cxx-binding \
--prefix=$MINGW_ROOT \
--with-cxx \
--without-ada \
--enable-warnings \
--enable-assertions \
--enable-reentrant \
--with-debug \
--with-normal \
--disable-home-terminfo \
--enable-database \
--enable-sp-funcs \
--enable-term-driver \
--enable-interop \
--with-pthread
--disable-termcap \
--with-progs \
--with-libtool \
--enable-pc-files \
--mandir=$MINGW_ROOT/share/man
If you are on a 64-Bit Windows system and want to build a 32-Bit version
of ncurses, you may use this commandline for configuration (when using
the TDM toolchain):
Please note that it is also necessary to set this environment variable:
CC="gcc -m32" LD="ld -m32" ./configure \
--prefix=/mingw \
--without-cxx-binding \
--without-ada \
--enable-warnings \
--enable-assertions \
--enable-reentrant \
--with-debug \
--with-normal \
--disable-home-terminfo \
--enable-sp-funcs \
--enable-term-driver \
--enable-interop \
--with-pthread
export PATH_SEPARATOR=";"
in order to parse the terminfo paths correctly. Terminfo paths should
always be separated by a seeeemicolon,even when running under MSYS.
To support regular expressions properly, ncurses under MinGW should be
linked against the gnurx regex library, which must be built separately
under MinGW. See
ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libgnurx-src-2.5.zip
All the options above are - like the whole Windows support -
experimental.
In order to build the DLLs, after your regular make you must call
make dlls
A lot is still TODO, e.g.:
- Wide Character support
- Wide Character support (display is workable, but input untested)
The Win32Con driver should actually only use Unicode in the
future.
- Thread support (locking). If using TDM toolchain this is done by
@ -145,5 +134,5 @@ A lot is still TODO, e.g.:
- Workarounds for MinGW's filesystem access are necessary to make infocmp
work (though tic works).
To support terminfo, we need to have an ioctl() simulation for the
serial and networked Terminals.
To support terminfo, we would need to have an ioctl() simulation for the
serial and networked terminals.

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
$Id: announce.html.in,v 1.85 2011/04/04 00:05:34 tom Exp $
$Id: announce.html.in,v 1.89 2013/05/18 10:12:25 tom Exp $
****************************************************************************
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* Copyright (c) 1998-2011,2013 Free 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 +28,12 @@
* authorization. *
****************************************************************************
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org">
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<title>Announcing ncurses @VERSION@</title>
<link rev="made" href="mailto:bug-ncurses@gnu.org">
@ -42,12 +42,13 @@
</head>
<body>
<h1>Announcing ncurses @VERSION@</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, 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.
<h1>Announcing ncurses @VERSION@</h1>
<p>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.</p>
<p>In mid-June 1995, the maintainer of 4.4BSD curses declared
that he considered 4.4BSD curses obsolete, and encouraged the
@ -73,38 +74,50 @@
It is also available at <a href=
"ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</a>&nbsp;.</p>
<h1>Release Notes</h1>This release is designed to be upward
compatible from ncurses 5.0 through 5.8; very few applications
will require recompilation, depending on the platform. These are
the highlights from the change-log since ncurses 5.8 release.
<p>
This is a bug-fix release, correcting a small number of urgent problems
in the ncurses library from the 5.8 release.
<p>
It also improves the Ada95 binding:
<h1>Release Notes</h1>
<p>This release is designed to be upward compatible from ncurses
5.0 through 5.8; very few applications will require
recompilation, depending on the platform. These are the
highlights from the change-log since ncurses 5.8 release.</p>
<p>This is a bug-fix release, correcting a small number of urgent
problems in the ncurses library from the 5.8 release.</p>
<p>It also improves the Ada95 binding:</p>
<ul>
<li>fixes a longstanding portability problem with its use of the
<a href="http://invisible-island.net/ncurses/man/form_fieldtype.3x">set_field_type</a>
function. Because that function uses variable-length argument lists,
its interface with gnat does not work with certain platforms.
<li>improves configurability and portability, particularly when built
separately from the main ncurses tree. The 5.8 release introduced
scripts which can be used to construct separate tarballs for the
Ada95 and ncurses examples.
<p>Those were a proof of concept. For the 5.9 release, those
scripts are augmented with rpm- and dpkg-scripts used in test builds
against a variety of gnat- and system ncurses versions as old as
gnat 3.15 and ncurses 5.4 (see snapshots and systems tested
<a href="http://invisible-island.net/ncurses/ncurses-Ada95.html">here</a>.
<li>additional improvements were made for portability of the
ncurses examples, adding rpm- and dpkg-scripts for test-builds.
See
<a href="http://invisible-island.net/ncurses/ncurses-examples.html">this page</a>
for snapshots and other information.
<li>fixes a longstanding portability problem with its use of
the <a href=
"http://invisible-island.net/ncurses/man/form_fieldtype.3x">set_field_type</a>
function. Because that function uses variable-length argument
lists, its interface with gnat does not work with certain
platforms.</li>
<li>improves configurability and portability, particularly when
built separately from the main ncurses tree. The 5.8 release
introduced scripts which can be used to construct separate
tarballs for the Ada95 and ncurses examples.
<p>Those were a proof of concept. For the 5.9 release, those
scripts are augmented with rpm- and dpkg-scripts used in test
builds against a variety of gnat- and system ncurses versions
as old as gnat 3.15 and ncurses 5.4 (see snapshots and
systems tested <a href=
"http://invisible-island.net/ncurses/ncurses-Ada95.html">here</a>.</p>
</li>
<li>additional improvements were made for portability of the
ncurses examples, adding rpm- and dpkg-scripts for test-builds.
See <a href=
"http://invisible-island.net/ncurses/ncurses-examples.html">this
page</a> for snapshots and other information.</li>
</ul>
<h1>Features of Ncurses</h1>The ncurses package is fully
compatible with SVr4 (System V Release 4) curses:
<h1>Features of Ncurses</h1>
<p>The ncurses package is fully compatible with SVr4 (System V
Release 4) curses:</p>
<ul>
<li>All 257 of the SVr4 calls have been implemented (and are
@ -132,8 +145,10 @@
entries for use with less capable
<strong>curses</strong>/<strong>terminfo</strong> versions such
as the HP/UX and AIX ports.</li>
</ul>The ncurses package also has many useful extensions over
SVr4:
</ul>
<p>The ncurses package also has many useful extensions over
SVr4:</p>
<ul>
<li>The API is 8-bit clean and base-level conformant with the
@ -249,12 +264,14 @@
interface.</li>
</ul>
<h1>State of the Package</h1>Numerous bugs present in earlier
versions have been fixed; the library is far more reliable than
it used to be. Bounds checking in many `dangerous' entry points
has been improved. The code is now type-safe according to gcc
-Wall. The library has been checked for malloc leaks and arena
corruption by the Purify memory-allocation tester.
<h1>State of the Package</h1>
<p>Numerous bugs present in earlier versions have been fixed; the
library is far more reliable than it used to be. Bounds checking
in many `dangerous' entry points has been improved. The code is
now type-safe according to gcc -Wall. The library has been
checked for malloc leaks and arena corruption by the Purify
memory-allocation tester.</p>
<p>The ncurses code has been tested with a wide variety of
applications including (versions starting with those noted):</p>
@ -321,8 +338,10 @@
<dd>newsreader, supporting color, MIME <a href=
"http://www.tin.org/">http://www.tin.org/</a></dd>
</dl>as well as some that use ncurses for the terminfo support
alone:
</dl>
<p>as well as some that use ncurses for the terminfo support
alone:</p>
<dl>
<dt>minicom</dt>
@ -341,15 +360,17 @@
<p>The ncurses distribution includes a selection of test programs
(including a few games).</p>
<h2>Who's Who and What's What</h2>Zeyd Ben-Halim started it from
a previous package pcurses, written by Pavel Curtis. Eric S.
Raymond continued development. J&uuml;rgen Pfeifer wrote most of
the form and menu libraries. Ongoing work is being done by
<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>.
<h2>Who's Who and What's What</h2>
<p>Zeyd Ben-Halim started it from a previous package pcurses,
written by Pavel Curtis. Eric S. Raymond continued development.
J&uuml;rgen Pfeifer wrote most of the form and menu libraries.
Ongoing work is being done by <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>
<p>To join the ncurses mailing list, please write email to
<code>bug-ncurses-request@gnu.org</code> containing the line:</p>
@ -364,6 +385,13 @@
are made available at <a href=
"ftp://invisible-island.net/ncurses/">ftp://invisible-island.net/ncurses/</a>&nbsp;.</p>
<p>There is an archive of the mailing list here:</p>
<p><a href=
"http://lists.gnu.org/archive/html/bug-ncurses">http://lists.gnu.org/archive/html/bug-ncurses</a>
(also <a href=
"https://lists.gnu.org/archive/html/bug-ncurses">https</a>)</p>
<h2>Future Plans</h2>
<ul>
@ -371,15 +399,19 @@
support.</li>
<li>Ports to more systems, including DOS and Windows.</li>
</ul>We need people to help with these projects. If you are
interested in working on them, please join the ncurses list.
</ul>
<h2>Other Related Resources</h2>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
<p>We need people to help with these projects. If you are
interested in working on them, please join the ncurses list.</p>
<h2>Other Related Resources</h2>
<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>&nbsp;. 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.
user-definable extensions beyond the X/Open specification.</p>
<p>You can find lots of information on terminal-related topics
not covered in the terminfo file at <a href=

View File

@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2010-09-24'
timestamp='2013-06-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@ -17,26 +15,22 @@ timestamp='2010-09-24'
# General Public License for more details.
#
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# 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.
# Originally written by Per Bothner. Please send patches (context
# diff format) to <config-patches@gnu.org> and include a ChangeLog
# entry.
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'`
@ -56,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -92,7 +84,7 @@ if test $# != 0; then
exit 1
fi
trap 'exit 1' HUP INT TERM
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
@ -106,7 +98,7 @@ trap 'exit 1' HUP INT TERM
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
@ -140,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@ -202,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@ -220,10 +237,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
@ -270,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;;
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@ -301,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@ -326,8 +346,8 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
@ -495,7 +515,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@ -597,50 +617,50 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@ -789,21 +809,26 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
@ -820,8 +845,8 @@ EOF
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
@ -849,70 +874,81 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \
grep -q __ARM_EABI__
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@ -931,54 +967,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-tilera-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@ -1093,7 +1138,7 @@ EOF
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@ -1136,8 +1181,8 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
@ -1165,9 +1210,9 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@ -1182,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@ -1208,26 +1256,28 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
i386)
eval $set_cc_for_build
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
@ -1237,7 +1287,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@ -1306,11 +1356,11 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
@ -1328,11 +1378,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
"4"
#else
""
""
#endif
); exit (0);
); exit (0);
#endif
#endif

View File

@ -1,38 +1,31 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2010-09-11'
timestamp='2013-10-01'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# 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., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# 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.
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted GNU ChangeLog entry.
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@ -75,9 +68,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, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -125,13 +116,17 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@ -154,7 +149,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 | -knuth | -cray | -microblaze)
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@ -175,10 +170,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
;;
-hiux*)
os=-hiuxwe2
;;
@ -223,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
@ -247,20 +248,28 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -278,30 +287,32 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be\
| nios | nios2 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| or32 \
| open8 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rx \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | 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 | tic54x | tic55x | tic6x | tic80 | tron \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
@ -314,8 +325,7 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@ -325,12 +335,27 @@ case $basic_machine in
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
@ -339,25 +364,31 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@ -375,31 +406,34 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| romp-* | rs6000-* | rx-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@ -539,7 +573,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16)
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@ -697,7 +731,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@ -755,11 +788,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
microblaze)
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i386-pc
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@ -794,10 +831,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@ -950,9 +995,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@ -977,7 +1023,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
rdos)
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
@ -1046,6 +1096,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
@ -1102,13 +1155,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
tile*)
basic_machine=tile-unknown
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@ -1178,6 +1226,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
@ -1303,21 +1354,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -bitrig* | -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* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1449,9 +1500,6 @@ case $os in
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
@ -1500,6 +1548,12 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
@ -1527,9 +1581,6 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
@ -1543,6 +1594,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
or1k-*)
os=-elf
;;
or32-*)
os=-coff
;;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. #
# Copyright (c) 1998-2013,2014 Free 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"), #
@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.810 2011/04/04 22:42:20 tom Exp $
# $Id: dist.mk,v 1.973 2014/02/22 16:55:12 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,20 +37,21 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
NCURSES_PATCH = 20110404
NCURSES_PATCH = 20140222
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# The most recent html files were generated with lynx 2.8.6, using ncurses
# configured with
# The most recent html files were generated with lynx 2.8.6 (or later), 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`
# gcc's file is "gnathtml.pl"
GNATHTML= gnathtml
# man2html 3.0.1 is a Perl script which assumes that pages are fixed size.
# Not all man programs agree with this assumption; some use half-spacing, which
@ -98,7 +99,13 @@ doc/hackguide.doc: doc/html/hackguide.html
MANPROG = tbl | nroff -mandoc -rLL=65n -rLT=71n -Tascii
manhtml:
@rm -f doc/html/man/*.html
@for f in doc/html/man/*.html; do \
test -f $$f || continue; \
case $$f in \
*/index.html) ;; \
*) rm -f $$f ;; \
esac; \
done
@mkdir -p doc/html/man
@rm -f subst.tmp ;
@for f in man/*.[0-9]*; do \
@ -126,7 +133,7 @@ manhtml:
g=$${m}.html ;\
if [ -f doc/html/$$g ]; then chmod +w doc/html/$$g; fi;\
echo "Converting $$m to HTML" ;\
echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' > doc/html/man/$$g ;\
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">' > doc/html/man/$$g ;\
echo '<!-- ' >> doc/html/man/$$g ;\
egrep '^.\\"[^#]' $$f | \
sed -e 's/\$$/@/g' \
@ -135,9 +142,15 @@ manhtml:
-e 's/>/\&gt;/g' \
>> doc/html/man/$$g ;\
echo '-->' >> doc/html/man/$$g ;\
./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' \
./edit_man.sh normal editing /usr/man man $$f | \
$(MANPROG) | \
tr '\255' '-' | \
$(MAN2HTML) \
-title "$$T" \
-aliases man/manhtml.aliases \
-externs man/manhtml.externs | \
sed -f subst.sed |\
sed -e 's/"curses.3x.html"/"ncurses.3x.html"/g' \
>> doc/html/man/$$g ;\
done
@rm -f subst.sed
@ -149,7 +162,7 @@ manhtml:
# .ali files contain cross referencing information required by gnathtml.
adahtml:
if [ ! -z "$(GNATHTML)" ]; then \
(cd ./Ada95/gen ; make html) ;\
(cd ./Ada95/gen ; make html GNATHTML=$(GNATHTML) ) ;\
fi
# This only works on a clean source tree, of course.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
$Id: announce.html,v 1.55 2011/04/04 09:46:33 tom Exp $
$Id: announce.html,v 1.56 2013/05/17 23:34:26 tom Exp $
****************************************************************************
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* *

View File

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
$Id: hackguide.html,v 1.28 2010/12/04 16:44:21 tom Exp $
$Id: hackguide.html,v 1.29 2013/05/17 23:29:18 tom Exp $
****************************************************************************
* Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *

View File

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--
$Id: ncurses-intro.html,v 1.44 2010/12/04 16:46:22 tom Exp $
$Id: ncurses-intro.html,v 1.46 2013/05/17 23:29:27 tom Exp $
****************************************************************************
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -431,6 +431,7 @@ mentioned above. <P>
Here is a sample program to motivate the discussion:
<PRE>
#include &lt;stdlib.h&gt;
#include &lt;curses.h&gt;
#include &lt;signal.h&gt;

View File

@ -333,6 +333,7 @@ Using the Library
Here is a sample program to motivate the discussion:
#include <curses.h>
#include <curses.h>
#include <signal.h>
static void finish(int sig);

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.53 2010/11/27 21:45:27 tom Exp $
# $Id: Makefile.in,v 1.56 2013/08/04 20:23:20 tom Exp $
##############################################################################
# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2012,2013 Free 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"), #
@ -57,6 +57,9 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
includesubdir = @includesubdir@
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
LIBTOOL = @LIBTOOL@
LIBTOOL_CLEAN = @LIB_CLEAN@
@ -102,6 +105,7 @@ LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
SHLIB_DIRS = -L../lib
SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
RPATH_LIST = @RPATH_LIST@
MK_SHARED_LIB = @MK_SHARED_LIB@
NCURSES_MAJOR = @NCURSES_MAJOR@
@ -111,7 +115,7 @@ ABI_VERSION = @cf_cv_abi_version@
RANLIB = @LIB_PREP@
LIBRARIES = @LIBS_TO_MAKE@
LIBRARIES = @Libs_To_Make@
LINT = @LINT@
LINT_OPTS = @LINT_OPTS@

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_arg.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_arg.c,v 1.13 2012/06/10 00:27:49 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -71,7 +71,7 @@ set_fieldtype_arg(FIELDTYPE *typ,
if (typ != 0 && make_arg != (void *)0)
{
typ->status |= _HAS_ARGS;
SetStatus(typ, _HAS_ARGS);
typ->makearg = make_arg;
typ->copyarg = copy_arg;
typ->freearg = free_arg;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_def.c,v 1.38 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_def.c,v 1.40 2012/03/11 00:37:16 tom Exp $")
/* this can't be readonly */
static FIELD default_field =
@ -65,8 +65,7 @@ static FIELD default_field =
NCURSES_FIELD_EXTENSION
};
NCURSES_EXPORT_VAR(FIELD *)
_nc_Default_Field = &default_field;
NCURSES_EXPORT_VAR(FIELD *) _nc_Default_Field = &default_field;
/*---------------------------------------------------------------------------
| Facility : libnform
@ -186,10 +185,12 @@ _nc_Free_Argument(const FIELDTYPE *typ, TypeArgument *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);
if (argp != 0)
{
_nc_Free_Argument(typ->left, argp->left);
_nc_Free_Argument(typ->right, argp->right);
free(argp);
}
}
else
{
@ -293,14 +294,14 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = default_field;
New_Field->rows = rows;
New_Field->cols = cols;
New_Field->rows = (short) rows;
New_Field->cols = (short) cols;
New_Field->drows = rows + nrow;
New_Field->dcols = cols;
New_Field->frow = frow;
New_Field->fcol = fcol;
New_Field->frow = (short) frow;
New_Field->fcol = (short) fcol;
New_Field->nrow = nrow;
New_Field->nbuf = nbuf;
New_Field->nbuf = (short) nbuf;
New_Field->link = New_Field;
#if USE_WIDEC_SUPPORT

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_dup.c,v 1.13 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_dup.c,v 1.14 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -60,8 +60,8 @@ dup_field(FIELD *field, int frow, int fcol)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
New_Field->frow = frow;
New_Field->fcol = fcol;
New_Field->frow = (short) frow;
New_Field->fcol = (short) fcol;
New_Field->link = New_Field;
New_Field->rows = field->rows;
New_Field->cols = field->cols;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_ftchoice.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_ftchoice.c,v 1.13 2012/06/10 00:27:49 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -56,7 +56,7 @@ set_fieldtype_choice(FIELDTYPE *typ,
if (!typ || !next_choice || !prev_choice)
RETURN(E_BAD_ARGUMENT);
typ->status |= _HAS_CHOICE;
SetStatus(typ, _HAS_CHOICE);
#if NCURSES_INTEROP_FUNCS
typ->enum_next.onext = next_choice;
typ->enum_prev.oprev = prev_choice;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_ftlink.c,v 1.14 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_ftlink.c,v 1.15 2012/06/10 00:27:49 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -62,11 +62,11 @@ link_fieldtype(FIELDTYPE *type1, FIELDTYPE *type2)
{
T((T_CREATE("fieldtype %p"), (void *)nftyp));
*nftyp = *_nc_Default_FieldType;
nftyp->status |= _LINKED_TYPE;
SetStatus(nftyp, _LINKED_TYPE);
if ((type1->status & _HAS_ARGS) || (type2->status & _HAS_ARGS))
nftyp->status |= _HAS_ARGS;
SetStatus(nftyp, _HAS_ARGS);
if ((type1->status & _HAS_CHOICE) || (type2->status & _HAS_CHOICE))
nftyp->status |= _HAS_CHOICE;
SetStatus(nftyp, _HAS_CHOICE);
nftyp->left = type1;
nftyp->right = type2;
type1->ref++;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_just.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -59,7 +59,7 @@ set_field_just(FIELD *field, int just)
Normalize_Field(field);
if (field->just != just)
{
field->just = just;
field->just = (short) just;
res = _nc_Synchronize_Attributes(field);
}
else

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
MODULE_ID("$Id: fld_link.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -61,8 +61,8 @@ link_field(FIELD *field, int frow, int fcol)
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
New_Field->frow = frow;
New_Field->fcol = fcol;
New_Field->frow = (short) frow;
New_Field->fcol = (short) fcol;
New_Field->link = field->link;
field->link = New_Field;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fld_max.c,v 1.13 2013/08/24 22:59:28 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -62,13 +62,13 @@ set_max_field(FIELD *field, int maxgrow)
RETURN(E_BAD_ARGUMENT);
}
field->maxgrow = maxgrow;
field->status &= ~_MAY_GROW;
if (!(field->opts & O_STATIC))
ClrStatus(field, _MAY_GROW);
if (!((unsigned)field->opts & O_STATIC))
{
if ((maxgrow == 0) ||
(single_line_field && (field->dcols < maxgrow)) ||
(!single_line_field && (field->drows < maxgrow)))
field->status |= _MAY_GROW;
SetStatus(field, _MAY_GROW);
}
}
RETURN(E_OK);

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fld_move.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -56,8 +56,8 @@ move_field(FIELD *field, int frow, int fcol)
if (field->form)
RETURN(E_CONNECTED);
field->frow = frow;
field->fcol = fcol;
field->frow = (short) frow;
field->fcol = (short) fcol;
RETURN(E_OK);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fld_page.c,v 1.12 2012/06/10 00:12:47 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -54,9 +54,9 @@ set_new_page(FIELD *field, bool new_page_flag)
RETURN(E_CONNECTED);
if (new_page_flag)
field->status |= _NEWPAGE;
SetStatus(field, _NEWPAGE);
else
field->status &= ~_NEWPAGE;
ClrStatus(field, _NEWPAGE);
RETURN(E_OK);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fld_stat.c,v 1.14 2012/06/10 00:13:09 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -51,9 +51,9 @@ set_field_status(FIELD *field, bool status)
Normalize_Field(field);
if (status)
field->status |= _CHANGED;
SetStatus(field, _CHANGED);
else
field->status &= ~_CHANGED;
ClrStatus(field, _CHANGED);
RETURN(E_OK);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2009,2013 Free 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: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
/* $Id: form.h,v 0.21 2009/11/07 19:31:11 tom Exp $ */
/* $Id: form.h,v 0.23 2013/12/07 17:57:32 tom Exp $ */
#ifndef FORM_H
#define FORM_H
@ -396,6 +396,9 @@ extern NCURSES_EXPORT(int) post_form (FORM *);
extern NCURSES_EXPORT(int) unpost_form (FORM *);
extern NCURSES_EXPORT(int) pos_form_cursor (FORM *);
extern NCURSES_EXPORT(int) form_driver (FORM *,int);
# if NCURSES_WIDECHAR
extern NCURSES_EXPORT(int) form_driver_w (FORM *,int,wchar_t);
# endif
extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *);
extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options);
extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options);

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2009,2012 Free 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,11 +30,11 @@
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
/* $Id: form.priv.h,v 0.32 2009/11/07 21:26:43 tom Exp $ */
/* $Id: form.priv.h,v 0.33 2012/03/11 00:37:46 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
/* *INDENT-OFF*/
#include "curses.priv.h"
#include "mf_common.h"
@ -119,7 +119,7 @@ extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
/* Calculate the total size of all buffers for this field */
#define Total_Buffer_Size(field) \
( (Buffer_Length(field) + 1) * (1+(field)->nbuf) * sizeof(FIELD_CELL) )
( (size_t)(Buffer_Length(field) + 1) * (size_t)(1+(field)->nbuf) * sizeof(FIELD_CELL) )
/* Logic to determine whether or not a field is single lined */
#define Single_Line_Field(field) \
@ -293,5 +293,6 @@ extern NCURSES_EXPORT(Form_Hook) _nc_retrace_form_hook (Form_Hook);
result = ((*buffer || (l < width)) ? FALSE : TRUE); \
}
#endif
/* *INDENT-ON*/
#endif /* FORM_PRIV_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_data.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: frm_data.c,v 1.16 2013/08/24 22:44:05 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -103,7 +103,7 @@ Only_Padding(WINDOW *w, int len, int pad)
}
}
#else
cell = winch(w);
cell = (FIELD_CELL) winch(w);
if (ChCharOf(cell) != ChCharOf(pad))
{
result = FALSE;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_def.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: frm_def.c,v 1.26 2012/03/11 00:37:16 tom Exp $")
/* this can't be readonly */
static FORM default_form =
@ -199,14 +199,14 @@ Connect_Fields(FORM *form, FIELD **fields)
for (j = 0; j < field_cnt; j++)
{
if (j == 0)
pg->pmin = j;
pg->pmin = (short) j;
else
{
if (fields[j]->status & _NEWPAGE)
{
pg->pmax = j - 1;
pg->pmax = (short) (j - 1);
pg++;
pg->pmin = j;
pg->pmin = (short) j;
}
}
@ -214,14 +214,14 @@ Connect_Fields(FORM *form, FIELD **fields)
maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
if (form->rows < maximum_row_in_field)
form->rows = maximum_row_in_field;
form->rows = (short) maximum_row_in_field;
if (form->cols < maximum_col_in_field)
form->cols = maximum_col_in_field;
form->cols = (short) maximum_col_in_field;
}
pg->pmax = field_cnt - 1;
form->maxfield = field_cnt;
form->maxpage = page_nr;
pg->pmax = (short) (field_cnt - 1);
form->maxfield = (short) field_cnt;
form->maxpage = (short) page_nr;
/* Sort fields on form pages */
for (page_nr = 0; page_nr < form->maxpage; page_nr++)
@ -230,8 +230,8 @@ Connect_Fields(FORM *form, FIELD **fields)
for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
{
fields[j]->index = j;
fields[j]->page = page_nr;
fields[j]->index = (short) j;
fields[j]->page = (short) page_nr;
fld = Insert_Field_By_Position(fields[j], fld);
}
if (fld)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_driver.c,v 1.98 2010/05/01 21:11:43 tom Exp $")
MODULE_ID("$Id: frm_driver.c,v 1.110 2014/02/10 00:42:48 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
@ -172,7 +172,7 @@ static int FE_Delete_Previous(FORM *);
instead of a derived window because it contains invisible parts.
This is true for non-public fields and for scrollable fields. */
#define Has_Invisible_Parts(field) \
(!((field)->opts & O_PUBLIC) || \
(!((unsigned)(field)->opts & O_PUBLIC) || \
Is_Scroll_Field(field))
/* Logic to decide whether or not a field needs justification */
@ -180,21 +180,21 @@ static int FE_Delete_Previous(FORM *);
(((field)->just != NO_JUSTIFICATION) && \
(Single_Line_Field(field)) && \
(((field)->dcols == (field)->cols) && \
((field)->opts & O_STATIC)) )
((unsigned)(field)->opts & O_STATIC)))
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
/* Macro to set the attributes for a fields window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
(void) wattrset((win),(field)->fore) )
( wbkgdset((win),(chtype)((chtype)((field)->pad) | (field)->back)), \
(void) wattrset((win), (int)(field)->fore) )
/* Logic to decide whether or not a field really appears on the form */
#define Field_Really_Appears(field) \
((field->form) &&\
(field->form->status & _POSTED) &&\
(field->opts & O_VISIBLE) &&\
((unsigned)field->opts & O_VISIBLE) &&\
(field->page == field->form->curpage))
/* Logic to determine whether or not we are on the first position in the
@ -601,8 +601,8 @@ Synchronize_Buffer(FORM *form)
{
if (form->status & _WINDOW_MODIFIED)
{
form->status &= ~_WINDOW_MODIFIED;
form->status |= _FCHECK_REQUIRED;
ClrStatus(form, _WINDOW_MODIFIED);
SetStatus(form, _FCHECK_REQUIRED);
Window_To_Buffer(form, form->current);
wmove(form->w, form->currow, form->curcol);
}
@ -653,7 +653,7 @@ Field_Grown(FIELD *field, int amount)
growth = Minimum(field->maxgrow - field->dcols, growth);
field->dcols += growth;
if (field->dcols == field->maxgrow)
field->status &= ~_MAY_GROW;
ClrStatus(field, _MAY_GROW);
}
else
{
@ -662,7 +662,7 @@ Field_Grown(FIELD *field, int amount)
growth = Minimum(field->maxgrow - field->drows, growth);
field->drows += growth;
if (field->drows == field->maxgrow)
field->status &= ~_MAY_GROW;
ClrStatus(field, _MAY_GROW);
}
/* drows, dcols changed, so we get really the new buffer length */
new_buflen = Buffer_Length(field);
@ -674,7 +674,7 @@ Field_Grown(FIELD *field, int amount)
field->drows = old_drows;
if ((single_line_field && (field->dcols != field->maxgrow)) ||
(!single_line_field && (field->drows != field->maxgrow)))
field->status |= _MAY_GROW;
SetStatus(field, _MAY_GROW);
}
else
{
@ -753,7 +753,7 @@ Field_Grown(FIELD *field, int amount)
(field->dcols != field->maxgrow)) ||
(!single_line_field &&
(field->drows != field->maxgrow)))
field->status |= _MAY_GROW;
SetStatus(field, _MAY_GROW);
free(newbuf);
}
}
@ -860,7 +860,7 @@ _nc_Refresh_Current_Field(FORM *form)
field = form->current;
formwin = Get_Form_Window(form);
if (field->opts & O_PUBLIC)
if ((unsigned)field->opts & O_PUBLIC)
{
if (Is_Scroll_Field(field))
{
@ -897,19 +897,19 @@ _nc_Refresh_Current_Field(FORM *form)
if (form->currow < form->toprow)
{
form->toprow = form->currow;
field->status |= _NEWTOP;
SetStatus(field, _NEWTOP);
}
if (form->currow >= row_after_bottom)
{
form->toprow = form->currow - field->rows + 1;
field->status |= _NEWTOP;
SetStatus(field, _NEWTOP);
}
if (field->status & _NEWTOP)
{
/* means we have to copy whole range */
first_modified_row = form->toprow;
first_unmodified_row = first_modified_row + field->rows;
field->status &= ~_NEWTOP;
ClrStatus(field, _NEWTOP);
}
else
{
@ -1111,27 +1111,27 @@ Display_Or_Erase_Field(FIELD *field, bool bEraseFlag)
return E_SYSTEM_ERROR;
else
{
if (field->opts & O_VISIBLE)
if ((unsigned)field->opts & O_VISIBLE)
{
Set_Field_Window_Attributes(field, win);
}
else
{
(void)wattrset(win, WINDOW_ATTRS(fwin));
(void)wattrset(win, (int)WINDOW_ATTRS(fwin));
}
werase(win);
}
if (!bEraseFlag)
{
if (field->opts & O_PUBLIC)
if ((unsigned)field->opts & O_PUBLIC)
{
if (Justification_Allowed(field))
Perform_Justification(field, win);
else
Buffer_To_Window(field, win);
}
field->status &= ~_NEWTOP;
ClrStatus(field, _NEWTOP);
}
wsyncup(win);
delwin(win);
@ -1170,18 +1170,18 @@ Synchronize_Field(FIELD *field)
form->currow = form->curcol = form->toprow = form->begincol = 0;
werase(form->w);
if ((field->opts & O_PUBLIC) && Justification_Allowed(field))
if (((unsigned)field->opts & O_PUBLIC) && Justification_Allowed(field))
Undo_Justification(field, form->w);
else
Buffer_To_Window(field, form->w);
field->status |= _NEWTOP;
SetStatus(field, _NEWTOP);
res = _nc_Refresh_Current_Field(form);
}
else
res = Display_Field(field);
}
field->status |= _CHANGED;
SetStatus(field, _CHANGED);
return (res);
}
@ -1211,7 +1211,7 @@ Synchronize_Linked_Fields(FIELD *field)
return (E_SYSTEM_ERROR);
for (linked_field = field->link;
linked_field != field;
(linked_field != field) && (linked_field != 0);
linked_field = linked_field->link)
{
if (((syncres = Synchronize_Field(linked_field)) != E_OK) &&
@ -1256,7 +1256,7 @@ _nc_Synchronize_Attributes(FIELD *field)
werase(form->w);
wmove(form->w, form->currow, form->curcol);
if (field->opts & O_PUBLIC)
if ((unsigned)field->opts & O_PUBLIC)
{
if (Justification_Allowed(field))
Undo_Justification(field, form->w);
@ -1272,7 +1272,7 @@ _nc_Synchronize_Attributes(FIELD *field)
field->rows - 1, field->cols - 1, 0);
wsyncup(formwin);
Buffer_To_Window(field, form->w);
field->status |= _NEWTOP; /* fake refresh to paint all */
SetStatus(field, _NEWTOP); /* fake refresh to paint all */
_nc_Refresh_Current_Field(form);
}
}
@ -1326,34 +1326,34 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts)
field->opts = oldopts;
returnCode(E_CURRENT);
}
if ((form->curpage == field->page))
if (form->curpage == field->page)
{
if (changed_opts & O_VISIBLE)
if ((unsigned)changed_opts & O_VISIBLE)
{
if (newopts & O_VISIBLE)
if ((unsigned)newopts & O_VISIBLE)
res = Display_Field(field);
else
res = Erase_Field(field);
}
else
{
if ((changed_opts & O_PUBLIC) &&
(newopts & O_VISIBLE))
if (((unsigned)changed_opts & O_PUBLIC) &&
((unsigned)newopts & O_VISIBLE))
res = Display_Field(field);
}
}
}
}
if (changed_opts & O_STATIC)
if ((unsigned)changed_opts & O_STATIC)
{
bool single_line_field = Single_Line_Field(field);
int res2 = E_OK;
if (newopts & O_STATIC)
if ((unsigned)newopts & O_STATIC)
{
/* the field becomes now static */
field->status &= ~_MAY_GROW;
ClrStatus(field, _MAY_GROW);
/* if actually we have no hidden columns, justification may
occur again */
if (single_line_field &&
@ -1371,7 +1371,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts)
(single_line_field && (field->dcols < field->maxgrow)) ||
(!single_line_field && (field->drows < field->maxgrow)))
{
field->status |= _MAY_GROW;
SetStatus(field, _MAY_GROW);
/* a field with justification now changes its behavior,
so we must redisplay it */
if (single_line_field &&
@ -1424,18 +1424,18 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield)
!(form->status & _POSTED))
{
if ((form->w) &&
(field->opts & O_VISIBLE) &&
((unsigned)field->opts & O_VISIBLE) &&
(field->form->curpage == field->page))
{
_nc_Refresh_Current_Field(form);
if (field->opts & O_PUBLIC)
if ((unsigned)field->opts & O_PUBLIC)
{
if (field->drows > field->rows)
{
if (form->toprow == 0)
field->status &= ~_NEWTOP;
ClrStatus(field, _NEWTOP);
else
field->status |= _NEWTOP;
SetStatus(field, _NEWTOP);
}
else
{
@ -1469,7 +1469,7 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield)
delwin(form->w);
form->w = new_window;
form->status &= ~_WINDOW_MODIFIED;
ClrStatus(form, _WINDOW_MODIFIED);
Set_Field_Window_Attributes(field, form->w);
if (Has_Invisible_Parts(field))
@ -1998,7 +1998,7 @@ Vertical_Scrolling(int (*const fct) (FORM *), FORM *form)
{
res = fct(form);
if (res == E_OK)
form->current->status |= _NEWTOP;
SetStatus(form, _NEWTOP);
}
return (res);
}
@ -2430,7 +2430,7 @@ Wrapping_Not_Necessary_Or_Wrapping_Ok(FORM *form)
int result = E_REQUEST_DENIED;
bool Last_Row = ((field->drows - 1) == form->currow);
if ((field->opts & O_WRAP) && /* wrapping wanted */
if (((unsigned)field->opts & O_WRAP) && /* wrapping wanted */
(!Single_Line_Field(field)) && /* must be multi-line */
(There_Is_No_Room_For_A_Char_In_Line(form)) && /* line is full */
(!Last_Row || Growable(field))) /* there are more lines */
@ -2513,7 +2513,7 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
editable fields.
*/
if ((fct == FE_Delete_Previous) &&
(form->opts & O_BS_OVERLOAD) &&
((unsigned)form->opts & O_BS_OVERLOAD) &&
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Previous_Field, form);
@ -2522,7 +2522,7 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
{
if (fct == FE_New_Line)
{
if ((form->opts & O_NL_OVERLOAD) &&
if (((unsigned)form->opts & O_NL_OVERLOAD) &&
First_Position_In_Current_Field(form))
{
res = Inter_Field_Navigation(FN_Next_Field, form);
@ -2534,11 +2534,11 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
else
{
/* From now on, everything must be editable */
if (form->current->opts & O_EDIT)
if ((unsigned)form->current->opts & O_EDIT)
{
res = fct(form);
if (res == E_OK)
form->status |= _WINDOW_MODIFIED;
SetStatus(form, _WINDOW_MODIFIED);
}
}
}
@ -2571,7 +2571,7 @@ FE_New_Line(FORM *form)
if (Last_Row &&
(!(Growable(field) && !Single_Line_Field(field))))
{
if (!(form->opts & O_NL_OVERLOAD))
if (!((unsigned)form->opts & O_NL_OVERLOAD))
returnCode(E_REQUEST_DENIED);
wmove(form->w, form->currow, form->curcol);
wclrtoeol(form->w);
@ -2579,7 +2579,7 @@ FE_New_Line(FORM *form)
handled in the generic routine. The reason is,
that FN_Next_Field may fail, but the form is
definitively changed */
form->status |= _WINDOW_MODIFIED;
SetStatus(form, _WINDOW_MODIFIED);
returnCode(Inter_Field_Navigation(FN_Next_Field, form));
}
else
@ -2595,7 +2595,7 @@ FE_New_Line(FORM *form)
wclrtoeol(form->w);
form->currow++;
form->curcol = 0;
form->status |= _WINDOW_MODIFIED;
SetStatus(form, _WINDOW_MODIFIED);
returnCode(E_OK);
}
}
@ -2605,7 +2605,7 @@ FE_New_Line(FORM *form)
if (Last_Row &&
!(Growable(field) && !Single_Line_Field(field)))
{
if (!(form->opts & O_NL_OVERLOAD))
if (!((unsigned)form->opts & O_NL_OVERLOAD))
returnCode(E_REQUEST_DENIED);
returnCode(Inter_Field_Navigation(FN_Next_Field, form));
}
@ -2627,7 +2627,7 @@ FE_New_Line(FORM *form)
wmove(form->w, form->currow, form->curcol);
winsertln(form->w);
myADDNSTR(form->w, bp, (int)(t - bp));
form->status |= _WINDOW_MODIFIED;
SetStatus(form, _WINDOW_MODIFIED);
returnCode(E_OK);
}
}
@ -2926,7 +2926,7 @@ static int
EM_Overlay_Mode(FORM *form)
{
T((T_CALLED("EM_Overlay_Mode(%p)"), (void *)form));
form->status |= _OVLMODE;
SetStatus(form, _OVLMODE);
returnCode(E_OK);
}
@ -2942,7 +2942,7 @@ static int
EM_Insert_Mode(FORM *form)
{
T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
form->status &= ~_OVLMODE;
ClrStatus(form, _OVLMODE);
returnCode(E_OK);
}
@ -3111,7 +3111,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
{
if (typ)
{
if (field->opts & O_NULLOK)
if ((unsigned)field->opts & O_NULLOK)
{
FIELD_CELL *bp = field->buf;
@ -3168,12 +3168,12 @@ _nc_Internal_Validation(FORM *form)
Synchronize_Buffer(form);
if ((form->status & _FCHECK_REQUIRED) ||
(!(field->opts & O_PASSOK)))
(!((unsigned)field->opts & O_PASSOK)))
{
if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
return FALSE;
form->status &= ~_FCHECK_REQUIRED;
field->status |= _CHANGED;
ClrStatus(form, _FCHECK_REQUIRED);
SetStatus(field, _CHANGED);
Synchronize_Linked_Fields(field);
}
return TRUE;
@ -3273,14 +3273,15 @@ _nc_First_Active_Field(FORM *form)
do
{
field = (field == last_on_page) ? first : field + 1;
if (((*field)->opts & O_VISIBLE))
if (((unsigned)(*field)->opts & O_VISIBLE))
break;
}
while (proposed != (*field));
proposed = *field;
if ((proposed == *last_on_page) && !(proposed->opts & O_VISIBLE))
if ((proposed == *last_on_page) &&
!((unsigned)proposed->opts & O_VISIBLE))
{
/* This means, there is also no visible field on the page.
So we propose the first one and hope the very best...
@ -3816,11 +3817,11 @@ _nc_Set_Form_Page(FORM *form, int page, FIELD *field)
FIELD *last_field, *field_on_page;
werase(Get_Form_Window(form));
form->curpage = page;
form->curpage = (short)page;
last_field = field_on_page = form->field[form->page[page].smin];
do
{
if (field_on_page->opts & O_VISIBLE)
if ((unsigned)field_on_page->opts & O_VISIBLE)
if ((res = Display_Field(field_on_page)) != E_OK)
return (res);
field_on_page = field_on_page->snext;
@ -3981,6 +3982,94 @@ PN_Last_Page(FORM *form)
Helper routines for the core form driver.
--------------------------------------------------------------------------*/
# if USE_WIDEC_SUPPORT
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : static int Data_Entry_w(FORM * form, wchar_t c)
|
| Description : Enter the wide character c into at the current
| position of the current field of the form.
|
| Return Values : E_OK - success
| E_REQUEST_DENIED - driver could not process the request
| E_SYSTEM_ERROR -
+--------------------------------------------------------------------------*/
static int
Data_Entry_w(FORM *form, wchar_t c)
{
FIELD *field = form->current;
int result = E_REQUEST_DENIED;
T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
if (((unsigned)field->opts & O_EDIT)
#if FIX_FORM_INACTIVE_BUG
&& ((unsigned)field->opts & O_ACTIVE)
#endif
)
{
wchar_t given[2];
cchar_t temp_ch;
given[0] = c;
given[1] = 1;
setcchar(&temp_ch, given, 0, 0, (void *)0);
if (((unsigned)field->opts & O_BLANK) &&
First_Position_In_Current_Field(form) &&
!(form->status & _FCHECK_REQUIRED) &&
!(form->status & _WINDOW_MODIFIED))
werase(form->w);
if (form->status & _OVLMODE)
{
wadd_wch(form->w, &temp_ch);
}
else
/* no _OVLMODE */
{
bool There_Is_Room = Is_There_Room_For_A_Char_In_Line(form);
if (!(There_Is_Room ||
((Single_Line_Field(field) && Growable(field)))))
RETURN(E_REQUEST_DENIED);
if (!There_Is_Room && !Field_Grown(field, 1))
RETURN(E_SYSTEM_ERROR);
wins_wch(form->w, &temp_ch);
}
if ((result = Wrapping_Not_Necessary_Or_Wrapping_Ok(form)) == E_OK)
{
bool End_Of_Field = (((field->drows - 1) == form->currow) &&
((field->dcols - 1) == form->curcol));
form->status |= _WINDOW_MODIFIED;
if (End_Of_Field && !Growable(field) && ((unsigned)field->opts & O_AUTOSKIP))
result = Inter_Field_Navigation(FN_Next_Field, form);
else
{
if (End_Of_Field && Growable(field) && !Field_Grown(field, 1))
result = E_SYSTEM_ERROR;
else
{
/*
* We have just added a byte to the form field. It may have
* been part of a multibyte character. If it was, the
* addch_used field is nonzero and we should not try to move
* to a new column.
*/
if (WINDOW_EXT(form->w, addch_used) == 0)
IFN_Next_Character(form);
result = E_OK;
}
}
}
}
RETURN(result);
}
# endif
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : static int Data_Entry(FORM * form,int c)
@ -3999,13 +4088,13 @@ Data_Entry(FORM *form, int c)
int result = E_REQUEST_DENIED;
T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
if ((field->opts & O_EDIT)
if (((unsigned)field->opts & O_EDIT)
#if FIX_FORM_INACTIVE_BUG
&& (field->opts & O_ACTIVE)
&& ((unsigned)field->opts & O_ACTIVE)
#endif
)
{
if ((field->opts & O_BLANK) &&
if (((unsigned)field->opts & O_BLANK) &&
First_Position_In_Current_Field(form) &&
!(form->status & _FCHECK_REQUIRED) &&
!(form->status & _WINDOW_MODIFIED))
@ -4035,8 +4124,8 @@ Data_Entry(FORM *form, int c)
bool End_Of_Field = (((field->drows - 1) == form->currow) &&
((field->dcols - 1) == form->curcol));
form->status |= _WINDOW_MODIFIED;
if (End_Of_Field && !Growable(field) && (field->opts & O_AUTOSKIP))
SetStatus(form, _WINDOW_MODIFIED);
if (End_Of_Field && !Growable(field) && ((unsigned)field->opts & O_AUTOSKIP))
result = Inter_Field_Navigation(FN_Next_Field, form);
else
{
@ -4228,7 +4317,10 @@ form_driver(FORM *form, int c)
if ((c >= MIN_FORM_COMMAND && c <= MAX_FORM_COMMAND) &&
((bindings[c - MIN_FORM_COMMAND].keycode & Key_Mask) == c))
BI = &(bindings[c - MIN_FORM_COMMAND]);
{
TR(TRACE_CALLS, ("form_request %s", form_request_name(c)));
BI = &(bindings[c - MIN_FORM_COMMAND]);
}
if (BI)
{
@ -4246,7 +4338,7 @@ form_driver(FORM *form, int c)
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
size_t method = (BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
size_t method = (size_t) ((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
@ -4255,9 +4347,13 @@ form_driver(FORM *form, int c)
Generic_Method fct = Generic_Methods[method];
if (fct)
res = fct(BI->cmd, form);
{
res = fct(BI->cmd, form);
}
else
res = (BI->cmd) (form);
{
res = (BI->cmd) (form);
}
}
}
#ifdef NCURSES_MOUSE_VERSION
@ -4360,6 +4456,195 @@ form_driver(FORM *form, int c)
RETURN(res);
}
# if USE_WIDEC_SUPPORT
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int form_driver_w(FORM * form,int type,wchar_t c)
|
| Description : This is the workhorse of the forms system.
|
| Input is either a key code (request) or a wide char
| returned by e.g. get_wch (). The type must be passed
| as well,so that we are able to determine whether the char
| is a multibyte char or a request.
| If it is a request, the form driver executes
| the request and returns the result. If it is data
| (printable character), it enters the data into the
| current position in the current field. If it is not
| recognized, the form driver assumes it is an application
| defined command and returns E_UNKNOWN_COMMAND.
| Application defined command should be defined relative
| to MAX_FORM_COMMAND, the maximum value of a request.
|
| Return Values : E_OK - success
| E_SYSTEM_ERROR - system error
| E_BAD_ARGUMENT - an argument is incorrect
| E_NOT_POSTED - form is not posted
| E_INVALID_FIELD - field contents are invalid
| E_BAD_STATE - called from inside a hook routine
| E_REQUEST_DENIED - request failed
| E_NOT_CONNECTED - no fields are connected to the form
| E_UNKNOWN_COMMAND - command not known
+--------------------------------------------------------------------------*/
NCURSES_EXPORT(int)
form_driver_w(FORM *form, int type, wchar_t c)
{
const Binding_Info *BI = (Binding_Info *) 0;
int res = E_UNKNOWN_COMMAND;
T((T_CALLED("form_driver(%p,%d)"), (void *)form, (int) c));
if (!form)
RETURN(E_BAD_ARGUMENT);
if (!(form->field))
RETURN(E_NOT_CONNECTED);
assert(form->page);
if (c == FIRST_ACTIVE_MAGIC)
{
form->current = _nc_First_Active_Field(form);
RETURN(E_OK);
}
assert(form->current &&
form->current->buf &&
(form->current->form == form)
);
if (form->status & _IN_DRIVER)
RETURN(E_BAD_STATE);
if (!(form->status & _POSTED))
RETURN(E_NOT_POSTED);
/* check if this is a keycode or a (wide) char */
if (type == KEY_CODE_YES)
{
if ((c >= MIN_FORM_COMMAND && c <= MAX_FORM_COMMAND) &&
((bindings[c - MIN_FORM_COMMAND].keycode & Key_Mask) == c))
BI = &(bindings[c - MIN_FORM_COMMAND]);
}
if (BI)
{
typedef int (*Generic_Method) (int (*const) (FORM *), FORM *);
static const Generic_Method Generic_Methods[] =
{
Page_Navigation, /* overloaded to call field&form hooks */
Inter_Field_Navigation, /* overloaded to call field hooks */
NULL, /* Intra-Field is generic */
Vertical_Scrolling, /* Overloaded to check multi-line */
Horizontal_Scrolling, /* Overloaded to check single-line */
Field_Editing, /* Overloaded to mark modification */
NULL, /* Edit Mode is generic */
NULL, /* Field Validation is generic */
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
size_t method = (size_t) (BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
else
{
Generic_Method fct = Generic_Methods[method];
if (fct)
res = fct(BI->cmd, form);
else
res = (BI->cmd) (form);
}
}
#ifdef NCURSES_MOUSE_VERSION
else if (KEY_MOUSE == c)
{
MEVENT event;
WINDOW *win = form->win ? form->win : StdScreen(Get_Form_Screen(form));
WINDOW *sub = form->sub ? form->sub : win;
getmouse(&event);
if ((event.bstate & (BUTTON1_CLICKED |
BUTTON1_DOUBLE_CLICKED |
BUTTON1_TRIPLE_CLICKED))
&& wenclose(win, event.y, event.x))
{ /* we react only if the click was in the userwin, that means
* inside the form display area or at the decoration window.
*/
int ry = event.y, rx = event.x; /* screen coordinates */
res = E_REQUEST_DENIED;
if (mouse_trafo(&ry, &rx, FALSE))
{ /* rx, ry are now "curses" coordinates */
if (ry < sub->_begy)
{ /* we clicked above the display region; this is
* interpreted as "scroll up" request
*/
if (event.bstate & BUTTON1_CLICKED)
res = form_driver(form, REQ_PREV_FIELD);
else if (event.bstate & BUTTON1_DOUBLE_CLICKED)
res = form_driver(form, REQ_PREV_PAGE);
else if (event.bstate & BUTTON1_TRIPLE_CLICKED)
res = form_driver(form, REQ_FIRST_FIELD);
}
else if (ry > sub->_begy + sub->_maxy)
{ /* we clicked below the display region; this is
* interpreted as "scroll down" request
*/
if (event.bstate & BUTTON1_CLICKED)
res = form_driver(form, REQ_NEXT_FIELD);
else if (event.bstate & BUTTON1_DOUBLE_CLICKED)
res = form_driver(form, REQ_NEXT_PAGE);
else if (event.bstate & BUTTON1_TRIPLE_CLICKED)
res = form_driver(form, REQ_LAST_FIELD);
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
int i;
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
int min_field = form->page[form->curpage].pmin;
int max_field = form->page[form->curpage].pmax;
for (i = min_field; i <= max_field; ++i)
{
FIELD *field = form->field[i];
if (Field_Is_Selectable(field)
&& Field_encloses(field, ry, rx) == E_OK)
{
res = _nc_Set_Current_Field(form, field);
if (res == E_OK)
res = _nc_Position_Form_Cursor(form);
if (res == E_OK
&& (event.bstate & BUTTON1_DOUBLE_CLICKED))
res = E_UNKNOWN_COMMAND;
break;
}
}
}
}
}
}
else
res = E_REQUEST_DENIED;
}
#endif /* NCURSES_MOUSE_VERSION */
else if (type == OK)
{
res = Data_Entry_w(form, c);
}
_nc_Refresh_Current_Field(form);
RETURN(res);
}
# endif /* USE_WIDEC_SUPPORT */
/*----------------------------------------------------------------------------
Field-Buffer manipulation routines.
The effects of setting a buffer are tightly coupled to the core of the form
@ -4389,8 +4674,8 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
{
FIELD_CELL *p;
int res = E_OK;
unsigned int i;
unsigned int len;
int i;
int len;
#if USE_WIDEC_SUPPORT
FIELD_CELL *widevalue = 0;
@ -4408,7 +4693,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
/* for a growable field we must assume zero terminated strings, because
somehow we have to detect the length of what should be copied.
*/
unsigned int vlen = strlen(value);
int vlen = (int)strlen(value);
if (vlen > len)
{
@ -4448,10 +4733,10 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
}
else
{
for (i = 0; i < (unsigned)field->drows; ++i)
for (i = 0; i < field->drows; ++i)
{
(void)mvwin_wchnstr(field->working, 0, i * field->dcols,
widevalue + (i * field->dcols),
(void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
widevalue + ((int)i * field->dcols),
field->dcols);
}
for (i = 0; i < len; ++i)
@ -4512,7 +4797,7 @@ field_buffer(const FIELD *field, int buffer)
{
#if USE_WIDEC_SUPPORT
FIELD_CELL *data = Address_Of_Nth_Buffer(field, buffer);
unsigned need = 0;
size_t need = 0;
int size = Buffer_Length(field);
int n;
@ -4526,7 +4811,7 @@ field_buffer(const FIELD *field, int buffer)
init_mb(state);
next = _nc_wcrtomb(0, data[n].chars[0], &state);
if (!isEILSEQ(next))
if (next > 0)
need += next;
}
}
@ -4613,7 +4898,7 @@ _nc_Widen_String(char *source, int *lengthp)
{
result[need] = wch;
}
passed += status;
passed += (size_t) status;
++need;
}
else
@ -4633,7 +4918,7 @@ _nc_Widen_String(char *source, int *lengthp)
break;
result = typeCalloc(wchar_t, need);
*lengthp = need;
*lengthp = (int)need;
if (result == 0)
break;
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,13 +32,13 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_hook.c,v 1.15 2010/01/23 21:12:08 tom Exp $")
MODULE_ID("$Id: frm_hook.c,v 1.16 2012/03/11 00:37:16 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));\
T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), (void *) form, func));\
(Normalize_Form( form ) -> typ ## name) = func ;\
RETURN(E_OK);\
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: frm_opts.c,v 1.17 2013/08/24 22:58:47 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -49,8 +49,8 @@ set_form_opts(FORM *form, Form_Options opts)
{
T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts));
opts &= ALL_FORM_OPTS;
if (opts & ~ALL_FORM_OPTS)
opts &= (Form_Options) ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
{
@ -71,7 +71,7 @@ NCURSES_EXPORT(Form_Options)
form_opts(const FORM *form)
{
T((T_CALLED("form_opts(%p)"), (const void *)form));
returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS));
returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
}
/*---------------------------------------------------------------------------
@ -89,8 +89,8 @@ form_opts_on(FORM *form, Form_Options opts)
{
T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts));
opts &= ALL_FORM_OPTS;
if (opts & ~ALL_FORM_OPTS)
opts &= (Form_Options) ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
{
@ -114,8 +114,8 @@ form_opts_off(FORM *form, Form_Options opts)
{
T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts));
opts &= ALL_FORM_OPTS;
if (opts & ~ALL_FORM_OPTS)
opts &= (Form_Options) ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
{

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_page.c,v 1.11 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: frm_page.c,v 1.12 2012/06/10 00:28:04 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -58,7 +58,7 @@ set_form_page(FORM *form, int page)
if (!(form->status & _POSTED))
{
form->curpage = page;
form->curpage = (short)page;
form->current = _nc_First_Active_Field(form);
}
else

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_post.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: frm_post.c,v 1.11 2012/06/10 00:27:49 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
@ -77,7 +77,7 @@ post_form(FORM *form)
if ((err = _nc_Set_Form_Page(form, page, form->current)) != E_OK)
RETURN(err);
form->status |= _POSTED;
SetStatus(form, _POSTED);
Call_Hook(form, forminit);
Call_Hook(form, fieldinit);
@ -117,7 +117,7 @@ unpost_form(FORM *form)
werase(Get_Form_Window(form));
delwin(form->w);
form->w = (WINDOW *)0;
form->status &= ~_POSTED;
ClrStatus(form, _POSTED);
RETURN(E_OK);
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2009,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -37,7 +37,7 @@
#include "form.priv.h"
MODULE_ID("$Id: frm_req_name.c,v 1.17 2009/10/10 16:17:01 tom Exp $")
MODULE_ID("$Id: frm_req_name.c,v 1.18 2012/07/21 23:17:23 tom Exp $")
static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] =
{
@ -144,23 +144,26 @@ 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];
size_t i = 0;
char buf[16]; /* longest name is 10 chars */
T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
if (str)
if (str != 0 && (i = strlen(str)) != 0)
{
strncpy(buf, str, sizeof(buf));
while ((i < sizeof(buf)) && (buf[i] != '\0'))
if (i > sizeof(buf) - 2)
i = sizeof(buf) - 2;
memcpy(buf, str, i);
buf[i] = '\0';
for (i = 0; buf[i] != '\0'; ++i)
{
buf[i] = (char)toupper(UChar(buf[i]));
i++;
}
for (i = 0; i < A_SIZE; i++)
{
if (strncmp(request_names[i], buf, sizeof(buf)) == 0)
if (strcmp(request_names[i], buf) == 0)
returnCode(MIN_FORM_COMMAND + (int)i);
}
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 2008-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -34,7 +34,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fty_generic.c,v 1.5 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fty_generic.c,v 1.6 2012/06/10 00:27:49 tom Exp $")
/*
* This is not a full implementation of a field type, but adds some
@ -119,7 +119,7 @@ _nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *),
if (res)
{
*res = *_nc_Default_FieldType;
res->status |= (_HAS_ARGS | _GENERIC);
SetStatus(res, (_HAS_ARGS | _GENERIC));
res->fieldcheck.gfcheck = field_check;
res->charcheck.gccheck = char_check;
res->genericarg = Generic_This_Type;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -34,7 +34,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fty_int.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fty_int.c,v 1.26 2012/02/23 10:02:15 tom Exp $")
#if USE_WIDEC_SUPPORT
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
@ -233,7 +233,8 @@ Check_This_Field(FIELD *field, const void *argp)
}
if (result)
{
sprintf(buf, "%.*ld", (prec > 0 ? prec : 0), val);
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*ld", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
}
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -34,7 +34,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fty_num.c,v 1.28 2010/01/23 21:14:36 tom Exp $")
MODULE_ID("$Id: fty_num.c,v 1.29 2012/02/23 10:02:15 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
@ -271,7 +271,8 @@ Check_This_Field(FIELD *field, const void *argp)
}
if (result)
{
sprintf(buf, "%.*f", (prec > 0 ? prec : 0), val);
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*f", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
}
}

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -34,7 +34,7 @@
#include "form.priv.h"
MODULE_ID("$Id: fty_regex.c,v 1.24 2010/01/23 21:14:37 tom Exp $")
MODULE_ID("$Id: fty_regex.c,v 1.25 2012/10/27 20:12:53 tom Exp $")
#if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */
#include <regex.h>
@ -123,9 +123,8 @@ Generic_RegularExpression_Type(void *arg MAYBE_UNUSED)
(REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
{
T((T_CREATE("regex_t %p"), (void *)preg->pRegExp));
preg->refCount = typeMalloc(unsigned long, 1);
*(preg->refCount) = 1;
if ((preg->refCount = typeMalloc(unsigned long, 1)) != 0)
*(preg->refCount) = 1;
}
else
{
@ -151,9 +150,8 @@ Generic_RegularExpression_Type(void *arg MAYBE_UNUSED)
T((T_CREATE("RegExp_Arg %p"), pArg));
pArg->compiled_expression = NULL;
pArg->refCount = typeMalloc(unsigned long, 1);
*(pArg->refCount) = 1;
if ((pArg->refCount = typeMalloc(unsigned long, 1)) != 0)
*(pArg->refCount) = 1;
do
{

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2010 Free Software Foundation, Inc. *
* Copyright (c) 2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey 2010 *
* Author: Thomas E. Dickey 2010-on *
****************************************************************************/
/* LINTLIBRARY */
@ -494,6 +494,13 @@ int form_driver(
int c)
{ return(*(int *)0); }
#undef form_driver_w
int form_driver_w(
FORM *form,
int type,
wchar_t c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
FIELD *field,

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. *
* Copyright (c) 2002-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey 2002-2005,2010 *
* Author: Thomas E. Dickey 2002-on *
****************************************************************************/
/* LINTLIBRARY */
@ -494,6 +494,13 @@ int form_driver(
int c)
{ return(*(int *)0); }
#undef form_driver_w
int form_driver_w(
FORM *form,
int type,
wchar_t c)
{ return(*(int *)0); }
#undef set_field_buffer
int set_field_buffer(
FIELD *field,

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2010,2011 Free 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.37 2010/12/04 18:47:13 tom Exp $
# $Id: Caps,v 1.38 2011/10/15 23:10:18 tom Exp $
#
# This is the master termcap/terminfo capability table.
#
@ -738,11 +738,13 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio
#%.ad
#%
#%.in .8i
#%The XSI Curses standard added these. They are some post-4.1
#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
#%The \fBncurses\fR termcap names for them are invented; according to the
#%XSI Curses standard, they have no termcap names. If your compiled terminfo
#%entries use these, they may not be binary-compatible with System V terminfo
#%The XSI Curses standard added these hardcopy capabilities.
#%They were used in some post-4.1 versions of System V curses,
#%e.g., Solaris 2.5 and IRIX 6.x.
#%Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
#%According to the XSI Curses standard, they have no termcap names.
#%If your compiled terminfo entries use these,
#%they may not be binary-compatible with System V terminfo
#%entries after SVr4.1; beware!
#%
#%.na
@ -760,7 +762,7 @@ enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode
enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode
enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode
set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6
set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch
set_pglen_inch slength str YI - - ----- Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
#%.TE
#%.ad
#

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2001-2006,2010 Free Software Foundation, Inc. #
# Copyright (c) 2001-2010,2011 Free 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.8 2010/12/04 18:47:13 tom Exp $
# $Id: Caps.aix4,v 1.9 2011/10/15 23:19:16 tom Exp $
#
# This is an adaptation of ncurses' termcap/terminfo capability table, which
# is designed to align with AIX 4.x's terminfo.
@ -840,11 +840,13 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio
#%.ad
#%
#%.in .8i
#%The XSI Curses standard added these. They are some post-4.1
#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
#%The \fBncurses\fR termcap names for them are invented; according to the
#%XSI Curses standard, they have no termcap names. If your compiled terminfo
#%entries use these, they may not be binary-compatible with System V terminfo
#%The XSI Curses standard added these hardcopy capabilities.
#%They were used in some post-4.1 versions of System V curses,
#%e.g., Solaris 2.5 and IRIX 6.x.
#%Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
#%According to the XSI Curses standard, they have no termcap names.
#%If your compiled terminfo entries use these,
#%they may not be binary-compatible with System V terminfo
#%entries after SVr4.1; beware!
#%
#%.na
@ -862,7 +864,7 @@ enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode
enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode
enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode
set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6
set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch
set_pglen_inch slength str YI - - ----- Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
#%.TE
#%.ad
#

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. #
# Copyright (c) 2002-2010,2011 Free 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.hpux11,v 1.5 2010/12/04 18:47:13 tom Exp $
# $Id: Caps.hpux11,v 1.6 2011/10/15 23:20:04 tom Exp $
#
# This is an adaptation of ncurses' termcap/terminfo capability table, which
# is designed to align with HPUX 11.x's terminfo.
@ -746,11 +746,13 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio
#%.ad
#%
#%.in .8i
#%The XSI Curses standard added these. They are some post-4.1
#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
#%The \fBncurses\fR termcap names for them are invented; according to the
#%XSI Curses standard, they have no termcap names. If your compiled terminfo
#%entries use these, they may not be binary-compatible with System V terminfo
#%The XSI Curses standard added these hardcopy capabilities.
#%They were used in some post-4.1 versions of System V curses,
#%e.g., Solaris 2.5 and IRIX 6.x.
#%Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
#%According to the XSI Curses standard, they have no termcap names.
#%If your compiled terminfo entries use these,
#%they may not be binary-compatible with System V terminfo
#%entries after SVr4.1; beware!
#%
#%.na
@ -761,7 +763,7 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio
#%lw25 lw6 lw2 lw20.
#%\fBVariable Cap- TCap Description\fR
#%\fBString name Code\fR
set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch
set_pglen_inch slength str YI - - ----- Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode
enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode
enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2001-2006,2010 Free Software Foundation, Inc. #
# Copyright (c) 2001-2011,2013 Free 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.4 2010/12/04 18:47:13 tom Exp $
# $Id: Caps.keys,v 1.7 2013/07/20 17:59:24 tom Exp $
#
# This is an adaptation of ncurses' termcap/terminfo capability table, which
# is illustrates an experimental extension to describe alt-, shift- and
@ -229,11 +229,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
@ -277,7 +277,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
#%
@ -828,11 +828,13 @@ alt_scancode_esc scesa str S8 - - ----- Alternate escape for scancode emulatio
#%.ad
#%
#%.in .8i
#%The XSI Curses standard added these. They are some post-4.1
#%versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
#%The \fBncurses\fR termcap names for them are invented; according to the
#%XSI Curses standard, they have no termcap names. If your compiled terminfo
#%entries use these, they may not be binary-compatible with System V terminfo
#%The XSI Curses standard added these hardcopy capabilities.
#%They were used in some post-4.1 versions of System V curses,
#%e.g., Solaris 2.5 and IRIX 6.x.
#%Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
#%According to the XSI Curses standard, they have no termcap names.
#%If your compiled terminfo entries use these,
#%they may not be binary-compatible with System V terminfo
#%entries after SVr4.1; beware!
#%
#%.na
@ -850,7 +852,7 @@ enter_right_hl_mode erhlm str Xr - - ----- Enter right highlight mode
enter_top_hl_mode ethlm str Xt - - ----- Enter top highlight mode
enter_vertical_hl_mode evhlm str Xv - - ----- Enter vertical highlight mode
set_a_attributes sgr1 str sA - - ----- Define second set of video attributes #1-#6
set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch
set_pglen_inch slength str YI - - ----- Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
#%.TE
#%.ad
#

View File

@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. #
# Copyright (c) 2002-2010,2011 Free 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.5 2010/12/04 18:47:13 tom Exp $
# $Id: Caps.osf1r5,v 1.6 2011/10/15 22:52:09 tom Exp $
#
# This is an adaptation of ncurses' termcap/terminfo capability table, which
# is designed to align with OSF/1 version 5 (Tru64) terminfo.
@ -769,7 +769,7 @@ wait_tone wait str WA - - ----- wait for dial-tone
xoff_character xoffc str XF - - ----- XOFF character
xon_character xonc str XN - - ----- XON character
zero_motion zerom str Zx - - ----- No motion for subsequent character
set_pglen_inch slength str sL - - ----- YI Set page length to #1 hundredth of an inch
set_pglen_inch slength str YI - - ----- Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
enter_horizontal_hl_mode ehhlm str Xh - - ----- Enter horizontal highlight mode
enter_left_hl_mode elhlm str Xl - - ----- Enter left highlight mode
enter_low_hl_mode elohlm str Xo - - ----- Enter low highlight mode

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: MKkey_defs.sh,v 1.14 2003/12/06 17:10:09 tom Exp $
# $Id: MKkey_defs.sh,v 1.15 2013/03/09 16:32:01 tom Exp $
##############################################################################
# Copyright (c) 2001-2002,2003 Free Software Foundation, Inc. #
# Copyright (c) 2001-2003,2013 Free 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,9 +65,12 @@ key_resize kr1 str R1 KEY_RESIZE + ----- Terminal resize event
key_event kv1 str V1 KEY_EVENT + ----- We were interrupted by an event
EOF
THIS=./`basename $0`
PARM=./`basename $DATA`
cat <<EOF
/*
* These definitions were generated by $0 $DATA
* These definitions were generated by $THIS $PARM
*/
EOF

View File

@ -1,7 +1,7 @@
# vile:awkmode
BEGIN {
print "/****************************************************************************"
print " * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *"
print " * Copyright (c) 1998-2011,2013 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 *"
@ -34,7 +34,7 @@ BEGIN {
print "/* and: Thomas E. Dickey 1995-on */"
print "/****************************************************************************/"
print ""
print "/* $Id: MKterm.h.awk.in,v 1.58 2010/01/09 19:53:26 tom Exp $ */"
print "/* $Id: MKterm.h.awk.in,v 1.62 2013/08/17 19:21:56 tom Exp $ */"
print ""
print "/*"
print "** term.h -- Definition of struct term"
@ -62,6 +62,12 @@ BEGIN {
print "#undef NCURSES_SBOOL"
print "#define NCURSES_SBOOL @NCURSES_SBOOL@"
print ""
print "#undef NCURSES_USE_DATABASE"
print "#define NCURSES_USE_DATABASE @NCURSES_USE_DATABASE@"
print ""
print "#undef NCURSES_USE_TERMCAP"
print "#define NCURSES_USE_TERMCAP @NCURSES_USE_TERMCAP@"
print ""
print "#undef NCURSES_XNAMES"
print "#define NCURSES_XNAMES @NCURSES_XNAMES@"
print ""
@ -93,41 +99,6 @@ BEGIN {
print "#include <termio.h>"
print "#define TTY struct termio"
print ""
print "/* Add definitions to make termio look like termios."
print " * But ifdef it, since there are some implementations"
print " * that try to do this for us in a fake <termio.h>."
print " */"
print "#ifndef TCSANOW"
print "#define TCSANOW TCSETA"
print "#endif"
print "#ifndef TCSADRAIN"
print "#define TCSADRAIN TCSETAW"
print "#endif"
print "#ifndef TCSAFLUSH"
print "#define TCSAFLUSH TCSETAF"
print "#endif"
print "#ifndef tcsetattr"
print "#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)"
print "#endif"
print "#ifndef tcgetattr"
print "#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)"
print "#endif"
print "#ifndef cfgetospeed"
print "#define cfgetospeed(t) ((t)->c_cflag & CBAUD)"
print "#endif"
print "#ifndef TCIFLUSH "
print "#define TCIFLUSH 0"
print "#endif"
print "#ifndef TCOFLUSH "
print "#define TCOFLUSH 1"
print "#endif"
print "#ifndef TCIOFLUSH "
print "#define TCIOFLUSH 2"
print "#endif"
print "#ifndef tcflush"
print "#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)"
print "#endif"
print ""
print "#else /* !HAVE_TERMIO_H */"
print ""
print "#if __MINGW32__"
@ -281,6 +252,7 @@ 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(void) _nc_init_termtype (TERMTYPE *const);"
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);"

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $
# $Id: Makefile.in,v 1.41 2013/08/03 23:10:51 tom Exp $
##############################################################################
# Copyright (c) 1998,2009,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -48,6 +48,9 @@ srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
includesubdir = @includesubdir@
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
* Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
* and: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: curses.h.in,v 1.220 2011/01/22 19:47:20 tom Exp $ */
/* $Id: curses.h.in,v 1.237 2014/02/01 22:08:12 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
@ -91,11 +91,20 @@
#define NCURSES_INLINE @NCURSES_INLINE@
/*
* The internal type used for color values
* The internal type used for color values, and for color-pairs. The latter
* allows the curses library to enumerate the combinations of foreground and
* background colors used by an application, and is normally the product of the
* total foreground and background colors.
*
* X/Open uses "short" for both of these types, ultimately because they are
* numbers from the terminal database, which uses 16-bit signed values.
*/
#undef NCURSES_COLOR_T
#define NCURSES_COLOR_T short
#undef NCURSES_PAIRS_T
#define NCURSES_PAIRS_T short
/*
* Definition used to make WINDOW and similar structs opaque.
*/
@ -128,6 +137,13 @@
#undef NCURSES_TPARM_VARARGS
#define NCURSES_TPARM_VARARGS @NCURSES_TPARM_VARARGS@
/*
* Control type used for tparm's arguments. While X/Open equates long and
* char* values, this is not always workable for 64-bit platforms.
*/
#undef NCURSES_TPARM_ARG
#define NCURSES_TPARM_ARG @NCURSES_TPARM_ARG@
/*
* 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
@ -151,15 +167,21 @@ typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t;
/*
* With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
* conflicting) when _XOPEN_SOURCE is 500 or greater.
* conflicting) when _XOPEN_SOURCE is 500 or greater. If NCURSES_WIDECHAR is
* not already defined, e.g., if the platform relies upon nonstandard feature
* test macros, define it at this point if the standard feature test macros
* indicate that it should be defined.
*/
#undef NCURSES_WIDECHAR
#if defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)
#define NCURSES_WIDECHAR
#ifndef NCURSES_WIDECHAR
#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
#define NCURSES_WIDECHAR 1
#else
#define NCURSES_WIDECHAR 0
#endif
#endif /* NCURSES_WIDECHAR */
#include <stdarg.h> /* we need va_list */
#ifdef NCURSES_WIDECHAR
#if NCURSES_WIDECHAR
#include <stddef.h> /* we want wchar_t */
#endif
@ -231,6 +253,10 @@ extern "C" {
#define WA_TOP A_TOP
#define WA_VERTICAL A_VERTICAL
#if @NCURSES_EXT_FUNCS@
#define WA_ITALIC A_ITALIC /* ncurses extension */
#endif
/* colors */
#define COLOR_BLACK 0
#define COLOR_RED 1
@ -250,7 +276,7 @@ NCURSES_WRAPPED_VAR(chtype*, acs_map);
extern NCURSES_EXPORT_VAR(chtype) acs_map[];
#endif
#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)])
#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,(c))])
/* VT100 symbols begin here */
#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */
@ -342,7 +368,7 @@ typedef struct _win_st WINDOW;
typedef chtype attr_t; /* ...must be at least as wide as chtype */
#ifdef NCURSES_WIDECHAR
#if NCURSES_WIDECHAR
#if @NCURSES_LIBUTF8@
#ifdef mblen /* libutf8.h defines it w/o undefining first */
@ -366,7 +392,7 @@ typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@;
/*
* cchar_t stores an array of CCHARW_MAX wide characters. The first is
* normally a spacing character. The others are non-spacing. If those
* (spacing and nonspacing) do not fill the array, a null L'\0' follows.
* (spacing and nonspacing) do not fill the array, a null L'\0' follows.
* Otherwise, a null is assumed to follow when extracting via getcchar().
*/
#define CCHARW_MAX @NCURSES_CCHARW_MAX@
@ -434,7 +460,7 @@ struct _win_st
NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
#ifdef NCURSES_WIDECHAR
#if NCURSES_WIDECHAR
cchar_t _bkgrnd; /* current background char/attribute pair */
#if @NCURSES_EXT_COLORS@
int _color; /* current color-pair for non-space character */
@ -556,10 +582,10 @@ extern NCURSES_EXPORT(int) addstr (const char *); /* generated */
extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */
extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */
extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */
extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */
extern NCURSES_EXPORT(int) attr_get (attr_t *, NCURSES_PAIRS_T *, void *); /* generated */
extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */
extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */
extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */
extern NCURSES_EXPORT(int) attr_set (attr_t, NCURSES_PAIRS_T, void *); /* generated */
extern NCURSES_EXPORT(int) baudrate (void); /* implemented */
extern NCURSES_EXPORT(int) beep (void); /* implemented */
extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */
@ -568,13 +594,13 @@ extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,cht
extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */
extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */
extern NCURSES_EXPORT(int) cbreak (void); /* implemented */
extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */
extern NCURSES_EXPORT(int) chgat (int, attr_t, NCURSES_PAIRS_T, const void *); /* generated */
extern NCURSES_EXPORT(int) clear (void); /* generated */
extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */
extern NCURSES_EXPORT(int) clrtobot (void); /* generated */
extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */
extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */
extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */
extern NCURSES_EXPORT(int) color_content (NCURSES_COLOR_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*,NCURSES_COLOR_T*); /* implemented */
extern NCURSES_EXPORT(int) color_set (NCURSES_PAIRS_T,void*); /* generated */
extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */
extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */
extern NCURSES_EXPORT(int) curs_set (int); /* implemented */
@ -613,8 +639,8 @@ extern NCURSES_EXPORT(chtype) inch (void); /* generated */
extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */
extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */
extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */
extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */
extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */
extern NCURSES_EXPORT(int) init_color (NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T); /* implemented */
extern NCURSES_EXPORT(int) init_pair (NCURSES_PAIRS_T,NCURSES_COLOR_T,NCURSES_COLOR_T); /* implemented */
extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */
extern NCURSES_EXPORT(int) insch (chtype); /* generated */
extern NCURSES_EXPORT(int) insdelln (int); /* generated */
@ -638,7 +664,7 @@ extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* gener
extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */
extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */
extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */
extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */
extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, NCURSES_PAIRS_T, const void *); /* generated */
extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */
extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */
extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */
@ -664,7 +690,7 @@ extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int
extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */
extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */
extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */
extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */
extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, NCURSES_PAIRS_T, const void *);/* generated */
extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */
extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */
extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */
@ -698,7 +724,7 @@ extern NCURSES_EXPORT(int) noraw (void); /* implemented */
extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */
extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */
extern NCURSES_EXPORT(int) pair_content (NCURSES_PAIRS_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*); /* implemented */
extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */
extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */
extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
@ -732,9 +758,9 @@ extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */
extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */
extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */
extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */
extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */
extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,NCURSES_PAIRS_T,void*); /* implemented */
extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */
extern NCURSES_EXPORT(int) slk_color (short); /* implemented */
extern NCURSES_EXPORT(int) slk_color (NCURSES_PAIRS_T); /* implemented */
extern NCURSES_EXPORT(int) slk_init (int); /* implemented */
extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */
extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */
@ -757,6 +783,7 @@ extern NCURSES_EXPORT(int) typeahead (int); /* implemented */
extern NCURSES_EXPORT(int) ungetch (int); /* implemented */
extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */
extern NCURSES_EXPORT(void) use_env (bool); /* implemented */
extern NCURSES_EXPORT(void) use_tioctl (bool); /* implemented */
extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */
extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC); /* implemented */
extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */
@ -772,18 +799,18 @@ 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_get (WINDOW *, attr_t *, NCURSES_PAIRS_T *, void *); /* generated */
extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */
extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */
extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */
extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, NCURSES_PAIRS_T, void *); /* generated */
extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */
extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */
extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */
extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */
extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, NCURSES_PAIRS_T, const void *);/* implemented */
extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */
extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,NCURSES_PAIRS_T,void*); /* implemented */
extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */
extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */
@ -832,7 +859,7 @@ extern NCURSES_EXPORT(int) putp (const char *); /* implemented */
#if NCURSES_TPARM_VARARGS
extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */
#else
extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */
extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG); /* special */
extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */
#endif
@ -854,7 +881,7 @@ extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */
/*
* vid_attr() was implemented originally based on a draft of X/Open curses.
*/
#ifndef NCURSES_WIDECHAR
#if !NCURSES_WIDECHAR
#define vid_attr(a,pair,opts) vidattr(a)
#endif
@ -929,7 +956,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FU
extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */
@ -945,8 +972,8 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* impleme
extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */
@ -963,7 +990,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
@ -978,9 +1005,9 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype);
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, NCURSES_PAIRS_T, void*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, NCURSES_PAIRS_T); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */
@ -994,6 +1021,7 @@ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemente
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_tioctl) (SCREEN*, bool); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
#if @NCURSES_EXT_FUNCS@
@ -1022,7 +1050,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
/* attributes */
#define NCURSES_ATTR_SHIFT 8
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) + NCURSES_ATTR_SHIFT))
#define A_NORMAL (@cf_cv_1UL@ - @cf_cv_1UL@)
#define A_ATTRIBUTES NCURSES_BITS(~(@cf_cv_1UL@ - @cf_cv_1UL@),0)
@ -1044,6 +1072,10 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
#define A_TOP NCURSES_BITS(@cf_cv_1UL@,21)
#define A_VERTICAL NCURSES_BITS(@cf_cv_1UL@,22)
#if @NCURSES_EXT_FUNCS@
#define A_ITALIC NCURSES_BITS(@cf_cv_1UL@,23) /* ncurses extension */
#endif
/*
* Most of the pseudo functions are macros that either provide compatibility
* with older versions of curses, or provide inline functionality to improve
@ -1084,7 +1116,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
*/
#define wgetstr(w, s) wgetnstr(w, s, -1)
#define getnstr(s, n) wgetnstr(stdscr, s, n)
#define getnstr(s, n) wgetnstr(stdscr, s, (n))
#define setterm(term) setupterm(term, 1, (int *)0)
@ -1115,7 +1147,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
#define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
#if !NCURSES_OPAQUE
#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@
#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@
#define wattrset(win,at) ((win) \
? ((win)->_color = PAIR_NUMBER(at), \
(win)->_attrs = NCURSES_CAST(attr_t, at), \
@ -1137,15 +1169,15 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0)
#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br)
#define hline(ch, n) whline(stdscr, ch, n)
#define vline(ch, n) wvline(stdscr, ch, n)
#define hline(ch, n) whline(stdscr, ch, (n))
#define vline(ch, n) wvline(stdscr, ch, (n))
#define winstr(w, s) winnstr(w, s, -1)
#define winchstr(w, s) winchnstr(w, s, -1)
#define winsstr(w, s) winsnstr(w, s, -1)
#if !NCURSES_OPAQUE
#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1)
#define redrawwin(win) wredrawln(win, 0, ((win) ? (win)->_maxy+1 : -1))
#endif /* NCURSES_OPAQUE */
#define waddstr(win,str) waddnstr(win,str,-1)
@ -1154,55 +1186,55 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
/*
* These apply to the first 256 color pairs.
*/
#define COLOR_PAIR(n) NCURSES_BITS(n, 0)
#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
#define COLOR_PAIR(n) NCURSES_BITS((n), 0)
#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,(a)) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
/*
* pseudo functions for standard screen
*/
#define addch(ch) waddch(stdscr,ch)
#define addchnstr(str,n) waddchnstr(stdscr,str,n)
#define addchstr(str) waddchstr(stdscr,str)
#define addnstr(str,n) waddnstr(stdscr,str,n)
#define addstr(str) waddnstr(stdscr,str,-1)
#define attroff(at) wattroff(stdscr,at)
#define attron(at) wattron(stdscr,at)
#define attrset(at) wattrset(stdscr,at)
#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o)
#define attr_off(a,o) wattr_off(stdscr,a,o)
#define attr_on(a,o) wattr_on(stdscr,a,o)
#define attr_set(a,c,o) wattr_set(stdscr,a,c,o)
#define bkgd(ch) wbkgd(stdscr,ch)
#define bkgdset(ch) wbkgdset(stdscr,ch)
#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o)
#define addch(ch) waddch(stdscr,(ch))
#define addchnstr(str,n) waddchnstr(stdscr,(str),(n))
#define addchstr(str) waddchstr(stdscr,(str))
#define addnstr(str,n) waddnstr(stdscr,(str),(n))
#define addstr(str) waddnstr(stdscr,(str),-1)
#define attroff(at) wattroff(stdscr,(at))
#define attron(at) wattron(stdscr,(at))
#define attrset(at) wattrset(stdscr,(at))
#define attr_get(ap,cp,o) wattr_get(stdscr,(ap),(cp),(o))
#define attr_off(a,o) wattr_off(stdscr,(a),(o))
#define attr_on(a,o) wattr_on(stdscr,(a),(o))
#define attr_set(a,c,o) wattr_set(stdscr,(a),(c),(o))
#define bkgd(ch) wbkgd(stdscr,(ch))
#define bkgdset(ch) wbkgdset(stdscr,(ch))
#define chgat(n,a,c,o) wchgat(stdscr,(n),(a),(c),(o))
#define clear() wclear(stdscr)
#define clrtobot() wclrtobot(stdscr)
#define clrtoeol() wclrtoeol(stdscr)
#define color_set(c,o) wcolor_set(stdscr,c,o)
#define color_set(c,o) wcolor_set(stdscr,(c),(o))
#define delch() wdelch(stdscr)
#define deleteln() winsdelln(stdscr,-1)
#define echochar(c) wechochar(stdscr,c)
#define echochar(c) wechochar(stdscr,(c))
#define erase() werase(stdscr)
#define getch() wgetch(stdscr)
#define getstr(str) wgetstr(stdscr,str)
#define getstr(str) wgetstr(stdscr,(str))
#define inch() winch(stdscr)
#define inchnstr(s,n) winchnstr(stdscr,s,n)
#define inchstr(s) winchstr(stdscr,s)
#define innstr(s,n) winnstr(stdscr,s,n)
#define insch(c) winsch(stdscr,c)
#define insdelln(n) winsdelln(stdscr,n)
#define inchnstr(s,n) winchnstr(stdscr,(s),(n))
#define inchstr(s) winchstr(stdscr,(s))
#define innstr(s,n) winnstr(stdscr,(s),(n))
#define insch(c) winsch(stdscr,(c))
#define insdelln(n) winsdelln(stdscr,(n))
#define insertln() winsdelln(stdscr,1)
#define insnstr(s,n) winsnstr(stdscr,s,n)
#define insstr(s) winsstr(stdscr,s)
#define instr(s) winstr(stdscr,s)
#define move(y,x) wmove(stdscr,y,x)
#define insnstr(s,n) winsnstr(stdscr,(s),(n))
#define insstr(s) winsstr(stdscr,(s))
#define instr(s) winstr(stdscr,(s))
#define move(y,x) wmove(stdscr,(y),(x))
#define refresh() wrefresh(stdscr)
#define scrl(n) wscrl(stdscr,n)
#define setscrreg(t,b) wsetscrreg(stdscr,t,b)
#define scrl(n) wscrl(stdscr,(n))
#define setscrreg(t,b) wsetscrreg(stdscr,(t),(b))
#define standend() wstandend(stdscr)
#define standout() wstandout(stdscr)
#define timeout(delay) wtimeout(stdscr,delay)
#define timeout(delay) wtimeout(stdscr,(delay))
#define wdeleteln(win) winsdelln(win,-1)
#define winsertln(win) winsdelln(win,1)
@ -1210,70 +1242,75 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /*
* mv functions
*/
#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n))
#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1))
#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n))
#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1))
#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win))
#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o))
#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win))
#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n))
#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str))
#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n))
#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? 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))
#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c))
#define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n))
#define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s))
#define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s))
#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n))
#define mvwaddch(win,y,x,ch) (wmove((win),(y),(x)) == ERR ? ERR : waddch((win),(ch)))
#define mvwaddchnstr(win,y,x,str,n) (wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),(n)))
#define mvwaddchstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),-1))
#define mvwaddnstr(win,y,x,str,n) (wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),(n)))
#define mvwaddstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),-1))
#define mvwdelch(win,y,x) (wmove((win),(y),(x)) == ERR ? ERR : wdelch(win))
#define mvwchgat(win,y,x,n,a,c,o) (wmove((win),(y),(x)) == ERR ? ERR : wchgat((win),(n),(a),(c),(o)))
#define mvwgetch(win,y,x) (wmove((win),(y),(x)) == ERR ? ERR : wgetch(win))
#define mvwgetnstr(win,y,x,str,n) (wmove((win),(y),(x)) == ERR ? ERR : wgetnstr((win),(str),(n)))
#define mvwgetstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : wgetstr((win),(str)))
#define mvwhline(win,y,x,c,n) (wmove((win),(y),(x)) == ERR ? ERR : whline((win),(c),(n)))
#define mvwinch(win,y,x) (wmove((win),(y),(x)) == ERR ? 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)))
#define mvwinsch(win,y,x,c) (wmove((win),(y),(x)) == ERR ? ERR : winsch((win),(c)))
#define mvwinsnstr(win,y,x,s,n) (wmove((win),(y),(x)) == ERR ? ERR : winsnstr((win),(s),(n)))
#define mvwinsstr(win,y,x,s) (wmove((win),(y),(x)) == ERR ? ERR : winsstr((win),(s)))
#define mvwinstr(win,y,x,s) (wmove((win),(y),(x)) == ERR ? ERR : winstr((win),(s)))
#define mvwvline(win,y,x,c,n) (wmove((win),(y),(x)) == ERR ? ERR : wvline((win),(c),(n)))
#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n)
#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str)
#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n)
#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o)
#define mvdelch(y,x) mvwdelch(stdscr,y,x)
#define mvgetch(y,x) mvwgetch(stdscr,y,x)
#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n)
#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
#define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n)
#define mvinch(y,x) mvwinch(stdscr,y,x)
#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n)
#define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s)
#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n)
#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n)
#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s)
#define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s)
#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n)
#define mvaddch(y,x,ch) mvwaddch(stdscr,(y),(x),(ch))
#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,(y),(x),(str),(n))
#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,(y),(x),(str))
#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,(y),(x),(str),(n))
#define mvaddstr(y,x,str) mvwaddstr(stdscr,(y),(x),(str))
#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,(y),(x),(n),(a),(c),(o))
#define mvdelch(y,x) mvwdelch(stdscr,(y),(x))
#define mvgetch(y,x) mvwgetch(stdscr,(y),(x))
#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,(y),(x),(str),(n))
#define mvgetstr(y,x,str) mvwgetstr(stdscr,(y),(x),(str))
#define mvhline(y,x,c,n) mvwhline(stdscr,(y),(x),(c),(n))
#define mvinch(y,x) mvwinch(stdscr,(y),(x))
#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,(y),(x),(s),(n))
#define mvinchstr(y,x,s) mvwinchstr(stdscr,(y),(x),(s))
#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,(y),(x),(s),(n))
#define mvinsch(y,x,c) mvwinsch(stdscr,(y),(x),(c))
#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,(y),(x),(s),(n))
#define mvinsstr(y,x,s) mvwinsstr(stdscr,(y),(x),(s))
#define mvinstr(y,x,s) mvwinstr(stdscr,(y),(x),(s))
#define mvvline(y,x,c,n) mvwvline(stdscr,(y),(x),(c),(n))
/*
* Some wide-character functions can be implemented without the extensions.
*/
#if !NCURSES_OPAQUE
#define getbkgd(win) ((win)->_bkgd)
#define getbkgd(win) ((win) ? ((win)->_bkgd) : 0)
#endif /* NCURSES_OPAQUE */
#define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a))
#define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a))
#if !NCURSES_OPAQUE
#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@
#define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \
(win)->_color = (p), \
#if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@
#define wattr_set(win,a,p,opts) (((win) \
? ((win)->_attrs = ((a) & ~A_COLOR), \
(win)->_color = (p)) \
: OK), \
OK)
#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
(void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \
#define wattr_get(win,a,p,opts) ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
(void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? (win)->_color : 0)) : OK), \
OK)
#else
#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK)
#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
(void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \
#define wattr_set(win,a,p,opts) (((win) \
? ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p))) \
: OK), \
OK)
#define wattr_get(win,a,p,opts) ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
(void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? PAIR_NUMBER((win)->_attrs) : 0)) : OK), \
OK)
#endif
#endif /* NCURSES_OPAQUE */

View File

@ -1,4 +1,4 @@
/* $Id: curses.tail,v 1.20 2010/03/28 19:10:55 tom Exp $ */
/* $Id: curses.tail,v 1.21 2011/10/29 20:03:22 tom Exp $ */
/*
* vile:cmode:
* This file is part of ncurses, designed to be appended after curses.h.in
@ -133,7 +133,7 @@ extern NCURSES_EXPORT(char *) _nc_tracebits (void);
extern NCURSES_EXPORT(char *) _tracechar (int);
extern NCURSES_EXPORT(char *) _tracechtype (chtype);
extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
#ifdef NCURSES_WIDECHAR
#if NCURSES_WIDECHAR
#define _tracech_t _tracecchar_t
extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
#define _tracech_t2 _tracecchar_t2

View File

@ -1,4 +1,4 @@
/* $Id: curses.wide,v 1.42 2010/03/30 00:39:41 tom Exp $ */
/* $Id: curses.wide,v 1.46 2014/02/01 22:00:32 tom Exp $ */
/*
* vile:cmode:
* This file is part of ncurses, designed to be appended after curses.h.in
@ -6,11 +6,11 @@
*/
#define _XOPEN_CURSES 1
#ifdef NCURSES_WIDECHAR
#if NCURSES_WIDECHAR
extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
#define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c])
#define NCURSES_WACS(c) (&_nc_wacs[NCURSES_CAST(unsigned char,(c))])
#define WACS_BSSB NCURSES_WACS('l')
#define WACS_SSBB NCURSES_WACS('m')
@ -135,7 +135,7 @@ 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) getcchar (const cchar_t *, wchar_t*, attr_t*, NCURSES_PAIRS_T*, void*); /* implemented */
extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* generated:WIDEC */
extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* generated:WIDEC */
extern NCURSES_EXPORT(int) in_wch (cchar_t *); /* generated:WIDEC */
@ -185,12 +185,12 @@ extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /*
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 *); /* implemented */
extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */
extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, NCURSES_PAIRS_T, const void *); /* implemented */
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 *, NCURSES_OUTC); /* implemented */
extern NCURSES_EXPORT(int) vid_attr (attr_t, NCURSES_PAIRS_T, void *); /* implemented */
extern NCURSES_EXPORT(int) vid_puts (attr_t, NCURSES_PAIRS_T, void *, NCURSES_OUTC); /* 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 */
@ -221,8 +221,8 @@ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* imple
extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, short, void *); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *); /* implemented:SP_FUNC */
extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
#endif
#ifndef NCURSES_NOMACROS
@ -230,77 +230,77 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, vo
/*
* XSI curses macros for XPG4 conformance.
*/
#define add_wch(c) wadd_wch(stdscr,c)
#define add_wchnstr(str,n) wadd_wchnstr(stdscr,str,n)
#define add_wchstr(str) wadd_wchstr(stdscr,str)
#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n)
#define addwstr(wstr) waddwstr(stdscr,wstr)
#define bkgrnd(c) wbkgrnd(stdscr,c)
#define bkgrndset(c) wbkgrndset(stdscr,c)
#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br)
#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0)
#define echo_wchar(c) wecho_wchar(stdscr,c)
#define get_wch(c) wget_wch(stdscr,c)
#define get_wstr(t) wget_wstr(stdscr,t)
#define getbkgrnd(wch) wgetbkgrnd(stdscr,wch)
#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n)
#define hline_set(c,n) whline_set(stdscr,c,n)
#define in_wch(c) win_wch(stdscr,c)
#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n)
#define in_wchstr(c) win_wchstr(stdscr,c)
#define innwstr(c,n) winnwstr(stdscr,c,n)
#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n)
#define ins_wch(c) wins_wch(stdscr,c)
#define ins_wstr(t) wins_wstr(stdscr,t)
#define inwstr(c) winwstr(stdscr,c)
#define 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 wget_wstr(w,t) wgetn_wstr(w,t,-1)
#define win_wchstr(w,c) win_wchnstr(w,c,-1)
#define wins_wstr(w,t) wins_nwstr(w,t,-1)
#define add_wch(c) wadd_wch(stdscr,(c))
#define add_wchnstr(str,n) wadd_wchnstr(stdscr,(str),(n))
#define add_wchstr(str) wadd_wchstr(stdscr,(str))
#define addnwstr(wstr,n) waddnwstr(stdscr,(wstr),(n))
#define addwstr(wstr) waddwstr(stdscr,(wstr))
#define bkgrnd(c) wbkgrnd(stdscr,(c))
#define bkgrndset(c) wbkgrndset(stdscr,(c))
#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,(l),(r),(t),(b),tl,tr,bl,br)
#define box_set(w,v,h) wborder_set((w),(v),(v),(h),(h),0,0,0,0)
#define echo_wchar(c) wecho_wchar(stdscr,(c))
#define get_wch(c) wget_wch(stdscr,(c))
#define get_wstr(t) wget_wstr(stdscr,(t))
#define getbkgrnd(wch) wgetbkgrnd(stdscr,(wch))
#define getn_wstr(t,n) wgetn_wstr(stdscr,(t),(n))
#define hline_set(c,n) whline_set(stdscr,(c),(n))
#define in_wch(c) win_wch(stdscr,(c))
#define in_wchnstr(c,n) win_wchnstr(stdscr,(c),(n))
#define in_wchstr(c) win_wchstr(stdscr,(c))
#define innwstr(c,n) winnwstr(stdscr,(c),(n))
#define ins_nwstr(t,n) wins_nwstr(stdscr,(t),(n))
#define ins_wch(c) wins_wch(stdscr,(c))
#define ins_wstr(t) wins_wstr(stdscr,(t))
#define inwstr(c) winwstr(stdscr,(c))
#define 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 wget_wstr(w,t) wgetn_wstr((w),(t),-1)
#define win_wchstr(w,c) win_wchnstr((w),(c),-1)
#define wins_wstr(w,t) wins_nwstr((w),(t),-1)
#if !NCURSES_OPAQUE
#define wgetbkgrnd(win,wch) (*wch = win->_bkgrnd, OK)
#define wgetbkgrnd(win,wch) ((win) ? (*(wch) = (win)->_bkgrnd) : *(wch), OK)
#endif
#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c)
#define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,y,x,s,n)
#define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,y,x,s)
#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n)
#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr)
#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c)
#define mvget_wstr(y,x,t) mvwget_wstr(stdscr,y,x,t)
#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n)
#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n)
#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c)
#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n)
#define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,y,x,c)
#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n)
#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n)
#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c)
#define mvins_wstr(y,x,t) mvwins_wstr(stdscr,y,x,t)
#define mvinwstr(y,x,c) mvwinwstr(stdscr,y,x,c)
#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n)
#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,(y),(x),(c))
#define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,(y),(x),(s),(n))
#define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,(y),(x),(s))
#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,(y),(x),(wstr),(n))
#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,(y),(x),(wstr))
#define mvget_wch(y,x,c) mvwget_wch(stdscr,(y),(x),(c))
#define mvget_wstr(y,x,t) mvwget_wstr(stdscr,(y),(x),(t))
#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,(y),(x),(t),(n))
#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,(y),(x),(c),(n))
#define mvin_wch(y,x,c) mvwin_wch(stdscr,(y),(x),(c))
#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,(y),(x),(c),(n))
#define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,(y),(x),(c))
#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,(y),(x),(c),(n))
#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,(y),(x),(t),(n))
#define mvins_wch(y,x,c) mvwins_wch(stdscr,(y),(x),(c))
#define mvins_wstr(y,x,t) mvwins_wstr(stdscr,(y),(x),(t))
#define mvinwstr(y,x,c) mvwinwstr(stdscr,(y),(x),(c))
#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,(y),(x),(c),(n))
#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c))
#define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n))
#define mvwadd_wchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s))
#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n))
#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr))
#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c))
#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t))
#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n))
#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n))
#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c))
#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n))
#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c))
#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n))
#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n))
#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(win,c))
#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t))
#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winwstr(win,c))
#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n))
#define mvwadd_wch(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : wadd_wch((win),(c)))
#define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,(y),(x)) == ERR ? ERR : wadd_wchnstr((win),(s),(n)))
#define mvwadd_wchstr(win,y,x,s) (wmove(win,(y),(x)) == ERR ? ERR : wadd_wchstr((win),(s)))
#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,(y),(x)) == ERR ? ERR : waddnwstr((win),(wstr),(n)))
#define mvwaddwstr(win,y,x,wstr) (wmove(win,(y),(x)) == ERR ? ERR : waddwstr((win),(wstr)))
#define mvwget_wch(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : wget_wch((win),(c)))
#define mvwget_wstr(win,y,x,t) (wmove(win,(y),(x)) == ERR ? ERR : wget_wstr((win),(t)))
#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,(y),(x)) == ERR ? ERR : wgetn_wstr((win),(t),(n)))
#define mvwhline_set(win,y,x,c,n) (wmove(win,(y),(x)) == ERR ? ERR : whline_set((win),(c),(n)))
#define mvwin_wch(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : win_wch((win),(c)))
#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,(y),(x)) == ERR ? ERR : win_wchnstr((win),(c),(n)))
#define mvwin_wchstr(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : win_wchstr((win),(c)))
#define mvwinnwstr(win,y,x,c,n) (wmove(win,(y),(x)) == ERR ? ERR : winnwstr((win),(c),(n)))
#define mvwins_nwstr(win,y,x,t,n) (wmove(win,(y),(x)) == ERR ? ERR : wins_nwstr((win),(t),(n)))
#define mvwins_wch(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : wins_wch((win),(c)))
#define mvwins_wstr(win,y,x,t) (wmove(win,(y),(x)) == ERR ? ERR : wins_wstr((win),(t)))
#define mvwinwstr(win,y,x,c) (wmove(win,(y),(x)) == ERR ? ERR : winwstr((win),(c)))
#define mvwvline_set(win,y,x,c,n) (wmove(win,(y),(x)) == ERR ? ERR : wvline_set((win),(c),(n)))
#endif /* NCURSES_NOMACROS */

View File

@ -1,6 +1,6 @@
# $Id: headers,v 1.10 2009/09/05 17:46:30 tom Exp $
# $Id: headers,v 1.13 2013/10/20 00:32:21 tom Exp $
##############################################################################
# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. #
# Copyright (c) 1998-2012,2013 Free 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,14 +29,24 @@
#
# Author: Thomas E. Dickey 1996-on
#
term.h
curses.h
unctrl.h
termcap.h
ncurses_dll.h
# Support for termcap (and tic, etc.), which can be a separate library
@ termlib
term.h
termcap.h
# Headers used only for tic, other programs using internal interfaces
@ ticlib
$(srcdir)/tic.h
$(srcdir)/term_entry.h
$(srcdir)/nc_tparm.h
# Porting
@ port_win32con
$(srcdir)/ncurses_mingw.h
$(srcdir)/nc_mingw.h
# vile:makemode

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
* Copyright (c) 1998-2012,2013 Free 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: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: nc_alloc.h,v 1.18 2010/11/20 22:59:49 tom Exp $ */
/* $Id: nc_alloc.h,v 1.22 2013/01/26 21:56:51 tom Exp $ */
#ifndef NC_ALLOC_included
#define NC_ALLOC_included 1
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
@ -94,6 +95,7 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC
/* doalloc.c */
extern NCURSES_EXPORT(void *) _nc_doalloc(void *, size_t);
#if !HAVE_STRDUP
#undef strdup
#define strdup _nc_strdup
extern NCURSES_EXPORT(char *) _nc_strdup(const char *);
#endif
@ -101,12 +103,14 @@ extern NCURSES_EXPORT(char *) _nc_strdup(const char *);
/* entries.c */
extern NCURSES_EXPORT(void) _nc_leaks_tinfo(void);
#define typeMalloc(type,elts) (type *)malloc((elts)*sizeof(type))
#define typeCalloc(type,elts) (type *)calloc((elts),sizeof(type))
#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (elts)*sizeof(type))
#define typeMalloc(type,elts) (type *)malloc((size_t)(elts)*sizeof(type))
#define typeCalloc(type,elts) (type *)calloc((size_t)(elts),sizeof(type))
#define typeRealloc(type,elts,ptr) (type *)_nc_doalloc(ptr, (size_t)(elts)*sizeof(type))
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* NC_ALLOC_included */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
* Copyright (c) 2012,2013 Free 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,36 +26,52 @@
* authorization. *
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey 2012 *
****************************************************************************/
#ifndef STRING_HACKS_H
#define STRING_HACKS_H 1
#include <ncurses_cfg.h>
/*
* $Id: tty_input.h,v 1.2 2000/12/10 02:26:51 tom Exp $
* $Id: nc_string.h,v 1.4 2013/12/15 01:09:19 tom Exp $
*
* String-hacks. Use these macros to stifle warnings on (presumably) correct
* uses of strcat, strcpy and sprintf.
*
* By the way -
* A fundamental limitation of the interfaces (and frequent issue in bug
* reports using these functions) is that sizes are passed as unsigned values
* (with associated sign-extension problems), limiting their effectiveness
* when checking for buffer overflow.
*/
#ifndef TTY_INPUT_H
#define TTY_INPUT_H 1
#ifdef __cplusplus
#define NCURSES_VOID /* nothing */
#else
#define NCURSES_VOID (void)
#endif
extern NCURSES_EXPORT(bool) _nc_tty_mouse_mask (mmask_t);
extern NCURSES_EXPORT(bool) _nc_tty_pending (void);
extern NCURSES_EXPORT(int) _nc_tty_next_event (int);
extern NCURSES_EXPORT(void) _nc_tty_flags_changed (void);
extern NCURSES_EXPORT(void) _nc_tty_flush (void);
extern NCURSES_EXPORT(void) _nc_tty_input_resume (void);
extern NCURSES_EXPORT(void) _nc_tty_input_suspend (void);
#if USE_STRING_HACKS && HAVE_STRLCAT
#define _nc_STRCAT(d,s,n) NCURSES_VOID strlcat((d),(s),NCURSES_CAST(size_t,n))
#else
#define _nc_STRCAT(d,s,n) NCURSES_VOID strcat((d),(s))
#endif
struct tty_input_data {
int _ifd; /* input file ptr for screen */
int _keypad_xmit; /* current terminal state */
int _meta_on; /* current terminal state */
#if USE_STRING_HACKS && HAVE_STRLCPY
#define _nc_STRCPY(d,s,n) NCURSES_VOID strlcpy((d),(s),NCURSES_CAST(size_t,n))
#else
#define _nc_STRCPY(d,s,n) NCURSES_VOID strcpy((d),(s))
#endif
/*
* These are the data that support the mouse interface.
*/
bool (*_mouse_event) (SCREEN *);
bool (*_mouse_inline)(SCREEN *);
bool (*_mouse_parse) (int);
void (*_mouse_resume)(SCREEN *);
void (*_mouse_wrap) (SCREEN *);
int _mouse_fd; /* file-descriptor, if any */
int mousetype;
};
#if USE_STRING_HACKS && HAVE_SNPRINTF
#define _nc_SPRINTF NCURSES_VOID snprintf
#define _nc_SLIMIT(n) NCURSES_CAST(size_t,n),
#else
#define _nc_SPRINTF NCURSES_VOID sprintf
#define _nc_SLIMIT(n) /* nothing */
#endif
#endif /* TTY_INPUT_H */
#endif /* STRING_HACKS_H */

View File

@ -0,0 +1,171 @@
/****************************************************************************
* Copyright (c) 2011 Free 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 2011 *
****************************************************************************/
/* $Id: nc_termios.h,v 1.2 2011/06/25 20:44:05 tom Exp $ */
#ifndef NC_TERMIOS_included
#define NC_TERMIOS_included 1
#if HAVE_TERMIOS_H && HAVE_TCGETATTR
#else /* !HAVE_TERMIOS_H */
#if HAVE_TERMIO_H
/* Add definitions to make termio look like termios.
* But ifdef it, since there are some implementations
* that try to do this for us in a fake <termio.h>.
*/
#ifndef TCSADRAIN
#define TCSADRAIN TCSETAW
#endif
#ifndef TCSAFLUSH
#define TCSAFLUSH TCSETAF
#endif
#ifndef tcsetattr
#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
#endif
#ifndef tcgetattr
#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
#endif
#ifndef cfgetospeed
#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
#endif
#ifndef TCIFLUSH
#define TCIFLUSH 0
#endif
#ifndef tcflush
#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
#endif
#else /* !HAVE_TERMIO_H */
#if __MINGW32__
/* c_cc chars */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VTIME 5
#define VMIN 6
/* c_iflag bits */
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#define BRKINT 0000002
#define PARMRK 0000010
#define IXON 0002000
#define IGNBRK 0000001
#define IGNPAR 0000004
#define INPCK 0000020
#define IXOFF 0010000
/* c_oflag bits */
#define OPOST 0000001
/* c_cflag bit meaning */
#define CBAUD 0010017
#define CSIZE 0000060
#define CS8 0000060
#define B0 0000000
#define B50 0000001
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define CLOCAL 0004000
#define CREAD 0000200
#define CSTOPB 0000100
#define HUPCL 0002000
#define PARENB 0000400
#define PARODD 0001000
/* c_lflag bits */
#define ECHO 0000010
#define ECHONL 0000100
#define ISIG 0000001
#define IEXTEN 0100000
#define ICANON 0000002
#define NOFLSH 0000200
#define ECHOE 0000020
#define ECHOK 0000040
/* tcflush() */
#define TCIFLUSH 0
/* tcsetattr uses these */
#define TCSADRAIN 1
/* ioctls */
#define TCGETA 0x5405
#define TCFLSH 0x540B
#define TIOCGWINSZ 0x5413
#ifndef cfgetospeed
#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
#endif
#ifndef tcsetattr
#define tcsetattr(fd, cmd, arg) _nc_mingw_ioctl(fd, cmd, arg)
#endif
#ifndef tcgetattr
#define tcgetattr(fd, arg) _nc_mingw_ioctl(fd, TCGETA, arg)
#endif
#ifndef tcflush
#define tcflush(fd, arg) _nc_mingw_ioctl(fd, TCFLSH, arg)
#endif
#undef ttyname
#define ttyname(fd) NULL
#else
#endif /* __MINGW32__ */
#endif /* HAVE_TERMIO_H */
#endif /* HAVE_TERMIOS_H */
#endif /* NC_TERMIOS_included */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2006,2010 Free Software Foundation, Inc. *
* Copyright (c) 2006-2010,2012 Free 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 2006 *
****************************************************************************/
/* $Id: nc_tparm.h,v 1.5 2010/12/25 20:27:22 tom Exp $ */
/* $Id: nc_tparm.h,v 1.6 2012/02/18 21:34:42 tom Exp $ */
#ifndef NC_TPARM_included
#define NC_TPARM_included 1
@ -40,8 +40,12 @@
* assumption of the varargs code.
*/
#ifndef TPARM_ARG
#ifdef NCURSES_TPARM_ARG
#define TPARM_ARG NCURSES_TPARM_ARG
#else
#define TPARM_ARG long
#endif
#endif /* TPARAM_ARG */
#define TPARM_N(n) (TPARM_ARG)(n)

View File

@ -1,6 +1,6 @@
# $Id: ncurses_defs,v 1.46 2011/03/22 09:17:59 tom Exp $
# $Id: ncurses_defs,v 1.62 2013/12/14 23:52:07 tom Exp $
##############################################################################
# Copyright (c) 2000-2010,2011 Free Software Foundation, Inc. #
# Copyright (c) 2000-2012,2013 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@ -33,7 +33,7 @@
BROKEN_LINKER
BSD_TPUTS
CC_HAS_PROTOS
CGETENT_CONST /* nothing */
CPP_HAS_PARAM_INIT
CURSES_ACS_ARRAY acs_map
CURSES_WACS_ARRAY _nc_wacs
@ -41,6 +41,7 @@ DECL_ERRNO
ETIP_NEEDS_MATH_H
GCC_NORETURN /* nothing */
GCC_UNUSED /* nothing */
HAVE_ASSUME_DEFAULT_COLORS
HAVE_BIG_CORE
HAVE_BSD_CGETENT
HAVE_BSD_SIGNAL_H
@ -69,6 +70,7 @@ HAVE_GPM_H
HAVE_GPP_BUILTIN_H
HAVE_GXX_BUILTIN_H
HAVE_HAS_KEY
HAVE_INTTYPES_H
HAVE_IOSTREAM
HAVE_ISASCII
HAVE_ISSETUGID
@ -102,6 +104,7 @@ HAVE_PANEL_H
HAVE_POLL
HAVE_POLL_H
HAVE_PURIFY
HAVE_PUTENV
HAVE_PUTWC
HAVE_PUTWIN 1
HAVE_REGEXPR_H_FUNCS
@ -115,6 +118,7 @@ HAVE_SCR_DUMP 1
HAVE_SELECT
HAVE_SETBUF
HAVE_SETBUFFER
HAVE_SETENV
HAVE_SETUPTERM 1
HAVE_SETVBUF
HAVE_SGTTY_H
@ -123,7 +127,11 @@ HAVE_SIGVEC
HAVE_SIZECHANGE
HAVE_SLK_COLOR
HAVE_SLK_INIT 1
HAVE_SNPRINTF
HAVE_STDINT_H
HAVE_STRDUP
HAVE_STRLCAT
HAVE_STRLCPY
HAVE_STRSTR
HAVE_SYMLINK
HAVE_SYS_BSDTYPES_H
@ -153,9 +161,12 @@ HAVE_TYPEAHEAD 1
HAVE_TYPEINFO
HAVE_TYPE_ATTR_T
HAVE_TYPE_SIGACTION
HAVE_UNCTRL_H 1
HAVE_UNISTD_H
HAVE_UNLINK
HAVE_USE_DEFAULT_COLORS
HAVE_USE_SCREEN
HAVE_USE_WINDOW
HAVE_VFSCANF
HAVE_VSNPRINTF
HAVE_VSSCANF
@ -175,11 +186,12 @@ NCURSES_EXPANDED
NCURSES_EXT_COLORS
NCURSES_EXT_FUNCS
NCURSES_NO_PADDING
NCURSES_OSPEED_COMPAT
NCURSES_PATHSEP ':'
NCURSES_WIDECHAR
NEED_PTEM_H
NO_LEAKS
PURE_TERMINFO
RETSIGTYPE
STDC_HEADERS
SVR4_ACTION
SVR4_TERMIO
@ -189,7 +201,6 @@ TERMPATH "none"
TIME_WITH_SYS_TIME
TYPEOF_CHTYPE
USE_COLORFGBG
USE_DATABASE
USE_GETCAP
USE_GETCAP_CACHE
USE_HARD_TABS
@ -205,9 +216,9 @@ USE_REENTRANT
USE_SAFE_SPRINTF
USE_SCROLL_HINTS
USE_SIGWINCH
USE_STRING_HACKS
USE_SYMLINKS
USE_SYSMOUSE
USE_TERMCAP
USE_WEAK_SYMBOLS
USE_WIDEC_SUPPORT
USE_XMC_SUPPORT

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -31,10 +31,10 @@
* *
****************************************************************************/
/* $Id: ncurses_mingw.h,v 1.1 2008/12/14 19:22:16 juergen Exp $ */
/* $Id: ncurses_mingw.h,v 1.2 2011/06/25 20:51:00 tom Exp $ */
/*
* This is a placholder up to now and describes what needs to be implemented
* This is a placeholder up to now and describes what needs to be implemented
* to support I/O to external terminals with ncurses on the Windows OS.
*/
@ -67,98 +67,8 @@ struct termios
speed_t c_ospeed; /* c_ospeed */
};
/* c_cc chars */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VTIME 5
#define VMIN 6
/* c_iflag bits */
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#define BRKINT 0000002
#define PARMRK 0000010
#define IXON 0002000
#define IGNBRK 0000001
#define IGNPAR 0000004
#define INPCK 0000020
#define IXOFF 0010000
/* c_oflag bits */
#define OPOST 0000001
/* c_cflag bit meaning */
#define CBAUD 0010017
#define CSIZE 0000060
#define CS8 0000060
#define B0 0000000
#define B50 0000001
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define CLOCAL 0004000
#define CREAD 0000200
#define CSTOPB 0000100
#define HUPCL 0002000
#define PARENB 0000400
#define PARODD 0001000
/* c_lflag bits */
#define ECHO 0000010
#define ECHONL 0000100
#define ISIG 0000001
#define IEXTEN 0100000
#define ICANON 0000002
#define NOFLSH 0000200
#define ECHOE 0000020
#define ECHOK 0000040
/* tcflush() */
#define TCIFLUSH 0
/* tcsetattr uses these */
#define TCSADRAIN 1
/* ioctls */
#define TCGETA 0x5405
#define TCFLSH 0x540B
#define TIOCGWINSZ 0x5413
extern int _nc_mingw_ioctl(int fd, long int request, struct termios* arg);
extern void _nc_set_term_driver(void* term);
#ifndef cfgetospeed
#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
#endif
#ifndef tcsetattr
#define tcsetattr(fd, cmd, arg) _nc_mingw_ioctl(fd, cmd, arg)
#endif
#ifndef tcgetattr
#define tcgetattr(fd, arg) _nc_mingw_ioctl(fd, TCGETA, arg)
#endif
#ifndef tcflush
#define tcflush(fd, arg) _nc_mingw_ioctl(fd, TCFLSH, arg)
#endif
#undef ttyname
#define ttyname(fd) NULL
#endif
#endif
#endif /* _NC_MINGWH */
#endif /* __MINGW32__ */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -32,7 +32,7 @@
* and: Thomas E. Dickey 1998-on *
****************************************************************************/
/* $Id: term_entry.h,v 1.37 2009/07/11 16:52:29 tom Exp $ */
/* $Id: term_entry.h,v 1.44 2013/05/25 20:13:38 tom Exp $ */
/*
* term_entry.h -- interface to entry-manipulation code
@ -47,28 +47,46 @@ extern "C" {
#include <term.h>
/*
* see db_iterator.c - this enumeration lists the places searched for a
* terminal description and defines the order in which they are searched.
*/
typedef enum {
dbdTIC = 0, /* special, used by tic when writing entry */
#if NCURSES_USE_DATABASE
dbdEnvOnce, /* the $TERMINFO environment variable */
dbdHome, /* $HOME/.terminfo */
dbdEnvList, /* the $TERMINFO_DIRS environment variable */
dbdCfgList, /* the compiled-in TERMINFO_DIRS value */
dbdCfgOnce, /* the compiled-in TERMINFO value */
#endif
#if NCURSES_USE_TERMCAP
dbdEnvOnce2, /* the $TERMCAP environment variable */
dbdEnvList2, /* the $TERMPATH environment variable */
dbdCfgList2, /* the compiled-in TERMPATH */
#endif
dbdLAST
} DBDIRS;
#define MAX_USES 32
#define MAX_CROSSLINKS 16
typedef struct entry {
TERMTYPE tterm;
unsigned nuses;
struct
{
char *name;
struct entry *link;
long line;
}
uses[MAX_USES];
int ncrosslinks;
struct entry *crosslinks[MAX_CROSSLINKS];
long cstart, cend;
long startline;
struct entry *next;
struct entry *last;
}
ENTRY;
typedef struct entry {
TERMTYPE tterm;
unsigned nuses;
struct {
char *name;
struct entry *link;
long line;
} uses[MAX_USES];
int ncrosslinks;
struct entry *crosslinks[MAX_CROSSLINKS];
long cstart, cend;
long startline;
struct entry *next;
struct entry *last;
} ENTRY;
/* *INDENT-OFF* */
#if NCURSES_XNAMES
#define NUM_BOOLEANS(tp) (tp)->num_Booleans
#define NUM_NUMBERS(tp) (tp)->num_Numbers
@ -132,7 +150,7 @@ extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool);
/* alloc_ttype.c: elementary allocation code */
extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *);
extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, TERMTYPE *);
extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, const TERMTYPE *);
/* free_ttype.c: elementary allocation code */
extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *);
@ -166,9 +184,9 @@ extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool);
/* trace_xnames.c */
extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *);
/* *INDENT-ON* */
#ifdef __cplusplus
}
#endif
#endif /* NCURSES_TERM_ENTRY_H_incl */
#endif /* NCURSES_TERM_ENTRY_H_incl */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. *
* Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@ -33,14 +33,14 @@
****************************************************************************/
/*
* $Id: tic.h,v 1.65 2009/08/08 17:52:46 tom Exp $
* $Id: tic.h,v 1.69 2012/03/17 18:22:10 tom Exp $
* tic.h - Global variables and structures for the terminfo
* compiler.
*/
#ifndef __TIC_H
#define __TIC_H
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
@ -224,6 +224,12 @@ extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
#define NOTFOUND ((struct name_table_entry *) 0)
/*
* The casts are required for correct sign-propagation with systems such as
* AIX, IRIX64, Solaris which default to unsigned characters. The C standard
* leaves this detail unspecified.
*/
/* out-of-band values for representing absent capabilities */
#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */
#define ABSENT_NUMERIC (-1)
@ -248,6 +254,8 @@ extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
#define TERMINFO "/usr/share/terminfo"
#endif
#ifdef NCURSES_TERM_ENTRY_H_incl
/* access.c */
extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *);
extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *);
@ -270,6 +278,7 @@ extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
extern NCURSES_EXPORT_VAR(int) _nc_curr_col;
extern NCURSES_EXPORT_VAR(int) _nc_curr_line;
extern NCURSES_EXPORT_VAR(int) _nc_syntax;
extern NCURSES_EXPORT_VAR(int) _nc_strict_bsd;
extern NCURSES_EXPORT_VAR(long) _nc_comment_end;
extern NCURSES_EXPORT_VAR(long) _nc_comment_start;
extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos;
@ -314,23 +323,6 @@ extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent *
extern const char * _nc_progname;
/* 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 *);
@ -339,8 +331,11 @@ extern NCURSES_EXPORT(void) _nc_last_db(void);
/* write_entry.c */
extern NCURSES_EXPORT(int) _nc_tic_written (void);
#endif /* NCURSES_TERM_ENTRY_H_incl */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* __TIC_H */

View File

@ -1,6 +1,6 @@
# $Id: Makefile.in,v 1.45 2010/11/27 21:45:27 tom Exp $
# $Id: Makefile.in,v 1.47 2013/08/04 20:23:20 tom Exp $
##############################################################################
# Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. #
# Copyright (c) 1998-2010,2013 Free 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"), #
@ -41,8 +41,12 @@ DESTDIR = @DESTDIR@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
includesubdir = @includesubdir@
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2013 Free 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.8 2010/12/04 18:36:44 tom Exp $
.\" $Id: clear.1,v 1.10 2013/06/22 22:22:11 tom Exp $
.TH @CLEAR@ 1 ""
.ds n 5
.SH NAME
@ -35,9 +35,10 @@
\fB@CLEAR@\fR
.br
.SH DESCRIPTION
\fB@CLEAR@\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.
\fB@CLEAR@\fR clears your screen if this is possible,
including its scrollback buffer (if the extended "E3" capability is defined).
\fB@CLEAR@\fR looks in the environment for the terminal type and then in the
\fBterminfo\fR database to determine how to clear the screen.
.PP
\fB@CLEAR@\fR ignores any command-line parameters that may be present.
.SH SEE ALSO

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2001-2010,2011 Free Software Foundation, Inc. *
.\" Copyright (c) 2001-2011,2012 Free 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.14 2011/01/15 15:27:43 tom Exp $
.\" $Id: curs_add_wch.3x,v 1.15 2012/11/03 23:03:59 tom Exp $
.TH curs_add_wch 3X ""
.de bP
.IP \(bu 4
@ -176,7 +176,7 @@ WACS_D_HLINE 0x2550 - double horizontal line
WACS_D_VLINE 0x2551 | double vertical line
WACS_D_PLUS 0x256c + double large plus or crossover
.TE
.SH RETURN VALUES
.SH RETURN VALUE
.PP
All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.PP

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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,8 +26,13 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_add_wchstr.3x,v 1.9 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_add_wchstr.3x,v 1.10 2012/11/03 22:54:43 tom Exp $
.TH curs_add_wchstr 3X ""
.de bP
.IP \(bu 4
..
.na
.hy 0
.SH NAME
\fBadd_wchstr\fR,
\fBadd_wchnstr\fR,
@ -37,10 +42,12 @@
\fBmvadd_wchnstr\fR,
\fBmvwadd_wchstr\fR,
\fBmvwadd_wchnstr\fR \- add an array of complex characters (and attributes) to a curses window
.ad
.hy
.SH SYNOPSIS
.B #include <curses.h>
.PP
.nf
\fB#include <curses.h>\fR
.PP
\fBint add_wchstr(const cchar_t *\fR\fIwchstr\fR\fB);\fR
.br
\fBint add_wchnstr(const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
@ -58,38 +65,53 @@
\fBint mvwadd_wchnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const cchar_t *\fR\fIwchstr\fR\fB, int \fR\fIn\fR\fB);\fR
.fi
.SH DESCRIPTION
These routines copy the array of complex characters \fIwchstr\fR
into the window image structure at and after the current cursor position.
The four routines with \fIn\fR as the last
argument copy at most \fIn\fR elements, but no more than will fit on the line.
These functions copy the (null-terminated)
array of complex characters \fIwchstr\fR
into the window image structure
starting at the current cursor position.
The four functions with \fIn\fR as the last
argument copy at most \fIn\fR elements,
but no more than will fit on the line.
If \fBn\fR=\fB\-1\fR then the whole array is copied,
to the maximum number of characters that will fit on the line.
.PP
The window cursor is \fInot\fR advanced.
These routines work faster than \fBwaddnstr\fR.
On the other hand, they do not perform checking
These functions work faster than \fBwaddnstr\fR.
On the other hand:
.bP
they do not perform checking
(such as for the newline, backspace, or carriage return characters),
.bP
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,
.bP
they do not expand other control characters to ^-escapes, and
.bP
they truncate the string if it crosses the right margin,
rather than wrapping it around to the new line.
.PP
These routines end successfully
These functions end successfully
on encountering a null \fIcchar_t\fR, or
when they have filled the current line.
If a complex character cannot completely fit at the end of the current line,
the remaining columns are filled with the background character and rendition.
.SH NOTES
All functions except \fBwadd_wchnstr\fR may be macros.
.SH RETURN VALUES
All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.SH RETURN VALUE
All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.PP
X/Open does not define any error conditions.
This implementation returns an error
if the window pointer is null.
.PP
Functions with a "mv" prefix first perform a cursor movement using
\fBwmove\fP, and return an error if the position is outside the window,
or if the window pointer is null.
.SH NOTES
All functions except \fBwadd_wchnstr\fR may be macros.
.SH PORTABILITY
All these entry points are described in the XSI Curses standard, Issue 4.
These entry points are described in the XSI Curses standard, Issue 4.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_addchstr\fR(3X),
\fBcurs_addwstr\fR(3X)
\fBcurs_addwstr\fR(3X),
\fBcurses\fR(3X).
.PP
Comparable functions in the narrow-character (ncurses) library are
described in
\fBcurs_addchstr\fR(3X).

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2012 Free 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,8 +26,11 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_addchstr.3x,v 1.15 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_addchstr.3x,v 1.16 2012/11/03 22:54:43 tom Exp $
.TH curs_addchstr 3X ""
.de bP
.IP \(bu 4
..
.na
.hy 0
.SH NAME
@ -42,6 +45,7 @@
.ad
.hy
.SH SYNOPSIS
.nf
\fB#include <curses.h>\fR
.PP
\fBint addchstr(const chtype *chstr);\fR
@ -59,24 +63,33 @@
\fBint mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr);\fR
.br
\fBint mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);\fR
.fi
.SH DESCRIPTION
These routines copy \fIchstr\fR into the window image structure at and after
the current cursor position. The four routines with \fIn\fR as the last
argument copy at most \fIn\fR elements, but no more than will fit on the line.
If \fBn\fR=\fB\-1\fR then the whole string is copied, to the maximum number of
characters that will fit on the line.
These functions copy the (null-terminated)
\fIchstr\fR array
into the window image structure
starting at the current cursor position.
The four functions with \fIn\fR as the last
argument copy at most \fIn\fR elements,
but no more than will fit on the line.
If \fBn\fR=\fB\-1\fR then the whole array is copied,
to the maximum number of characters that will fit on the line.
.PP
The window cursor is \fInot\fR advanced, and these routines work faster than
\fBwaddnstr\fR. On the other hand, they do not perform any kind of checking
(such as for the newline, backspace, or carriage return characters), they do not
advance the current cursor position, they do not expand other control characters
to ^-escapes, and they truncate the string if it crosses the right margin,
The window cursor is \fInot\fR advanced.
These functions work faster than \fBwaddnstr\fR.
On the other hand:
.bP
they do not perform checking
(such as for the newline, backspace, or carriage return characters),
.bP
they do not advance the current cursor position,
.bP
they do not expand other control characters to ^-escapes, and
.bP
they truncate the string if it crosses the right margin,
rather than wrapping it around to the new line.
.SH RETURN VALUES
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
successful completion, unless otherwise noted in the preceding routine
descriptions.
.SH RETURN VALUE
All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.PP
X/Open does not define any error conditions.
This implementation returns an error
@ -86,10 +99,11 @@ Functions with a "mv" prefix first perform a cursor movement using
\fBwmove\fP, and return an error if the position is outside the window,
or if the window pointer is null.
.SH NOTES
Note that all routines except \fBwaddchnstr\fR may be macros.
All functions except \fBwaddchnstr\fR may be macros.
.SH PORTABILITY
These entry points are described in the XSI Curses standard, Issue 4.
.SH SEE ALSO
\fBcurs_addstr\fR(3X),
\fBcurses\fR(3X).
.PP
Comparable functions in the wide-character (ncursesw) library are

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2012 Free 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,8 +26,11 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_addstr.3x,v 1.16 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_addstr.3x,v 1.17 2012/11/03 22:57:31 tom Exp $
.TH curs_addstr 3X ""
.de bP
.IP \(bu 4
..
.na
.hy 0
.SH NAME
@ -62,34 +65,37 @@
\fBint mvwaddnstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const char *\fR\fIstr, int \fR\fIn\fR\fB);\fR
.fi
.SH DESCRIPTION
These routines write the characters of the (null-terminated) character string
These functions write the (null-terminated) character string
\fIstr\fR on the given window.
It is similar to calling \fBwaddch\fR once for each character in the string.
The four routines with \fIn\fR as the last argument
write at most \fIn\fR characters.
If \fIn\fR is \-1, then the entire string will be added,
up to the maximum number of characters that will fit on the line,
.PP
The \fImv\fR functions perform cursor movement once, before writing any
characters.
Thereafter, the cursor is advanced as a side-effect of writing to the window.
.PP
The four functions with \fIn\fR as the last argument
write at most \fIn\fR characters,
or until a terminating null is reached.
If \fIn\fR is \-1, then the entire string will be added.
.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
successful completion.
All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.PP
X/Open does not define any error conditions.
This implementation returns an error
.bP
if the window pointer is null or
.bP
if the string pointer is null or
.bP
if the corresponding calls to \fBwaddch\fP return an error.
.PP
Functions with a "mv" prefix first perform a cursor movement using
\fBwmove\fP, and return an error if the position is outside the window,
or if the window pointer is null.
.SH NOTES
Note that all of these routines except \fBwaddstr\fR and \fBwaddnstr\fR may be
macros.
All of these functions except \fBwaddnstr\fR may be macros.
.SH PORTABILITY
All these entry points are described in the XSI Curses standard, Issue 4. The
XSI errors EILSEQ and EOVERFLOW, associated with extended-level conformance,
are not yet detected.
These functions are described in the XSI Curses standard, Issue 4.
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_addch\fR(3X).
\fBcurses\fR(3X),
\fBcurs_addch\fR(3X).

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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,8 +26,11 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_addwstr.3x,v 1.10 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_addwstr.3x,v 1.11 2012/11/03 22:57:31 tom Exp $
.TH curs_addwstr 3X ""
.de bP
.IP \(bu 4
..
.na
.hy 0
.SH NAME
@ -62,31 +65,39 @@
\fBint mvwaddnwstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, const wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
.fi
.SH DESCRIPTION
These routines write the characters of the
These functions write the characters of the
(null-terminated) \fBwchar_t\fR character string
\fIwstr\fR on the given window.
It is similar to constructing a \fBcchar_t\fR for each wchar_t in the string,
then calling \fBwadd_wch\fR for the resulting \fBcchar_t\fR.
.PP
The \fImv\fR routines perform cursor movement once, before writing any
The \fImv\fR functions perform cursor movement once, before writing any
characters.
Thereafter, the cursor is advanced as a side-effect of writing to the window.
.PP
The four routines with \fIn\fR as the last argument
write at most \fIn\fR \fBwchar_t\fR characters.
If \fIn\fR is \-1, then the entire string will be added,
up to the maximum number of characters that will fit on the line,
The four functions with \fIn\fR as the last argument
write at most \fIn\fR \fBwchar_t\fR characters,
or until a terminating null is reached.
.SH RETURN VALUES
All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
If \fIn\fR is \-1, then the entire string will be added.
.SH RETURN VALUE
All functions return the integer \fBERR\fR upon failure and \fBOK\fR on success.
.PP
X/Open does not define any error conditions.
This implementation returns an error
.bP
if the window pointer is null or
.bP
if the string pointer is null or
.bP
if the corresponding calls to \fBwadd_wch\fP return an error.
.PP
Functions with a "mv" prefix first perform a cursor movement using
\fBwmove\fP, and return an error if the position is outside the window,
or if the window pointer is null.
.SH NOTES
Note that all of these routines except \fBwaddnwstr\fR may be macros.
All of these functions except \fBwaddnwstr\fR may be macros.
.SH PORTABILITY
All these entry points are described in the XSI Curses standard, Issue 4.
These functions are described in the XSI Curses standard, Issue 4.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_add_wch\fR(3X)

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_attr.3x,v 1.36 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_attr.3x,v 1.39 2013/09/21 20:39:49 Sven.Joachim Exp $
.TH curs_attr 3X ""
.na
.hy 0
@ -164,9 +164,12 @@ The following video attributes, defined in \fB<curses.h>\fR, can be passed to
the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'd with the
characters passed to \fBaddch\fR.
.PP
.RS
.TS
center ;
l l
_ _ _
l l .
\fIName\fR \fIDescription\fR
\fBA_NORMAL\fR Normal display (no highlight)
\fBA_STANDOUT\fR Best highlighting mode of the terminal.
\fBA_UNDERLINE\fR Underlining
@ -177,9 +180,30 @@ l l .
\fBA_PROTECT\fR Protected mode
\fBA_INVIS\fR Invisible or blank mode
\fBA_ALTCHARSET\fR Alternate character set
\fBA_ITALIC\fR Italics (non-X/Open extension)
\fBA_CHARTEXT\fR Bit-mask to extract a character
\fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR Color-pair number \fIn\fR
.TE
.RE
.PP
These video attributes are supported by \fBattr_on\fP and related functions
(which also support the attributes recognized by \fBattron\fP, etc.):
.RS
.TS
l l
_ _ _
l l .
\fIName\fR \fIDescription\fR
\fBWA_HORIZONTAL\fR Horizontal highlight
\fBWA_LEFT\fR Left highlight
\fBWA_LOW\fR Low highlight
\fBWA_RIGHT\fR Right highlight
\fBWA_TOP\fR Top highlight
\fBWA_VERTICAL\fR Vertical highlight
.TE
.RE
.PP
For consistency
.PP
The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR:
.PP
@ -214,19 +238,27 @@ The XSI Curses standard states that whether the traditional functions
SVr4 curses, these functions correctly manipulate all other highlights
(specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
.PP
This implementation provides the \fBA_ITALIC\fP attribute for terminals
which have the \fIenter_italics_mode\fP (sitm) and \fIexit_italics_mode\fP (ritm) capabilities.
Italics are not mentioned in X/Open Curses.
Unlike the other video attributes, \fBI_ITALIC\fP is unrelated
to the \fIset_attributes\fP capabilities.
This implementation makes the assumption that
\fIexit_attribute_mode\fP may also reset italics.
.PP
XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR,
\fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
\fBwattr_get\fR, \fBwattr_set\fR. These are intended to work with
a new series of highlight macros prefixed with \fBWA_\fR.
The older macros have direct counterparts in the newer set of names:
.PP
Older versions of this library did not force an update of the screen
when changing the attributes.
Use \fBtouchwin\fR to force the screen to match the updated attributes.
.PP
.RS
.ne 9
.TS
center ;
l l
_ _ _
l l .
\fIName\fR \fIDescription\fR
\fBWA_NORMAL\fR Normal display (no highlight)
\fBWA_STANDOUT\fR Best highlighting mode of the terminal.
\fBWA_UNDERLINE\fR Underlining
@ -236,6 +268,11 @@ l l .
\fBWA_BOLD\fR Extra bright or bold
\fBWA_ALTCHARSET\fR Alternate character set
.TE
.RE
.PP
Older versions of this library did not force an update of the screen
when changing the attributes.
Use \fBtouchwin\fR to force the screen to match the updated attributes.
.PP
The XSI curses standard specifies that each pair of corresponding \fBA_\fR
and \fBWA_\fR-using functions operates on the same current-highlight
@ -243,8 +280,10 @@ information.
.PP
The XSI standard extended conformance level adds new highlights
\fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
\fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this
implementation does not yet support.
\fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each).
As of August 2013,
no known terminal provides these highlights
(i.e., via the \fBsgr1\fP capability).
.SH RETURN VALUE
All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
.PP

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_bkgrnd.3x,v 1.4 2010/12/04 18:49:20 tom Exp $
.\" $Id: curs_bkgrnd.3x,v 1.5 2012/11/03 23:03:59 tom Exp $
.TH curs_bkgrnd 3X ""
.SH NAME
\fBbkgrnd\fR,
@ -89,7 +89,7 @@ Note that
\fBbkgrndset\fR, and
\fBgetbkgrnd\fR
may be macros.
.SH RETURN VALUES
.SH RETURN VALUE
The \fBbkgrndset\fR and \fBwbkgrndset\fR routines do not return a value.
.PP
Upon successful completion, the other functions return \fBOK\fR.

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2010,2011 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2011,2012 Free 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_border_set.3x,v 1.10 2011/01/15 12:56:18 tom Exp $
.\" $Id: curs_border_set.3x,v 1.11 2012/11/03 23:03:59 tom Exp $
.TH curs_border_set 3X ""
.na
.hy 0
@ -187,7 +187,7 @@ Note that
\fBvline_set\fR
may be macros.
.br
.SH RETURN VALUES
.SH RETURN VALUE
.PP
Upon successful completion, these functions return
\fBOK\fR.

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_get_wch.3x,v 1.7 2010/08/14 23:31:42 tom Exp $
.\" $Id: curs_get_wch.3x,v 1.8 2012/11/03 23:03:59 tom Exp $
.TH curs_get_wch 3X ""
.SH NAME
\fBget_wch\fR,
@ -132,7 +132,7 @@ is typed, the program may produce undesirable results.
.PP
All functions except \fBwget_wch\fR and \fBunget_wch\fR
may be macros.
.SH RETURN VALUES
.SH RETURN VALUE
When
\fBget_wch\fR,
\fBwget_wch\fR,

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_get_wstr.3x,v 1.8 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_get_wstr.3x,v 1.9 2012/11/03 23:03:59 tom Exp $
.TH curs_get_wstr 3X ""
.na
.hy 0
@ -144,7 +144,7 @@ These functions cannot return \fBKEY_\fR values because there
is no way to distinguish a \fBKEY_\fR value from a valid \fBwchar_t\fR value.
.PP
All of these routines except \fBwgetn_wstr\fR may be macros.
.SH RETURN VALUES
.SH RETURN VALUE
All of these functions return \fBOK\fR upon successful completion.
Otherwise, they return \fBERR\fR.
.PP

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2001-2010,2012 Free 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_getcchar.3x,v 1.15 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_getcchar.3x,v 1.16 2012/11/03 23:03:59 tom Exp $
.TH curs_getcchar 3X ""
.de bP
.IP \(bu 4
@ -116,7 +116,7 @@ Currently, an application must provide a null pointer as \fIopts\fP.
The \fIwcval\fP argument may be a value generated by a call to
\fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument.
If \fIwcval\fP is constructed by any other means, the effect is unspecified.
.SH RETURN VALUES
.SH RETURN VALUE
.PP
When \fIwch\fP is a null pointer,
\fBgetcchar\fP returns the number of wide characters referenced by

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_getch.3x,v 1.36 2011/01/22 19:38:51 tom Exp $
.\" $Id: curs_getch.3x,v 1.37 2012/07/07 20:04:56 tom Exp $
.TH curs_getch 3X ""
.na
.hy 0
@ -237,14 +237,14 @@ See \fBresizeterm\fR(3X) for more details about \fBKEY_RESIZE\fP, and
All routines return the integer \fBERR\fR upon failure and an integer value
other than \fBERR\fR (\fBOK\fR in the case of ungetch()) upon successful
completion.
.RS
.RS 3
.TP 5
\fBungetch\fP
returns an error
returns ERR
if there is no more room in the FIFO.
.TP 5
.TP
\fBwgetch\fP
returns an error
returns ERR
if the window pointer is null, or
if its timeout expires without having any data.
.RE

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_in_wchstr.3x,v 1.8 2010/12/04 18:36:44 tom Exp $
.\" $Id: curs_in_wchstr.3x,v 1.9 2012/11/03 23:03:59 tom Exp $
.TH curs_in_wchstr 3X ""
.na
.hy 0
@ -98,7 +98,7 @@ causes undefined results. Therefore, the use of
\fBmvwin_wchnstr\fR, or
\fBwin_wchnstr\fR
is recommended.
.SH RETURN VALUES
.SH RETURN VALUE
Upon successful completion, these functions return
\fBOK\fR.
Otherwise, they return

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2012,2013 Free 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,8 +26,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_initscr.3x,v 1.17 2010/12/04 18:36:58 tom Exp $
.\" $Id: curs_initscr.3x,v 1.19 2013/07/20 19:34:14 tom Exp $
.TH curs_initscr 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.na
.hy 0
.SH NAME
@ -121,10 +125,19 @@ Old versions of curses, e.g., BSD 4.4, may have returned a null pointer
from \fBinitscr\fR when an error is detected, rather than exiting.
It is safe but redundant to check the return value of \fBinitscr\fR
in XSI Curses.
.PP
If the TERM variable is missing or empty, \fBinitscr\fP uses the
value \*(``unknown\*('',
which normally corresponds to a terminal entry with the \fIgeneric\fP
(\fIgn\fP) capability.
Generic entries are detected by \fBsetupterm\fP(3X) and cannot be
used for full-screen operation.
Other implementations may handle a missing/empty TERM variable differently.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_kernel\fR(3X),
\fBcurs_refresh\fR(3X),
\fBcurs_slk\fR(3X),
\fBcurs_terminfo\fR(3X),
\fBcurs_util\fR(3X),
\fBcurs_variables\fR(3X).

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2012,2013 Free 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,8 +26,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_inopts.3x,v 1.15 2010/12/04 18:40:45 tom Exp $
.\" $Id: curs_inopts.3x,v 1.18 2013/07/20 19:42:02 tom Exp $
.TH curs_inopts 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.na
.hy 0
.SH NAME
@ -188,11 +192,13 @@ Hence, these routines provide the same functionality as \fBnodelay\fR,
plus the additional capability of being able to block for only
\fIdelay\fR milliseconds (where \fIdelay\fR is positive).
.PP
The \fBcurses\fR library does ``line-breakout optimization'' by looking for
typeahead periodically while updating the screen. If input is found,
and it is coming from a tty, the current update is postponed until
\fBrefresh\fR or \fBdoupdate\fR is called again. This allows faster
response to commands typed in advance. Normally, the input FILE
The \fBcurses\fR library does \*(``line-breakout optimization\*(''
by looking for typeahead periodically while updating the screen.
If input is found, and it is coming from a tty,
the current update is postponed until
\fBrefresh\fR or \fBdoupdate\fR is called again.
This allows faster response to commands typed in advance.
Normally, the input FILE
pointer passed to \fBnewterm\fR, or \fBstdin\fR in the case that
\fBinitscr\fR was used, will be used to do this typeahead checking.
The \fBtypeahead\fR routine specifies that the file descriptor
@ -223,6 +229,42 @@ initializes the terminal state. BSD curses differed from this slightly; it
left the echo bit on at initialization, but the BSD \fBraw\fR call turned it
off as a side-effect. For best portability, set echo or noecho explicitly
just after initialization, even if your program remains in cooked mode.
.PP
When \fBkeypad\fP is first enabled,
ncurses loads the key-definitions for the current terminal description.
If the terminal description includes extended string capabilities,
e.g., from using the \fB\-x\fP option of @TIC@,
then ncurses also defines keys for the capabilities whose names
begin with "k".
The corresponding keycodes are generated and (depending on previous
loads of terminal descriptions) may differ from one execution of a
program to the next.
The generated keycodes are recognized by the \fBkeyname\fP function
(which will then return a name beginning with "k" denoting the
terminfo capability name rather than "K", used for curses key-names).
On the other hand, an application can use \fBdefine_key\fP to establish
a specific keycode for a given string.
This makes it possible for an application to check for an extended
capability's presence with \fItigetstr\fP,
and reassign the keycode to match its own needs.
.PP
Low-level applications can use \fBtigetstr\fP to obtain the definition
of any particular string capability.
Higher-level applications which use the curses \fBwgetch\fP
and similar functions to return keycodes rely upon the order in which
the strings are loaded.
If more than one key definition has the same string value,
then \fBwgetch\fP can return only one keycode.
Most curses implementations (including ncurses)
load key definitions in the order
defined by the array of string capability names.
The last key to be loaded determines the keycode which will be returned.
In ncurses, you may also have extended capabilities interpreted as
key definitions.
These are loaded after the predefined keys,
and if a capability's value is the same as a previously-loaded
key definition,
the later definition is the one used.
.SH NOTES
Note that \fBecho\fR, \fBnoecho\fR, \fBhalfdelay\fR, \fBintrflush\fR,
\fBmeta\fR, \fBnodelay\fR, \fBnotimeout\fR, \fBnoqiflush\fR,
@ -233,4 +275,9 @@ they attempt to restore to normal (`cooked') mode from raw and cbreak modes
respectively. Mixing raw/noraw and cbreak/nocbreak calls leads to tty driver
control states that are hard to predict or understand; it is not recommended.
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_getch\fR(3X), \fBcurs_initscr\fR(3X), \fBtermio\fR(7)
\fBcurses\fR(3X),
\fBcurs_getch\fR(3X),
\fBcurs_initscr\fR(3X),
\fBcurs_util\fR(3X),
\fBdefine_key\fR(3X),
\fBtermio\fR(7)

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_ins_wstr.3x,v 1.6 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_ins_wstr.3x,v 1.7 2012/11/03 23:03:59 tom Exp $
.TH curs_ins_wstr 3X ""
.na
.hy 0
@ -92,7 +92,7 @@ If the first character in the string is a nonspacing character, these
functions will fail.
XSI does not define what will happen if a nonspacing character follows
a control character.
.SH RETURN VALUES
.SH RETURN VALUE
Upon successful completion, these functions return OK.
Otherwise, they return ERR.
.PP

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2002-2010,2012 Free 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_inwstr.3x,v 1.7 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_inwstr.3x,v 1.8 2012/11/03 23:03:59 tom Exp $
.TH curs_inwstr 3X ""
.SH NAME
\fBinwstr\fR,
@ -72,7 +72,7 @@ an error is generated.
Note that all routines except
\fBwinnwstr\fR
may be macros.
.SH RETURN VALUES
.SH RETURN VALUE
All routines return
\fBERR\fR
upon failure. Upon

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_mouse.3x,v 1.38 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_mouse.3x,v 1.39 2013/06/22 18:09:42 tom Exp $
.TH curs_mouse 3X ""
.na
.hy 0
@ -40,20 +40,18 @@
.ad
.hy
.SH SYNOPSIS
\fB#include <curses.h>\fR
.PP
\fBtypedef unsigned long mmask_t;\fR
.PP
.nf
\fB#include <curses.h>
.PP
\fBtypedef unsigned long mmask_t;
.PP
typedef struct
{
short id; \fI/* ID to distinguish multiple devices */\fB
int x, y, z; \fI/* event coordinates */\fB
mmask_t bstate; \fI/* button state bits */\fB
}
MEVENT;\fR
\fBtypedef struct {\fR
\fB short id; \fR\fI/* ID to distinguish multiple devices */\fR
\fB int x, y, z; \fR\fI/* event coordinates */\fR
\fB mmask_t bstate; \fR\fI/* button state bits */\fR
\fB} MEVENT;\fR
.fi
.br
.PP
\fBbool has_mouse(void);\fR
.br
\fBint getmouse(MEVENT *event);\fR

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2007-2009,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2007-2010,2013 Free 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,8 +26,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_opaque.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
.\" $Id: curs_opaque.3x,v 1.10 2013/07/20 19:42:29 tom Exp $
.TH curs_opaque 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.na
.hy 0
.SH NAME
@ -78,7 +82,7 @@
.br
.SH DESCRIPTION
This implementation provides functions which return properties
set in the WINDOW structure, allowing it to be ``opaque'' if
set in the WINDOW structure, allowing it to be \*(``opaque\*('' if
the symbol \fBNCURSES_OPAQUE\fR is defined:
.TP 5
\fBis_cleared\fR
@ -124,7 +128,8 @@ returns the parent WINDOW pointer for subwindows,
or NULL for windows having no parent.
.TP 5
\fBwgetscrreg\fR
returns the top and bottom rows for the scrolling margin as set in \fBwsetscrreg\fP.
returns the top and bottom rows for the scrolling margin
as set in \fBwsetscrreg\fP.
.SH RETURN VALUE
These functions all return TRUE or FALSE, except as noted.
.SH NOTES

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_overlay.3x,v 1.16 2010/12/04 18:40:45 tom Exp $
.\" $Id: curs_overlay.3x,v 1.17 2013/04/06 23:48:51 tom Exp $
.TH curs_overlay 3X ""
.na
.hy 0
@ -48,18 +48,21 @@
\fBint dmaxcol, int overlay);\fR
.SH DESCRIPTION
The \fBoverlay\fR and \fBoverwrite\fR routines overlay \fIsrcwin\fR on
top of \fIdstwin\fR. \fIscrwin\fR and \fIdstwin\fR are not required
to be the same size; only text where the two windows overlap is
copied. The difference is that \fBoverlay\fR is non-destructive
top of \fIdstwin\fR.
\fIscrwin\fR and \fIdstwin\fR are not required
to be the same size; only text where the two windows overlap is copied.
The difference is that \fBoverlay\fR is non-destructive
(blanks are not copied) whereas \fBoverwrite\fR is destructive.
.PP
The \fBcopywin\fR routine provides a finer granularity of control over the
\fBoverlay\fR and \fBoverwrite\fR routines. Like in the \fBprefresh\fR
routine, a rectangle is specified in the destination window, (\fIdminrow\fR,
\fBoverlay\fR and \fBoverwrite\fR routines.
As in the \fBprefresh\fR routine,
a rectangle is specified in the destination window, (\fIdminrow\fR,
\fIdmincol\fR) and (\fIdmaxrow\fR, \fIdmaxcol\fR), and the upper-left-corner
coordinates of the source window, (\fIsminrow\fR, \fIsmincol\fR). If the
argument \fIoverlay\fR is \fBtrue\fR, then copying is non-destructive, as in
\fBoverlay\fR.
coordinates of the source window, (\fIsminrow\fR, \fIsmincol\fR).
If the argument \fIoverlay\fR is \fBtrue\fR,
then copying is non-destructive,
as in \fBoverlay\fR.
.SH RETURN VALUE
Routines that return an integer return \fBERR\fR upon failure, and \fBOK\fR
(SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
@ -75,7 +78,8 @@ if some part of the window would be placed off-screen.
Note that \fBoverlay\fR and \fBoverwrite\fR may be macros.
.SH PORTABILITY
The XSI Curses standard, Issue 4 describes these functions (adding the const
qualifiers). It further specifies their behavior in the presence of characters
qualifiers).
It further specifies their behavior in the presence of characters
with multibyte renditions (not yet supported in this implementation).
.SH SEE ALSO
\fBcurses\fR(3X), \fBcurs_pad\fR(3X), \fBcurs_refresh\fR(3X)

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2010,2013 Free 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_sp_funcs.3x,v 1.5 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_sp_funcs.3x,v 1.6 2013/06/22 17:53:59 tom Exp $
.TH curs_sp_funcs 3X ""
.na
.hy 0
@ -186,7 +186,7 @@ new_prescr \- \fBcurses\fR screen-pointer extension
.br
\fBint slk_attrset_sp(SCREEN*, const chtype);\fR
.br
\fBint slk_attr_sp((SCREEN*);\fR
\fBint slk_attr_sp(SCREEN*);\fR
.br
\fBint slk_clear_sp(SCREEN*);\fR
.br

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2012,2013 Free 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,8 +26,11 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_termcap.3x,v 1.26 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_termcap.3x,v 1.30 2013/01/19 15:58:48 tom Exp $
.TH curs_termcap 3X ""
.de bP
.IP \(bu 4
..
.na
.hy 0
.ds n 5
@ -75,11 +78,39 @@ the \fItermcap\fR library. Their parameters are the same and the
routines are emulated using the \fIterminfo\fR database. Thus, they
can only be used to query the capabilities of entries for which a
terminfo entry has been compiled.
.SS INITIALIZATION
.PP
The \fBtgetent\fR routine loads the entry for \fIname\fR.
It returns 1 on success, 0 if there is no such entry, and \-1 if the
terminfo database could not be found.
It returns:
.RS 3
.TP 3
1
on success,
.TP 3
0
if there is no such entry
(or that it is a generic type, having too little information for curses
applications to run), and
.TP 3
\-1
if the terminfo database could not be found.
.RE
.PP
This differs from the \fItermcap\fP library in two ways:
.RS 3
.bP
The emulation ignores the buffer pointer \fIbp\fR.
The \fItermcap\fP library would store a copy of the terminal
description in the area referenced by this pointer.
However, ncurses stores its terminal descriptions in compiled
binary form, which is not the same thing.
.bP
There is a difference in return codes.
The \fItermcap\fP library does not check if the terminal
description is marked with the \fIgeneric\fP capability,
or if the terminal description has cursor-addressing.
.RE
.SS CAPABILITY VALUES
.PP
The \fBtgetflag\fR routine gets the boolean entry for \fIid\fR,
or zero if it is not available.
@ -98,12 +129,14 @@ Only the first two characters of the \fBid\fR parameter of
\fBtgetflag\fR,
\fBtgetnum\fR and
\fBtgetstr\fR are compared in lookups.
.SS FORMATTING CAPABILITIES
.PP
The \fBtgoto\fR routine instantiates the parameters into the given capability.
The output from this routine is to be passed to \fBtputs\fR.
.PP
The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual
page. It can retrieve capabilities by either termcap or terminfo name.
.SS GLOBAL VARIABLES
.PP
The variables
\fBPC\fR,
@ -165,8 +198,28 @@ However, termcap applications' use of those variables is poorly documented,
e.g., not distinguishing between input and output.
In particular, some applications are reported to declare and/or
modify \fBospeed\fR.
.PP
The comment that only the first two characters of the \fBid\fR parameter
are used escapes many application developers.
The original BSD 4.2 termcap library (and historical relics thereof)
did not require a trailing null NUL on the parameter name passed
to \fBtgetstr\fP, \fBtgetnum\fP and \fBtgetflag\fP.
Some applications assume that the termcap interface does not require
the trailing NUL for the parameter name.
Taking into account these issues:
.bP
As a special case,
\fBtgetflag\fP matched against a single-character identifier
provided that was at the end of the terminal description.
You should not rely upon this behavior in portable programs.
This implementation disallows matches against single-character capability names.
.bP
This implementation disallows matches by the termcap interface against
extended capability names which are longer than two characters.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBterminfo\fR(\*n),
\fBterm_variables\fR(3X),
\fBputc\fR(3).
.sp
http://invisible-island.net/ncurses/tctest.html

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1999-2008,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1999-2011,2013 Free 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,8 +26,15 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_terminfo.3x,v 1.35 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_terminfo.3x,v 1.43 2013/07/20 19:29:59 tom Exp $
.TH curs_terminfo 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.de bP
.IP \(bu 4
..
.ds n 5
.na
.hy 0
@ -77,7 +84,7 @@
.br
\fBint vidattr(chtype \fR\fIattrs\fR\fB);\fR
.br
\fBint vid_puts(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB, int (*\fR\fIputc\fR\fB)(char));\fR
\fBint vid_puts(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB, int (*\fR\fIputc\fR\fB)(int));\fR
.br
\fBint vid_attr(attr_t \fR\fIattrs\fR\fB, short \fR\fIpair\fR\fB, void *\fR\fIopts\fR\fB);\fR
.br
@ -98,40 +105,54 @@ directly with the \fBterminfo\fR database to handle certain terminal
capabilities, such as programming function keys. For all other
functionality, \fBcurses\fR routines are more suitable and their use is
recommended.
.SS Initialization
.PP
Initially, \fBsetupterm\fR should be called. Note that
\fBsetupterm\fR is automatically called by \fBinitscr\fR and
\fBnewterm\fR. This defines the set of terminal-dependent variables
[listed in \fBterminfo\fR(\*n)].
.PP
Each initialization routine provides applications with the
terminal capabilities either directly (via header definitions),
or by special functions.
The header files \fBcurses.h\fR and \fBterm.h\fR should be included (in this
order) to get the definitions for these strings, numbers, and flags.
.PP
The \fBterminfo\fR variables
\fBlines\fR and \fBcolumns\fR are initialized by \fBsetupterm\fR as
follows:
.RS
.PP
.bP
If \fBuse_env(FALSE)\fR has been called, values for
\fBlines\fR and \fBcolumns\fR specified in \fBterminfo\fR are used.
.PP
.bP
Otherwise, if the environment variables \fBLINES\fR and \fBCOLUMNS\fR
exist, their values are used. If these environment variables do not
exist and the program is running in a window, the current window size
is used. Otherwise, if the environment variables do not exist, the
values for \fBlines\fR and \fBcolumns\fR specified in the
\fBterminfo\fR database are used.
.RE
.PP
The header files \fBcurses.h\fR and \fBterm.h\fR should be included (in this
order) to get the definitions for these strings, numbers, and flags.
Parameterized strings should be passed through \fBtparm\fR to instantiate them.
All \fBterminfo\fR strings [including the output of \fBtparm\fR] should be printed
with \fBtputs\fR or \fBputp\fR. Call the \fBreset_shell_mode\fR to restore the
tty modes before exiting [see \fBcurs_kernel\fR(3X)]. Programs which use
cursor addressing should output \fBenter_ca_mode\fR upon startup and should
output \fBexit_ca_mode\fR before exiting. Programs desiring shell escapes
should call
with \fBtputs\fR or \fBputp\fR.
Call \fBreset_shell_mode\fR to restore the
tty modes before exiting [see \fBcurs_kernel\fR(3X)].
.PP
\fBreset_shell_mode\fR and output \fBexit_ca_mode\fR before the shell
is called and should output \fBenter_ca_mode\fR and call
\fBreset_prog_mode\fR after returning from the shell.
Programs which use
cursor addressing should
.bP
output \fBenter_ca_mode\fR upon startup and
.bP
output \fBexit_ca_mode\fR before exiting.
.PP
Programs which execute shell subprocesses should
.bP
call \fBreset_shell_mode\fR and
output \fBexit_ca_mode\fR before the shell
is called and
.bP
output \fBenter_ca_mode\fR and
call \fBreset_prog_mode\fR after returning from the shell.
.PP
The \fBsetupterm\fR routine reads in the \fBterminfo\fR database,
initializing the \fBterminfo\fR structures, but does not set up the
@ -146,19 +167,23 @@ then \fBsetupterm\fR returns \fBOK\fR or
A return value of \fBOK\fR combined with status of \fB1\fR in \fIerrret\fR
is normal.
If \fBERR\fR is returned, examine \fIerrret\fR:
.RS
.TP 5
.B 1
means that the terminal is hardcopy, cannot be used for curses applications.
.IP
\fBsetupterm\fP determines if the entry is a hardcopy type by
checking the \fIhc\fP (\fIhardcopy\fP) capability.
.TP 5
.B 0
means that the terminal could not be found,
or that it is a generic type,
having too little information for curses applications to run.
.IP
\fBsetupterm\fP determines if the entry is a generic type by
checking the \fIgn\fP (\fIgeneric\fP) capability.
.TP 5
.B \-1
means that the \fBterminfo\fR database could not be found.
.RE
.PP
If \fIerrret\fR is
null, \fBsetupterm\fR prints an error message upon finding an error
@ -168,18 +193,33 @@ and exits. Thus, the simplest call is:
.sp
which uses all the defaults and sends the output to \fBstdout\fR.
.PP
The \fBsetterm\fR routine is being replaced by \fBsetupterm\fR. The call:
The \fBsetterm\fR routine was replaced by \fBsetupterm\fR. The call:
.sp
\fBsetupterm(\fR\fIterm\fR\fB, 1, (int *)0)\fR
.sp
provides the same functionality as \fBsetterm(\fR\fIterm\fR\fB)\fR.
The \fBsetterm\fR routine is included here for BSD compatibility, and
The \fBsetterm\fR routine is provided for BSD compatibility, and
is not recommended for new programs.
.\" ***************************************************************************
.SS The Terminal State
.PP
The \fBset_curterm\fR routine sets the variable \fBcur_term\fR to
The \fBsetupterm\fR routine stores its information about the terminal
in a \fBTERMINAL\fP structure pointed to by the global variable \fBcur_term\fP.
If it detects an error,
or decides that the terminal is unsuitable (hardcopy or generic),
it discards this information,
making it not available to applications.
.PP
If \fBsetupterm\fP is called repeatedly for the same terminal type,
it will reuse the information.
It maintains only one copy of a given terminal's capabilities in memory.
If it is called for different terminal types,
\fBsetupterm\fP allocates new storage for each set of terminal capabilities.
.PP
The \fBset_curterm\fR routine sets \fBcur_term\fR to
\fInterm\fR, and makes all of the \fBterminfo\fR boolean, numeric, and
string variables use the values from \fInterm\fR. It returns the old value
of \fBcur_term\fR.
string variables use the values from \fInterm\fR.
It returns the old value of \fBcur_term\fR.
.PP
The \fBdel_curterm\fR routine frees the space pointed to by
\fIoterm\fR and makes it available for further use. If \fIoterm\fR is
@ -189,11 +229,14 @@ memory locations until another \fBsetupterm\fR has been called.
.PP
The \fBrestartterm\fR routine is similar to \fBsetupterm\fR and \fBinitscr\fR,
except that it is called after restoring memory to a previous state (for
example, when reloading a game saved as a core image dump). It assumes that
the windows and the input and output options are the same as when memory was
saved, but the terminal type and baud rate may be different. Accordingly,
it saves various tty state bits, calls \fBsetupterm\fP,
and then restores the bits.
example, when reloading a game saved as a core image dump).
\fBrestartterm\fP assumes that the windows and the input and output options
are the same as when memory was saved,
but the terminal type and baud rate may be different.
Accordingly, \fBrestartterm\fP saves various tty state bits,
calls \fBsetupterm\fP, and then restores the bits.
.\" ***************************************************************************
.SS Formatting Output
.PP
The \fBtparm\fR routine instantiates the string \fIstr\fR with
parameters \fIpi\fR. A pointer is returned to the result of \fIstr\fR
@ -202,6 +245,8 @@ with the parameters applied.
\fBtiparm\fP is a newer form of \fBtparm\fP which uses \fI<stdarg.h>\fP
rather than a fixed-parameter list.
Its numeric parameters are integers (int) rather than longs.
.\" ***************************************************************************
.SS Output Functions
.PP
The \fBtputs\fR routine applies padding information to the string
\fIstr\fR and outputs it. The \fIstr\fR must be a terminfo string
@ -235,26 +280,48 @@ Currently, applications must provide a null pointer for that argument.
.PP
The \fBmvcur\fR routine provides low-level cursor motion. It takes
effect immediately (rather than at the next refresh).
.\" ***************************************************************************
.SS Terminal Capability Functions
.PP
The \fBtigetflag\fR, \fBtigetnum\fR and \fBtigetstr\fR routines return
the value of the capability corresponding to the \fBterminfo\fR
\fIcapname\fR passed to them, such as \fBxenl\fR.
.PP
The \fBtigetflag\fR routine returns the value \fB\-1\fR if
\fIcapname\fR is not a boolean capability,
or \fB0\fR if it is canceled or absent from the terminal description.
.PP
The \fBtigetnum\fR routine returns the value \fB\-2\fR if
\fIcapname\fR is not a numeric capability,
or \fB\-1\fR if it is canceled or absent from the terminal description.
.PP
The \fBtigetstr\fR routine returns the value \fB(char *)\-1\fR
if \fIcapname\fR is not a string capability,
or \fB0\fR if it is canceled or absent from the terminal description.
.PP
The \fIcapname\fR for each capability is given in the table column entitled
\fIcapname\fR code in the capabilities section of \fBterminfo\fR(\*n).
.sp
.PP
These routines return special values to denote errors.
.PP
The \fBtigetflag\fR routine returns
.TP
\fB\-1\fR
if \fIcapname\fR is not a boolean capability,
or
.TP
\fB0\fR
if it is canceled or absent from the terminal description.
.PP
The \fBtigetnum\fR routine returns
.TP
\fB\-2\fR
if \fIcapname\fR is not a numeric capability, or
.TP
\fB\-1\fR
if it is canceled or absent from the terminal description.
.PP
The \fBtigetstr\fR routine returns
.TP
\fB(char *)\-1\fR
if \fIcapname\fR is not a string capability,
or
.TP
\fB0\fR
if it is canceled or absent from the terminal description.
.\" ***************************************************************************
.SS Terminal Capability Names
These null-terminated arrays contain
the short terminfo names ("codes"),
the \fBtermcap\fR names, and the long terminfo names ("fnames")
for each of the predefined \fBterminfo\fR variables:
.RS
\fBchar *boolnames[]\fR, \fB*boolcodes[]\fR, \fB*boolfnames[]\fR
.sp
@ -262,10 +329,6 @@ The \fIcapname\fR for each capability is given in the table column entitled
.sp
\fBchar *strnames[]\fR, \fB*strcodes[]\fR, \fB*strfnames[]\fR
.RE
.PP
These null-terminated arrays contain the \fIcapnames\fR, the
\fBtermcap\fR codes, and the full C names, for each of the
\fBterminfo\fR variables.
.SH RETURN VALUE
Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
(SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
@ -275,7 +338,7 @@ Routines that return pointers always return \fBNULL\fR on error.
.PP
X/Open defines no error conditions.
In this implementation
.RS
.RS 5
.TP 5
\fBdel_curterm\fP
returns an error
@ -300,19 +363,41 @@ It does not detect I/O errors:
X/Open states that \fBtputs\fP ignores the return value
of the output function \fIputc\fP.
.RE
.SH NOTES
The \fBsetupterm\fR routine should be used in place of \fBsetterm\fR.
It may be useful when you want to test for terminal capabilities without
committing to the allocation of storage involved in \fBinitscr\fR.
.PP
Note that \fBvidattr\fR and \fBvidputs\fR may be macros.
.SH PORTABILITY
X/Open notes that \fBvidattr\fR and \fBvidputs\fR may be macros.
.PP
The function \fBsetterm\fR is not described by X/Open and must
be considered non-portable. All other functions are as described by X/Open.
be considered non-portable.
All other functions are as described by X/Open.
.PP
\fBsetupterm\fP copies the terminal name to the array \fBttytype\fP.
This is not part of X/Open Curses, but is assumed by some applications.
.PP
If configured to use the terminal-driver,
e.g., for the MinGW port,
.bP
\fBsetupterm\fP interprets a missing/empty TERM variable as the
special value \*(``unknown\*(''.
.bP
\fBsetupterm\fP allows explicit use of the
the windows console driver by checking if $TERM is set to
\*(``#win32con\*('' or an abbreviation of that string.
.PP
Older versions of \fBncurses\fP assumed that the file descriptor passed to
\fBsetupterm\fP from \fBinitscr\fP or \fBnewterm\fP uses buffered I/O,
and would write to the corresponding stream.
In addition to the limitation that the terminal was left in block-buffered
mode on exit (like SystemV curses),
it was problematic because \fBncurses\fP
did not allow a reliable way to cleanup on receiving SIGTSTP.
The current version uses output buffers managed directly by \fBncurses\fP.
Some of the low-level functions described in this manual page write
to the standard output.
They are not signal-safe.
The high-level functions in \fBncurses\fP use
alternate versions of these functions
using the more reliable buffering scheme.
.PP
In System V Release 4, \fBset_curterm\fR has an \fBint\fR return type and
returns \fBOK\fR or \fBERR\fR. We have chosen to implement the X/Open Curses
semantics.
@ -332,12 +417,12 @@ Portable applications should provide 9 parameters after the format;
zeroes are fine for this purpose.
.PP
In response to comments by Thomas E. Dickey,
X/Open Curses Issue 7 proposed the \fBtiparam\fP function in mid-2009.
X/Open Curses Issue 7 proposed the \fBtiparm\fP function in mid-2009.
.PP
X/Open notes that after calling \fBmvcur\fR, the curses state may not match the
actual terminal state, and that an application should touch and refresh
the window before resuming normal curses calls.
Both ncurses and System V Release 4 curses implement \fBmvcur\fR using
Both \fBncurses\fP and System V Release 4 curses implement \fBmvcur\fR using
the SCREEN data allocated in either \fBinitscr\fR or \fBnewterm\fR.
So though it is documented as a terminfo function,
\fBmvcur\fR is really a curses function which is not well specified.
@ -346,8 +431,12 @@ X/Open states that the old location must be given for \fBmvcur\fP.
This implementation allows the caller to use \-1's for the old ordinates.
In that case, the old location is unknown.
.PP
Extended terminal capability names, e.g., as defined by \fBtic\ \-x\fP,
are not stored in the arrays described in this section.
Other implementions may not declare the capability name arrays.
Some provide them without declaring them.
X/Open does not specify them.
.PP
Extended terminal capability names, e.g., as defined by \fB@TIC@\ \-x\fP,
are not stored in the arrays described here.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_initscr\fR(3X),

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2008,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2008-2010,2012 Free 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_threads.3x,v 1.18 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_threads.3x,v 1.19 2012/05/26 17:03:26 tom Exp $
.TH curs_threads 3X ""
.de bP
.IP \(bu 4

View File

@ -1,5 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2012,2013 Free 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,8 +27,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_util.3x,v 1.32 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_util.3x,v 1.37 2013/07/20 19:43:45 tom Exp $
.TH curs_util 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.de bP
.IP \(bu 4
..
@ -44,6 +49,7 @@
\fBputwin\fR,
\fBunctrl\fR,
\fBuse_env\fR,
\fBuse_tioctl\fR,
\fBwunctrl\fR \- miscellaneous \fBcurses\fR utility routines
.ad
.hy
@ -64,6 +70,8 @@
.br
\fBvoid use_env(bool f);\fR
.br
\fBvoid use_tioctl(bool f);\fR
.br
\fBint putwin(WINDOW *win, FILE *filep);\fR
.br
\fBWINDOW *getwin(FILE *filep);\fR
@ -80,10 +88,12 @@ Printing characters are displayed as is.
The corresponding \fBwunctrl\fR returns a printable representation of
a wide character.
.PP
The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR:
The \fBkeyname\fR routine returns a character string
corresponding to the key \fIc\fR:
.RS 3
.bP
Printable characters are displayed as themselves, e.g., a one-character string containing the key.
Printable characters are displayed as themselves,
e.g., a one-character string containing the key.
.bP
Control characters are displayed in the \fB^\fR\fIX\fR notation.
.bP
@ -123,16 +133,70 @@ using a different value of \fB$TERM\fP.
The limitation arises because the \fBfilter\fP routine modifies the
in-memory copy of the terminal information.
.PP
The \fBuse_env\fR routine, if used, is called before \fBinitscr\fR or
\fBnewterm\fR are called. When called with \fBFALSE\fR as an
argument, the values of \fBlines\fR and \fBcolumns\fR specified in the
\fIterminfo\fR database will be used, even if environment variables
\fBLINES\fR and \fBCOLUMNS\fR (used by default) are set, or if
\fBcurses\fR is running in a window (in which case default behavior
would be to use the window size if \fBLINES\fR and \fBCOLUMNS\fR are
not set).
Note that setting \fBLINES\fR or \fBCOLUMNS\fR overrides the
corresponding size which may be obtained from the operating system.
The \fBuse_env\fR routine, if used,
should be called before \fBinitscr\fR or
\fBnewterm\fR are called
(because those compute the screen size).
It modifies the way \fBncurses\fP treats environment variables
when determining the screen size.
.bP
Normally ncurses looks first at the terminal database for the screen size.
.IP
If \fBuse_env\fP was called with \fBFALSE\fP for parameter,
it stops here unless
If \fBuse_tioctl\fP was also called with \fBTRUE\fP for parameter.
.bP
Then it asks for the screen size via operating system calls.
If successful,
it overrides the values from the terminal database.
.bP
Finally (unless \fBuse_env\fP was called with \fBFALSE\fP parameter),
ncurses examines the \fBLINES\fR or \fBCOLUMNS\fR environment variables,
using a value in those to override the results
from the operating system or terminal database.
.IP
Ncurses also updates the screen size in response to SIGWINCH,
unless overridden by the \fBLINES\fR or \fBCOLUMNS\fR environment variables,
.PP
The \fBuse_tioctl\fR routine, if used,
should be called before \fBinitscr\fR or \fBnewterm\fR are called
(because those compute the screen size).
After \fBuse_tioctl\fR is called with \fBTRUE\fR as an argument,
ncurses modifies the last step in its computation of screen size as follows:
.bP
checks if the \fBLINES\fR and \fBCOLUMNS\fR environment variables
are set to a number greater than zero.
.bP
for each, ncurses updates the corresponding environment variable
with the value that it has obtained via operating system call
or from the terminal database.
.bP
ncurses re-fetches the value of the environment variables so that
it is still the environment variables which set the screen size.
.PP
The \fBuse_env\fP and \fBuse_tioctl\fP routines combine as
summarized here:
.TS
center tab(/);
l l l
_ _ _
lw7 lw7 lw40.
\fIuse_env\fR/\fIuse_tioctl\fR/\fISummary\fR
TRUE/FALSE/T{
This is the default behavior.
ncurses uses operating system calls
unless overridden by $LINES or $COLUMNS environment variables.
T}
TRUE/TRUE/T{
ncurses updates $LINES and $COLUMNS based on operating system calls.
T}
FALSE/TRUE/T{
ncurses ignores $LINES and $COLUMNS, uses operating system calls to obtain size.
T}
FALSE/FALSE/T{
ncurses relies on the terminal database to determine size.
T}
.TE
.PP
The \fBputwin\fR routine writes all data associated with window \fIwin\fR into
the file to which \fIfilep\fR points. This information can be later retrieved
@ -145,7 +209,8 @@ data. It returns a pointer to the new window.
The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause
in output. This routine should not be used extensively because
padding characters are used rather than a CPU pause.
If no padding character is specified, this uses \fBnapms\fR to perform the delay.
If no padding character is specified,
this uses \fBnapms\fR to perform the delay.
.PP
The \fBflushinp\fR routine throws away any typeahead that has been typed by the
user and has not yet been read by the program.
@ -183,12 +248,13 @@ the parameter is in the range 128\-159, i.e., a C1 control code.
If \fBuse_legacy_coding\fP has been called with a \fB2\fP parameter,
\fBunctrl\fP returns the parameter, i.e., a one-character string with
the parameter as the first character.
Otherwise, it returns ``~@'', ``~A'', etc., analogous to ``^@'', ``^A'', C0 controls.
Otherwise, it returns \*(``~@\*('', \*(``~A\*('', etc.,
analogous to \*(``^@\*('', \*(``^A\*('', C0 controls.
.IP
X/Open Curses does not document whether \fBunctrl\fP can be called before
initializing curses.
This implementation permits that,
and returns the ``~@'', etc., values in that case.
and returns the \*(``~@\*('', etc., values in that case.
.bP
parameter values outside the 0 to 255 range.
\fBunctrl\fP returns a null pointer.
@ -214,17 +280,17 @@ change the output of \fBunctrl\fP.
Likewise, the \fBmeta\fP function allows the caller to change the
output of \fBkeyname\fP, i.e.,
it determines whether to use the `M\-' prefix
for ``meta'' keys (codes in the range 128 to 255).
for \*(``meta\*('' keys (codes in the range 128 to 255).
Both \fBuse_legacy_coding\fP and \fBmeta\fP succeed only after
curses is initialized.
X/Open Curses does not document the treatment of codes 128 to 159.
When treating them as ``meta'' keys
When treating them as \*(``meta\*('' keys
(or if \fBkeyname\fP is called before initializing curses),
this implementation returns strings ``M\-^@'', ``M\-^A'', etc.
this implementation returns strings \*(``M\-^@\*('', \*(``M\-^A\*('', etc.
.PP
The \fBkeyname\fP function may return the names of user-defined
string capabilities which are defined in the terminfo entry via the \fB\-x\fP
option of \fBtic\fP.
option of \fB@TIC@\fP.
This implementation automatically assigns at run-time keycodes to
user-defined strings which begin with "k".
The keycodes start at KEY_MAX, but are not guaranteed to be
@ -233,8 +299,8 @@ merged from all terminal descriptions which have been loaded.
The \fBuse_extended_names\fP function controls whether this data is
loaded when the terminal description is read by the library.
.PP
The \fBnofilter\fP routine is specific to ncurses.
It was not supported on Version 7, BSD or System V implementations.
The \fBnofilter\fP and \fBuse_tioctl\fP routines are specific to ncurses.
They were not supported on Version 7, BSD or System V implementations.
It is recommended that any code depending on ncurses extensions
be conditioned using NCURSES_VERSION.
.SH SEE ALSO

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2010,2013 Free 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_variables.3x,v 1.4 2010/12/04 18:38:55 tom Exp $
.\" $Id: curs_variables.3x,v 1.6 2013/12/21 18:41:32 tom Exp $
.TH curs_variables 3X ""
.de bP
.IP \(bu 4
@ -74,7 +74,7 @@ This page summarizes variables provided by the \fBcurses\fP library.
A more complete description is given in the \fBcurses\fP(3X) manual page.
.PP
Depending on the configuration, these may be actual variables,
or macros (see \fBcurs_threads\fR(3X))
or macros (see \fBcurs_threads\fR(3X) and \fBcurs_opaque\fR(3X))
which provide read-only access to \fIcurses\fP's state.
In either case, applications should treat them as read-only to avoid
confusing the library.
@ -129,7 +129,8 @@ ESCDELAY and TABSIZE are extensions,
not provided in most other implementations of curses.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_opaque\fR(3X),
\fBcurs_terminfo\fR(3X),
\fBcurs_threads\fR(3X),
\fBterm_variables\fR(3X),
\fBterminfo\fR(3X),
\fBterminfo\fR(\*n).

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: form_field.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
.\" $Id: form_field.3x,v 1.11 2012/11/03 23:03:59 tom Exp $
.TH form_field 3X ""
.SH NAME
\fBform_field\fR \- make and break connections between fields and forms
@ -52,7 +52,7 @@ The function \fBfield_count\fR returns the count of fields in \fIform\fR.
.PP
The function \fBmove_field\fR moves the given field (which must be disconnected)
to a specified location on the screen.
.SH RETURN VALUES
.SH RETURN VALUE
The function \fBform_fields\fR returns a pointer (which may be \fBNULL\fR).
It does not set errno.
.PP

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2010 Free Software Foundation, Inc. *
.\" Copyright (c) 2010,2013 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@ -26,7 +26,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: form_variables.3x,v 1.3 2010/12/04 18:38:55 tom Exp $
.\" $Id: form_variables.3x,v 1.4 2013/06/22 17:58:32 tom Exp $
.TH form_variables 3X ""
.ds n 5
.na
@ -45,7 +45,6 @@
.SH SYNOPSIS
.nf
\fB#include <form.h>\fR
.br
.PP
\fBFIELDTYPE * TYPE_ALNUM;\fR
\fBFIELDTYPE * TYPE_ALPHA;\fR
@ -54,7 +53,6 @@
\fBFIELDTYPE * TYPE_IPV4;\fR
\fBFIELDTYPE * TYPE_NUMERIC;\fR
\fBFIELDTYPE * TYPE_REGEXP;\fR
.br
.fi
.SH DESCRIPTION
These are building blocks for the form library,

View File

@ -1,6 +1,6 @@
'\" t
.\"***************************************************************************
.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-2012,2013 Free 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,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: infocmp.1m,v 1.46 2010/12/04 18:40:45 tom Exp $
.\" $Id: infocmp.1m,v 1.53 2013/02/02 22:07:35 tom Exp $
.TH @INFOCMP@ 1M ""
.ds n 5
.de bP
.IP \(bu 4
..
.ds d @TERMINFO@
.SH NAME
\fB@INFOCMP@\fR \- compare or print out \fIterminfo\fR descriptions
@ -37,10 +40,12 @@
\fB@INFOCMP@\fR [\fB\-\
1\
C\
D\
E\
F\
G\
I\
K\
L\
T\
U\
@ -69,32 +74,40 @@ x\
\fB@INFOCMP@\fR can be used to compare a binary \fBterminfo\fR entry with other
terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the
\fBuse=\fR terminfo field, or print out a \fBterminfo\fR description from the
binary file (\fBterm\fR) in a variety of formats. In all cases, the boolean
binary file (\fBterm\fR) in a variety of formats.
In all cases, the boolean
fields will be printed first, followed by the numeric fields, followed by the
string fields.
.SS Default Options
If no options are specified and zero or one \fItermnames\fR are specified, the
\fB\-I\fR option will be assumed. If more than one \fItermname\fR is specified,
\fB\-I\fR option will be assumed.
If more than one \fItermname\fR is specified,
the \fB\-d\fR option will be assumed.
.SS Comparison Options [\-d] [\-c] [\-n]
\fB@INFOCMP@\fR compares the \fBterminfo\fR description of the first terminal
\fItermname\fR with each of the descriptions given by the entries for the other
terminal's \fItermnames\fR. If a capability is defined for only one of the
terminal's \fItermnames\fR.
If a capability is defined for only one of the
terminals, the value returned will depend on the type of the capability:
\fBF\fR for boolean variables, \fB\-1\fR for integer variables, and \fBNULL\fR
for string variables.
.PP
The \fB\-d\fR option produces a list of each capability that is different
between two entries. This option is useful to show the difference between two
between two entries.
This option is useful to show the difference between two
entries, created by different people, for the same or similar terminals.
.PP
The \fB\-c\fR option produces a list of each capability that is common between
two entries. Capabilities that are not set are ignored. This option can be
two or more entries.
Capabilities that are not set are ignored.
This option can be
used as a quick check to see if the \fB\-u\fR option is worth using.
.PP
The \fB\-n\fR option produces a list of each capability that is in neither
entry. If no \fItermnames\fR are given, the environment variable \fBTERM\fR
will be used for both of the \fItermnames\fR. This can be used as a quick
The \fB\-n\fR option produces a list of each capability that is in none of
the given entries.
If no \fItermnames\fR are given, the environment variable \fBTERM\fR
will be used for both of the \fItermnames\fR.
This can be used as a quick
check to see if anything was left out of a description.
.SS Source Listing Options [\-I] [\-L] [\-C] [\-r]
The \fB\-I\fR, \fB\-L\fR, and \fB\-C\fR options will produce a source listing for
@ -107,6 +120,7 @@ l l .
\fB\-L\fR/use the long C variable name listed in <\fBterm.h\fR>
\fB\-C\fR/use the \fBtermcap\fR names
\fB\-r\fR/when using \fB\-C\fR, put out all capabilities in \fBtermcap\fR form
\fB\-K\fR/modifies the \fB\-C\fP option, improving BSD-compatibility.
.TE
.PP
If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
@ -114,26 +128,48 @@ used for the terminal name.
.PP
The source produced by the \fB\-C\fR option may be used directly as a
\fBtermcap\fR entry, but not all parameterized strings can be changed to
the \fBtermcap\fR format. \fB@INFOCMP@\fR will attempt to convert most of the
the \fBtermcap\fR format.
\fB@INFOCMP@\fR will attempt to convert most of the
parameterized information, and anything not converted will be plainly marked in
the output and commented out. These should be edited by hand.
the output and commented out.
These should be edited by hand.
.PP
For best results when converting to \fBtermcap\fP format,
you should use both \fB\-C\fP and \fB\-r\fP.
Normally a termcap description is limited to 1023 bytes.
@INFOCMP@ trims away less essential parts to make it fit.
If you are converting to one of the (rare) termcap implementations
which accept an unlimited size of termcap,
you may want to add the \fB\-T\fP option.
More often however, you must help the termcap implementation,
and trim excess whitespace (use the \fB\-0\fP option for that).
.PP
All padding information for strings will be collected together and placed
at the beginning of the string where \fBtermcap\fR expects it. Mandatory
at the beginning of the string where \fBtermcap\fR expects it.
Mandatory
padding (padding information with a trailing '/') will become optional.
.PP
All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
are derivable from other \fBterminfo\fR variables, will be output. Not all
are derivable from other \fBterminfo\fR variables, will be output.
Not all
\fBterminfo\fR capabilities will be translated; only those variables which were
part of \fBtermcap\fR will normally be output. Specifying the \fB\-r\fR option
part of \fBtermcap\fR will normally be output.
Specifying the \fB\-r\fR option
will take off this restriction, allowing all capabilities to be output in
\fItermcap\fR form.
Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
The actual format used incorporates some improvements for escaped characters
from terminfo format.
For a stricter BSD-compatible translation, use the \fB\-K\fR option
rather than \fB\-C\fP.
.PP
Note that because padding is collected to the beginning of the capability, not
all capabilities are output. Mandatory padding is not supported. Because
all capabilities are output.
Mandatory padding is not supported.
Because
\fBtermcap\fR strings are not as flexible, it is not always possible to convert
a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format. A
subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.
A subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
will not necessarily reproduce the original \fBterminfo\fR
source.
.PP
@ -156,27 +192,33 @@ l l l.
.SS Use= Option [\-u]
The \fB\-u\fR option produces a \fBterminfo\fR source description of the first
terminal \fItermname\fR which is relative to the sum of the descriptions given
by the entries for the other terminals \fItermnames\fR. It does this by
by the entries for the other terminals \fItermnames\fR.
It does this by
analyzing the differences between the first \fItermname\fR and the other
\fItermnames\fR and producing a description with \fBuse=\fR fields for the
other terminals. In this manner, it is possible to retrofit generic terminfo
entries into a terminal's description. Or, if two similar terminals exist, but
other terminals.
In this manner, it is possible to retrofit generic terminfo
entries into a terminal's description.
Or, if two similar terminals exist, but
were coded at different times or by different people so that each description
is a full description, using \fB@INFOCMP@\fR will show what can be done to change
one description to be relative to the other.
.PP
A capability will get printed with an at-sign (@) if it no longer exists in the
first \fItermname\fR, but one of the other \fItermname\fR entries contains a
value for it. A capability's value gets printed if the value in the first
value for it.
A capability's value gets printed if the value in the first
\fItermname\fR is not found in any of the other \fItermname\fR entries, or if
the first of the other \fItermname\fR entries that has this capability gives a
different value for the capability than that in the first \fItermname\fR.
.PP
The order of the other \fItermname\fR entries is significant. Since the
terminfo compiler \fBtic\fR does a left-to-right scan of the capabilities,
The order of the other \fItermname\fR entries is significant.
Since the
terminfo compiler \fB@TIC@\fR does a left-to-right scan of the capabilities,
specifying two \fBuse=\fR entries that contain differing entries for the same
capabilities will produce different results depending on the order that the
entries are given in. \fB@INFOCMP@\fR will flag any such inconsistencies between
entries are given in.
\fB@INFOCMP@\fR will flag any such inconsistencies between
the other \fItermname\fR entries as they are found.
.PP
Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
@ -187,29 +229,48 @@ description.
.PP
Another error that does not cause incorrect compiled files, but will slow down
the compilation time, is specifying extra \fBuse=\fR fields that are
superfluous. \fB@INFOCMP@\fR will flag any other \fItermname use=\fR fields that
superfluous.
\fB@INFOCMP@\fR will flag any other \fItermname use=\fR fields that
were not needed.
.SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
The location of the compiled \fBterminfo\fR database is taken from the
environment variable \fBTERMINFO\fR . If the variable is not defined, or the
terminal is not found in that location, the system \fBterminfo\fR database,
in \fB@TERMINFO@\fR, will be used. The options \fB\-A\fR
and \fB\-B\fR may be used to override this location. The \fB\-A\fR option will
set \fBTERMINFO\fR for the first \fItermname\fR and the \fB\-B\fR option will
set \fBTERMINFO\fR for the other \fItermnames\fR. With this, it is possible to
Like other \fBncurses\fP utilities,
@INFOCMP@ looks for the terminal descriptions in several places.
You can use the \fBTERMINFO\fP and \fBTERMINFO_DIRS\fP environment variables
to override the compiled-in default list of places to search
(see \fBcurses\fP(3X) for details).
.PP
You can also use the options \fB\-A\fR
and \fB\-B\fR to override the list of places to search
when comparing terminal descriptions:
.bP
The \fB\-A\fR option sets the location for the first \fItermname\fR
.bP
The \fB\-B\fR option sets the location for the other \fItermnames\fR.
.PP
Using these options, it is possible to
compare descriptions for a terminal with the same name located in two different
databases. This is useful for comparing descriptions for the same terminal
databases.
For instance,
you can use this feature for comparing descriptions for the same terminal
created by different people.
.SS Other Options
.TP 5
\fB\-0\fR
causes the fields to be printed on one line, without wrapping.
.TP 5
\fB\-1\fR
causes the fields to be printed out one to a line. Otherwise,
causes the fields to be printed out one to a line.
Otherwise,
the fields will be printed several to a line to a maximum width
of 60 characters.
.TP
\fB\-a\fR
tells \fB@INFOCMP@\fP to retain commented-out capabilities rather than discarding
them. Capabilities are commented by prefixing them with a period.
them.
Capabilities are commented by prefixing them with a period.
.TP
\fB\-D\fR
tells \fB@INFOCMP@\fP to print the database locations that it knows about, and exit.
.TP 5
\fB\-E\fR
Dump the capabilities of the given terminal as tables, needed in
@ -231,12 +292,15 @@ This option is useful for preparing versions of the curses library hardwired
for a given terminal type.
.TP 5
\fB\-F\fR
compare terminfo files. This assumes that two following arguments are
filenames. The files are searched for pairwise matches between
compare terminfo files.
This assumes that two following arguments are filenames.
The files are searched for pairwise matches between
entries, with two entries considered to match if any of their names do.
The report printed to standard output lists entries with no matches in
the other file, and entries with more than one match. For entries
with exactly one match it includes a difference report. Normally,
the other file, and entries with more than one match.
For entries
with exactly one match it includes a difference report.
Normally,
to reduce the volume of the report, use references are
not resolved before looking for differences, but resolution can be forced
by also specifying \fB\-r\fR.
@ -255,14 +319,17 @@ rather than their decimal equivalents.
.TP 5
\fB\-i\fR
Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
(\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry. For each string, the
(\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.
For each string, the
code tries to analyze it into actions in terms of the other capabilities in the
entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
private modes (the set of recognized special sequences has been selected for
completeness over the existing terminfo database). Each report line consists
completeness over the existing terminfo database).
Each report line consists
of the capability name, followed by a colon and space, followed by a printable
expansion of the capability string with sections matching recognized actions
translated into {}-bracketed descriptions. Here is a list of the DEC/ANSI
translated into {}-bracketed descriptions.
Here is a list of the DEC/ANSI
special sequences recognized:
i.
.TS
@ -308,7 +375,8 @@ DEC[+\-]ARM/auto-repeat mode
.sp
It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
REVERSE. All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
REVERSE.
All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
.PP
An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
.TP 5
@ -323,12 +391,15 @@ Make the comparison listing shorter by omitting subheadings, and using
"\-" for absent capabilities, "@" for canceled rather than "NULL".
.TP 5
\fB\-R\fR\fIsubset\fR
Restrict output to a given subset. This option is for use with archaic
Restrict output to a given subset.
This option is for use with archaic
versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
the full set of SVR4/XSI Curses terminfo; and variants such as AIX
that have their own extensions incompatible with SVr4/XSI. Available terminfo
that have their own extensions incompatible with SVr4/XSI.
Available terminfo
subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
details. You can also choose the subset "BSD" which selects only capabilities
details.
You can also choose the subset "BSD" which selects only capabilities
with termcap equivalents recognized by 4.4BSD.
.TP
\fB\-s \fR\fI[d|i|l|c]\fR
@ -362,7 +433,7 @@ This is mainly useful for testing and analysis, since the compiled
descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
.TP
\fB\-t\fR
tells \fBtic\fP to discard commented-out capabilities.
tells \fB@TIC@\fP to discard commented-out capabilities.
Normally when translating from terminfo to termcap,
untranslatable capabilities are commented-out.
.TP 5
@ -385,13 +456,15 @@ changes the output to \fIwidth\fR characters.
\fB\-x\fR
print information for user-defined capabilities.
These are extensions to the terminfo repertoire which can be loaded
using the \fB\-x\fR option of \fBtic\fP.
using the \fB\-x\fR option of \fB@TIC@\fP.
.SH FILES
.TP 20
\*d
Compiled terminal description database.
.SH EXTENSIONS
The
\fB\-0\fR,
\fB\-1\fR,
\fB\-E\fR,
\fB\-F\fR,
\fB\-G\fR,
@ -410,7 +483,8 @@ The
options are not supported in SVr4 curses.
.PP
The \fB\-r\fR option's notion of `termcap' capabilities is System V Release 4's.
Actual BSD curses versions will have a more restricted set. To see only the
Actual BSD curses versions will have a more restricted set.
To see only the
4.4BSD set, use \fB\-r\fR \fB\-RBSD\fR.
.SH BUGS
The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
@ -421,6 +495,8 @@ The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
\fB@TOE@\fR(1M),
\fBcurses\fR(3X),
\fBterminfo\fR(\*n).
.sp
http://invisible-island.net/ncurses/tctest.html
.PP
This describes \fBncurses\fR
version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).

View File

@ -0,0 +1,16 @@
# $Id: manhtml.aliases,v 1.1 2013/12/21 21:44:52 tom Exp $
# Items in this list will be linked to the corresponding manpages by man2html
addch(3X) curs_addch(3X)
delscreen(3X) curs_initscr(3X)
filter(3X) curs_util(3X)
form_fieldtype(3X) form_fieldtype(3X)
getch(3X) curs_getch(3X)
infocmp(1) infocmp(1M)
initscr(3X) curs_initscr(3X)
newterm(3X) curs_initscr(3X)
set_fieldtype(3X) form_fieldtype(3X)
set_term(3X) curs_initscr(3X)
setupterm(3X) curs_terminfo(3X)
tic(1) tic(1M)
use_env(3X) curs_util(3X)
vidputs(3X) curs_terminfo(3X)

View File

@ -0,0 +1,24 @@
# $Id: manhtml.externs,v 1.3 2013/12/21 22:11:29 tom Exp $
# Items in this list will not be linked by man2html
conflict(1)
csh(1)
ded(1)
environ(7)
getty(1)
nvi(1)
printf(3)
profile(5)
putc(3)
putwc(3)
read(2)
rogue(1)
scanf(3)
sh(1)
sscanf(3)
stdio(3)
stty(1)
system(3)
termio(7)
tty(4)
ttys(5)
wcwidth(3)

Some files were not shown because too many files have changed in this diff Show More