Update to ncurses-6.0

Change-Id: I98ab2ea8a5e13cca9f8b7cf6277b9b14a4da4299
diff --git a/man/MKada_config.in b/man/MKada_config.in
new file mode 100644
index 0000000..6845897
--- /dev/null
+++ b/man/MKada_config.in
@@ -0,0 +1,122 @@
+.\"***************************************************************************
+.\" Copyright (c) 2010-2011,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.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: MKada_config.in,v 1.8 2014/06/07 19:32:52 tom Exp $
+.TH ADACURSES "1" "" "" "User Commands"
+.SH NAME
+adacurses\-config \- helper script for AdaCurses libraries
+.SH SYNOPSIS
+.B adacurses\-config
+[\fIoptions\fR]
+.SH DESCRIPTION
+This is a shell script which simplifies configuring an application to use
+the AdaCurses library binding to ncurses.
+.SH OPTIONS
+.TP
+\fB\-\-cflags\fR
+echos the gnat (Ada compiler) flags needed to compile with AdaCurses.
+.TP
+\fB\-\-libs\fR
+echos the gnat libraries needed to link with AdaCurses.
+.TP
+\fB\-\-version\fR
+echos the release+patchdate version of the ncurses libraries used
+to configure and build AdaCurses.
+.TP
+\fB\-\-help\fR
+prints a list of the \fBadacurses\-config\fP script's options.
+.PP
+If no options are given, \fBadacurses\-config\fP prints the combination
+of 
+\fB\-\-cflags\fR and
+\fB\-\-libs\fR
+that \fBgnatmake\fP expects (see example).
+.SH EXAMPLE
+.PP
+For example, supposing that you want to compile the "Hello World!"
+program for AdaCurses.
+Make a file named "hello.adb":
+.RS
+.nf
+.ft CW
+with Terminal_Interface.Curses; use Terminal_Interface.Curses;
+
+procedure Hello is
+
+   Visibility : Cursor_Visibility := Invisible;
+   done : Boolean := False;
+   c : Key_Code;
+
+begin
+
+   Init_Screen;
+   Set_Echo_Mode (False);
+
+   Set_Cursor_Visibility (Visibility);
+   Set_Timeout_Mode (Standard_Window, Non_Blocking, 0);
+
+   Move_Cursor (Line => Lines / 2, Column => (Columns - 12) / 2);
+   Add (Str => "Hello World!");
+
+   while not done loop
+
+      c := Get_Keystroke (Standard_Window);
+      case c is
+      when Character'Pos ('q') => done := True;
+      when others => null;
+      end case;
+
+      Nap_Milli_Seconds (50);
+   end loop;
+
+   End_Windows;
+
+end Hello;
+.fi
+.RE
+.PP
+Then, using
+.RS
+.ft CW
+gnatmake `adacurses-config --cflags` hello -largs `adacurses-config --libs`
+.ft
+.RE
+.PP
+or (simpler):
+.RS
+.ft CW
+gnatmake hello `adacurses-config`
+.ft
+.RE
+.PP
+you will compile and link the program.
+.SH "SEE ALSO"
+\fBcurses\fR(3X)
+.PP
+This describes \fBncurses\fR
+version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
diff --git a/man/MKncu_config.in b/man/MKncu_config.in
new file mode 100644
index 0000000..3de772c
--- /dev/null
+++ b/man/MKncu_config.in
@@ -0,0 +1,98 @@
+.\"***************************************************************************
+.\" Copyright (c) 2010 Free Software Foundation, Inc.                        *
+.\"                                                                          *
+.\" Permission is hereby granted, free of charge, to any person obtaining a  *
+.\" copy of this software and associated documentation files (the            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: MKncu_config.in,v 1.3 2010/03/06 22:29:17 tom Exp $
+.TH @LIB_NAME@@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config 1 ""
+.SH NAME
+@LIB_NAME@@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config \- helper script for ncurses libraries
+.SH SYNOPSIS
+.B @LIB_NAME@@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config 
+[\fIoptions\fR]
+.SH DESCRIPTION
+This is a shell script which simplifies configuring applications against
+a particular set of ncurses libraries.
+.SH OPTIONS
+.TP
+\fB\-\-prefix\fR
+echos the package\-prefix of ncurses
+.TP
+\fB\-\-exec\-prefix\fR
+echos the executable\-prefix of ncurses
+.TP
+\fB\-\-cflags\fR
+echos the C compiler flags needed to compile with ncurses
+.TP
+\fB\-\-libs\fR
+echos the libraries needed to link with ncurses
+.TP
+\fB\-\-version\fR
+echos the release+patchdate version of ncurses
+.TP
+\fB\-\-abi\-version\fR
+echos the ABI version of ncurses
+.TP
+\fB\-\-mouse\-version\fR
+echos the mouse\-interface version of ncurses
+.TP
+\fB\-\-bindir\fR
+echos the directory containing ncurses programs
+.TP
+\fB\-\-datadir\fR
+echos the directory containing ncurses data
+.TP
+\fB\-\-includedir\fR
+echos the directory containing ncurses header files
+.TP
+\fB\-\-libdir\fR
+echos the directory containing ncurses libraries
+.TP
+\fB\-\-mandir\fR
+echos the directory containing ncurses manpages
+.TP
+\fB\-\-terminfo\fR
+echos the $TERMINFO terminfo database path, e.g.,
+.RS
+@TERMINFO@
+.RE
+.TP
+\fB\-\-terminfo\-dirs\fR
+echos the $TERMINFO_DIRS directory list, e.g.,
+.RS
+@TERMINFO_DIRS@
+.RE
+.TP
+\fB\-\-termpath\fR
+echos the $TERMPATH termcap list, if support for termcap is configured.
+.TP
+\fB\-\-help\fR
+prints this message
+.SH "SEE ALSO"
+\fBcurses\fR(3X)
+.PP
+This describes \fBncurses\fR
+version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
diff --git a/man/Makefile.in b/man/Makefile.in
index c04f7c9..478c398 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.41 2007/03/31 15:54:06 tom Exp $
+# $Id: Makefile.in,v 1.48 2015/08/05 23:15:41 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2013,2015 Free 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"), #
@@ -34,14 +34,19 @@
 # NOTE: When you add or rename a man page, make sure you update both
 # the top-level MANIFEST and any man/*.renames files!
 
-SHELL		= /bin/sh
+SHELL		= @SHELL@
+VPATH		= @srcdir@
 
 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@
@@ -52,20 +57,20 @@
 tags :
 
 $(DESTDIR)$(mandir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
-EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 $(srcdir)/*.[0-9]*
+EDITARGS = $(DESTDIR)$(mandir) $(srcdir) terminfo.5 *-config.1 $(srcdir)/*.[0-9]*
 
 install install.man : terminfo.5 $(DESTDIR)$(mandir)
-	sh ../edit_man.sh normal installing $(EDITARGS)
+	$(SHELL) ../edit_man.sh normal installing $(EDITARGS)
 
 uninstall uninstall.man :
-	-sh ../edit_man.sh normal removing $(EDITARGS)
+	-$(SHELL) ../edit_man.sh normal removing $(EDITARGS)
 
 # We compose terminfo.5 from the real sources...
 CAPLIST=$(srcdir)/../include/@TERMINFO_CAPS@
 terminfo.5: $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail Makefile $(srcdir)/MKterminfo.sh
-	sh $(srcdir)/MKterminfo.sh $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail >terminfo.5
+	$(SHELL) $(srcdir)/MKterminfo.sh $(srcdir)/terminfo.head $(CAPLIST) $(srcdir)/terminfo.tail >terminfo.5
 
 mostlyclean :
 	-rm -f core tags TAGS *~ *.bak *.ln *.atac trace
@@ -74,7 +79,7 @@
 	rm -f terminfo.5
 
 ../edit_man.sed : make_sed.sh @MANPAGE_RENAMES@
-	sh $(srcdir)/make_sed.sh @MANPAGE_RENAMES@ >../edit_man.sed
+	$(SHELL) $(srcdir)/make_sed.sh @MANPAGE_RENAMES@ >../edit_man.sed
 
 distclean realclean: clean
-	rm -f Makefile ../edit_man.* ../man_alias.*
+	rm -f Makefile *-config.1 ../edit_man.* ../man_alias.*
diff --git a/man/captoinfo.1m b/man/captoinfo.1m
index de57a27..c7a3364 100644
--- a/man/captoinfo.1m
+++ b/man/captoinfo.1m
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,38 +27,44 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: captoinfo.1m,v 1.22 2007/06/02 20:40:07 tom Exp $
+.\" $Id: captoinfo.1m,v 1.25 2010/12/04 18:36:44 tom Exp $
 .TH @CAPTOINFO@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fB@CAPTOINFO@\fR - convert a \fItermcap\fR description into a \fIterminfo\fR description
+\fB@CAPTOINFO@\fR \- convert a \fItermcap\fR description into a \fIterminfo\fR description
 .SH SYNOPSIS
-\fB@CAPTOINFO@\fR [\fB-v\fR\fIn\fR \fIwidth\fR]  [\fB-V\fR] [\fB-1\fR] [\fB-w\fR \fIwidth\fR] \fIfile\fR . . .
+\fB@CAPTOINFO@\fR [\fB\-v\fR\fIn\fR \fIwidth\fR]  [\fB\-V\fR] [\fB\-1\fR] [\fB\-w\fR \fIwidth\fR] \fIfile\fR . . .
 .SH DESCRIPTION
-\fB@CAPTOINFO@\fR looks in \fIfile\fR for \fBtermcap\fR descriptions.  For each
+\fB@CAPTOINFO@\fR looks in each given text
+\fIfile\fR for \fBtermcap\fR descriptions.
+For each
 one found, an equivalent \fBterminfo\fR description is written to standard
-output.  Termcap \fBtc\fR capabilities are translated directly to terminfo
+output.
+Termcap \fBtc\fR capabilities are translated directly to terminfo
 \fBuse\fR capabilities.
 .PP
 If no \fIfile\fR is given, then the environment variable \fBTERMCAP\fR is used
-for the filename or entry.  If \fBTERMCAP\fR is a full pathname to a file, only
+for the filename or entry.
+If \fBTERMCAP\fR is a full pathname to a file, only
 the terminal whose name is specified in the environment variable \fBTERM\fR is
-extracted from that file.  If the environment variable \fBTERMCAP\fR is not
+extracted from that file.
+If the environment variable \fBTERMCAP\fR is not
 set, then the file \fB\*d\fR is read.
 .TP 5
-\fB-v\fR
+\fB\-v\fR
 print out tracing information on standard error as the program runs.
 .TP 5
-\fB-V\fR
+\fB\-V\fR
 print out the version of the program in use on standard error and exit.
 .TP 5
-\fB-1\fR
-cause the fields to print out one to a line.  Otherwise, the fields
+\fB\-1\fR
+cause the fields to print out one to a line.
+Otherwise, the fields
 will be printed several to a line to a maximum width of 60
 characters.
 .TP 5
-\fB-w\fR
+\fB\-w\fR
 change the output to \fIwidth\fR characters.
 .SH FILES
 .TP 20
@@ -112,7 +118,8 @@
 .PP
 XENIX termcap also used to have a set of extension capabilities
 for forms drawing, designed to take advantage of the IBM PC
-high-half graphics.  They were as follows:
+high-half graphics.
+They were as follows:
 .PP
 .TS H
 c c
@@ -145,11 +152,13 @@
 .TE
 .PP
 If the single-line capabilities occur in an entry, they will automatically
-be composed into an \fIacsc\fR string.  The double-line capabilities and
+be composed into an \fIacsc\fR string.
+The double-line capabilities and
 \fBGG\fR are discarded with a warning message.
 .PP
 IBM's AIX has a terminfo facility descended from SVr1 terminfo but incompatible
-with the SVr4 format. The following AIX extensions are automatically
+with the SVr4 format.
+The following AIX extensions are automatically
 translated:
 .TS
 c c
@@ -171,11 +180,12 @@
 capabilities \fImeml\fR (memory lock) and \fImemu\fR (memory unlock).
 These will be discarded with a warning message.
 .SH NOTES
-This utility is actually a link to \fB@TIC@\fR(1M), running in \fI-I\fR mode.
-You can use other \fB@TIC@\fR options such as \fB-f\fR and  \fB-x\fR.
+This utility is actually a link to \fB@TIC@\fR(1M), running in \fI\-I\fR mode.
+You can use other \fB@TIC@\fR options such as \fB\-f\fR and  \fB\-x\fR.
 .PP
-The trace option is not identical to SVr4's.  Under SVr4, instead of following
-the \fB-v\fR with a trace level n, you repeat it n times.
+The trace option is not identical to SVr4's.
+Under SVr4, instead of following
+the \fB\-v\fR with a trace level n, you repeat it n times.
 .SH SEE ALSO
 \fB@INFOCMP@\fR(1M),
 \fBcurses\fR(3X),
@@ -185,9 +195,6 @@
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
 .SH AUTHOR
 Eric S. Raymond <esr@snark.thyrsus.com>
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+and
+.br
+Thomas E. Dickey <dickey@invisible-island.net>
diff --git a/man/clear.1 b/man/clear.1
index 31d0f93..d8e24e5 100644
--- a/man/clear.1
+++ b/man/clear.1
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2000,2006 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,18 +26,19 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: clear.1,v 1.6 2006/12/24 18:07:53 tom Exp $
+.\" $Id: clear.1,v 1.10 2013/06/22 22:22:11 tom Exp $
 .TH @CLEAR@ 1 ""
 .ds n 5
 .SH NAME
-\fB@CLEAR@\fR - clear the terminal screen
+\fB@CLEAR@\fR \- clear the terminal screen
 .SH SYNOPSIS
 \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
@@ -45,9 +46,3 @@
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_add_wch.3x b/man/curs_add_wch.3x
index 51ac1a4..5b744db 100644
--- a/man/curs_add_wch.3x
+++ b/man/curs_add_wch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2001-2012,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,15 +26,18 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_add_wch.3x,v 1.6 2006/12/24 15:22:22 tom Exp $
+.\" $Id: curs_add_wch.3x,v 1.16 2015/07/20 23:44:56 tom Exp $
 .TH curs_add_wch 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
 \fBadd_wch\fP,
 \fBwadd_wch\fP,
 \fBmvadd_wch\fP,
 \fBmvwadd_wch\fP,
 \fBecho_wchar\fP,
-\fBwecho_wchar\fP - add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
+\fBwecho_wchar\fP \- add a complex character and rendition to a \fBcurses\fR window, then advance the cursor
 .SH SYNOPSIS
 .PP
 \fB#include <curses.h>\fP
@@ -52,6 +55,7 @@
 .B "int wecho_wchar( WINDOW *\fIwin\fP, const cchar_t *\fIwch\fB );"
 .br
 .SH DESCRIPTION
+.SS add_wch
 .PP
 The
 \fBadd_wch\fP,
@@ -63,26 +67,24 @@
 which is then advanced.
 These functions perform
 wrapping and special-character processing as follows:
-.TP 5
--
+.bP
 If \fIwch\fP refers to a spacing character,
 then any previous character at that location is removed.
 A new character specified by \fIwch\fP is
 placed at that location with rendition specified by \fIwch\fP.
 The cursor then advances to
 the next spacing character on the screen.
-.TP 5
--
+.bP
 If \fIwch\fP refers to a non-spacing character,
 all previous characters at that location are preserved.
 The non-spacing characters of \fIwch\fP
 are added to the spacing complex character,
 and the rendition specified by \fIwch\fP is ignored.
-.TP 5
--
+.bP
 If the character part of \fIwch\fP is
 a tab, newline, backspace or other control character,
 the window is updated and the cursor moves as if \fBaddch\fR were called.
+.SS echo_wchar
 .PP
 The \fBecho_wchar\fP
 function is functionally equivalent to a call to
@@ -99,9 +101,90 @@
 that only a single character is being output is taken into consideration and,
 for non-control characters, a considerable performance gain might be seen
 by using the *\fBecho\fP* functions instead of their equivalents.
-.SH RETURN VALUES
+.SS Line Graphics
+Like \fBaddch\fP(3X),
+\fBaddch_wch\fP accepts symbols which make it simple to draw lines and other
+frequently used special characters.
+These symbols correspond to the same VT100 line-drawing set as
+\fBaddch\fP(3X).
+.PP
+.TS
+l l l l
+_ _ _ _
+lw(1.5i) lw7 lw7 lw20.
+\fIName\fR	\fIUnicode\fP	\fIDefault\fR	\fIDescription\fR
+WACS_BLOCK	0x25ae 	#	solid square block
+WACS_BOARD	0x2592 	#	board of squares
+WACS_BTEE	0x2534 	+	bottom tee
+WACS_BULLET	0x00b7 	o	bullet
+WACS_CKBOARD	0x2592 	:	checker board (stipple)
+WACS_DARROW	0x2193 	v	arrow pointing down
+WACS_DEGREE	0x00b0 	'	degree symbol
+WACS_DIAMOND	0x25c6 	+	diamond
+WACS_GEQUAL	0x2265 	>	greater-than-or-equal-to
+WACS_HLINE	0x2500 	\-	horizontal line
+WACS_LANTERN	0x2603 	#	lantern symbol
+WACS_LARROW	0x2190 	<	arrow pointing left
+WACS_LEQUAL	0x2264 	<	less-than-or-equal-to
+WACS_LLCORNER	0x2514 	+	lower left-hand corner
+WACS_LRCORNER	0x2518 	+	lower right-hand corner
+WACS_LTEE	0x2524 	+	left tee
+WACS_NEQUAL	0x2260 	!	not-equal
+WACS_PI	0x03c0 	*	greek pi
+WACS_PLMINUS	0x00b1 	#	plus/minus
+WACS_PLUS	0x253c 	+	plus
+WACS_RARROW	0x2192 	>	arrow pointing right
+WACS_RTEE	0x251c 	+	right tee
+WACS_S1	0x23ba 	\-	scan line 1
+WACS_S3	0x23bb 	\-	scan line 3
+WACS_S7	0x23bc 	\-	scan line 7
+WACS_S9	0x23bd 	\&_	scan line 9
+WACS_STERLING	0x00a3 	f	pound-sterling symbol
+WACS_TTEE	0x252c 	+	top tee
+WACS_UARROW	0x2191  	^	arrow pointing up
+WACS_ULCORNER	0x250c 	+	upper left-hand corner
+WACS_URCORNER	0x2510 	+	upper right-hand corner
+WACS_VLINE	0x2502 	|	vertical line
+.TE
+.PP
+The wide-character configuration of ncurses also defines symbols
+for thick- and double-lines:
+.PP
+.TS
+l l l l
+_ _ _ _
+lw(1.5i) lw7 lw7 lw20.
+\fIName\fR	\fIUnicode\fP	\fIDefault\fR	\fIDescription\fR
+WACS_T_ULCORNER	0x250f	+	thick upper left corner
+WACS_T_LLCORNER	0x2517	+	thick lower left corner
+WACS_T_URCORNER	0x2513	+	thick upper right corner
+WACS_T_LRCORNER	0x251b	+	thick lower right corner
+WACS_T_LTEE	0x252b	+	thick tee pointing right
+WACS_T_RTEE	0x2523	+	thick tee pointing left
+WACS_T_BTEE	0x253b	+	thick tee pointing up
+WACS_T_TTEE	0x2533	+	thick tee pointing down
+WACS_T_HLINE	0x2501	-	thick horizontal line
+WACS_T_VLINE	0x2503	|	thick vertical line
+WACS_T_PLUS	0x254b	+	thick large plus or crossover
+WACS_D_ULCORNER	0x2554	+	double upper left corner
+WACS_D_LLCORNER	0x255a	+	double lower left corner
+WACS_D_URCORNER	0x2557	+	double upper right corner
+WACS_D_LRCORNER	0x255d	+	double lower right corner
+WACS_D_RTEE	0x2563	+	double tee pointing left
+WACS_D_LTEE	0x2560	+	double tee pointing right
+WACS_D_BTEE	0x2569	+	double tee pointing up
+WACS_D_TTEE	0x2566	+	double tee pointing down
+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 VALUE
 .PP
 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
+.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
 .PP
 Note that
@@ -112,13 +195,28 @@
 may be macros.
 .SH PORTABILITY
 .PP
-All these functions are described in the XSI Curses standard, Issue 4.
-The defaults specified for forms-drawing characters apply in the POSIX locale.
+All of these functions are described in the XSI Curses standard, Issue 4.
+The defaults specified for line-drawing characters apply in the POSIX locale.
 .PP
-XSI documents constants beginning with \fBWACS_\fP which are used for
-line-drawing.
-Those are not currently implemented in \fBncurses\fP.
+X/Open Curses makes it clear that the WACS_ symbols should be defined as
+a pointer to \fBcchar_t\fP data, e.g., in the discussion of \fBborder_set\fR.
+A few implementations are problematic:
+.bP
+NetBSD curses defines the symbols as a \fBwchar_t\fP within a \fBcchar_t\fP.
+.bP
+HPUX curses equates some of the \fIACS_\fP symbols
+to the analogous \fIWACS_\fP symbols as if the \fIACS_\fP symbols were
+wide characters.
+The misdefined symbols are the arrows
+and other symbols which are not used for line-drawing.
+.PP
+X/Open Curses does not define symbols for thick- or double-lines.
+SVr4 curses implementations defined their line-drawing symbols in
+terms of intermediate symbols.
+This implementation extends those symbols, providing new definitions
+which are not in the SVr4 implementations.
 .SH SEE ALSO
+.na
 .PP
 \fBcurses\fR(3X),
 \fBcurs_addch\fR(3X),
@@ -127,9 +225,3 @@
 \fBcurs_outopts\fR(3X),
 \fBcurs_refresh\fR(3X),
 \fBputwc\fR(3)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_add_wchstr.3x b/man/curs_add_wchstr.3x
index f84c2cb..37e3df6 100644
--- a/man/curs_add_wchstr.3x
+++ b/man/curs_add_wchstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,2005 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.6 2005/01/02 01:28:49 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,40 +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.
-If \fBn\fR=\fB-1\fR then the whole array is copied,
+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 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 RETURN VALUES
-All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
 .SH PORTABILITY
-All these entry points are described in the XSI Curses standard, Issue 4.
+These entry points are described in the XSI Curses standard, Issue 4.
 .SH SEE ALSO
-\fBcurses\fR(3X),
-\fBcurs_addchstr\fR(3X),
-\fBcurs_addwstr\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurs_addwstr\fR(3X),
+\fBcurses\fR(3X).
+.PP
+Comparable functions in the narrow-character (ncurses) library are
+described in
+\fBcurs_addchstr\fR(3X).
diff --git a/man/curs_addch.3x b/man/curs_addch.3x
index 73918b8..15d859b 100644
--- a/man/curs_addch.3x
+++ b/man/curs_addch.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,12 +27,18 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_addch.3x,v 1.27 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_addch.3x,v 1.36 2015/07/16 09:14:44 tom Exp $
 .TH curs_addch 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
-\fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR,
+\fBaddch\fR,
+\fBwaddch\fR,
+\fBmvaddch\fR,
+\fBmvwaddch\fR,
 \fBechochar\fR,
-\fBwechochar\fR - add a character (with attributes) to a \fBcurses\fR window, then advance the cursor
+\fBwechochar\fR \- add a character (with attributes) to a \fBcurses\fR window, then advance the cursor
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .PP
@@ -49,24 +55,39 @@
 \fBint wechochar(WINDOW *win, const chtype ch);\fR
 .br
 .SH DESCRIPTION
+.SS Adding characters
 The \fBaddch\fR, \fBwaddch\fR, \fBmvaddch\fR and \fBmvwaddch\fR routines put
 the character \fIch\fR into the given window at its current window position,
 which is then advanced.  They are analogous to \fBputchar\fR in \fBstdio\fR(3).
-If the advance is at the right margin, the cursor automatically wraps to the
-beginning of the next line.  At the bottom of the current scrolling region, if
-\fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
+If the advance is at the right margin:
+.bP
+The cursor automatically wraps to the beginning of the next line.
+.bP
+At the bottom of the current scrolling region,
+and if \fBscrollok\fR is enabled,
+the scrolling region is scrolled up one line.
+.bP
+If \fBscrollok\fR is not enabled,
+writing a character at the lower right margin succeeds.
+However, an error is returned because
+it is not possible to wrap to a new line
 .PP
-If \fIch\fR is a tab, newline, or backspace,
-the cursor is moved appropriately within the window.
+If \fIch\fR is a tab, newline, carriage return or backspace,
+the cursor is moved appropriately within the window:
+.bP
 Backspace moves the cursor one character left; at the left
 edge of a window it does nothing.
+.bP
+Carriage return moves the cursor to the window left margin on the current line.
+.bP
 Newline does a \fBclrtoeol\fR,
 then moves the cursor to the window left margin on the next line,
 scrolling the window if on the last line.
+.bP
 Tabs are considered to be at every eighth column.
 The tab interval may be altered by setting the \fBTABSIZE\fR variable.
 .PP
-If \fIch\fR is any control character other than tab, newline, or backspace, it
+If \fIch\fR is any other control character, it
 is drawn in \fB^\fR\fIX\fR notation.  Calling \fBwinch\fR after adding a
 control character does not return the character itself, but instead returns
 the ^-representation of the control character.
@@ -77,6 +98,7 @@
 using \fBinch\fR and \fBaddch\fR.)  See the \fBcurs_attr\fR(3X) page for
 values of predefined video attribute constants that can be usefully OR'ed
 into characters.
+.SS Echoing characters
 .PP
 The \fBechochar\fR and \fBwechochar\fR routines are equivalent to a call to
 \fBaddch\fR followed by a call to \fBrefresh\fR, or a call to \fBwaddch\fR
@@ -105,7 +127,7 @@
 ACS_DEGREE	'	degree symbol
 ACS_DIAMOND	+	diamond
 ACS_GEQUAL	>	greater-than-or-equal-to
-ACS_HLINE	-	horizontal line
+ACS_HLINE	\-	horizontal line
 ACS_LANTERN	#	lantern symbol
 ACS_LARROW	<	arrow pointing left
 ACS_LEQUAL	<	less-than-or-equal-to
@@ -118,9 +140,9 @@
 ACS_PLUS	+	plus
 ACS_RARROW	>	arrow pointing right
 ACS_RTEE	+	right tee
-ACS_S1	-	scan line 1
-ACS_S3	-	scan line 3
-ACS_S7	-	scan line 7
+ACS_S1	\-	scan line 1
+ACS_S3	\-	scan line 3
+ACS_S7	\-	scan line 7
 ACS_S9	\&_	scan line 9
 ACS_STERLING	f	pound-sterling symbol
 ACS_TTEE	+	top tee
@@ -134,6 +156,10 @@
 (the SVr4 manuals specify only "an integer value other than \fBERR\fR") upon
 successful completion, unless otherwise noted in the preceding routine
 descriptions.
+.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 \fBaddch\fR, \fBmvaddch\fR, \fBmvwaddch\fR, and
 \fBechochar\fR may be macros.
@@ -141,6 +167,10 @@
 All these functions are described in the XSI Curses standard, Issue 4.
 The defaults specified for forms-drawing characters apply in the POSIX locale.
 .LP
+X/Open Curses states that the \fIACS_\fP definitions are \fBchar\fP constants.
+For the wide-character implementation (see \fBcurs_add_wch\fP),
+there are analogous \fIWACS_\fP definitions which are \fBcchar_t\fP constants.
+.LP
 Some ACS symbols
 (ACS_S3,
 ACS_S7,
@@ -168,14 +198,9 @@
 \fBcurs_inch\fR(3X),
 \fBcurs_outopts\fR(3X),
 \fBcurs_refresh\fR(3X),
+\fBcurs_variables\fR(3X),
 \fBputc\fR(3).
 .PP
 Comparable functions in the wide-character (ncursesw) library are
 described in
 \fBcurs_add_wch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_addchstr.3x b/man/curs_addchstr.3x
index ac1b040..08536e3 100644
--- a/man/curs_addchstr.3x
+++ b/man/curs_addchstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 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.12 2006/12/02 17:02:45 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
@@ -38,10 +41,11 @@
 \fBmvaddchstr\fR,
 \fBmvaddchnstr\fR,
 \fBmvwaddchstr\fR,
-\fBmvwaddchnstr\fR - add a string of characters (and attributes) to a \fBcurses\fR window
+\fBmvwaddchnstr\fR \- add a string of characters (and attributes) to a \fBcurses\fR window
 .ad
 .hy
 .SH SYNOPSIS
+.nf
 \fB#include <curses.h>\fR
 .PP
 \fBint addchstr(const chtype *chstr);\fR
@@ -59,41 +63,49 @@
 \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
 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
-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
 described in
 \fBcurs_add_wchstr\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_addstr.3x b/man/curs_addstr.3x
index 488b9dd..b1cb1cc 100644
--- a/man/curs_addstr.3x
+++ b/man/curs_addstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 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.13 2005/05/15 16:17:14 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
@@ -38,7 +41,7 @@
 \fBmvaddstr\fR,
 \fBmvaddnstr\fR,
 \fBmvwaddstr\fR,
-\fBmvwaddnstr\fR - add a string of characters to a \fBcurses\fR window and advance cursor
+\fBmvwaddnstr\fR \- add a string of characters to a \fBcurses\fR window and advance cursor
 .ad
 .hy
 .SH SYNOPSIS
@@ -62,36 +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).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_addch\fR(3X).
diff --git a/man/curs_addwstr.3x b/man/curs_addwstr.3x
index 63d2746..835cb34 100644
--- a/man/curs_addwstr.3x
+++ b/man/curs_addwstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,2006 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.7 2006/02/25 20:59:08 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,33 +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)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_attr.3x b/man/curs_attr.3x
index cf58aff..718417f 100644
--- a/man/curs_attr.3x
+++ b/man/curs_attr.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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.31 2007/03/17 20:30:33 tom Exp $
+.\" $Id: curs_attr.3x,v 1.40 2015/07/20 23:35:38 tom Exp $
 .TH curs_attr 3X ""
 .na
 .hy 0
@@ -56,80 +56,88 @@
 \fBwchgat\fR,
 \fBmvchgat\fR,
 \fBmvwchgat\fR,
-\fBPAIR_NUMBER\fR - \fBcurses\fR character and window attribute control routines
+\fBPAIR_NUMBER\fR \- \fBcurses\fR character and window attribute control routines
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .br
-\fBint attroff(int attrs);\fR
+\fBint attroff(int \fP\fIattrs);\fR
 .br
-\fBint wattroff(WINDOW *win, int attrs);\fR
+\fBint wattroff(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
 .br
-\fBint attron(int attrs);\fR
+\fBint attron(int \fP\fIattrs\fP\fB);\fR
 .br
-\fBint wattron(WINDOW *win, int attrs);\fR
+\fBint wattron(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
 .br
-\fBint attrset(int attrs);\fR
+\fBint attrset(int \fP\fIattrs\fP\fB);\fR
 .br
-\fBint wattrset(WINDOW *win, int attrs);\fR
+\fBint wattrset(WINDOW *\fP\fIwin\fP\fB, int \fP\fIattrs\fP\fB);\fR
 .br
-\fBint color_set(short color_pair_number, void* opts);\fR
+\fBint color_set(short \fP\fIcolor_pair_number\fP\fB, void* \fP\fIopts\fP\fB);\fR
 .br
-\fBint wcolor_set(WINDOW *win, short color_pair_number,\fR
-      \fBvoid* opts);\fR
+\fBint wcolor_set(WINDOW *\fP\fIwin\fP\fB, short \fP\fIcolor_pair_number\fP\fB,\fR
+      \fBvoid* \fP\fIopts);\fR
 .br
 \fBint standend(void);\fR
 .br
-\fBint wstandend(WINDOW *win);\fR
+\fBint wstandend(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
 \fBint standout(void);\fR
 .br
-\fBint wstandout(WINDOW *win);\fR
+\fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBint attr_get(attr_t *attrs, short *pair, void *opts);\fR
+\fBint attr_get(attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint wattr_get(WINDOW *win, attr_t *attrs, short *pair,\fR
-       \fBvoid *opts);\fR
+\fBint wattr_get(WINDOW *\fP\fIwin\fP\fB, attr_t *\fP\fIattrs\fP\fB, short *\fP\fIpair\fP\fB,\fR
+       \fBvoid *\fP\fIopts\fP\fB);\fR
 .br
-\fBint attr_off(attr_t attrs, void *opts);\fR
+\fBint attr_off(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint wattr_off(WINDOW *win, attr_t attrs, void *opts);\fR
+\fBint wattr_off(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint attr_on(attr_t attrs, void *opts);\fR
+\fBint attr_on(attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint wattr_on(WINDOW *win, attr_t attrs, void *opts);\fR
+\fBint wattr_on(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint attr_set(attr_t attrs, short pair, void *opts);\fR
+\fBint attr_set(attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint wattr_set(WINDOW *win, attr_t attrs, short pair, void *opts);\fR
+\fBint wattr_set(WINDOW *\fP\fIwin\fP\fB, attr_t \fP\fIattrs\fP\fB, short \fP\fIpair\fP\fB, void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint chgat(int n, attr_t attr, short color,\fR
-      \fBconst void *opts)\fR
+\fBint chgat(int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB, short \fP\fIcolor\fP\fB,\fR
+      \fBconst void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint wchgat(WINDOW *win, int n, attr_t attr,\fR
-      \fBshort color, const void *opts)\fR
+\fBint wchgat(WINDOW *\fP\fIwin\fP\fB, int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR
+      \fBshort \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint mvchgat(int y, int x, int n, attr_t attr,\fR
-      \fBshort color, const void *opts)\fR
+\fBint mvchgat(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB, int \fP\fIn\fP\fB, attr_t \fP\fIattr\fP\fB,\fR
+      \fBshort \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR
 .br
-\fBint mvwchgat(WINDOW *win, int y, int x, int n,\fR
-      \fBattr_t attr, short color, const void *opts)\fR
+\fBint mvwchgat(WINDOW *\fP\fIwin, int \fP\fIy, int \fP\fIx, int \fP\fIn,\fR
+      \fBattr_t \fP\fIattr\fP\fB, short \fP\fIcolor\fP\fB, const void *\fP\fIopts\fP\fB);\fR
 .br
 .SH DESCRIPTION
-These routines manipulate the current attributes of the named window.  The
+These routines manipulate the current attributes of the named window.
+The
 current attributes of a window apply to all characters that are written into
-the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.  Attributes are
+the window with \fBwaddch\fR, \fBwaddstr\fR and \fBwprintw\fR.
+Attributes are
 a property of the character, and move with the character through any scrolling
-and insert/delete line/character operations.  To the extent possible, they are
+and insert/delete line/character operations.
+To the extent possible, they are
 displayed as appropriate modifications to the graphic rendition of characters
 put on the screen.
+.SS attrset
 .PP
 The routine \fBattrset\fR sets the current attributes of the given window to
-\fIattrs\fR.  The routine \fBattroff\fR turns off the named attributes without
-turning any other attributes on or off.  The routine \fBattron\fR turns on the
-named attributes without affecting any others.  The routine \fBstandout\fR is
-the same as \fBattron(A_STANDOUT)\fR.  The routine \fBstandend\fR is the same
+\fIattrs\fR.
+The routine \fBattroff\fR turns off the named attributes without
+turning any other attributes on or off.
+The routine \fBattron\fR turns on the
+named attributes without affecting any others.
+The routine \fBstandout\fR is
+the same as \fBattron(A_STANDOUT)\fR.
+The routine \fBstandend\fR is the same
 as \fBattrset(A_NORMAL)\fR or \fBattrset(0)\fR, that is, it turns off all
 attributes.
 .PP
@@ -137,36 +145,57 @@
 when erasing portions of the window.
 See \fBcurs_bkgd\fR(3X) for functions which modify the attributes used for
 erasing and clearing.
+.SS attr_set
+The \fBattrset\fP routine is actually a legacy feature predating SVr4 curses
+but kept in X/Open Curses for the same reason that SVr4 curses kept it:
+compatbility.
+The routine \fBattr_set\fP provides for passing a color-pair parameter.
+.PP
+The remaining \fBattr_\fR* functions operate exactly like the corresponding
+\fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR
+rather than \fBint\fR.
+.SS color_set
 .PP
 The routine \fBcolor_set\fR sets the current color of the given window to the
-foreground/background combination described by the color_pair_number. The
+foreground/background combination described by the color_pair_number.
+The
 parameter opts is reserved for future use, applications must supply a null
 pointer.
+.SS attr_get
 .PP
 The routine \fBwattr_get\fR returns the current attribute and color pair for
 the given window; \fBattr_get\fR returns the current attribute and color pair
 for \fBstdscr\fR.
-The remaining \fBattr_\fR* functions operate exactly like the corresponding
-\fBattr\fR* functions, except that they take arguments of type \fBattr_t\fR
-rather than \fBint\fR.
+.PP
+There is no corresponding \fBattrget\fP function as such in X/Open Curses,
+although ncurses provides \fBgetattrs\fP (see curs_legacy(3x)).
+.SS chgat
 .PP
 The routine \fBchgat\fR changes the attributes of a given number of characters
-starting at the current cursor location of \fBstdscr\fR.  It does not update
-the cursor and does not perform wrapping.  A character count of -1 or greater
+starting at the current cursor location of \fBstdscr\fR.
+It does not update
+the cursor and does not perform wrapping.
+A character count of \-1 or greater
 than the remaining window width means to change attributes all the way to the
-end of the current line.  The \fBwchgat\fR function generalizes this to any
-window; the \fBmvwchgat\fR function does a cursor move before acting.  In these
+end of the current line.
+The \fBwchgat\fR function generalizes this to any
+window; the \fBmvwchgat\fR function does a cursor move before acting.
+In these
 functions, the color argument is a color-pair index (as in the first argument
-of \fIinit_pair\fR, see \fBcurs_color\fR(3X)).  The \fBopts\fR argument is not
+of \fIinit_pair\fR, see \fBcurs_color\fR(3X)).
+The \fBopts\fR argument is not
 presently used, but is reserved for the future (leave it \fBNULL\fR).
 .SS Attributes
 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.
+characters passed to \fBaddch\fR (see curs_addch(3x)).
 .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 +206,30 @@
 \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
@@ -202,30 +252,43 @@
 However, ncurses ABI 4 and 5 simply OR this value within the alternate functions.
 You must use ncurses ABI 6 to support more than 256 color pairs.
 .SH PORTABILITY
-These functions are supported in the XSI Curses standard, Issue 4.  The
+These functions are supported in the XSI Curses standard, Issue 4.
+The
 standard defined the dedicated type for highlights, \fBattr_t\fR, which is not
-defined in SVr4 curses. The functions taking \fBattr_t\fR arguments are
+defined in SVr4 curses.
+The functions taking \fBattr_t\fR arguments are
 not supported under SVr4.
 .PP
 The XSI Curses standard states that whether the traditional functions
 \fBattron\fR/\fBattroff\fR/\fBattrset\fR can manipulate attributes other than
 \fBA_BLINK\fR, \fBA_BOLD\fR, \fBA_DIM\fR, \fBA_REVERSE\fR, \fBA_STANDOUT\fR, or
-\fBA_UNDERLINE\fR is "unspecified".  Under this implementation as well as
+\fBA_UNDERLINE\fR is "unspecified".
+Under this implementation as well as
 SVr4 curses, these functions correctly manipulate all other highlights
 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
 .PP
+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
+\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
@@ -235,6 +298,11 @@
 \fBWA_BOLD\fR	Extra bright or bold
 \fBWA_ALTCHARSET\fR	Alternate character set
 .TE
+.RE
+.PP
+Very old 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
@@ -242,8 +310,10 @@
 .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
@@ -252,19 +322,19 @@
 This implementation returns an error
 if the window pointer is null.
 The \fBwcolor_set\fP function returns an error if the color pair parameter
-is outside the range 0..COLOR_PAIRS-1.
+is outside the range 0..COLOR_PAIRS\-1.
 This implementation also provides
 \fBgetattrs\fR
 for compatibility with older versions of curses.
+.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 SEE ALSO
+.na
 \fBcurses\fR(3X),
 \fBcurs_addch\fR(3X),
 \fBcurs_addstr\fR(3X),
 \fBcurs_bkgd\fR(3X),
-\fBcurs_printw\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurs_printw\fR(3X),
+\fBcurs_variables\fR(3X)
diff --git a/man/curs_beep.3x b/man/curs_beep.3x
index 49e5761..c6af6f0 100644
--- a/man/curs_beep.3x
+++ b/man/curs_beep.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_beep.3x,v 1.10 2005/01/08 17:55:51 tom Exp $
+.\" $Id: curs_beep.3x,v 1.12 2010/12/04 18:36:44 tom Exp $
 .TH curs_beep 3X ""
 .SH NAME
-\fBbeep\fR, \fBflash\fR - \fBcurses\fR bell and screen flash routines
+\fBbeep\fR, \fBflash\fR \- \fBcurses\fR bell and screen flash routines
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .PP
@@ -55,9 +55,3 @@
 Like SVr4, it specifies that they always return \fBOK\fR.
 .SH SEE ALSO
 \fBcurses\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_bkgd.3x b/man/curs_bkgd.3x
index b2d768a..50c3b30 100644
--- a/man/curs_bkgd.3x
+++ b/man/curs_bkgd.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free 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,26 +26,30 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_bkgd.3x,v 1.19 2003/12/27 18:50:40 tom Exp $
+.\" $Id: curs_bkgd.3x,v 1.23 2015/07/21 00:11:05 tom Exp $
+.de bP
+.IP \(bu 4
+..
 .TH curs_bkgd 3X ""
 .SH NAME
 \fBbkgdset\fR, \fBwbkgdset\fR,
 \fBbkgd\fR, \fBwbkgd\fR,
-\fBgetbkgd\fR - \fBcurses\fR window background manipulation routines
+\fBgetbkgd\fR \- \fBcurses\fR window background manipulation routines
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .PP
-\fBvoid bkgdset(chtype ch);\fR
+\fBvoid bkgdset(chtype \fP\fIch\fP\fB);\fR
 .br
-\fBvoid wbkgdset(WINDOW *win, chtype ch);\fR
+\fBvoid wbkgdset(WINDOW *\fP\fIwin, chtype \fP\fIch\fP\fB);\fR
 .br
-\fBint bkgd(chtype ch);\fR
+\fBint bkgd(chtype \fP\fIch\fP\fB);\fR
 .br
-\fBint wbkgd(WINDOW *win, chtype ch);\fR
+\fBint wbkgd(WINDOW *\fP\fIwin\fP\fB, chtype \fP\fIch\fP\fB);\fR
 .br
-\fBchtype getbkgd(WINDOW *win);\fR
+\fBchtype getbkgd(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
 .SH DESCRIPTION
+.SS bkgdset
 The \fBbkgdset\fR and \fBwbkgdset\fR routines manipulate the
 background of the named window.
 The window background is a \fBchtype\fR consisting of
@@ -60,39 +64,40 @@
 To the extent possible on a particular terminal,
 the attribute part of the background is displayed
 as the graphic rendition of the character put on the screen.
+.SS bkgd
 .PP
 The \fBbkgd\fR and \fBwbkgd\fR functions
 set the background property of the current or specified window
 and then apply this setting to every character position in that window:
 .PP
-.RS
+.bP
 The rendition of every character on the screen is changed to
 the new background rendition.
-.PP
+.bP
 Wherever the former background character
 appears, it is changed to the new background character.
 .RE
+.SS getbkgd
 .PP
 The \fBgetbkgd\fR function returns the given window's current background
 character/attribute pair.
 .SH RETURN VALUE
+.PP
 The routines \fBbkgd\fR and \fBwbkgd\fR return the integer \fBOK\fR.
 The SVr4.0 manual says "or a non-negative integer if \fBimmedok\fR is set",
 but this appears to be an error.
 .SH NOTES
+.PP
 Note that \fBbkgdset\fR and \fBbkgd\fR may be macros.
 .SH PORTABILITY
+.PP
 These functions are described in the XSI Curses standard, Issue 4.
-It specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR on failure.
+It specifies that \fBbkgd\fR and \fBwbkgd\fR return \fBERR\fR on failure,
 but gives no failure conditions.
 .SH SEE ALSO
+.na
+.PP
 \fBcurses\fR(3X),
 \fBcurs_addch\fR(3X),
 \fBcurs_attr\fR(3X),
 \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_bkgrnd.3x b/man/curs_bkgrnd.3x
index 8c6f6af..2bbb4fc 100644
--- a/man/curs_bkgrnd.3x
+++ b/man/curs_bkgrnd.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2002-2012,2015 Free 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,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_bkgrnd.3x,v 1.3 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_bkgrnd.3x,v 1.6 2015/07/21 00:18:42 tom Exp $
+.de bP
+.IP \(bu 4
+..
 .TH curs_bkgrnd 3X ""
 .SH NAME
 \fBbkgrnd\fR,
@@ -52,6 +55,8 @@
 \fBint wgetbkgrnd(WINDOW *\fR\fIwin\fR\fB, cchar_t *\fR\fIwch\fR\fB);\fR
 .br
 .SH DESCRIPTION
+.SS bkgrndset
+.PP
 The \fBbkgrndset\fR and \fBwbkgrndset\fR routines manipulate the
 background of the named window.
 The window background is a \fBcchar_t\fR consisting of
@@ -67,29 +72,29 @@
 To the extent possible on a
 particular terminal, the attribute part of the background is displayed
 as the graphic rendition of the character put on the screen.
+.SS bkgrnd
 .PP
 The \fBbkgrnd\fR and \fBwbkgrnd\fR functions
 set the background property of the current or specified window
 and then apply this setting to every character position in that window:
-.RS
-.PP
+.bP
 The rendition of every character on the screen is changed to
 the new background rendition.
-.PP
+.bP
 Wherever the former background character
 appears, it is changed to the new background character.
-.RE
+.SS getbkgrnd
 .PP
 The \fBgetbkgrnd\fR function returns the given window's current background
 character/attribute pair via the \fBwch\fR pointer.
-.
 .SH NOTES
 Note that
 \fBbkgrnd\fR,
 \fBbkgrndset\fR, and
 \fBgetbkgrnd\fR
 may be macros.
-.SH RETURN VALUES
+.SH RETURN VALUE
+.PP
 The \fBbkgrndset\fR and \fBwbkgrndset\fR routines do not return a value.
 .PP
 Upon successful completion, the other functions return \fBOK\fR.
@@ -98,9 +103,3 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_bkgd\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_border.3x b/man/curs_border.3x
index 09f9a4c..5a58e9d 100644
--- a/man/curs_border.3x
+++ b/man/curs_border.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free 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.3x,v 1.19 2007/02/24 16:15:38 tom Exp $
+.\" $Id: curs_border.3x,v 1.22 2010/12/04 18:36:44 tom Exp $
 .TH curs_border 3X ""
 .na
 .hy 0
@@ -41,7 +41,7 @@
 \fBmvhline\fR,
 \fBmvwhline\fR,
 \fBmvvline\fR,
-\fBmvwvline\fR - create \fBcurses\fR borders, horizontal and vertical lines
+\fBmvwvline\fR \- create \fBcurses\fR borders, horizontal and vertical lines
 .ad
 .hy
 .SH SYNOPSIS
@@ -78,21 +78,21 @@
 Other than the window, each argument is a character with attributes:
 .sp
 .RS
-\fIls\fR - left side,
+\fIls\fR \- left side,
 .br
-\fIrs\fR - right side,
+\fIrs\fR \- right side,
 .br
-\fIts\fR - top side,
+\fIts\fR \- top side,
 .br
-\fIbs\fR - bottom side,
+\fIbs\fR \- bottom side,
 .br
-\fItl\fR - top left-hand corner,
+\fItl\fR \- top left-hand corner,
 .br
-\fItr\fR - top right-hand corner,
+\fItr\fR \- top right-hand corner,
 .br
-\fIbl\fR - bottom left-hand corner, and
+\fIbl\fR \- bottom left-hand corner, and
 .br
-\fIbr\fR - bottom right-hand corner.
+\fIbr\fR \- bottom right-hand corner.
 .RE
 .PP
 If any of these arguments is zero, then the corresponding
@@ -136,6 +136,10 @@
 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
 The borders generated by these functions are \fIinside\fR borders (this
 is also true of SVr4 curses, though the fact is not documented).
@@ -147,9 +151,3 @@
 but specifies no error conditions.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_outopts\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_border_set.3x b/man/curs_border_set.3x
index dbf8653..c9621ac 100644
--- a/man/curs_border_set.3x
+++ b/man/curs_border_set.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,2005 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.6 2005/05/15 16:17:37 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
@@ -110,21 +110,21 @@
 .PP
 Other than the window, each argument is a complex character with attributes:
 .RS
-\fIls\fR - left side,
+\fIls\fR \- left side,
 .br
-\fIrs\fR - right side,
+\fIrs\fR \- right side,
 .br
-\fIts\fR - top side,
+\fIts\fR \- top side,
 .br
-\fIbs\fR - bottom side,
+\fIbs\fR \- bottom side,
 .br
-\fItl\fR - top left-hand corner,
+\fItl\fR \- top left-hand corner,
 .br
-\fItr\fR - top right-hand corner,
+\fItr\fR \- top right-hand corner,
 .br
-\fIbl\fR - bottom left-hand corner, and
+\fIbl\fR \- bottom left-hand corner, and
 .br
-\fIbr\fR - bottom right-hand corner.
+\fIbr\fR \- bottom right-hand corner.
 .RE
 .PP
 If any of these arguments is zero, then the corresponding
@@ -187,7 +187,7 @@
 \fBvline_set\fR
 may be macros.
 .br
-.SH RETURN VALUES
+.SH RETURN VALUE
 .PP
 Upon successful completion, these functions return
 \fBOK\fR.
@@ -195,13 +195,12 @@
 \fBERR\fR.
 .PP
 Functions using a window parameter return an error if it 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 SEE ALSO
 \fBncurses\fR(3X),
+\fBcurs_add_wch\fR(3X),
 \fBcurs_border\fR(3X),
 \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_clear.3x b/man/curs_clear.3x
index adbfd2c..305c608 100644
--- a/man/curs_clear.3x
+++ b/man/curs_clear.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free 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_clear.3x,v 1.11 2007/12/29 15:58:38 tom Exp $
+.\" $Id: curs_clear.3x,v 1.14 2010/12/04 18:36:44 tom Exp $
 .TH curs_clear 3X ""
 .na
 .hy 0
@@ -38,7 +38,7 @@
 \fBclrtobot\fR,
 \fBwclrtobot\fR,
 \fBclrtoeol\fR,
-\fBwclrtoeol\fR - clear all or part of a \fBcurses\fR window
+\fBwclrtoeol\fR \- clear all or part of a \fBcurses\fR window
 .ad
 .hy
 .SH SYNOPSIS
@@ -112,10 +112,7 @@
 If you do not want to clear the screen during the next \fBwrefresh\fP,
 use \fBwerase\fP instead.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_outopts\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_variables\fR(3X)
diff --git a/man/curs_color.3x b/man/curs_color.3x
index 99e63ef..46af844 100644
--- a/man/curs_color.3x
+++ b/man/curs_color.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free 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,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_color.3x,v 1.28 2005/12/18 00:00:37 tom Exp $
+.\" $Id: curs_color.3x,v 1.39 2015/06/06 23:29:02 tom Exp $
 .TH curs_color 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
 .SH NAME
@@ -38,12 +46,12 @@
 \fBcan_change_color\fR,
 \fBcolor_content\fR,
 \fBpair_content\fR,
-\fBCOLOR_PAIR\fR - \fBcurses\fR color manipulation routines
+\fBCOLOR_PAIR\fR \- \fBcurses\fR color manipulation routines
 .ad
 .hy
 .SH SYNOPSIS
 \fB# include <curses.h>\fR
-.br
+.sp
 \fBint start_color(void);\fR
 .br
 \fBint init_pair(short pair, short f, short b);\fR
@@ -60,98 +68,203 @@
 .br
 .SH DESCRIPTION
 .SS Overview
-\fBcurses\fR support color attributes on terminals with that capability.  To
-use these routines \fBstart_color\fR must be called, usually right after
-\fBinitscr\fR.  Colors are always used in pairs (referred to as color-pairs).
+\fBcurses\fR supports color attributes on terminals with that capability.
+To use these routines \fBstart_color\fR must be called, usually right after
+\fBinitscr\fR.
+Colors are always used in pairs (referred to as color-pairs).
 A color-pair consists of a foreground color (for characters) and a background
-color (for the blank field on which the characters are displayed).  A
-programmer initializes a color-pair with the routine \fBinit_pair\fR.  After it
-has been initialized, \fBCOLOR_PAIR\fR(\fIn\fR), a macro defined in
+color (for the blank field on which the characters are displayed).
+A programmer initializes a color-pair with the routine \fBinit_pair\fR.
+After it has been initialized, \fBCOLOR_PAIR\fR(\fIn\fR), a macro defined in
 \fB<curses.h>\fR, can be used as a new video attribute.
 .PP
 If a terminal is capable of redefining colors, the programmer can use the
-routine \fBinit_color\fR to change the definition of a color.  The routines
-\fBhas_colors\fR and \fBcan_change_color\fR return \fBTRUE\fR or \fBFALSE\fR,
+routine \fBinit_color\fR to change the definition of a color.
+The routines \fBhas_colors\fR and \fBcan_change_color\fR
+return \fBTRUE\fR or \fBFALSE\fR,
 depending on whether the terminal has color capabilities and whether the
-programmer can change the colors.  The routine \fBcolor_content\fR allows a
+programmer can change the colors.
+The routine \fBcolor_content\fR allows a
 programmer to extract the amounts of red, green, and blue components in an
-initialized color.  The routine \fBpair_content\fR allows a programmer to find
+initialized color.
+The routine \fBpair_content\fR allows a programmer to find
 out how a given color-pair is currently defined.
-.SS Routine Descriptions
-The \fBstart_color\fR routine requires no arguments.  It must be
-called if the programmer wants to use colors, and before any other
-color manipulation routine is called.  It is good practice to call
-this routine right after \fBinitscr\fR.  \fBstart_color\fR initializes
-eight basic colors (black, red, green, yellow, blue, magenta, cyan,
-and white), and two global variables, \fBCOLORS\fR and
-\fBCOLOR_PAIRS\fR (respectively defining the maximum number of colors
-and color-pairs the terminal can support).  It also restores the
-colors on the terminal to the values they had when the terminal was
-just turned on.
+.SS Color Rendering
+The \fBcurses\fP library combines these inputs to produce the
+actual foreground and background colors shown on the screen:
+.bP
+per-character video attributes (e.g., via \fBwaddch\fP),
+.bP
+the window attribute (e.g., by \fBwattrset\fP), and
+.bP
+the background character (e.g., \fBwbkgdset\fP).
 .PP
-The \fBinit_pair\fR routine changes the definition of a color-pair.  It takes
-three arguments: the number of the color-pair to be changed, the foreground
-color number, and the background color number.
-For portable applications:
-.TP 5
--
-The value of the first argument
-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
-.TP 5
--
-The value of the second and
-third arguments must be between 0 and \fBCOLORS\fR.
-Color pair 0 is assumed to be white on black,
+Per-character and window attributes are usually set by a parameter containing
+video attributes including a \fBCOLOR_PAIR\fP value.
+Some functions such as \fBwattr_set\fP use a separate parameter which
+is the color pair number.
+.PP
+The background character is a special case: it includes a character value,
+just as if it were passed to \fBwaddch\fP.
+.PP
+The \fBcurses\fP library does the actual work of combining these color
+pairs in an internal function called from \fBwaddch\fP:
+.bP
+If the parameter passed to \fBwaddch\fP is \fIblank\fP,
+and it uses the special color pair 0,
+.RS
+.bP
+\fBcurses\fP next checks the window attribute.
+.bP
+If the window attribute does not use color pair 0,
+\fBcurses\fP uses the color pair from the window attribute.
+.bP
+Otherwise, \fBcurses\fP uses the background character.
+.RE
+.bP
+If the parameter passed to \fBwaddch\fP is \fInot blank\fP,
+or it does not use the special color pair 0,
+\fBcurses\fP prefers the color pair from the parameter,
+if it is nonzero.
+Otherwise, it tries the window attribute next, and finally the
+background character.
+.PP
+Some \fBcurses\fP functions such as \fBwprintw\fP call \fBwaddch\fP.
+Those do not combine its parameter with a color pair.
+Consequently those calls use only the window attribute or
+the background character.
+.SS Routine Descriptions
+The \fBstart_color\fR routine requires no arguments.
+It must be called if the programmer wants to use colors, and before any other
+color manipulation routine is called.
+It is good practice to call this routine right after \fBinitscr\fR.
+\fBstart_color\fR does this:
+.bP
+It initializes two global variables, \fBCOLORS\fR and
+\fBCOLOR_PAIRS\fR (respectively defining the maximum number of colors
+and color-pairs the terminal can support).
+.bP
+It initializes the special color pair \fB0\fP to the default foreground
+and background colors.
+No other color pairs are initialized.
+.bP
+It restores the colors on the terminal to the values
+they had when the terminal was just turned on.
+.bP
+If the terminal supports the \fBinitc\fP (\fBinitialize_color\fP) capability,
+\fBstart_color\fP
+initializes its internal table representing the
+red, green and blue components of the color palette.
+.IP
+The components depend on whether the terminal uses
+CGA (aka "ANSI") or
+HLS (i.e., the \fBhls\fP (\fBhue_lightness_saturation\fP) capability is set).
+The table is initialized first for eight basic colors
+(black, red, green, yellow, blue, magenta, cyan, and white),
+and after that (if the terminal supports more than eight colors)
+the components are initialized to \fB1000\fP.
+.IP
+\fBstart_color\fP does not attempt to set the terminal's color palette
+to match its built-in table.
+An application may use \fBinit_color\fP to alter the internal table
+along with the terminal's color.
+.PP
+These limits apply to color values and color pairs.
+Values outside these limits are not legal, and may result in a runtime error:
+.bP
+\fBCOLORS\fP corresponds to the terminal database's \fBmax_colors\fP capability,
+which is typically a signed 16-bit integer (see \fBterminfo\fR(\*n)).
+.bP
+color values are expected to be in the range \fB0\fP to \fBCOLORS\-1\fP,
+inclusive (including \fB0\fP and \fBCOLORS\-1\fP).
+.bP
+a special color value \fB\-1\fP is used in certain extended functions
+to denote the \fIdefault color\fP (see \fBuse_default_colors\fP).
+.bP
+\fBCOLOR_PAIRS\fP corresponds to the terminal database's \fBmax_pairs\fP capability,
+which is typically a signed 16-bit integer (see \fBterminfo\fR(\*n)).
+.bP
+legal color pair values are in the range \fB1\fP to \fBCOLOR_PAIRS\-1\fP,
+inclusive.
+.bP
+color pair \fB0\fP is special; it denotes \*(``no color\*(''.
+.IP
+Color pair \fB0\fP is assumed to be white on black,
 but is actually whatever the terminal implements before color is initialized.
 It cannot be modified by the application.
 .PP
-If the color-pair was previously
-initialized, the screen is refreshed and all occurrences of that color-pair
+The \fBinit_pair\fR routine changes the definition of a color-pair.
+It takes three arguments: the number of the color-pair to be changed, the foreground
+color number, and the background color number.
+For portable applications:
+.bP
+The first argument must be a legal color pair value.
+If default colors are used (see \fBuse_default_colors\fP)
+the upper limit is adjusted to allow for extra pairs which use
+a default color in foreground and/or background.
+.bP
+The second and third arguments must be legal color values.
+.PP
+If the color-pair was previously initialized,
+the screen is refreshed and all occurrences of that color-pair
 are changed to the new definition.
 .PP
-As an extension, ncurses allows you to set color pair 0 via
+As an extension, ncurses allows you to set color pair \fB0\fP via
 the \fBassume_default_colors\fR routine, or to specify the use of
-default colors (color number \fB-1\fR) if you first invoke the
+default colors (color number \fB\-1\fR) if you first invoke the
 \fBuse_default_colors\fR routine.
 .PP
-The \fBinit_color\fR routine changes the definition of a color.  It takes four
-arguments: the number of the color to be changed followed by three RGB values
-(for the amounts of red, green, and blue components).  The value of the first
-argument must be between \fB0\fR and \fBCOLORS\fR.  (See the section
-\fBColors\fR for the default color index.)  Each of the last three arguments
-must be a value between 0 and 1000.  When \fBinit_color\fR is used, all
+The \fBinit_color\fR routine changes the definition of a color.
+It takes four arguments: the number of the color to be changed followed by three RGB values
+(for the amounts of red, green, and blue components).
+The first argument must be a legal color value;
+default colors are not allowed here.
+(See the section \fBColors\fR for the default color index.)
+Each of the last three arguments
+must be a value in the range \fB0\fP through \fB1000\fP.
+When \fBinit_color\fR is used, all
 occurrences of that color on the screen immediately change to the new
 definition.
 .PP
-The \fBhas_colors\fR routine requires no arguments.  It returns \fBTRUE\fR if
-the terminal can manipulate colors; otherwise, it returns \fBFALSE\fR.  This
-routine facilitates writing terminal-independent programs.  For example, a
-programmer can use it to decide whether to use color or some other video
-attribute.
+The \fBhas_colors\fR routine requires no arguments.
+It returns \fBTRUE\fR if
+the terminal can manipulate colors; otherwise, it returns \fBFALSE\fR.
+This routine facilitates writing terminal-independent programs.
+For example, a programmer can use it to decide
+whether to use color or some other video attribute.
 .PP
-The \fBcan_change_color\fR routine requires no arguments.  It returns
-\fBTRUE\fR if the terminal supports colors and can change their definitions;
-other, it returns \fBFALSE\fR.  This routine facilitates writing
-terminal-independent programs.
+The \fBcan_change_color\fR routine requires no arguments.
+It returns \fBTRUE\fR if the terminal supports colors
+and can change their definitions;
+other, it returns \fBFALSE\fR.
+This routine facilitates writing terminal-independent programs.
 .PP
 The \fBcolor_content\fR routine gives programmers a way to find the intensity
-of the red, green, and blue (RGB) components in a color.  It requires four
-arguments: the color number, and three addresses of \fBshort\fRs for storing
+of the red, green, and blue (RGB) components in a color.
+It requires four arguments: the color number, and three addresses
+of \fBshort\fRs for storing
 the information about the amounts of red, green, and blue components in the
-given color.  The value of the first argument must be between 0 and
-\fBCOLORS\fR.  The values that are stored at the addresses pointed to by the
-last three arguments are between 0 (no component) and 1000 (maximum amount of
-component).
+given color.
+The first argument must be a legal color value, i.e.,
+\fB0\fP through \fBCOLORS\-1\fP, inclusive.
+The values that are stored at the addresses pointed to by the
+last three arguments are in the range
+\fB0\fP (no component) through \fB1000\fP (maximum amount of component), inclusive.
 .PP
 The \fBpair_content\fR routine allows programmers to find out what colors a
-given color-pair consists of.  It requires three arguments: the color-pair
+given color-pair consists of.
+It requires three arguments: the color-pair
 number, and two addresses of \fBshort\fRs for storing the foreground and the
-background color numbers.  The value of the first argument must be between 1
-and \fBCOLOR_PAIRS-1\fR.  The values that are stored at the addresses pointed
-to by the second and third arguments are between 0 and \fBCOLORS\fR.
+background color numbers.
+The first argument must be a legal color value,
+i.e., in the range \fB1\fP through \fBCOLOR_PAIRS\-1\fR, inclusive.
+The values that are stored at the addresses pointed
+to by the second and third arguments are in the
+range \fB0\fP through \fBCOLORS\fR, inclusive.
 .SS Colors
-In \fB<curses.h>\fR the following macros are defined.  These are the default
-colors.  \fBcurses\fR also assumes that \fBCOLOR_BLACK\fR is the default
+In \fB<curses.h>\fR the following macros are defined.
+These are the standard colors (ISO-6429).
+\fBcurses\fR also assumes that \fBCOLOR_BLACK\fR is the default
 background color for all terminals.
 .PP
 .nf
@@ -174,15 +287,15 @@
 .PP
 X/Open defines no error conditions.
 This implementation will return \fBERR\fR on attempts to
-use color values outside the range 0 to COLORS-1
+use color values outside the range \fB0\fP to COLORS\-1
 (except for the default colors extension),
-or use color pairs outside the range 0 to COLOR_PAIR-1.
-Color values used in \fBinit_color\fP must be in the range 0 to 1000.
+or use color pairs outside the range \fB0\fP to \fBCOLOR_PAIRS\-1\fP.
+Color values used in \fBinit_color\fP must be in the range \fB0\fP to \fB1000\fP.
 An error is returned from all functions
 if the terminal has not been initialized.
 An error is returned from secondary functions such as \fBinit_pair\fP
 if \fBstart_color\fP was not called.
-.RS
+.RS 3
 .TP 5
 \fBinit_color\fP
 returns an error if the terminal does not support
@@ -190,34 +303,33 @@
 from the terminal description.
 .TP 5
 \fBstart_color\fP
-returns an error
-If the color table cannot be allocated.
+returns an error if the color table cannot be allocated.
 .RE
 .SH NOTES
 In the \fIncurses\fR implementation, there is a separate color activation flag,
 color palette, color pairs table, and associated COLORS and COLOR_PAIRS counts
 for each screen; the \fBstart_color\fR function only affects the current
-screen.  The SVr4/XSI interface is not really designed with this in mind, and
+screen.
+The SVr4/XSI interface is not really designed with this in mind, and
 historical implementations may use a single shared color palette.
 .PP
 Note that setting an implicit background color via a color pair affects only
-character cells that a character write operation explicitly touches.  To change
+character cells that a character write operation explicitly touches.
+To change
 the background color used when parts of a window are blanked by erasing or
 scrolling operations, see \fBcurs_bkgd\fR(3X).
 .PP
 Several caveats apply on 386 and 486 machines with VGA-compatible graphics:
-.TP 5
--
-COLOR_YELLOW is actually brown.  To get yellow, use COLOR_YELLOW combined with
-the \fBA_BOLD\fR attribute.
-.TP 5
--
-The A_BLINK attribute should in theory cause the background to go bright.  This
-often fails to work, and even some cards for which it mostly works (such as the
+.bP
+COLOR_YELLOW is actually brown.
+To get yellow, use COLOR_YELLOW combined with the \fBA_BOLD\fR attribute.
+.bP
+The A_BLINK attribute should in theory cause the background to go bright.
+This often fails to work, and even some cards for which it mostly works
+(such as the
 Paradise and compatibles) do the wrong thing when you try to set a bright
 "yellow" background (you get a blinking yellow foreground instead).
-.TP 5
--
+.bP
 Color RGB values are not settable.
 .SH PORTABILITY
 This implementation satisfies XSI Curses's minimum maximums
@@ -239,10 +351,5 @@
 \fBcurses\fR(3X),
 \fBcurs_initscr\fR(3X),
 \fBcurs_attr\fR(3X),
+\fBcurs_variables\fR(3X),
 \fBdefault_colors\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_delch.3x b/man/curs_delch.3x
index 7026667..6dfc0a0 100644
--- a/man/curs_delch.3x
+++ b/man/curs_delch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_delch.3x,v 1.8 2006/02/25 21:42:57 tom Exp $
+.\" $Id: curs_delch.3x,v 1.11 2010/12/04 18:36:44 tom Exp $
 .TH curs_delch 3X ""
 .SH NAME
 \fBdelch\fR,
 \fBwdelch\fR,
 \fBmvdelch\fR,
-\fBmvwdelch\fR - delete character under the cursor in a \fBcurses\fR window
+\fBmvwdelch\fR \- delete character under the cursor in a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -54,6 +54,10 @@
 All routines return the integer \fBERR\fR upon failure and an \fBOK\fR (SVr4
 specifies only "an integer value other than \fBERR\fR") upon successful
 completion.
+.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 \fBdelch\fR, \fBmvdelch\fR, and \fBmvwdelch\fR may be macros.
 .SH PORTABILITY
@@ -62,9 +66,3 @@
 error conditions.
 .SH SEE ALSO
 \fBcurses\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_deleteln.3x b/man/curs_deleteln.3x
index fc7b16a..83cbdec 100644
--- a/man/curs_deleteln.3x
+++ b/man/curs_deleteln.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free 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_deleteln.3x,v 1.11 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_deleteln.3x,v 1.13 2010/12/04 18:36:44 tom Exp $
 .TH curs_deleteln 3X ""
 .SH NAME
 \fBdeleteln\fR,
@@ -34,7 +34,7 @@
 \fBinsdelln\fR,
 \fBwinsdelln\fR,
 \fBinsertln\fR,
-\fBwinsertln\fR - delete and insert lines in a \fBcurses\fR window
+\fBwinsertln\fR \- delete and insert lines in a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -83,9 +83,3 @@
 \fBidlok(..., TRUE)\fR has been set on the current window.
 .SH SEE ALSO
 \fBcurses\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_extend.3x b/man/curs_extend.3x
index 3092253..9a52f93 100644
--- a/man/curs_extend.3x
+++ b/man/curs_extend.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1999-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1999-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 1999-on
 .\"
-.\" $Id: curs_extend.3x,v 1.17 2006/12/24 18:01:48 tom Exp $
+.\" $Id: curs_extend.3x,v 1.19 2010/12/04 18:36:44 tom Exp $
 .TH curs_extend 3X ""
 .SH NAME
 \fBcurses_version\fP,
@@ -56,7 +56,7 @@
 which may be compiled into the terminfo
 description, i.e., via the terminfo or termcap interfaces.
 Normally these names are available for use, since the essential decision
-is made by using the \fB-x\fP option of \fB@TIC@\fP to compile
+is made by using the \fB\-x\fP option of \fB@TIC@\fP to compile
 extended terminal definitions.
 However you can disable this feature
 to ensure compatibility with other implementations of curses.
@@ -77,9 +77,3 @@
 \fBwresize\fR(3X).
 .SH AUTHOR
 Thomas Dickey.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_get_wch.3x b/man/curs_get_wch.3x
index 6ecff79..df9bc6a 100644
--- a/man/curs_get_wch.3x
+++ b/man/curs_get_wch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2003,2006 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.6 2006/02/25 21:47:06 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 @@
 .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,
@@ -152,6 +152,10 @@
 \fBOK\fR.
 Otherwise, the function returns
 \fBERR\fR.
+.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 SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_getch\fR(3X),
diff --git a/man/curs_get_wstr.3x b/man/curs_get_wstr.3x
index 4286c78..2a3fb3c 100644
--- a/man/curs_get_wstr.3x
+++ b/man/curs_get_wstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,2006 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.6 2006/02/25 21:49:19 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 @@
 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
@@ -154,6 +154,10 @@
 \fBwgetn_wstr\fP
 returns an error if the associated call to \fBwget_wch\fP failed.
 .RE
+.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 PORTABILITY
 These functions are described in The Single Unix Specification, Version 2.
 No error conditions are defined.
@@ -170,9 +174,3 @@
 \fBcurses\fR(3X),
 \fBcurs_get_wch\fR(3X),
 \fBcurs_getstr\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_getcchar.3x b/man/curs_getcchar.3x
index cb02f5d..4c5b229 100644
--- a/man/curs_getcchar.3x
+++ b/man/curs_getcchar.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2001-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2001-2012,2015 Free 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_getcchar.3x,v 1.11 2008/05/17 19:37:05 tom Exp $
+.\" $Id: curs_getcchar.3x,v 1.17 2015/07/21 09:30:38 tom Exp $
 .TH curs_getcchar 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
 \fBgetcchar\fP,
 \fBsetcchar\fP \- Get a wide character string and rendition from a \fBcchar_t\fP or set a \fBcchar_t\fP from a wide-character string
@@ -58,22 +61,19 @@
 .br
 .B "        void *\fIopts\fP );"
 .SH DESCRIPTION
+.SS getcchar
 .PP
 The \fBgetcchar\fP function gets a wide-character string
 and rendition from a \fBcchar_t\fP argument.
 When \fIwch\fP is not a null pointer,
 the \fBgetcchar\fP function does the following:
-.TP 5
--
+.bP
 Extracts information from a \fBcchar_t\fP value \fIwcval\fP
-.TP 5
--
+.bP
 Stores the character attributes in the location pointed to by \fIattrs\fP
-.TP 5
--
+.bP
 Stores the color-pair in the location pointed to by \fIcolor_pair\fP
-.TP 5
--
+.bP
 Stores the wide-character string,
 characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP.
 .PP
@@ -82,34 +82,30 @@
 is a null pointer, the
 \fBgetcchar\fP
 function does the following:
-.TP 5
--
+.bP
 Obtains the number of wide characters pointed to by \fIwcval\fP
-.TP 5
--
+.bP
 Does not change the data referenced by
 \fIattrs\fP
 or
 \fIcolor_pair\fP
+.SS setcchar
 .PP
 The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP
 by using:
-.TP 5
--
+.bP
 The character attributes in
 \fIattrs\fP
-.TP 5
--
+.bP
 The color pair in
 \fIcolor_pair\fP
-.TP 5
--
+.bP
 The wide-character string pointed to by \fIwch\fP.
 The string must be L'\\0' terminated,
 contain at most one spacing character,
 which must be the first.
 .IP
-Up to \fBCCHARW_MAX\fP-1 nonspacing characters may follow.
+Up to \fBCCHARW_MAX\fP\-1 nonspacing characters may follow.
 Additional nonspacing characters are ignored.
 .IP
 The string may contain a single control character instead.
@@ -122,11 +118,12 @@
 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
-\fIwcval\fP.
+\fIwcval\fP,
+including one for a trailing null.
 .PP
 When \fIwch\fP is not a null pointer,
 \fBgetcchar\fP returns \fBOK\fP upon successful completion,
@@ -141,9 +138,3 @@
 \fBcurs_color\fR(3X),
 \fBcurses\fR(3X),
 \fBwcwidth\fR(3).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_getch.3x b/man/curs_getch.3x
index 71fed5f..8d94e0a 100644
--- a/man/curs_getch.3x
+++ b/man/curs_getch.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getch.3x,v 1.30 2006/12/02 17:02:53 tom Exp $
+.\" $Id: curs_getch.3x,v 1.42 2015/07/21 08:44:04 tom Exp $
 .TH curs_getch 3X ""
 .na
 .hy 0
+.de bP
+.IP \(bu 4
+..
 .SH NAME
 \fBgetch\fR,
 \fBwgetch\fR,
@@ -45,17 +48,18 @@
 .PP
 \fBint getch(void);\fR
 .br
-\fBint wgetch(WINDOW *win);\fR
+\fBint wgetch(WINDOW *\fP\fIwin);\fR
 .br
-\fBint mvgetch(int y, int x);\fR
+\fBint mvgetch(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBint mvwgetch(WINDOW *win, int y, int x);\fR
+\fBint mvwgetch(WINDOW *\fP\fIwin\fP\fB, int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBint ungetch(int ch);\fR
+\fBint ungetch(int \fP\fIch\fP\fB);\fR
 .br
-\fBint has_key(int ch);\fR
+\fBint has_key(int \fP\fIch\fP\fB);\fR
 .br
 .SH DESCRIPTION
+.SS Reading characters
 The \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR and \fBmvwgetch\fR, routines read
 a character from the window.
 In no-delay mode, if no input is waiting, the value \fBERR\fR is returned.
@@ -68,25 +72,34 @@
 the program waits until a character is typed or the
 specified timeout has been reached.
 .PP
-Unless \fBnoecho\fR has been set,
+If \fBecho\fR is enabled, and the window is not a pad,
 then the character will also be echoed into the
 designated window according to the following rules:
+.bP
 If the character is the current erase character, left arrow, or backspace,
 the cursor is moved one space to the left and that screen position is erased
 as if \fBdelch\fR had been called.
+.bP
 If the character value is any other \fBKEY_\fR define, the user is alerted
 with a \fBbeep\fR call.
+.bP
+If the character is a carriage-return,
+and if \fBnl\fP is enabled,
+it is translated to a line-feed after echoing.
+.bP
 Otherwise the character is simply output to the screen.
 .PP
 If the window is not a pad, and it has been moved or modified since the last
 call to \fBwrefresh\fR, \fBwrefresh\fR will be called before another character
 is read.
+.SS Keypad mode
 .PP
 If \fBkeypad\fR is \fBTRUE\fR, and a function key is pressed, the token for
 that function key is returned instead of the raw characters.
 Possible function
 keys are defined in \fB<curses.h>\fR as macros with values outside the range
-of 8-bit characters whose names begin with \fBKEY_\fR. Thus, a variable
+of 8-bit characters whose names begin with \fBKEY_\fR.
+Thus, a variable
 intended to hold the return value of a function key must be of short size or
 larger.
 .PP
@@ -98,22 +111,22 @@
 otherwise, the function key value is returned.
 For this reason, many terminals experience a delay between the time
 a user presses the escape key and the escape is returned to the program.
+.SS Ungetting characters
 .PP
 The \fBungetch\fR routine places \fIch\fR back onto the input queue to be
 returned by the next call to \fBwgetch\fR.
 There is just one input queue for all windows.
 .PP
-.SS Function Keys
-The following function keys, defined in \fB<curses.h>\fR, might be returned by
+.SS Predefined key-codes
+The following special keys, defined in \fB<curses.h>\fR, may be returned by
 \fBgetch\fR if \fBkeypad\fR has been enabled.
-Note that not all of these are
-necessarily supported on any particular terminal.
-.sp
+Not all of these are necessarily supported on any particular terminal.
+.PP
 .TS
 center tab(/) ;
-l l
 l l .
 \fIName\fR/\fIKey\fR \fIname\fR
+_
 KEY_BREAK/Break key
 KEY_DOWN/The four arrow keys ...
 KEY_UP
@@ -213,7 +226,7 @@
 .TE
 .PP
 Keypad is arranged like this:
-.sp
+.br
 .TS
 center allbox tab(/) ;
 c c c .
@@ -222,35 +235,56 @@
 \fBC1\fR/\fBdown\fR/\fBC3\fR
 .TE
 .sp
-The \fBhas_key\fR routine takes a key value from the above list, and
-returns TRUE or FALSE according to whether
+A few of these predefined values do \fInot\fP correspond to a real key:
+.bP
+.B KEY_RESIZE
+is returned when the \fBSIGWINCH\fP signal has been detected
+(see \fBinitscr\fP(3X) and \fBresizeterm\fR(3X)).
+.bP
+.B KEY_MOUSE
+is returned for mouse-events (see \fBcurs_mouse\fR(3X)).
+.SS Testing key-codes
+.PP
+The \fBhas_key\fR routine takes a key-code value from the above list, and
+returns \fBTRUE\fP or \fBFALSE\fP according to whether
 the current terminal type recognizes a key with that value.
-Note that a few values do not correspond to a real key,
-e.g., \fBKEY_RESIZE\fP and \fBKEY_MOUSE\fP.
-See \fBresizeterm\fR(3X) for more details about \fBKEY_RESIZE\fP, and
-\fBcurs_mouse\fR(3X) for a discussion of \fBKEY_MOUSE\fP.
+.PP
+The library also supports these extensions:
+.RS 3
+.TP 5
+.B define_key
+defines a key-code for a given string (see \fBdefine_key\fP(3X)).
+.TP 5
+.B key_defined
+checks if there is a key-code defined for a given
+string (see \fBkey_defined\fP(3X)).
+.RE
 .PP
 .SH RETURN VALUE
 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
+.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
 Use of the escape key by a programmer for a single character function is
 discouraged, as it will cause a delay of up to one second while the
 keypad code looks for a following function-key sequence.
 .PP
-Note that some keys may be the same as commonly used control
+Some keys may be the same as commonly used control
 keys, e.g., \fBKEY_ENTER\fP versus control/M, \fBKEY_BACKSPACE\fP versus control/H.
 Some curses implementations may differ according to whether they
 treat these control keys specially (and ignore the terminfo), or
@@ -260,6 +294,20 @@
 \fBgetch\fR will return \fBKEY_ENTER\fP
 when you press control/M.
 .PP
+Generally, \fBKEY_ENTER\fP denotes the character(s) sent by the \fIEnter\fP
+key on the numeric keypad:
+.bP
+the terminal description lists the most useful keys,
+.bP
+the \fIEnter\fP key on the regular keyboard is already handled by
+the standard ASCII characters for carriage-return and line-feed,
+.bP
+depending on whether \fBnl\fP or \fBnonl\fP was called,
+pressing "Enter" on the regular keyboard may return either a carriage-return
+or line-feed, and finally
+.bP
+"Enter or send" is the standard description for this key.
+.PP
 When using \fBgetch\fR, \fBwgetch\fR, \fBmvgetch\fR, or
 \fBmvwgetch\fR, nocbreak mode (\fBnocbreak\fR) and echo mode
 (\fBecho\fR) should not be used at the same time.
@@ -312,6 +360,7 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_inopts\fR(3X),
+\fBcurs_outopts\fR(3X),
 \fBcurs_mouse\fR(3X),
 \fBcurs_move\fR(3X),
 \fBcurs_refresh\fR(3X),
@@ -320,9 +369,3 @@
 Comparable functions in the wide-character (ncursesw) library are
 described in
 \fBcurs_get_wch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_getstr.3x b/man/curs_getstr.3x
index f131765..e548cf1 100644
--- a/man/curs_getstr.3x
+++ b/man/curs_getstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getstr.3x,v 1.15 2006/01/12 00:30:58 tom Exp $
+.\" $Id: curs_getstr.3x,v 1.19 2010/12/04 18:36:44 tom Exp $
 .TH curs_getstr 3X ""
 .na
 .hy 0
@@ -38,7 +38,7 @@
 \fBmvgetstr\fR,
 \fBmvgetnstr\fR,
 \fBmvwgetstr\fR,
-\fBmvwgetnstr\fR - accept character strings from \fBcurses\fR terminal keyboard
+\fBmvwgetnstr\fR \- accept character strings from \fBcurses\fR terminal keyboard
 .ad
 .hy
 .SH SYNOPSIS
@@ -94,6 +94,10 @@
 This implementation provides an extension as well.
 If a SIGWINCH interrupts the function, it will return \fBKEY_RESIZE\fP
 rather than \fBOK\fP or \fBERR\fP.
+.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 \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros.
 .SH PORTABILITY
@@ -113,10 +117,6 @@
 The functions \fBgetnstr\fR, \fBmvgetnstr\fR, and \fBmvwgetnstr\fR were
 present but not documented in SVr4.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_getch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_getch\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_getyx.3x b/man/curs_getyx.3x
index 2581253..980968e 100644
--- a/man/curs_getyx.3x
+++ b/man/curs_getyx.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getyx.3x,v 1.16 2007/05/12 16:34:49 tom Exp $
+.\" $Id: curs_getyx.3x,v 1.18 2010/12/04 18:36:44 tom Exp $
 .TH curs_getyx 3X ""
 .SH NAME
 \fBgetyx\fR,
 \fBgetparyx\fR,
 \fBgetbegyx\fR,
-\fBgetmaxyx\fR - get \fBcurses\fR cursor and window coordinates
+\fBgetmaxyx\fR \- get \fBcurses\fR cursor and window coordinates
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -51,7 +51,7 @@
 If \fIwin\fR is a subwindow, the \fBgetparyx\fR macro places the beginning
 coordinates of the subwindow relative to the parent window into two integer
 variables \fIy\fR and \fIx\fR.
-Otherwise, \fB-1\fR is placed into \fIy\fR and \fIx\fR.
+Otherwise, \fB\-1\fR is placed into \fIy\fR and \fIx\fR.
 .PP
 Like \fBgetyx\fR, the \fBgetbegyx\fR and \fBgetmaxyx\fR macros store
 the current beginning coordinates and size of the specified window.
@@ -98,9 +98,3 @@
 \fBcurses\fR(3X),
 \fBcurs_legacy\fR(3X),
 \fBcurs_opaque\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_in_wch.3x b/man/curs_in_wch.3x
index 8709d13..5f50e5a 100644
--- a/man/curs_in_wch.3x
+++ b/man/curs_in_wch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 2002-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_in_wch.3x,v 1.2 2006/02/25 21:42:22 tom Exp $
+.\" $Id: curs_in_wch.3x,v 1.5 2010/12/04 18:36:44 tom Exp $
 .TH curs_in_wch 3X ""
 .SH NAME
 \fBin_wch\fR,
 \fBmvin_wch\fR,
 \fBmvwin_wch\fR,
-\fBwin_wch\fR - extract a complex character and rendition from a window
+\fBwin_wch\fR \- extract a complex character and rendition from a window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -53,6 +53,10 @@
 Also, the \fImv\fR routines check for error moving the cursor, returning ERR
 in that case.
 Otherwise they return OK
+.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 may be macros.
 .SH PORTABILITY
@@ -60,9 +64,3 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_inch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_in_wchstr.3x b/man/curs_in_wchstr.3x
index b04a1f5..f929687 100644
--- a/man/curs_in_wchstr.3x
+++ b/man/curs_in_wchstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,2006 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.6 2006/12/02 17:03:07 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,11 +98,15 @@
 \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
 \fBERR\fR.
+.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 PORTABILITY
 The XSI Curses defines no error conditions.
 This implementation checks for null pointers,
@@ -114,9 +118,3 @@
 \fBcurs_instr\fR(3X),
 \fBcurs_inwstr\fR(3X)
 \fBcurs_inchstr\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_inch.3x b/man/curs_inch.3x
index 3091b9c..7e1e3b4 100644
--- a/man/curs_inch.3x
+++ b/man/curs_inch.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,11 +27,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inch.3x,v 1.13 2006/12/02 16:58:55 tom Exp $
+.\" $Id: curs_inch.3x,v 1.17 2010/12/04 18:36:44 tom Exp $
 .TH curs_inch 3X ""
 .SH NAME
-\fBinch\fR, \fBwinch\fR, \fBmvinch\fR, \fBmvwinch\fR
-- get a character and attributes from a \fBcurses\fR window
+\fBinch\fR,
+\fBwinch\fR,
+\fBmvinch\fR,
+\fBmvwinch\fR \- get a character and attributes from a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -59,6 +61,10 @@
 \fBA_ATTRIBUTES\fR	Bit-mask to extract attributes
 \fBA_COLOR\fR	Bit-mask to extract color-pair field information
 .TE
+.SH RETURN VALUE
+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 may be macros.
 .SH PORTABILITY
@@ -69,9 +75,3 @@
 Comparable functions in the wide-character (ncursesw) library are
 described in
 \fBcurs_in_wch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_inchstr.3x b/man/curs_inchstr.3x
index 18c21dc..2dc7673 100644
--- a/man/curs_inchstr.3x
+++ b/man/curs_inchstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free 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_inchstr.3x,v 1.12 2006/12/02 17:00:58 tom Exp $
+.\" $Id: curs_inchstr.3x,v 1.15 2010/12/04 18:36:44 tom Exp $
 .TH curs_inchstr 3X ""
 .na
 .hy 0
@@ -38,7 +38,7 @@
 \fBmvinchstr\fR,
 \fBmvinchnstr\fR,
 \fBmvwinchstr\fR,
-\fBmvwinchnstr\fR - get a string of characters (and attributes) from a \fBcurses\fR window
+\fBmvwinchnstr\fR \- get a string of characters (and attributes) from a \fBcurses\fR window
 .ad
 .hy
 .SH SYNOPSIS
@@ -78,9 +78,13 @@
 If the \fIchstr\fP parameter is null,
 no data is returned,
 and the return value is zero.
+.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 routines except \fBwinchnstr\fR may be macros.  SVr4 does not
-document whether the result string is 0-terminated; it does not document
+document whether the result string is zero-terminated; it does not document
 whether a length limit argument includes any trailing 0; and it does not
 document the meaning of the return value.
 .SH PORTABILITY
@@ -93,9 +97,3 @@
 Comparable functions in the wide-character (ncursesw) library are
 described in
 \fBcurs_in_wchstr\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_initscr.3x b/man/curs_initscr.3x
index 1a865f9..dc15ecb 100644
--- a/man/curs_initscr.3x
+++ b/man/curs_initscr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free 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_initscr.3x,v 1.14 2005/05/15 16:18:01 tom Exp $
+.\" $Id: curs_initscr.3x,v 1.24 2015/07/21 23:01:38 tom Exp $
 .TH curs_initscr 3X ""
+.de bP
+.IP \(bu 4
+..
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
 .na
 .hy 0
 .SH NAME
@@ -36,7 +43,7 @@
 \fBendwin\fR,
 \fBisendwin\fR,
 \fBset_term\fR,
-\fBdelscreen\fR - \fBcurses\fR screen initialization and manipulation routines
+\fBdelscreen\fR \- \fBcurses\fR screen initialization and manipulation routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -48,57 +55,85 @@
 .br
 \fBbool isendwin(void);\fR
 .br
-\fBSCREEN *newterm(char *type, FILE *outfd, FILE *infd);\fR
+\fBSCREEN *newterm(char *\fP\fItype\fP\fB, FILE *\fP\fIoutfd\fP\fB, FILE *\fP\fIinfd\fP\fB);\fR
 .br
-\fBSCREEN *set_term(SCREEN *new);\fR
+\fBSCREEN *set_term(SCREEN *\fP\fInew\fP\fB);\fR
 .br
-\fBvoid delscreen(SCREEN* sp);\fR
+\fBvoid delscreen(SCREEN* \fP\fIsp\fP\fB);\fR
 .br
 .SH DESCRIPTION
+.SS initscr
 \fBinitscr\fR is normally the first \fBcurses\fR routine to call when
-initializing a program.  A few special routines sometimes need to be
-called before it; these are \fBslk_init\fR, \fBfilter\fR, \fBripoffline\fR,
-\fBuse_env\fR.  For multiple-terminal applications, \fBnewterm\fR may be
-called before \fBinitscr\fR.
+initializing a program.
+A few special routines sometimes need to be called before it;
+these are \fBslk_init\fR, \fBfilter\fR, \fBripoffline\fR,
+\fBuse_env\fR.
+For multiple-terminal applications,
+\fBnewterm\fR may be called before \fBinitscr\fR.
 .PP
 The initscr code determines the terminal type and initializes all \fBcurses\fR
-data structures.  \fBinitscr\fR also causes the first call to \fBrefresh\fR to
-clear the screen.  If errors occur, \fBinitscr\fR writes an appropriate error
-message to standard error and exits; otherwise, a pointer is returned to
-\fBstdscr\fR.
+data structures.
+\fBinitscr\fR also causes the first call to \fBrefresh\fR to clear the screen.
+If errors occur, \fBinitscr\fR writes an appropriate error
+message to standard error and exits;
+otherwise, a pointer is returned to \fBstdscr\fR.
+.SS newterm
 .PP
 A program that outputs to more than one terminal should use the \fBnewterm\fR
-routine for each terminal instead of \fBinitscr\fR.  A program that needs to
-inspect capabilities, so it can continue to run in a line-oriented mode if the
+routine for each terminal instead of \fBinitscr\fR.
+A program that needs to inspect capabilities,
+so it can continue to run in a line-oriented mode if the
 terminal cannot support a screen-oriented program, would also use
-\fBnewterm\fR.  The routine \fBnewterm\fR should be called once for each
-terminal.  It returns a variable of type \fBSCREEN *\fR which should be saved
-as a reference to that terminal.  The arguments are the \fItype\fR of the
-terminal to be used in place of \fB$TERM\fR, a file pointer for output to the
-terminal, and another file pointer for input from the terminal (if \fItype\fR
-is \fBNULL\fR, \fB$TERM\fR will be used).  The program must also call
+\fBnewterm\fR.
+The routine \fBnewterm\fR should be called once for each terminal.
+It returns a variable of type \fBSCREEN *\fR which should be saved
+as a reference to that terminal.
+\fBnewterm\fP's arguments are
+.bP
+the \fItype\fR of the terminal to be used in place of \fB$TERM\fR,
+.bP
+a file pointer for output to the terminal, and
+.bP
+another file pointer for input from the terminal
+.PP
+If the \fItype\fR parameter is \fBNULL\fR, \fB$TERM\fR will be used.
+.SS endwin
+.PP
+The program must also call
 \fBendwin\fR for each terminal being used before exiting from \fBcurses\fR.
 If \fBnewterm\fR is called more than once for the same terminal, the first
 terminal referred to must be the last one for which \fBendwin\fR is called.
 .PP
 A program should always call \fBendwin\fR before exiting or escaping from
-\fBcurses\fR mode temporarily.  This routine restores tty modes, moves the
-cursor to the lower left-hand corner of the screen and resets the terminal into
-the proper non-visual mode.  Calling \fBrefresh\fR or \fBdoupdate\fR after a
+\fBcurses\fR mode temporarily.
+This routine
+.bP
+restores tty modes,
+.bP
+moves the cursor to the lower left-hand corner of the screen and
+.bP
+resets the terminal into
+the proper non-visual mode.
+.PP
+Calling \fBrefresh\fR or \fBdoupdate\fR after a
 temporary escape causes the program to resume visual mode.
+.SS isendwin
 .PP
 The \fBisendwin\fR routine returns \fBTRUE\fR if \fBendwin\fR has been
-called without any subsequent calls to \fBwrefresh\fR, and \fBFALSE\fR
-otherwise.
+called without any subsequent calls to \fBwrefresh\fR,
+and \fBFALSE\fR otherwise.
+.SS set_term
 .PP
-The \fBset_term\fR routine is used to switch between different
-terminals.  The screen reference \fBnew\fR becomes the new current
-terminal.  The previous terminal is returned by the routine.  This is
-the only routine which manipulates \fBSCREEN\fR pointers; all other
-routines affect only the current terminal.
+The \fBset_term\fR routine is used to switch between different terminals.
+The screen reference \fBnew\fR becomes the new current terminal.
+The previous terminal is returned by the routine.
+This is the only routine which manipulates \fBSCREEN\fR pointers;
+all other routines affect only the current terminal.
+.SS delscreen
 .PP
 The \fBdelscreen\fR routine frees storage associated with the
-\fBSCREEN\fR data structure.  The \fBendwin\fR routine does not do
+\fBSCREEN\fR data structure.
+The \fBendwin\fR routine does not do
 this, so \fBdelscreen\fR should be called after \fBendwin\fR if a
 particular \fBSCREEN\fR is no longer needed.
 .SH RETURN VALUE
@@ -109,24 +144,107 @@
 .PP
 X/Open defines no error conditions.
 In this implementation
+.bP
 \fBendwin\fP returns an error if the terminal was not initialized.
+.bP
+\fBnewterm\fP
+returns an error if it cannot allocate the data structures for the screen,
+or for the top-level windows within the screen,
+i.e.,
+\fBcurscr\fP, \fBnewscr\fP, or \fBstdscr\fP.
+.bP
+\fBset_term\fP
+returns no error.
 .SH NOTES
 Note that \fBinitscr\fR and \fBnewterm\fR may be macros.
 .SH PORTABILITY
-These functions are described in the XSI Curses standard, Issue 4.  It
-specifies that portable applications must not call \fBinitscr\fR more than
-once.
+These functions were described in the XSI Curses standard, Issue 4.
+As of 2015, the current document is X/Open Curses, Issue 7.
+.SS Differences
+X/Open specifies that portable applications must not
+call \fBinitscr\fR more than once:
+.bP
+The portable way to use \fBinitscr\fP is once only,
+using \fBrefresh\fP (see curs_refresh(3X)) to restore the screen after \fBendwin\fP.
+.bP
+This implementation allows using \fBinitscr\fP after \fBendwin\fP.
 .PP
 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.
+.SS Unset TERM Variable
+.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 (see curs_terminfo(3X)) and cannot be
+used for full-screen operation.
+Other implementations may handle a missing/empty TERM variable differently.
+.SS Signal Handlers
+.PP
+Quoting from X/Open Curses, section 3.1.1:
+.RS 5
+.PP
+\fICurses implementations may provide for special handling of the SIGINT,
+SIGQUIT and SIGTSTP signals if their disposition is SIG_DFL at the time
+\fBinitscr()\fP is called \fP...
+.PP
+\fIAny special handling for these signals may remain in effect for the
+life of the process or until the process changes the disposition of
+the signal.\fP
+.PP
+\fINone of the Curses functions are required to be safe with respect to signals \fP...
+.RE
+.PP
+This implementation establishes signal handlers during initialization,
+e.g., \fBinitscr\fP or \fBnewterm\fP.
+Applications which must handle these signals should set up the corresponding
+handlers \fIafter\fP initializing the library:
+.TP 5
+.B SIGINT
+The handler \fIattempts\fP to cleanup the screen on exit.
+Although it \fIusually\fP works as expected, there are limitations:
+.RS 5
+.bP
+Walking the \fBSCREEN\fP list is unsafe, since all list management
+is done without any signal blocking.
+.bP
+On systems which have \fBREENTRANT\fP turned on, \fBset_term\fP uses
+functions which could deadlock or misbehave in other ways.
+.bP
+\fBendwin\fP calls other functions, many of which use stdio or
+other library functions which are clearly unsafe.
+.RE
+.TP 5
+.B SIGTERM
+This uses the same handler as \fBSIGINT\fP, with the same limitations.
+It is not mentioned in X/Open Curses, but is more suitable for this
+purpose than \fBSIGQUIT\fP (which is used in debugging).
+.TP 5
+.B SIGTSTP
+This handles the \fIstop\fP signal, used in job control.
+When resuming the process, this implementation discards pending
+input with \fBflushinput\fP (see curs_util(3X)), and repaints the screen
+assuming that it has been completely altered.
+It also updates the saved terminal modes with \fBdef_shell_mode\fP (see curs_kernel(3X)).
+.TP 5
+.B SIGWINCH
+This handles the window-size changes which were initially ignored in
+the standardization efforts.
+The handler sets a (signal-safe) variable
+which is later tested in \fBwgetch\fP (see curs_getch(3X)).
+If \fBkeypad\fP has been enabled for the corresponding window,
+\fBwgetch\fP returns the key symbol \fBKEY_RESIZE\fP.
+At the same time, \fBwgetch\fP calls \fBresizeterm\fP to adjust the
+standard screen \fBstdscr\fP,
+and update other data such as \fBLINES\fP and \fBCOLS\fP.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_kernel\fR(3X), \fBcurs_refresh\fR(3X),
-\fBcurs_slk\fR(3X), \fBcurs_util\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\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).
diff --git a/man/curs_inopts.3x b/man/curs_inopts.3x
index 7b5a17b..7b9a1be 100644
--- a/man/curs_inopts.3x
+++ b/man/curs_inopts.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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.13 2005/05/15 16:18:07 tom Exp $
+.\" $Id: curs_inopts.3x,v 1.19 2015/04/11 10:21:38 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
@@ -47,7 +51,7 @@
 \fBqiflush\fR,
 \fBtimeout\fR,
 \fBwtimeout\fR,
-\fBtypeahead\fR - \fBcurses\fR input options
+\fBtypeahead\fR \- \fBcurses\fR input options
 .ad
 .hy
 .SH SYNOPSIS
@@ -88,116 +92,179 @@
 \fBint typeahead(int fd);\fR
 .br
 .SH DESCRIPTION
+The \fBncurses\fP library provides several functions which let an application
+change way input from the terminal is handled.
+Some are global, applying to all windows.
+Others apply only to a specific window.
+Window-specific settings are not automatically applied to new or derived
+windows.
+An application must apply these to each window, if the same behavior
+is needed.
+.\"
+.SS cbreak
 Normally, the tty driver buffers typed characters until a newline or carriage
-return is typed.  The \fBcbreak\fR routine disables line buffering and
+return is typed.
+The \fBcbreak\fR routine disables line buffering and
 erase/kill character-processing (interrupt and flow control characters are
 unaffected), making characters typed by the user immediately available to the
-program.  The \fBnocbreak\fR routine returns the terminal to normal (cooked)
+program.
+The \fBnocbreak\fR routine returns the terminal to normal (cooked)
 mode.
 .PP
 Initially the terminal may or may not be in \fBcbreak\fR mode, as the mode is
 inherited; therefore, a program should call \fBcbreak\fR or \fBnocbreak\fR
-explicitly.  Most interactive programs using \fBcurses\fR set the \fBcbreak\fR
-mode.  Note that \fBcbreak\fR overrides \fBraw\fR.
+explicitly.
+Most interactive programs using \fBcurses\fR set the \fBcbreak\fR
+mode.
+Note that \fBcbreak\fR overrides \fBraw\fR.
 [See \fBcurs_getch\fR(3X) for a
 discussion of how these routines interact with \fBecho\fR and \fBnoecho\fR.]
+.\"
+.SS echo/noecho
 .PP
 The \fBecho\fR and \fBnoecho\fR routines control whether characters typed by
-the user are echoed by \fBgetch\fR as they are typed.  Echoing by the tty
+the user are echoed by \fBgetch\fR as they are typed.
+Echoing by the tty
 driver is always disabled, but initially \fBgetch\fR is in echo mode, so
-characters typed are echoed.  Authors of most interactive programs prefer to do
+characters typed are echoed.
+Authors of most interactive programs prefer to do
 their own echoing in a controlled area of the screen, or not to echo at all, so
 they disable echoing by calling \fBnoecho\fR.
 [See \fBcurs_getch\fR(3X) for a
 discussion of how these routines interact with \fBcbreak\fR and
 \fBnocbreak\fR.]
+.\"
+.SS halfdelay
 .PP
 The \fBhalfdelay\fR routine is used for half-delay mode, which is similar to
 \fBcbreak\fR mode in that characters typed by the user are immediately
-available to the program.  However, after blocking for \fItenths\fR tenths of
-seconds, ERR is returned if nothing has been typed.  The value of \fBtenths\fR
-must be a number between 1 and 255.  Use \fBnocbreak\fR to leave half-delay
+available to the program.
+However, after blocking for \fItenths\fR tenths of
+seconds, ERR is returned if nothing has been typed.
+The value of \fBtenths\fR
+must be a number between 1 and 255.
+Use \fBnocbreak\fR to leave half-delay
 mode.
+.\"
+.SS intrflush
 .PP
 If the \fBintrflush\fR option is enabled, (\fIbf\fR is \fBTRUE\fR), when an
 interrupt key is pressed on the keyboard (interrupt, break, quit) all output in
 the tty driver queue will be flushed, giving the effect of faster response to
 the interrupt, but causing \fBcurses\fR to have the wrong idea of what is on
-the screen.  Disabling (\fIbf\fR is \fBFALSE\fR), the option prevents the
-flush.  The default for the option is inherited from the tty driver settings.
+the screen.
+Disabling (\fIbf\fR is \fBFALSE\fR), the option prevents the
+flush.
+The default for the option is inherited from the tty driver settings.
 The window argument is ignored.
+.\"
+.SS keypad
 .PP
-The \fBkeypad\fR option enables the keypad of the user's terminal.  If
+The \fBkeypad\fR option enables the keypad of the user's terminal.
+If
 enabled (\fIbf\fR is \fBTRUE\fR), the user can press a function key
 (such as an arrow key) and \fBwgetch\fR returns a single value
-representing the function key, as in \fBKEY_LEFT\fR.  If disabled
+representing the function key, as in \fBKEY_LEFT\fR.
+If disabled
 (\fIbf\fR is \fBFALSE\fR), \fBcurses\fR does not treat function keys
 specially and the program has to interpret the escape sequences
-itself.  If the keypad in the terminal can be turned on (made to
+itself.
+If the keypad in the terminal can be turned on (made to
 transmit) and off (made to work locally), turning on this option
 causes the terminal keypad to be turned on when \fBwgetch\fR is
-called.  The default value for keypad is false.
+called.
+The default value for keypad is \fBFALSE\fP.
+.\"
+.SS meta
 .PP
 Initially, whether the terminal returns 7 or 8 significant bits on
 input depends on the control mode of the tty driver [see termio(7)].
 To force 8 bits to be returned, invoke \fBmeta\fR(\fIwin\fR,
 \fBTRUE\fR); this is equivalent, under POSIX, to setting the CS8 flag
-on the terminal.  To force 7 bits to be returned, invoke
+on the terminal.
+To force 7 bits to be returned, invoke
 \fBmeta\fR(\fIwin\fR, \fBFALSE\fR); this is equivalent, under POSIX,
-to setting the CS7 flag on the terminal.  The window argument,
-\fIwin\fR, is always ignored.  If the terminfo capabilities \fBsmm\fR
+to setting the CS7 flag on the terminal.
+The window argument,
+\fIwin\fR, is always ignored.
+If the terminfo capabilities \fBsmm\fR
 (meta_on) and \fBrmm\fR (meta_off) are defined for the terminal,
 \fBsmm\fR is sent to the terminal when \fBmeta\fR(\fIwin\fR,
 \fBTRUE\fR) is called and \fBrmm\fR is sent when \fBmeta\fR(\fIwin\fR,
 \fBFALSE\fR) is called.
+.\"
+.SS nodelay
 .PP
 The \fBnodelay\fR option causes \fBgetch\fR to be a non-blocking call.
-If no input is ready, \fBgetch\fR returns \fBERR\fR.  If disabled
+If no input is ready, \fBgetch\fR returns \fBERR\fR.
+If disabled
 (\fIbf\fR is \fBFALSE\fR), \fBgetch\fR waits until a key is pressed.
 .PP
 While interpreting an input escape sequence, \fBwgetch\fR sets a timer
-while waiting for the next character.  If \fBnotimeout(\fR\fIwin\fR,
-\fBTRUE\fR) is called, then \fBwgetch\fR does not set a timer.  The
+while waiting for the next character.
+If \fBnotimeout(\fR\fIwin\fR,
+\fBTRUE\fR) is called, then \fBwgetch\fR does not set a timer.
+The
 purpose of the timeout is to differentiate between sequences received
 from a function key and those typed by a user.
+.\"
+.SS raw/noraw
 .PP
 The \fBraw\fR and \fBnoraw\fR routines place the terminal into or out of raw
-mode.  Raw mode is similar to \fBcbreak\fR mode, in that characters typed are
-immediately passed through to the user program.  The differences are that in
+mode.
+Raw mode is similar to \fBcbreak\fR mode, in that characters typed are
+immediately passed through to the user program.
+The differences are that in
 raw mode, the interrupt, quit, suspend, and flow control characters are all
-passed through uninterpreted, instead of generating a signal.  The behavior of
+passed through uninterpreted, instead of generating a signal.
+The behavior of
 the BREAK key depends on other bits in the tty driver that are not set by
 \fBcurses\fR.
+.\"
+.SS noqiflush
 .PP
 When the \fBnoqiflush\fR routine is used, normal flush of input and
 output queues associated with the \fBINTR\fR, \fBQUIT\fR and
-\fBSUSP\fR characters will not be done [see termio(7)].  When
+\fBSUSP\fR characters will not be done [see termio(7)].
+When
 \fBqiflush\fR is called, the queues will be flushed when these control
-characters are read.  You may want to call \fBnoqiflush()\fR in a signal
+characters are read.
+You may want to call \fBnoqiflush()\fR in a signal
 handler if you want output to continue as though the interrupt
 had not occurred, after the handler exits.
+.\"
+.SS timeout/wtimeout
 .PP
 The \fBtimeout\fR and \fBwtimeout\fR routines set blocking or
-non-blocking read for a given window.  If \fIdelay\fR is negative,
+non-blocking read for a given window.
+If \fIdelay\fR is negative,
 blocking read is used (i.e., waits indefinitely for
-input).  If \fIdelay\fR is zero, then non-blocking read is used
-(i.e., read returns \fBERR\fR if no input is waiting).  If
+input).
+If \fIdelay\fR is zero, then non-blocking read is used
+(i.e., read returns \fBERR\fR if no input is waiting).
+If
 \fIdelay\fR is positive, then read blocks for \fIdelay\fR
 milliseconds, and returns \fBERR\fR if there is still no input.
 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).
+.\"
+.SS typeahead
 .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
-\fIfd\fR is to be used to check for typeahead instead.  If \fIfd\fR is
--1, then no typeahead checking is done.
+\fIfd\fR is to be used to check for typeahead instead.
+If \fIfd\fR is
+\-1, then no typeahead checking is done.
+.\"
 .SH RETURN VALUE
 All routines that return an integer return \fBERR\fR upon failure and OK (SVr4
 specifies only "an integer value other than \fBERR\fR") upon successful
@@ -219,10 +286,48 @@
 .PP
 The ncurses library obeys the XPG4 standard and the historical practice of the
 AT&T curses implementations, in that the echo bit is cleared when curses
-initializes the terminal state.  BSD curses differed from this slightly; it
+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
+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,
@@ -230,13 +335,13 @@
 .PP
 The \fBnoraw\fR and \fBnocbreak\fR calls follow historical practice in that
 they attempt to restore to normal (`cooked') mode from raw and cbreak modes
-respectively.  Mixing raw/noraw and cbreak/nocbreak calls leads to tty driver
+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)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_getch\fR(3X),
+\fBcurs_initscr\fR(3X),
+\fBcurs_util\fR(3X),
+\fBdefine_key\fR(3X),
+\fBtermio\fR(7)
diff --git a/man/curs_ins_wch.3x b/man/curs_ins_wch.3x
index bb8a9a3..4c6a925 100644
--- a/man/curs_ins_wch.3x
+++ b/man/curs_ins_wch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 2002-2006,2010 Free 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_wch.3x,v 1.3 2006/02/25 21:42:22 tom Exp $
+.\" $Id: curs_ins_wch.3x,v 1.5 2010/12/04 18:38:55 tom Exp $
 .TH curs_ins_wch 3X ""
 .SH NAME
 \fBins_wch\fR,
@@ -52,14 +52,12 @@
 .SH RETURN VALUE
 If successful, these functions return OK.
 If not, they return ERR.
+.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 ERRORS
 No errors are defined.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_insch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_ins_wstr.3x b/man/curs_ins_wstr.3x
index 0c153c4..12479b0 100644
--- a/man/curs_ins_wstr.3x
+++ b/man/curs_ins_wstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002,2005 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.4 2005/05/15 17:02:54 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,17 +92,15 @@
 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
+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 SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_insstr\fR(3X),
 \fBcurs_in_wch\fR(3X),
 \fBcurs_ins_wch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_insch.3x b/man/curs_insch.3x
index 78ab5a5..77e92ec 100644
--- a/man/curs_insch.3x
+++ b/man/curs_insch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_insch.3x,v 1.10 2006/12/02 17:01:50 tom Exp $
+.\" $Id: curs_insch.3x,v 1.13 2010/12/04 18:38:55 tom Exp $
 .TH curs_insch 3X ""
 .SH NAME
 \fBinsch\fR,
 \fBwinsch\fR,
 \fBmvinsch\fR,
-\fBmvwinsch\fR - insert a character before cursor in a \fBcurses\fR window
+\fBmvwinsch\fR \- insert a character before cursor in a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -53,6 +53,10 @@
 All routines that return an integer return \fBERR\fR upon failure and OK (SVr4
 specifies only "an integer value other than \fBERR\fR") upon successful
 completion, unless otherwise noted in the preceding routine descriptions.
+.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
 These routines do not necessarily imply use of a hardware insert character
 feature.
@@ -66,9 +70,3 @@
 Comparable functions in the wide-character (ncursesw) library are
 described in
 \fBcurs_ins_wch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_insstr.3x b/man/curs_insstr.3x
index 1536ea2..3e38a53 100644
--- a/man/curs_insstr.3x
+++ b/man/curs_insstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_insstr.3x,v 1.18 2006/12/24 14:59:30 tom Exp $
+.\" $Id: curs_insstr.3x,v 1.21 2010/12/04 18:38:55 tom Exp $
 .TH curs_insstr 3X ""
 .SH NAME
 \fBinsstr\fR,
@@ -36,7 +36,7 @@
 \fBmvinsstr\fR,
 \fBmvinsnstr\fR,
 \fBmvwinsstr\fR,
-\fBmvwinsnstr\fR - insert string before cursor in a \fBcurses\fR window
+\fBmvwinsnstr\fR \- insert string before cursor in a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .br
@@ -78,6 +78,10 @@
 In this implementation,
 if the window parameter is null or the str parameter is null,
 an error is returned.
+.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 but \fBwinsnstr\fR may be macros.
 .SH PORTABILITY
@@ -93,9 +97,3 @@
 \fBcurs_util\fR(3X),
 \fBcurs_clear\fR(3X),
 \fBcurs_inch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_instr.3x b/man/curs_instr.3x
index a93de27..1b17db9 100644
--- a/man/curs_instr.3x
+++ b/man/curs_instr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_instr.3x,v 1.13 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_instr.3x,v 1.16 2010/12/04 18:38:55 tom Exp $
 .TH curs_instr 3X ""
 .SH NAME
 \fBinstr\fR,
@@ -36,7 +36,7 @@
 \fBmvinstr\fR,
 \fBmvinnstr\fR,
 \fBmvwinstr\fR,
-\fBmvwinnstr\fR - get a string of characters from a \fBcurses\fR window
+\fBmvwinnstr\fR \- get a string of characters from a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -70,6 +70,10 @@
 In this implementation,
 if the window parameter is null or the str parameter is null,
 a zero is returned.
+.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 routines except \fBwinnstr\fR may be macros.
 .SH PORTABILITY
@@ -81,9 +85,3 @@
 In this case, the functions return the string ending at the right margin.
 .SH SEE ALSO
 \fBcurses\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_inwstr.3x b/man/curs_inwstr.3x
index 990789c..0cdf4d8 100644
--- a/man/curs_inwstr.3x
+++ b/man/curs_inwstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,2006 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.5 2006/02/25 21:20:20 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 @@
 Note that all routines except
 \fBwinnwstr\fR
 may be macros.
-.SH RETURN VALUES
+.SH RETURN VALUE
 All routines return
 \fBERR\fR
 upon failure. Upon
@@ -81,13 +81,11 @@
 \fBOK\fR, and the *\fBinnwstr\fR
 routines return the
 number of characters read into the string.
+.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 SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_instr\fR(3X),
 \fBcurs_in_wchstr\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_kernel.3x b/man/curs_kernel.3x
index 9403973..664d15d 100644
--- a/man/curs_kernel.3x
+++ b/man/curs_kernel.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2001,2005 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 1998-2010,2015 Free 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,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_kernel.3x,v 1.15 2005/05/15 16:18:13 tom Exp $
+.\" $Id: curs_kernel.3x,v 1.20 2015/07/21 01:10:11 tom Exp $
+.de bP
+.IP \(bu 4
+..
 .TH curs_kernel 3X ""
 .na
 .hy 0
@@ -41,7 +44,7 @@
 \fBsetsyx\fR,
 \fBripoffline\fR,
 \fBcurs_set\fR,
-\fBnapms\fR - low-level \fBcurses\fR routines
+\fBnapms\fR \- low-level \fBcurses\fR routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -59,20 +62,21 @@
 .br
 \fBint savetty(void);\fR
 .br
-\fBvoid getsyx(int y, int x);\fR
+\fBvoid getsyx(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBvoid setsyx(int y, int x);\fR
+\fBvoid setsyx(int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBint ripoffline(int line, int (*init)(WINDOW *, int));\fR
+\fBint ripoffline(int \fP\fIline\fP\fB, int (*\fP\fIinit\fP\fB)(WINDOW *, int));\fR
 .br
-\fBint curs_set(int visibility);\fR
+\fBint curs_set(int \fP\fIvisibility\fP\fB);\fR
 .br
-\fBint napms(int ms);\fR
+\fBint napms(int \fP\fIms\fP\fB);\fR
 .br
 .SH DESCRIPTION
 The following routines give low-level access to various \fBcurses\fR
-capabilities.  Theses routines typically are used inside library
+capabilities.  These routines typically are used inside library
 routines.
+.SS def_prog_mode, def_shell_mode
 .PP
 The \fBdef_prog_mode\fR and \fBdef_shell_mode\fR routines save the
 current terminal modes as the "program" (in \fBcurses\fR) or "shell"
@@ -80,27 +84,31 @@
 \fBreset_shell_mode\fR routines.  This is done automatically by
 \fBinitscr\fR.  There is one such save area for each screen context
 allocated by \fBnewterm()\fR.
+.SS reset_prog_mode, reset_shell_mode
 .PP
 The \fBreset_prog_mode\fR and \fBreset_shell_mode\fR routines restore
 the terminal to "program" (in \fBcurses\fR) or "shell" (out of
 \fBcurses\fR) state.  These are done automatically by \fBendwin\fR
 and, after an \fBendwin\fR, by \fBdoupdate\fR, so they normally are
 not called.
+.SS resetty, savetty
 .PP
 The \fBresetty\fR and \fBsavetty\fR routines save and restore the
 state of the terminal modes.  \fBsavetty\fR saves the current state in
 a buffer and \fBresetty\fR restores the state to what it was at the
 last call to \fBsavetty\fR.
+.SS getsyx
 .PP
 The \fBgetsyx\fR routine returns the current coordinates of the virtual screen
 cursor in \fIy\fR and \fIx\fR.  If \fBleaveok\fR is currently \fBTRUE\fR, then
-\fB-1\fR,\fB-1\fR is returned.  If lines have been removed from the top of the
+\fB\-1\fR,\fB\-1\fR is returned.  If lines have been removed from the top of the
 screen, using \fBripoffline\fR, \fIy\fR and \fIx\fR include these lines;
 therefore, \fIy\fR and \fIx\fR should be used only as arguments for
 \fBsetsyx\fR.
+.SS setsyx
 .PP
 The \fBsetsyx\fR routine sets the virtual screen cursor to
-\fIy\fR, \fIx\fR.  If \fIy\fR and \fIx\fR are both \fB-1\fR, then
+\fIy\fR, \fIx\fR.  If \fIy\fR and \fIx\fR are both \fB\-1\fR, then
 \fBleaveok\fR is set.  The two routines \fBgetsyx\fR and \fBsetsyx\fR
 are designed to be used by a library routine, which manipulates
 \fBcurses\fR windows but does not want to change the current position
@@ -108,16 +116,26 @@
 at the beginning, do its manipulation of its own windows, do a
 \fBwnoutrefresh\fR on its windows, call \fBsetsyx\fR, and then call
 \fBdoupdate\fR.
+.SS ripoffline
 .PP
 The \fBripoffline\fR routine provides access to the same facility that
 \fBslk_init\fR [see \fBcurs_slk\fR(3X)] uses to reduce the size of the
 screen.  \fBripoffline\fR must be called before \fBinitscr\fR or
-\fBnewterm\fR is called.  If \fIline\fR is positive, a line is removed
-from the top of \fBstdscr\fR; if \fIline\fR is negative, a line is
-removed from the bottom.  When this is done inside \fBinitscr\fR, the
+\fBnewterm\fR is called, to prepare these initial actions:
+.bP
+If \fIline\fR is positive, a line is removed from the top of \fBstdscr\fR.
+.bP
+if \fIline\fR is negative, a line is removed from the bottom.
+.PP
+When the resulting initialization is done inside \fBinitscr\fR, the
 routine \fBinit\fR (supplied by the user) is called with two
-arguments: a window pointer to the one-line window that has been
-allocated and an integer with the number of columns in the window.
+arguments:
+.bP
+a window pointer to the one-line window that has been
+allocated and
+.bP
+an integer with the number of columns in the window.
+.PP
 Inside this initialization routine, the integer variables \fBLINES\fR
 and \fBCOLS\fR (defined in \fB<curses.h>\fR) are not guaranteed to be
 accurate and \fBwrefresh\fR or \fBdoupdate\fR must not be called.  It
@@ -126,12 +144,14 @@
 .PP
 \fBripoffline\fR can be called up to five times before calling \fBinitscr\fR or
 \fBnewterm\fR.
+.SS curs_set
 .PP
-The \fBcurs_set\fR routine sets the cursor state is set to invisible,
+The \fBcurs_set\fR routine sets the cursor state to invisible,
 normal, or very visible for \fBvisibility\fR equal to \fB0\fR,
 \fB1\fR, or \fB2\fR respectively.  If the terminal supports the
 \fIvisibility\fR requested, the previous \fIcursor\fR state is
 returned; otherwise, \fBERR\fR is returned.
+.SS napms
 .PP
 The \fBnapms\fR routine is used to sleep for \fIms\fR milliseconds.
 .SH RETURN VALUE
@@ -143,9 +163,12 @@
 .PP
 X/Open defines no error conditions.
 In this implementation
-.RS
 .TP 5
+.na
+.hy 0
 \fBdef_prog_mode\fR, \fBdef_shell_mode\fR, \fBreset_prog_mode\fR, \fBreset_shell_mode\fR
+.hy
+.ad
 return an error
 if the terminal was not initialized, or
 if the I/O call to obtain the terminal settings fails.
@@ -153,7 +176,6 @@
 \fBripoffline\fP
 returns an error if the maximum number of ripped-off lines
 exceeds the maximum (NRIPS = 5).
-.RE
 .SH NOTES
 Note that \fBgetsyx\fR is a macro, so \fB&\fR is not necessary before
 the variables \fIy\fR and \fIx\fR.
@@ -176,11 +198,10 @@
 type int. This is misleading, as they are macros with no documented semantics
 for the return value.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X), \fBcurs_refresh\fR(3X),
-\fBcurs_scr_dump\fR(3X), \fBcurs_slk\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_initscr\fR(3X),
+\fBcurs_outopts\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_scr_dump\fR(3X),
+\fBcurs_slk\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_legacy.3x b/man/curs_legacy.3x
index 251ae49..febaf29 100644
--- a/man/curs_legacy.3x
+++ b/man/curs_legacy.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2007 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2007,2010 Free 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,20 +26,15 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_legacy.3x,v 1.1 2007/04/07 23:54:29 tom Exp $
+.\" $Id: curs_legacy.3x,v 1.5 2010/12/04 18:38:55 tom Exp $
 .TH curs_legacy 3X ""
 .SH NAME
-\fBgetbegx\fR,
-\fBgetbegy\fR,
-\fBgetcurx\fR,
-\fBgetcury\fR,
-\fBgetmaxx\fR,
-\fBgetmaxy\fR,
-\fBgetparx\fR,
-\fBgetpary\fR - get \fBcurses\fR cursor and window coordinates
+getattrs \- get \fBcurses\fR cursor and window coordinates, attributes
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
+\fBint getattrs(WINDOW *win);\fR
+.br
 \fBint getbegx(WINDOW *win);\fR
 .br
 \fBint getbegy(WINDOW *win);\fR
@@ -85,9 +80,3 @@
 \fBcurses\fR(3X),
 \fBcurs_getyx\fR(3X),
 \fBcurs_opaque\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_memleaks.3x b/man/curs_memleaks.3x
index a8a4552..5ebc0d0 100644
--- a/man/curs_memleaks.3x
+++ b/man/curs_memleaks.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2008 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2008,2010 Free Software Foundation, Inc.                   *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_memleaks.3x,v 1.1 2008/10/25 23:38:13 tom Exp $
+.\" $Id: curs_memleaks.3x,v 1.3 2010/12/04 18:40:45 tom Exp $
 .TH curs_memleaks 3X ""
 .na
 .hy 0
 .SH NAME
 \fB_nc_freeall\fP
-\fB_nc_free_and_exit\fP - \fBcurses\fR memory-leak checking
+\fB_nc_free_and_exit\fP \- \fBcurses\fR memory-leak checking
 .ad
 .hy
 .SH SYNOPSIS
@@ -45,7 +45,7 @@
 These functions are used to simplify analysis of memory leaks in the ncurses
 library.
 They are normally not available; they must be configured into the library
-at build time using the \fB--disable-leaks\fP option.
+at build time using the \fB\-\-disable-leaks\fP option.
 That compiles-in code that frees memory that normally would not be freed.
 .PP
 Any implementation of curses must not free the memory associated with
@@ -67,9 +67,3 @@
 These functions are not part of the XSI interface.
 .SH SEE ALSO
 \fBcurses\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_mouse.3x b/man/curs_mouse.3x
index 23f9f9c..b7cf4c6 100644
--- a/man/curs_mouse.3x
+++ b/man/curs_mouse.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free 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,53 +27,58 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_mouse.3x,v 1.30 2006/12/30 23:43:34 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.42 2015/07/21 09:27:39 tom Exp $
+.de bP
+.IP \(bu 4
+..
 .TH curs_mouse 3X ""
 .na
 .hy 0
 .SH NAME
+\fBhas_mouse\fR,
 \fBgetmouse\fR, \fBungetmouse\fR,
 \fBmousemask\fR, \fBwenclose\fR,
 \fBmouse_trafo\fR, \fBwmouse_trafo\fR,
-\fBmouseinterval\fR - mouse interface through curses
+\fBmouseinterval\fR \- mouse interface through curses
 .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
+.PP
+\fBbool has_mouse(void);\fR
 .br
-\fBint getmouse(MEVENT *event);\fR
+\fBint getmouse(MEVENT *\fP\fIevent\fP\fB);\fR
 .br
-\fBint ungetmouse(MEVENT *event);\fR
+\fBint ungetmouse(MEVENT *\fP\fIevent\fP\fB);\fR
 .br
-\fBmmask_t mousemask(mmask_t newmask, mmask_t *oldmask);\fR
+\fBmmask_t mousemask(mmask_t \fP\fInewmask\fP\fB, mmask_t *\fP\fIoldmask\fP\fB);\fR
 .br
-\fBbool wenclose(const WINDOW *win, int y, int x);\fR
+\fBbool wenclose(const WINDOW *\fP\fIwin\fP\fB, int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBbool mouse_trafo(int* pY, int* pX, bool to_screen);\fR
+\fBbool mouse_trafo(int* \fP\fIpY\fP\fB, int* \fP\fIpX\fP\fB, bool \fP\fIto_screen\fP\fB);\fR
 .br
-\fBbool wmouse_trafo(const WINDOW* win, int* pY, int* pX,\fR
+\fBbool wmouse_trafo(const WINDOW* \fP\fIwin\fP\fB, int* \fP\fIpY\fP\fB, int* \fP\fIpX\fP\fB,\fR
 .br
-	\fBbool to_screen);\fR
+	\fBbool \fP\fIto_screen\fP\fB);\fR
 .br
-\fBint mouseinterval(int erval);\fR
+\fBint mouseinterval(int \fP\fIerval\fP\fB);\fR
 .br
 .SH DESCRIPTION
 These functions provide an interface to mouse events from
 \fBncurses\fR(3X).
 Mouse events are represented by \fBKEY_MOUSE\fR
 pseudo-key values in the \fBwgetch\fR input stream.
+.SS mousemask
 .PP
 To make mouse events visible, use the \fBmousemask\fR function.
 This will set
@@ -88,6 +93,7 @@
 As a side effect, setting a zero mousemask may turn off the mouse pointer;
 setting a nonzero mask may turn it on.
 Whether this happens is device-dependent.
+.SS Mouse events
 .PP
 Here are the mouse event type masks which may be defined:
 .PP
@@ -133,8 +139,9 @@
 REPORT_MOUSE_POSITION	report mouse movement
 _
 .TE
+.SS getmouse
 .PP
-Once a class of mouse events have been made visible in a window,
+Once a class of mouse events has been made visible in a window,
 calling the \fBwgetch\fR function on that window may return
 \fBKEY_MOUSE\fR as an indicator that a mouse event has been queued.
 To read the event data and pop the event off the queue, call
@@ -146,56 +153,72 @@
 coordinates.
 The returned state mask will have exactly one bit set to
 indicate the event type.
+The corresponding data in the queue is marked invalid.
+A subsequent call to \fBgetmouse\fP will retrieve the next older
+item from the queue.
+.SS ungetmouse
 .PP
 The \fBungetmouse\fR function behaves analogously to \fBungetch\fR.
 It pushes
 a \fBKEY_MOUSE\fR event onto the input queue, and associates with that event
 the given state data and screen-relative character-cell coordinates.
+.SS wenclose
 .PP
 The \fBwenclose\fR function tests whether a given pair of screen-relative
-character-cell coordinates is enclosed by a given window, returning TRUE
-if it is and FALSE otherwise.
+character-cell coordinates is enclosed by a given window, returning \fBTRUE\fP
+if it is and \fBFALSE\fP otherwise.
 It is useful for determining what subset of
 the screen windows enclose the location of a mouse event.
+.SS wmouse_trafo
 .PP
 The \fBwmouse_trafo\fR function transforms a given pair of coordinates
 from stdscr-relative coordinates
 to coordinates relative to the given window or vice versa.
-Please remember, that stdscr-relative coordinates are not always identical
+The resulting stdscr-relative coordinates are not always identical
 to window-relative coordinates due to the mechanism to reserve lines on top
 or bottom of the screen for other purposes
-(see the \fBripoffline()\fP and \fBslk_init\fR calls, for example).
+(see the \fBripoffline\fP and \fBslk_init\fR calls, for example).
+.bP
 If the parameter \fBto_screen\fR is \fBTRUE\fR, the pointers
 \fBpY, pX\fR must reference the coordinates of a location
 inside the window \fBwin\fR.
 They are converted to window-relative coordinates and returned
 through the pointers.
 If the conversion was successful, the function returns \fBTRUE\fR.
+.bP
 If one of the parameters was NULL or the location is
 not inside the window, \fBFALSE\fR is returned.
+.bP
 If \fBto_screen\fR is
 \fBFALSE\fR, the pointers \fBpY, pX\fR must reference window-relative
 coordinates.
 They are converted to stdscr-relative coordinates if the
 window \fBwin\fR encloses this point.
 In this case the function returns \fBTRUE\fR.
+.bP
 If one of the parameters is NULL or the point is not inside the
 window, \fBFALSE\fR is returned.
-Please notice, that the referenced coordinates
+The referenced coordinates
 are only replaced by the converted coordinates if the transformation was
 successful.
+.SS mouse_trafo
 .PP
 The \fBmouse_trafo\fR function performs the same translation
 as \fBwmouse_trafo\fR,
 using stdscr for \fBwin\fR.
+.SS mouseinterval
 .PP
 The \fBmouseinterval\fR function sets the maximum time (in thousands of a
 second) that can elapse between press and release events for them to
 be recognized as a click.
 Use \fBmouseinterval(0)\fR to disable click resolution.
 This function returns the previous interval value.
-Use \fBmouseinterval(-1)\fR to obtain the interval without altering it.
+Use \fBmouseinterval(\-1)\fR to obtain the interval without altering it.
 The default is one sixth of a second.
+.SS has_mouse
+.PP
+The \fBhas_mouse\fP function returns \fBTRUE\fP if the mouse driver has been
+successfully initialized.
 .PP
 Note that mouse events will be ignored when input is in cooked mode, and will
 cause an error beep when cooked mode is being simulated in a window by a
@@ -204,13 +227,16 @@
 .SH RETURN VALUE
 \fBgetmouse\fR and \fBungetmouse\fR
 return the integer \fBERR\fR upon failure or \fBOK\fR
-upon successful completion.
-.RS
+upon successful completion:
+.RS 3
 .TP 5
 \fBgetmouse\fP
 returns an error.
+.bP
 If no mouse driver was initialized, or
 if the mask parameter is zero,
+.bP
+It also returns an error if no more events remain in the queue.
 .TP 5
 \fBungetmouse\fP
 returns an error if the FIFO is full.
@@ -237,7 +263,7 @@
 incremented.
 These values for \fBNCURSES_MOUSE_VERSION\fR may be
 specified when configuring ncurses:
-.RS
+.RS 3
 .TP 3
 1
 has definitions for reserved events.
@@ -255,13 +281,15 @@
 Under \fBncurses\fR(3X), these calls are implemented using either
 xterm's built-in mouse-tracking API or
 platform-specific drivers including
-.RS
-Alessandro Rubini's gpm server.
-.br
+.RS 3
+.bP
+Alessandro Rubini's gpm server
+.bP
 FreeBSD sysmouse
-.br
+.bP
 OS/2 EMX
 .RE
+.PP
 If you are using an unsupported configuration,
 mouse events will not be visible to
 \fBncurses\fR(3X) (and the \fBmousemask\fR function will always
@@ -272,13 +300,21 @@
 way the terminal is initialized for mouse operation.
 The default, if \fBXM\fR is not found,
 corresponds to private mode 1000 of xterm:
-.RS
+.PP
+.RS 3
 \\E[?1000%?%p1%{1}%=%th%el%;
 .RE
-The z member in the event structure is not presently used.
+.PP
+The \fIz\fP member in the event structure is not presently used.
 It is intended
 for use with touch screens (which may be pressure-sensitive) or with
 3D-mice/trackballs/power gloves.
+.PP
+The \fBALL_MOUSE_EVENTS\fP class does not include \fBREPORT_MOUSE_POSITION\fP.
+They are distinct.
+For example, in xterm,
+wheel/scrolling mice send position reports as a sequence of
+presses of buttons 4 or 5 without matching button-releases.
 .SH BUGS
 Mouse events under xterm will not in fact be ignored during cooked mode,
 if they have been enabled by \fBmousemask\fR.
@@ -301,10 +337,5 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_kernel\fR(3X),
-\fBcurs_slk\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurs_slk\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_move.3x b/man/curs_move.3x
index 8046377..226595c 100644
--- a/man/curs_move.3x
+++ b/man/curs_move.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_move.3x,v 1.12 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_move.3x,v 1.14 2010/12/04 18:40:45 tom Exp $
 .TH curs_move 3X ""
 .na
 .hy 0
 .SH NAME
 \fBmove\fR,
-\fBwmove\fR - move \fBcurses\fR window cursor
+\fBwmove\fR \- move \fBcurses\fR window cursor
 .ad
 .hy
 .SH SYNOPSIS
@@ -61,9 +61,3 @@
 These functions are described in the XSI Curses standard, Issue 4.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_opaque.3x b/man/curs_opaque.3x
index 6c9cfaa..b395950 100644
--- a/man/curs_opaque.3x
+++ b/man/curs_opaque.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2007 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2007-2014,2015 Free 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.6 2007/09/08 18:49:13 tom Exp $
+.\" $Id: curs_opaque.3x,v 1.12 2015/04/11 10:23:49 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
@@ -38,9 +42,11 @@
 \fBis_keypad\fR,
 \fBis_leaveok\fR,
 \fBis_nodelay\fR,
-\fBis_timeout\fR,
+\fBis_notimeout\fR,
+\fBis_pad\fR,
 \fBis_scrollok\fR,
-\fBis_syncok\fR - \fBcurses\fR window properties
+\fBis_subwin\fR,
+\fBis_syncok\fR \- \fBcurses\fR window properties
 .ad
 .hy
 .SH SYNOPSIS
@@ -62,17 +68,23 @@
 .br
 \fBbool is_notimeout(const WINDOW *win);\fR
 .br
+\fBbool is_pad(const WINDOW *win);\fR
+.br
 \fBbool is_scrollok(const WINDOW *win);\fR
 .br
+\fBbool is_subwin(const WINDOW *win);\fR
+.br
 \fBbool is_syncok(const WINDOW *win);\fR
 .br
 \fBWINDOW * wgetparent(const WINDOW *win);\fR
 .br
+\fBint wgetdelay(const WINDOW *win);\fR
+.br
 \fBint wgetscrreg(const WINDOW *win, int *top, int *bottom);\fR
 .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
@@ -99,20 +111,32 @@
 \fBis_notimeout\fR
 returns the value set in \fBnotimeout\fR
 .TP 5
+\fBis_pad\fR
+returns \fBTRUE\fP if the window is a pad
+i.e., created by \fBnewpad\fP
+.TP 5
 \fBis_scrollok\fR
 returns the value set in \fBscrollok\fR
 .TP 5
+\fBis_subwin\fR
+returns \fBTRUE\fP if the window is a subwindow,
+i.e., created by \fBsubwin\fP or \fBderwin\fP
+.TP 5
 \fBis_syncok\fR
 returns the value set in \fBsyncok\fR
 .TP 5
+\fBwgetdelay\fR
+returns the delay timeout as set in \fBwtimeout\fP.
+.TP 5
 \fBwgetparent\fR
 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.
+These functions all return \fBTRUE\fP or \fBFALSE\fP, except as noted.
 .SH NOTES
 Both a macro and a function are provided for each name.
 .SH PORTABILITY
@@ -125,9 +149,3 @@
 \fBcurs_inopts\fR(3X),
 \fBcurs_outopts\fR(3X),
 \fBcurs_window\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_outopts.3x b/man/curs_outopts.3x
index 3fd437a..f6d425b 100644
--- a/man/curs_outopts.3x
+++ b/man/curs_outopts.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_outopts.3x,v 1.21 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_outopts.3x,v 1.26 2015/07/21 00:23:43 tom Exp $
 .TH curs_outopts 3X ""
 .na
 .hy 0
@@ -40,27 +40,27 @@
 \fBwsetscrreg\fR,
 \fBscrollok\fR,
 \fBnl\fR,
-\fBnonl\fR - \fBcurses\fR output options
+\fBnonl\fR \- \fBcurses\fR output options
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBint clearok(WINDOW *win, bool bf);\fR
+\fBint clearok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBint idlok(WINDOW *win, bool bf);\fR
+\fBint idlok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBvoid idcok(WINDOW *win, bool bf);\fR
+\fBvoid idcok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBvoid immedok(WINDOW *win, bool bf);\fR
+\fBvoid immedok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBint leaveok(WINDOW *win, bool bf);\fR
+\fBint leaveok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBint setscrreg(int top, int bot);\fR
+\fBint setscrreg(int \fP\fItop\fP\fB, int \fP\fIbot\fP\fB);\fR
 .br
-\fBint wsetscrreg(WINDOW *win, int top, int bot);\fR
+\fBint wsetscrreg(WINDOW *\fP\fIwin\fP\fB, int \fP\fItop\fP\fB, int \fP\fIbot\fP\fB);\fR
 .br
-\fBint scrollok(WINDOW *win, bool bf);\fR
+\fBint scrollok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
 \fBint nl(void);\fR
 .br
@@ -71,6 +71,7 @@
 \fBcurses\fR.
 All options are initially \fBFALSE\fR, unless otherwise stated.
 It is not necessary to turn these options off before calling \fBendwin\fR.
+.SS clearok
 .PP
 If \fBclearok\fR is called with \fBTRUE\fR as argument, the next
 call to \fBwrefresh\fR with this window will clear the screen completely and
@@ -81,6 +82,7 @@
 the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR,
 the next call to \fBwrefresh\fR with any window causes the screen to be cleared
 and repainted from scratch.
+.SS idlok
 .PP
 If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR
 considers using the hardware insert/delete line feature of terminals so
@@ -94,6 +96,7 @@
 when used in applications where it is not really needed.
 If insert/delete line
 cannot be used, \fBcurses\fR redraws the changed portions of all lines.
+.SS idcok
 .PP
 If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR
 no longer considers using the hardware insert/delete character feature of
@@ -101,6 +104,7 @@
 Use of character insert/delete is enabled by default.
 Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use
 of character insertion and deletion.
+.SS immedok
 .PP
 If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change
 in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR,
@@ -108,6 +112,7 @@
 However, it may
 degrade performance considerably, due to repeated calls to \fBwrefresh\fR.
 It is disabled by default.
+.SS leaveok
 .PP
 Normally, the hardware cursor is left at the location of the window cursor
 being refreshed.
@@ -115,11 +120,13 @@
 wherever the update happens to leave it.
 It is useful for applications where
 the cursor is not used, since it reduces the need for cursor motions.
+.SS setscrreg
 .PP
 The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application
 programmer to set a software scrolling region in a window.
-\fItop\fR and
-\fIbot\fR are the line numbers of the top and bottom margin of the scrolling
+The \fItop\fR and
+\fIbot\fR parameters
+are the line numbers of the top and bottom margin of the scrolling
 region.
 (Line 0 is the top line of the window.)  If this option and
 \fBscrollok\fR are enabled, an attempt to move off the bottom margin line
@@ -132,6 +139,7 @@
 If \fBidlok\fR is enabled and the terminal
 has either a scrolling region or insert/delete line capability, they will
 probably be used by the output routines.)
+.SS scrollok
 .PP
 The \fBscrollok\fR option controls what happens when the cursor of a window is
 moved off the edge of the window or scrolling region, either as a result of a
@@ -142,6 +150,7 @@
 If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line
 (Note that to get the physical scrolling effect on the terminal, it is
 also necessary to call \fBidlok\fR).
+.SS nl, nonl
 .PP
 The \fBnl\fR and \fBnonl\fR routines control whether the underlying display
 device translates the return key into newline on input, and whether it
@@ -160,7 +169,7 @@
 All other routines that return an integer always
 return \fBOK\fR.
 .PP
-X/Open does not define any error conditions.
+X/Open Curses does not define any error conditions.
 .PP
 In this implementation, those functions that have a window pointer
 will return an error if the window pointer is null.
@@ -212,11 +221,11 @@
 The \fBimmedok\fR routine is useful for windows that are used as terminal
 emulators.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_clear\fR(3X),
-\fBcurs_initscr\fR(3X), \fBcurs_scroll\fR(3X), \fBcurs_refresh\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+.na
+\fBcurses\fR(3X),
+\fBcurs_addch\fR(3X),
+\fBcurs_clear\fR(3X),
+\fBcurs_initscr\fR(3X),
+\fBcurs_scroll\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_overlay.3x b/man/curs_overlay.3x
index 066c3a4..e3ed63f 100644
--- a/man/curs_overlay.3x
+++ b/man/curs_overlay.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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,40 +26,45 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_overlay.3x,v 1.14 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_overlay.3x,v 1.18 2015/07/21 00:51:31 tom Exp $
 .TH curs_overlay 3X ""
 .na
 .hy 0
 .SH NAME
 \fBoverlay\fR,
 \fBoverwrite\fR,
-\fBcopywin\fR - overlay and manipulate overlapped \fBcurses\fR windows
+\fBcopywin\fR \- overlay and manipulate overlapped \fBcurses\fR windows
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBint overlay(const WINDOW *srcwin, WINDOW *dstwin);\fR
+\fBint overlay(const WINDOW *\fP\fIsrcwin\fP\fB, WINDOW *\fP\fIdstwin\fP\fB);\fR
 .br
-\fBint overwrite(const WINDOW *srcwin, WINDOW *dstwin);\fR
+\fBint overwrite(const WINDOW *\fP\fIsrcwin\fP\fB, WINDOW *\fP\fIdstwin\fP\fB);\fR
 .br
-\fBint copywin(const WINDOW *srcwin, WINDOW *dstwin, int sminrow,\fR
-      \fBint smincol, int dminrow, int dmincol, int dmaxrow,\fR
-      \fBint dmaxcol, int overlay);\fR
+\fBint copywin(const WINDOW *\fP\fIsrcwin\fP\fB, WINDOW *\fP\fIdstwin\fP\fB, int \fP\fIsminrow\fP\fB,\fR
+      \fBint \fP\fIsmincol\fP\fB, int \fP\fIdminrow\fP\fB, int \fP\fIdmincol\fP\fB, int \fP\fIdmaxrow\fP\fB,\fR
+      \fBint \fP\fIdmaxcol\fP\fB, int \fP\fIoverlay\fP\fB);\fR
 .SH DESCRIPTION
+.SS overlay, overwrite
 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.
+.SS copywin
 .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,13 +80,8 @@
 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)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_pad.3x b/man/curs_pad.3x
index c722207..52fe51c 100644
--- a/man/curs_pad.3x
+++ b/man/curs_pad.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free 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_pad.3x,v 1.14 2005/05/15 16:18:43 tom Exp $
+.\" $Id: curs_pad.3x,v 1.18 2015/07/21 08:58:44 tom Exp $
 .TH curs_pad 3X ""
 .na
 .hy 0
@@ -36,27 +36,28 @@
 \fBprefresh\fR,
 \fBpnoutrefresh\fR,
 \fBpechochar\fR,
-\fBpecho_wchar\fR - create and display \fBcurses\fR pads
+\fBpecho_wchar\fR \- create and display \fBcurses\fR pads
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBWINDOW *newpad(int nlines, int ncols);\fR
+\fBWINDOW *newpad(int \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB);\fR
 .br
-\fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols,\fR
-      \fBint begin_y, int begin_x);\fR
+\fBWINDOW *subpad(WINDOW *\fP\fIorig\fP\fB, int \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR
+      \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR
 .br
-\fBint prefresh(WINDOW *pad, int pminrow, int pmincol,\fR
-      \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
+\fBint prefresh(WINDOW *\fP\fIpad\fP\fB, int \fP\fIpminrow\fP\fB, int \fP\fIpmincol\fP\fB,\fR
+      \fBint \fP\fIsminrow\fP\fB, int \fP\fIsmincol\fP\fB, int \fP\fIsmaxrow\fP\fB, int \fP\fIsmaxcol\fP\fB);\fR
 .br
-\fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,\fR
-      \fBint sminrow, int smincol, int smaxrow, int smaxcol);\fR
+\fBint pnoutrefresh(WINDOW *\fP\fIpad\fP\fB, int \fP\fIpminrow\fP\fB, int \fP\fIpmincol\fP\fB,\fR
+      \fBint \fP\fIsminrow\fP\fB, int \fP\fIsmincol\fP\fB, int \fP\fIsmaxrow\fP\fB, int \fP\fIsmaxcol\fP\fB);\fR
 .br
-\fBint pechochar(WINDOW *pad, chtype ch);\fR
+\fBint pechochar(WINDOW *\fP\fIpad\fP\fB, chtype \fP\fIch\fP\fB);\fR
 .br
-\fBint pecho_wchar(WINDOW *pad, const cchar_t *wch);\fR
+\fBint pecho_wchar(WINDOW *\fP\fIpad\fP\fB, const cchar_t *\fP\fIwch\fP\fB);\fR
 .SH DESCRIPTION
+.SS newpad
 The \fBnewpad\fR routine creates and returns a pointer to a new pad data
 structure with the given number of lines, \fInlines\fR, and columns,
 \fIncols\fR.
@@ -73,6 +74,7 @@
 Note that these
 routines require additional parameters to specify the part of the pad to be
 displayed and the location on the screen to be used for the display.
+.SS subpad
 .PP
 The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
 pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
@@ -84,16 +86,18 @@
 During the use of this routine, it will often be
 necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
 calling \fBprefresh\fR.
+.SS prefresh, pnoutrefresh
 .PP
 The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
 \fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
 of windows.
 The additional parameters are needed to indicate what part of the
 pad and screen are involved.
-\fIpminrow\fR and \fIpmincol\fR specify the upper
+The \fIpminrow\fR and \fIpmincol\fR parameters specify the upper
 left-hand corner of the rectangle to be displayed in the pad.
-\fIsminrow\fR,
-\fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR specify the edges of the
+The \fIsminrow\fR,
+\fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR
+parameters specify the edges of the
 rectangle to be displayed on the screen.
 The lower right-hand corner of the
 rectangle to be displayed in the pad is calculated from the screen coordinates,
@@ -103,6 +107,7 @@
 Negative values of
 \fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
 they were zero.
+.SS pechochar
 .PP
 The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
 followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
@@ -114,6 +119,7 @@
 equivalents.
 In the case of \fBpechochar\fR, the last location of the pad on
 the screen is reused for the arguments to \fBprefresh\fR.
+.SS pecho_wchar
 .PP
 The \fBpecho_wchar\fR function is the analogous wide-character
 form of \fBpechochar\fR.
@@ -129,7 +135,7 @@
 .PP
 X/Open does not define any error conditions.
 In this implementation
-.RS
+.RS 3
 .TP 5
 \fBprefresh\fP and \fBpnoutrefresh\fP
 return an error
@@ -154,9 +160,3 @@
 The XSI Curses standard, Issue 4 describes these functions.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_addch\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_print.3x b/man/curs_print.3x
index 92b9ca2..31a4535 100644
--- a/man/curs_print.3x
+++ b/man/curs_print.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_print.3x,v 1.8 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_print.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH curs_print 3X ""
 .SH NAME
-\fBmcprint\fR - ship binary data to printer
+\fBmcprint\fR \- ship binary data to printer
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -66,9 +66,3 @@
 interpreted.
 .SH SEE ALSO
 \fBcurses\fR(3X)\fR
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_printw.3x b/man/curs_printw.3x
index ead0f18..9918f9d 100644
--- a/man/curs_printw.3x
+++ b/man/curs_printw.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free 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_printw.3x,v 1.17 2006/12/24 16:05:17 tom Exp $
+.\" $Id: curs_printw.3x,v 1.20 2010/12/04 18:40:45 tom Exp $
 .TH curs_printw 3X ""
 .na
 .hy 0
@@ -35,7 +35,7 @@
 \fBwprintw\fR,
 \fBmvprintw\fR,
 \fBmvwprintw\fR,
-\fBvwprintw\fR, \fBvw_printw\fR - print formatted output in \fBcurses\fR windows
+\fBvwprintw\fR, \fBvw_printw\fR \- print formatted output in \fBcurses\fR windows
 .ad
 .hy
 .SH SYNOPSIS
@@ -74,6 +74,10 @@
 an error may be returned if it cannot allocate enough memory for the
 buffer used to format the results.
 It will return 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 PORTABILITY
 The XSI Curses standard, Issue 4 describes these functions.  The function
 \fBvwprintw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function
@@ -86,9 +90,3 @@
 is included in \fB<curses.h\fR>.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBprintf\fR(3), \fBvprintf(3)\fR
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_refresh.3x b/man/curs_refresh.3x
index 5ce0690..e1552c3 100644
--- a/man/curs_refresh.3x
+++ b/man/curs_refresh.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2001,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2005,2010 Free 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_refresh.3x,v 1.12 2005/05/15 16:18:49 tom Exp $
+.\" $Id: curs_refresh.3x,v 1.15 2010/12/04 18:38:55 tom Exp $
 .TH curs_refresh 3X ""
 .na
 .hy 0
@@ -36,7 +36,7 @@
 \fBrefresh\fR,
 \fBwnoutrefresh\fR,
 \fBwredrawln\fR,
-\fBwrefresh\fR - refresh \fBcurses\fR windows and lines
+\fBwrefresh\fR \- refresh \fBcurses\fR windows and lines
 .ad
 .hy
 .SH SYNOPSIS
@@ -135,10 +135,6 @@
 Instead, you can do an explicit \fBtouchwin()\fR before the
 \fBwnoutrefresh()\fR call to guarantee an entire-contents copy anywhere.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_outopts\fR(3X)
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_scanw.3x b/man/curs_scanw.3x
index 71ba9ee..a3208f5 100644
--- a/man/curs_scanw.3x
+++ b/man/curs_scanw.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free 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,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_scanw.3x,v 1.14 2006/12/24 16:05:49 tom Exp $
+.\" $Id: curs_scanw.3x,v 1.17 2010/12/04 18:40:45 tom Exp $
 .TH curs_scanw 3X ""
 .SH NAME
 \fBscanw\fR,
 \fBwscanw\fR,
 \fBmvscanw\fR,
 \fBmvwscanw\fR,
-\fBvwscanw\fR, \fBvw_scanw\fR - convert formatted input from a \fBcurses\fR window
+\fBvwscanw\fR, \fBvw_scanw\fR \- convert formatted input from a \fBcurses\fR window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -66,6 +66,10 @@
 Applications may use the return value from the \fBscanw\fR, \fBwscanw\fR,
 \fBmvscanw\fR and \fBmvwscanw\fR routines to determine the number of fields
 which were mapped in the call.
+.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 PORTABILITY
 The XSI Curses standard, Issue 4 describes these functions.  The function
 \fBvwscanw\fR is marked TO BE WITHDRAWN, and is to be replaced by a function
@@ -89,9 +93,3 @@
 at the end of the format string to ensure that something was processed.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_getstr\fR(3X), \fBcurs_printw\fR(3X), \fBscanf\fR(3)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_scr_dump.3x b/man/curs_scr_dump.3x
index 7884f6a..df3e79c 100644
--- a/man/curs_scr_dump.3x
+++ b/man/curs_scr_dump.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free 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_scr_dump.3x,v 1.7 2006/12/24 16:05:49 tom Exp $
+.\" $Id: curs_scr_dump.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH curs_scr_dump 3X ""
 .na
 .hy 0
@@ -34,7 +34,7 @@
 \fBscr_dump\fR,
 \fBscr_restore\fR,
 \fBscr_init\fR,
-\fBscr_set\fR - read (write) a \fBcurses\fR screen from (to) a file
+\fBscr_set\fR \- read (write) a \fBcurses\fR screen from (to) a file
 .ad
 .hy
 .SH SYNOPSIS
@@ -94,9 +94,3 @@
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X),
 \fBcurs_util\fR(3X), \fBsystem\fR(3)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_scroll.3x b/man/curs_scroll.3x
index 754b714..2cb152d 100644
--- a/man/curs_scroll.3x
+++ b/man/curs_scroll.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free 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,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_scroll.3x,v 1.13 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_scroll.3x,v 1.15 2010/12/04 18:40:45 tom Exp $
 .TH curs_scroll 3X ""
 .na
 .hy 0
 .SH NAME
 \fBscroll\fR,
 \fBscrl\fR,
-\fBwscrl\fR - scroll a \fBcurses\fR window
+\fBwscrl\fR \- scroll a \fBcurses\fR window
 .ad
 .hy
 .SH SYNOPSIS
@@ -88,9 +88,3 @@
 The XSI Curses standard, Issue 4 describes these functions.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_slk.3x b/man/curs_slk.3x
index 6361268..e8f7afb 100644
--- a/man/curs_slk.3x
+++ b/man/curs_slk.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,13 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_slk.3x,v 1.16 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_slk.3x,v 1.22 2010/12/04 18:38:55 tom Exp $
 .TH curs_slk 3X ""
 .na
 .hy 0
 .SH NAME
 \fBslk_init\fR,
 \fBslk_set\fR,
+\fBslk_wset\fR,
 \fBslk_refresh\fR,
 \fBslk_noutrefresh\fR,
 \fBslk_label\fR,
@@ -46,7 +47,7 @@
 \fBslk_attr_set\fR,
 \fBslk_attr_off\fR,
 \fBslk_attr\fR,
-\fBslk_color\fR - \fBcurses\fR soft label routines
+\fBslk_color\fR \- \fBcurses\fR soft label routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -78,42 +79,76 @@
 .br
 \fBint slk_attr_off(const attr_t attrs, void * opts);\fR
 .br
-\fBint slk_attr_set(const attr_t attrs,\fR
-.br
-	\fBshort color_pair_number, void* opts);\fR
+\fBint slk_attr_set(const attr_t attrs, short color_pair, void* opts);\fR
 .br
 \fBattr_t slk_attr(void);\fR
 .br
-\fBint slk_color(short color_pair_number);\fR
+\fBint slk_color(short color_pair);\fR
+.br
+\fBint slk_wset(int labnum, const wchar_t *label, int fmt);\fR
 .br
 .SH DESCRIPTION
 The slk* functions manipulate the set of soft function-key labels that exist on
-many terminals.  For those terminals that do not have soft labels,
+many terminals.
+For those terminals that do not have soft labels,
 \fBcurses\fR takes over the bottom line of \fBstdscr\fR, reducing the size of
-\fBstdscr\fR and the variable \fBLINES\fR.  \fBcurses\fR standardizes on eight
-labels of up to eight characters each. In addition to this, the ncurses
+\fBstdscr\fR and the variable \fBLINES\fR.
+\fBcurses\fR standardizes on eight
+labels of up to eight characters each.
+In addition to this, the ncurses
 implementation supports a mode where it simulates 12 labels of up to five
-characters each. This is most common for todays PC like enduser devices.
-Please note that ncurses simulates this mode by taking over up to two lines at
-the bottom of the screen, it does not try to use any hardware support for this
+characters each.
+This is useful for today's PC-like enduser devices.
+ncurses simulates this mode by taking over up to two lines at
+the bottom of the screen;
+it does not try to use any hardware support for this
 mode.
 .PP
 The \fBslk_init\fR routine must be called before \fBinitscr\fR or \fBnewterm\fR
-is called.  If \fBinitscr\fR eventually uses a line from \fBstdscr\fR to
-emulate the soft labels, then \fIfmt\fR determines how the labels are arranged
-on the screen.  Setting \fIfmt\fR to \fB0\fR indicates a 3-2-3 arrangement of
-the labels, \fB1\fR indicates a 4-4 arrangement and \fB2\fR indicates the
-PC like 4-4-4 mode. If \fBfmt\fR is set to \fB3\fR, it is again the PC like
-4-4-4 mode, but in addition an index line is generated, helping the user to
+is called.
+If \fBinitscr\fR eventually uses a line from \fBstdscr\fR to
+emulate the soft labels,
+then \fIfmt\fR determines how the labels are arranged on the screen:
+.RS
+.TP 3
+.B 0
+indicates a 3\-2\-3 arrangement of
+the labels.
+.TP 3
+.B 1
+indicates a 4\-4 arrangement
+.TP 3
+.B 2
+indicates the PC-like 4\-4\-4 mode.
+.TP 3
+.B 3
+is again the PC-like 4\-4\-4 mode,
+but in addition an index line is generated, helping the user to
 identify the key numbers easily.
+.RE
 .PP
-The \fBslk_set\fR routine requires \fIlabnum\fR to be a label number,
-from \fB1\fR to \fB8\fR (resp. \fB12\fR); \fIlabel\fR must be the string
-to be put on the label, up to eight (resp. five) characters in length.
-A null string or a null pointer sets up a blank label. \fIfmt\fR is either
-\fB0\fR, \fB1\fR, or \fB2\fR, indicating whether the label is  to be
+The \fBslk_set\fR routine
+(and the \fBslk_wset\fR routine for the wide-character library)
+has three parameters:
+.RS
+.TP 5
+.I labnum
+is the label number, from \fB1\fR to \fB8\fR
+(12 for \fIfmt\fP in \fBslk_init\fP is \fB2\fP or \fB3\fP);
+.TP
+.I label
+is be the string to put on the label,
+up to eight
+(five for \fIfmt\fP in \fBslk_init\fP is \fB2\fP or \fB3\fP)
+characters in length.
+A null string or a null pointer sets up a blank label.
+.TP
+.I fmt
+is either
+\fB0\fR, \fB1\fR, or \fB2\fR, indicating whether the label is to be
 left-justified, centered, or right-justified, respectively, within the
 label.
+.RE
 .PP
 The \fBslk_refresh\fR and \fBslk_noutrefresh\fR routines correspond to
 the \fBwrefresh\fR and \fBwnoutrefresh\fR routines.
@@ -132,10 +167,12 @@
 The \fBslk_attron\fR, \fBslk_attrset\fR, \fBslk_attroff\fR and \fBslk_attr\fR
 routines correspond to \fBattron\fR, \fBattrset\fR, \fBattroff\fR and \fBattr_get\fR.
 They have an effect only if soft labels are simulated on the bottom line of
-the screen.  The default highlight for soft keys is A_STANDOUT (as in
+the screen.
+The default highlight for soft keys is A_STANDOUT (as in
 System V curses, which does not document this fact).
 .PP
-The \fBslk_color\fR routine corresponds to \fBcolor_set\fR. It has an effect only
+The \fBslk_color\fR routine corresponds to \fBcolor_set\fR.
+It has an effect only
 if soft labels are simulated on the bottom line of the screen.
 .
 .SH RETURN VALUE
@@ -164,13 +201,13 @@
 \fBslk_attr_set\fP
 returns an error
 if the terminal or the softkeys were not initialized, or
-the color pair is outside the range 0..COLOR_PAIRS-1,
+the color pair is outside the range 0..COLOR_PAIRS\-1,
 or opts is not null.
 .TP 5
 \fBslk_color\fP
 returns an error
 if the terminal or the softkeys were not initialized, or
-the color pair is outside the range 0..COLOR_PAIRS-1.
+the color pair is outside the range 0..COLOR_PAIRS\-1.
 .TP 5
 \fBslk_init\fR
 returns an error
@@ -190,16 +227,16 @@
 Most applications would use \fBslk_noutrefresh\fR because a
 \fBwrefresh\fR is likely to follow soon.
 .SH PORTABILITY
-The XSI Curses standard, Issue 4, describes these functions.  It changes the
+The XSI Curses standard, Issue 4, describes these functions.
+It changes the
 argument type of the attribute-manipulation functions \fBslk_attron\fR,
 \fBslk_attroff\fR, \fBslk_attrset\fR to be \fBattr_t\fR, and adds \fBconst\fR
-qualifiers. The format codes \fB2\fR and \fB3\fR for \fBslk_init()\fR and the
+qualifiers.
+The format codes \fB2\fR and \fB3\fR for \fBslk_init()\fR and the
 function \fBslk_attr\fR are specific to ncurses.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_attr\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_refresh\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_attr\fR(3X),
+\fBcurs_initscr\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_sp_funcs.3x b/man/curs_sp_funcs.3x
new file mode 100644
index 0000000..c7c55dd
--- /dev/null
+++ b/man/curs_sp_funcs.3x
@@ -0,0 +1,353 @@
+.\"***************************************************************************
+.\" 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            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: curs_sp_funcs.3x,v 1.6 2013/06/22 17:53:59 tom Exp $
+.TH curs_sp_funcs 3X ""
+.na
+.hy 0
+.SH NAME
+new_prescr \- \fBcurses\fR screen-pointer extension
+.ad
+.hy
+.SH SYNOPSIS
+\fB#include <curses.h>\fR
+.nf
+.sp
+\fBint assume_default_colors_sp(SCREEN*, int, int);\fR
+.br
+\fBint baudrate_sp(SCREEN*);\fR
+.br
+\fBint beep_sp(SCREEN*);\fR
+.br
+\fBbool can_change_color_sp(SCREEN*);\fR
+.br
+\fBint cbreak_sp(SCREEN*);\fR
+.br
+\fBint color_content_sp(SCREEN*, short, short*, short*, short*);\fR
+.br
+\fBint curs_set_sp(SCREEN*, int);\fR
+.br
+\fBint define_key_sp(SCREEN*, const char *, int);\fR
+.br
+\fBint def_prog_mode_sp(SCREEN*);\fR
+.br
+\fBint def_shell_mode_sp(SCREEN*);\fR
+.br
+\fBint delay_output_sp(SCREEN*, int);\fR
+.br
+\fBint doupdate_sp(SCREEN*);\fR
+.br
+\fBint echo_sp(SCREEN*);\fR
+.br
+\fBint endwin_sp(SCREEN*);\fR
+.br
+\fBint erasechar_sp(SCREEN*);\fR
+.br
+\fBint filter_sp(SCREEN*);\fR
+.br
+\fBint flash_sp(SCREEN*);\fR
+.br
+\fBint flushinp_sp(SCREEN*);\fR
+.br
+\fBint get_escdelay_sp(SCREEN*);\fR
+.br
+\fBint getmouse_sp(SCREEN*, MEVENT*);\fR
+.br
+\fBWINDOW* getwin_sp(SCREEN*, FILE*);\fR
+.br
+\fBint halfdelay_sp(SCREEN*);\fR
+.br
+\fBbool has_colors_sp(SCREEN*);\fR
+.br
+\fBbool has_ic_sp(SCREEN*);\fR
+.br
+\fBbool has_il_sp(SCREEN*);\fR
+.br
+\fBint has_key_sp(SCREEN*, int);\fR
+.br
+\fBbool has_mouse_sp(SCREEN*);\fR
+.br
+\fBint init_color_sp(SCREEN*, short, short, short, short);\fR
+.br
+\fBint init_pair_sp(SCREEN*, short, short, short);\fR
+.br
+\fBint intrflush_sp(SCREEN*, WINDOW*, bool);\fR
+.br
+\fBbool isendwin_sp(SCREEN*);\fR
+.br
+\fBbool is_term_resized_sp(SCREEN*, int, int);\fR
+.br
+\fBchar* keybound_sp(SCREEN*, int, int);\fR
+.br
+\fBint key_defined_sp(SCREEN*, const char *);\fR
+.br
+\fBNCURSES_CONST char * keyname_sp(SCREEN*, int);\fR
+.br
+\fBint keyok_sp(SCREEN*, int, bool);\fR
+.br
+\fBchar killchar_sp(SCREEN*);\fR
+.br
+\fBint mcprint_sp(SCREEN*, char *, int);\fR
+.br
+\fBint mouseinterval_sp(SCREEN*, int);\fR
+.br
+\fBmmask_t mousemask_sp(SCREEN*, mmask_t, mmask_t *);\fR
+.br
+\fBint mvcur_sp(SCREEN*, int, int, int, int);\fR
+.br
+\fBint napms_sp(SCREEN*, int);\fR
+.br
+\fBWINDOW* newpad_sp(SCREEN*, int, int);\fR
+.br
+\fBSCREEN* new_prescr(void);\fR
+.br
+\fBSCREEN* newterm_sp(SCREEN*, NCURSES_CONST char *, FILE *, FILE *);\fR
+.br
+\fBWINDOW* newwin_sp(SCREEN*, int, int, int, int);\fR
+.br
+\fBint nl_sp(SCREEN*);\fR
+.br
+\fBint nocbreak_sp(SCREEN*);\fR
+.br
+\fBint noecho_sp(SCREEN*);\fR
+.br
+\fBint nofilter_sp(SCREEN*);\fR
+.br
+\fBint nonl_sp(SCREEN*);\fR
+.br
+\fBvoid noqiflush_sp(SCREEN*);\fR
+.br
+\fBint noraw_sp(SCREEN*);\fR
+.br
+\fBint pair_content_sp(SCREEN*, short, short*, short*);\fR
+.br
+\fBvoid qiflush_sp(SCREEN*);\fR
+.br
+\fBint raw_sp(SCREEN*);\fR
+.br
+\fBint reset_prog_mode_sp(SCREEN*);\fR
+.br
+\fBint reset_shell_mode_sp(SCREEN*);\fR
+.br
+\fBint resetty_sp(SCREEN*);\fR
+.br
+\fBint resize_term_sp(SCREEN*, int, int);\fR
+.br
+\fBint resizeterm_sp(SCREEN*, int, int);\fR
+.br
+\fBint restartterm_sp(SCREEN*, NCURSES_CONST char*, int, int *);\fR
+.br
+\fBint ripoffline_sp(SCREEN*, int, int (*)(WINDOW*, int));\fR
+.br
+\fBint savetty_sp(SCREEN*);\fR
+.br
+\fBint scr_init_sp(SCREEN*, const char *);\fR
+.br
+\fBint scr_restore_sp(SCREEN*, const char *);\fR
+.br
+\fBint scr_set_sp(SCREEN*, const char *);\fR
+.br
+\fBTERMINAL* set_curterm_sp(SCREEN*, TERMINAL*);\fR
+.br
+\fBint set_escdelay_sp(SCREEN*, int);\fR
+.br
+\fBint set_tabsize_sp(SCREEN*, int);\fR
+.br
+\fBint slk_attroff_sp(SCREEN*, const chtype);\fR
+.br
+\fBint slk_attron_sp(SCREEN*, const chtype);\fR
+.br
+\fBint slk_attr_set_sp(SCREEN*, const attr_t, short, void*);\fR
+.br
+\fBint slk_attrset_sp(SCREEN*, const chtype);\fR
+.br
+\fBint slk_attr_sp(SCREEN*);\fR
+.br
+\fBint slk_clear_sp(SCREEN*);\fR
+.br
+\fBint slk_color_sp(SCREEN*, short);\fR
+.br
+\fBint slk_init_sp(SCREEN*, int);\fR
+.br
+\fBint slk_label_sp(SCREEN*, int);\fR
+.br
+\fBint slk_noutrefresh_sp(SCREEN*);\fR
+.br
+\fBint slk_refresh_sp(SCREEN*);\fR
+.br
+\fBint slk_restore_sp(SCREEN*);\fR
+.br
+\fBint slk_set_sp(SCREEN*, int, const char *, int);\fR
+.br
+\fBint slk_touch_sp(SCREEN*);\fR
+.br
+\fBint start_color_sp(SCREEN*);\fR
+.br
+\fBattr_t term_attrs_sp(SCREEN*);\fR
+.br
+\fBchtype termattrs_sp(SCREEN*);\fR
+.br
+\fBchar* termname_sp(SCREEN*);\fR
+.br
+\fBint typeahead_sp(SCREEN*, int);\fR
+.br
+\fBNCURSES_CONST char* unctrl_sp(SCREEN*, chtype);\fR
+.br
+\fBint ungetch_sp(SCREEN*, int);\fR
+.br
+\fBint ungetmouse_sp(SCREEN*,MEVENT *);\fR
+.br
+\fBint unget_wch_sp(SCREEN*, const wchar_t);\fR
+.br
+\fBint use_default_colors_sp(SCREEN*);\fR
+.br
+\fBvoid use_env_sp(SCREEN*, bool);\fR
+.br
+\fBint use_legacy_coding_sp(SCREEN*, int);\fR
+.br
+\fBint vid_attr_sp(SCREEN*, attr_t, short, void *);\fR
+.br
+\fBint vidattr_sp(SCREEN*, chtype);\fR
+.br
+\fBint vid_puts_sp(SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC);\fR
+.br
+\fBint vidputs_sp(SCREEN*, chtype, NCURSES_SP_OUTC);\fR
+.br
+\fBwchar_t* wunctrl_sp(SCREEN*, cchar_t *);\fR
+.sp
+\fB#include <form.h>\fR
+.sp
+\fBint new_form_sp(SCREEN*, FIELD **);\fR
+.sp
+\fB#include <menu.h>\fR
+.sp
+\fBint new_menu_sp(SCREEN*, ITEM **);\fR
+.sp
+\fB#include <panel.h>\fR
+.sp
+\fBint ceiling_panel(SCREEN*);\fR
+.br
+\fBPANEL* ground_panel(SCREEN*);\fR
+.br
+\fBint update_panels_sp(SCREEN*);\fR
+.sp
+\fB#include <term.h>\fR
+.sp
+\fBint del_curterm_sp(SCREEN*, TERMINAL *);\fR
+.br
+\fBint putp_sp(SCREEN*, const char *);\fR
+.br
+\fBint tgetflag_sp(SCREEN*, char *, const char *);\fR
+.br
+\fBint tgetent_sp(SCREEN*, char *, const char *);\fR
+.br
+\fBint tgetnum_sp(SCREEN*, NCURSES_CONST char *);\fR
+.br
+\fBchar* tgetstr_sp(SCREEN*, NCURSES_CONST char *, char **);\fR
+.br
+\fBint tigetflag_sp(SCREEN*, NCURSES_CONST char *);\fR
+.br
+\fBint tigetnum_sp(SCREEN*, NCURSES_CONST char *);\fR
+.br
+\fBchar* tigetstr_sp(SCREEN*, NCURSES_CONST char *);\fR
+.br
+\fBint tputs_sp(SCREEN*, const char *, int, NCURSES_SP_OUTC);\fR
+.ad
+.br
+.SH DESCRIPTION
+This implementation can be configured to provide a set of functions which
+improve the ability to manage multiple screens.
+This feature can be added to any of the configurations supported by ncurses;
+it adds new entrypoints
+without changing the meaning of any of the existing ones.
+.PP
+.\" ***************************************************************************
+.SS IMPROVED FUNCTIONS
+Most of the functions are new versions of existing functions.
+A parameter is added at the front of the parameter list.
+It is a SCREEN pointer.
+.PP
+The existing functions all use the current screen,
+which is a static variable.
+The extended functions use the specified screen,
+thereby reducing the number of variables which must be modified
+to update multiple screens.
+.\" ***************************************************************************
+.SS NEW FUNCTIONS
+Here are the new functions:
+.TP 5
+ceiling_panel
+this returns a pointer to the topmost panel in the given screen.
+.TP 5
+ground_panel
+this returns a pointer to the lowest panel in the given screen.
+.TP 5
+new_prescr
+when creating a new screen, the library uses static variables which
+have been preset, e.g., by \fBuse_env\fP(3X), \fBfilter\fP(3X), etc.
+With the screen-pointer extension,
+there are situations where it must create a current screen before
+the unextended library does.
+The \fBnew_prescr\fP function is used internally to handle these cases.
+It is also provided as an entrypoint to allow applications to customize
+the library initialization.
+.\" ***************************************************************************
+.SH NOTES
+This extension introduces some new names:
+.TP 5
+NCURSES_SP_FUNCS
+This is set to the library patch-level number.
+In the unextended library, this is zero (0),
+to make it useful for checking if the extension is provided.
+.TP 5
+NCURSES_SP_NAME
+The new functions are named using the macro \fINCURSES_SP_NAME\fP,
+which hides the actual implementation.
+Currently this adds a "_sp" suffix to the name of the unextended function.
+This manual page indexes the extensions showing the full name.
+However the proper usage of these functions uses the macro,
+to provide for the possibility of changing the naming convention
+for specific library configurations.
+.TP 5
+NCURSES_SP_OUTC
+This is a new function-pointer type to use in the screen-pointer functions
+where an \fINCURSES_OUTC\fP is used in the unextended library.
+.TP 5
+NCURSES_OUTC
+This is a function-pointer type used for the cases where a function passes
+characters to the output stream, e.g., \fBvidputs\fP(3X).
+.PP
+.SH PORTABILITY
+These routines are specific to ncurses.
+They were not supported on Version 7, BSD or System V implementations.
+It is recommended that any code depending on ncurses extensions
+be conditioned using \fINCURSES_SP_FUNCS\fP.
+.SH SEE ALSO
+\fBcurses\fR(3X),
+\fBcurs_opaque\fR(3X),
+\fBcurs_threads\fR(3X).
diff --git a/man/curs_termattrs.3x b/man/curs_termattrs.3x
index 1e07307..e19459f 100644
--- a/man/curs_termattrs.3x
+++ b/man/curs_termattrs.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free 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_termattrs.3x,v 1.10 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_termattrs.3x,v 1.13 2015/07/21 00:03:34 tom Exp $
 .TH curs_termattrs 3X ""
 .SH NAME
 \fBbaudrate\fR,
@@ -39,7 +39,7 @@
 \fBlongname\fR,
 \fBterm_attrs\fR,
 \fBtermattrs\fR,
-\fBtermname\fR - \fBcurses\fR environment query routines
+\fBtermname\fR \- \fBcurses\fR environment query routines
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .PP
@@ -66,9 +66,11 @@
 \fBchar *termname(void);\fR
 .br
 .SH DESCRIPTION
+.SS baudrate
 The \fBbaudrate\fR routine returns the output speed of the terminal.  The
 number returned is in bits per second, for example \fB9600\fR, and is an
 integer.
+.SS erasechar, erasewchar
 .PP
 The \fBerasechar\fR routine returns the user's current erase character.
 .PP
@@ -76,6 +78,7 @@
 in the location referenced by \fIch\fR.
 If no erase character has been defined, the routine fails
 and the location referenced by \fIch\fR is not changed.
+.SS has_is, has_il
 .PP
 The \fBhas_ic\fR routine is true if the terminal has insert- and delete-
 character capabilities.
@@ -84,6 +87,7 @@
 capabilities, or can simulate them using scrolling regions.  This might
 be used to determine if it would be appropriate to turn on physical
 scrolling using \fBscrollok\fR.
+.SS killchar, killwchar
 .PP
 The \fBkillchar\fR routine returns the user's current line kill character.
 .PP
@@ -91,6 +95,7 @@
 in the location referenced by \fIch\fR.
 If no line-kill character has been defined,
 the routine fails and the location referenced by \fIch\fR is not changed.
+.SS longname
 .PP
 The \fBlongname\fR routine returns a pointer to a static area
 containing a verbose description of the current terminal.  The maximum
@@ -100,6 +105,7 @@
 \fBset_term\fR, so the value should be saved between calls to
 \fBnewterm\fR if \fBlongname\fR is going to be used with multiple
 terminals.
+.SS termattrs, term_attrs
 .PP
 If a given terminal does not support a video attribute that an
 application program is trying to use, \fBcurses\fR may substitute a
@@ -109,6 +115,7 @@
 terminal using \fIA_\fR and \fIWA_\fR constants respectively.
 This information is useful when a \fBcurses\fR program
 needs complete control over the appearance of the screen.
+.SS termname
 .PP
 The \fBtermname\fR routine returns the terminal name used by \fBsetupterm\fR.
 .SH RETURN VALUE
@@ -126,9 +133,3 @@
 14 characters.
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBcurs_initscr\fR(3X), \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_termcap.3x b/man/curs_termcap.3x
index 93ac2fb..2f0eea8 100644
--- a/man/curs_termcap.3x
+++ b/man/curs_termcap.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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,16 +26,27 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_termcap.3x,v 1.22 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_termcap.3x,v 1.31 2015/04/26 00:49:10 tom Exp $
 .TH curs_termcap 3X ""
+.de bP
+.IP \(bu 4
+..
+.na
+.hy 0
 .ds n 5
 .SH NAME
+\fBPC\fR,
+\fBUP\fR,
+\fBBC\fR,
+\fBospeed\fR,
 \fBtgetent\fR,
 \fBtgetflag\fR,
 \fBtgetnum\fR,
 \fBtgetstr\fR,
 \fBtgoto\fR,
-\fBtputs\fR - direct \fBcurses\fR interface to the terminfo capability database
+\fBtputs\fR \- direct \fBcurses\fR interface to the terminfo capability database
+.ad
+.hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .br
@@ -67,35 +78,80 @@
 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.
 .PP
 The \fBtgetnum\fR routine gets the numeric entry for \fIid\fR,
-or -1 if it is not available.
+or \-1 if it is not available.
 .PP
 The \fBtgetstr\fR routine returns the string entry for \fIid\fR,
 or zero if it is not available.
 Use \fBtputs\fR to output the returned string.
-The return value will also be copied to the buffer pointed to by \fIarea\fR,
+The \fIarea\fP parameter is used as follows:
+.RS 3
+.bP
+It is assumed to be the address of a pointer to a buffer managed by the
+calling application.
+.bP
+However, ncurses checks to ensure that \fBarea\fP is not NULL,
+and also that the resulting buffer pointer is not NULL.
+If either check fails, the \fIarea\fP parameter is ignored.
+.bP
+If the checks succeed, ncurses also copies the return value to
+the buffer pointed to by \fIarea\fR,
 and the \fIarea\fR value will be updated to point past the null ending
 this value.
+.bP
+The return value itself is an address in the terminal description which
+is loaded into memory.
+.RE
 .PP
 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,
@@ -157,11 +213,28 @@
 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), \fBputc\fR(3).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBterminfo\fR(\*n),
+\fBterm_variables\fR(3X),
+\fBputc\fR(3).
+.sp
+http://invisible-island.net/ncurses/tctest.html
diff --git a/man/curs_terminfo.3x b/man/curs_terminfo.3x
index 4412a6a..7d440bf 100644
--- a/man/curs_terminfo.3x
+++ b/man/curs_terminfo.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1999-2007,2008 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.30 2008/08/16 20:53:27 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
@@ -42,12 +49,13 @@
 \fBtigetflag\fR,
 \fBtigetnum\fR,
 \fBtigetstr\fR,
+\fBtiparm\fR,
 \fBtparm\fR,
 \fBtputs\fR,
 \fBvid_attr\fR,
 \fBvid_puts\fR,
 \fBvidattr\fR,
-\fBvidputs\fR - \fBcurses\fR interfaces to terminfo database
+\fBvidputs\fR \- \fBcurses\fR interfaces to terminfo database
 .ad
 .hy
 .SH SYNOPSIS
@@ -76,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
@@ -88,6 +96,8 @@
 .br
 \fBchar *tigetstr(char *\fR\fIcapname\fR\fB);\fR
 .br
+\fBchar *tiparm(const char *\fR\fIstr\fR\fB, ...);\fR
+.br
 .fi
 .SH DESCRIPTION
 These low-level routines must be called by programs that have to deal
@@ -95,40 +105,54 @@
 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
@@ -143,19 +167,23 @@
 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
+.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
@@ -165,18 +193,33 @@
 .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
@@ -186,16 +229,25 @@
 .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
 with the parameters applied.
 .PP
+\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
 variable or the return value from \fBtparm\fR, \fBtgetstr\fR, or
@@ -228,26 +280,48 @@
 .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
@@ -255,10 +329,6 @@
 .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
@@ -268,7 +338,7 @@
 .PP
 X/Open defines no error conditions.
 In this implementation
-.RS
+.RS 5
 .TP 5
 \fBdel_curterm\fP
 returns an error
@@ -293,19 +363,41 @@
 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.
@@ -319,34 +411,38 @@
 .PP
 X/Open Curses prototypes \fBtparm\fR with a fixed number of parameters,
 rather than a variable argument list.
-This implementation uses a variable argument list.
+This implementation uses a variable argument list, but can be
+configured to use the fixed-parameter list.
 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 \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.
 .PP
 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.
+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),
 \fBcurs_kernel\fR(3X),
 \fBcurs_termcap\fR(3X),
+\fBcurs_variables\fR(3X),
+\fBterm_variables\fR(3X),
 \fBputc\fR(3),
 \fBterminfo\fR(\*n)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_threads.3x b/man/curs_threads.3x
index 17dabdb..7776459 100644
--- a/man/curs_threads.3x
+++ b/man/curs_threads.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2008 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2008-2014,2015 Free 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,28 +26,34 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_threads.3x,v 1.12 2008/04/12 18:22:51 tom Exp $
+.\" $Id: curs_threads.3x,v 1.21 2015/04/11 10:23:49 tom Exp $
 .TH curs_threads 3X ""
+.de bP
+.IP \(bu 4
+..
 .na
 .hy 0
 .SH NAME
 \fBuse_screen\fR,
-\fBuse_window\fR - \fBcurses\fR thread support
+\fBuse_window\fR \- \fBcurses\fR thread support
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
 \fBtypedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);\fR
+.br
 \fBtypedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);\fR
 .br
+\fBint get_escdelay(void);\fR
+.br
 \fBint set_escdelay(int size);\fR
 .br
 \fBint set_tabsize(int size);\fR
 .br
-\fBint use_screen(SCREEN *scr, NCURSES_WINDOW_CB func, void *data);\fR
+\fBint use_screen(SCREEN *scr, NCURSES_SCREEN_CB func, void *data);\fR
 .br
-\fBint use_window(WINDOW *win, NCURSES_SCREEN_CB func, void *data);\fR
+\fBint use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data);\fR
 .br
 .SH DESCRIPTION
 This implementation can be configured to provide rudimentary support
@@ -89,6 +95,8 @@
 use the \fBset_escdelay\fP or \fBset_tabsize\fP functions.
 Other global variables are not modifiable.
 .PP
+The \fBget_escdelay\fP function returns the value for ESCDELAY.
+.PP
 The \fBuse_window\fP and \fBuse_screen\fP functions provide coarse
 granularity mutexes for their respective \fBWINDOW\fP and \fBSCREEN\fP
 parameters, and call a user-supplied function,
@@ -100,26 +108,21 @@
 altered during operation.
 In addition,
 they use data which is maintained within a hierarchy of scopes.
-.RS
-.TP 3
--
+.RS 3
+.bP
 global data, e.g., used in the low-level terminfo or termcap interfaces.
-.TP 3
--
+.bP
 terminal data, e.g., associated with a call to \fIset_curterm\fP.
 The terminal data are initialized when screens are created.
-.TP 3
--
+.bP
 screen data, e.g., associated with a call to \fInewterm\fP or \fIinitscr\fP.
-.TP 3
--
+.bP
 window data, e.g., associated with a call to \fInewwin\fP or \fIsubwin\fP.
 Windows are associated with screens.
 Pads are not necessarily associated with a particular screen.
 .IP
 Most curses applications operate on one or more windows within a single screen.
-.TP 3
--
+.bP
 reentrant, i.e., it uses only the data passed as parameters.
 .RE
 .PP
@@ -537,6 +540,7 @@
 wget_wstr/screen (input-operation)
 wgetbkgrnd/window
 wgetch/screen (input-operation)
+wgetdelay/window
 wgetn_wstr/screen (input-operation)
 wgetnstr/screen (input-operation)
 wgetparent/window
@@ -584,7 +588,7 @@
 .TE
 .\" ***************************************************************************
 .SH RETURN VALUE
-These functions all return TRUE or FALSE, except as noted.
+These functions all return \fBTRUE\fP or \fBFALSE\fP, except as noted.
 .SH NOTES
 Both a macro and a function are provided for each name.
 .SH PORTABILITY
@@ -594,10 +598,5 @@
 be conditioned using NCURSES_VERSION.
 .SH SEE ALSO
 \fBcurses\fR(3X),
-\fBcurs_opaque\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurs_opaque\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_touch.3x b/man/curs_touch.3x
index a7d07bc..f65d2f9 100644
--- a/man/curs_touch.3x
+++ b/man/curs_touch.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2020,2015 Free 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_touch.3x,v 1.11 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_touch.3x,v 1.15 2015/04/11 10:23:49 tom Exp $
 .TH curs_touch 3X ""
 .na
 .hy 0
@@ -36,7 +36,7 @@
 \fBuntouchwin\fR,
 \fBwtouchln\fR,
 \fBis_linetouched\fR,
-\fBis_wintouched\fR - \fBcurses\fR refresh control routines
+\fBis_wintouched\fR \- \fBcurses\fR refresh control routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -90,7 +90,7 @@
 returns an error 
 if the window pointer is null, or
 if the line number is outside the window.
-Note that ERR is distinct from TRUE and FALSE, which are the normal return values of this function.
+Note that ERR is distinct from \fBTRUE\fP and \fBFALSE\fP, which are the normal return values of this function.
 .TP 5
 \fBwtouchln\fP
 returns an error 
@@ -107,10 +107,6 @@
 .SH NOTES
 Note that all routines except \fBwtouchln\fR may be macros.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_refresh\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_variables\fR(3X).
diff --git a/man/curs_trace.3x b/man/curs_trace.3x
index ca74952..00e7bd6 100644
--- a/man/curs_trace.3x
+++ b/man/curs_trace.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2000-2005,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2000-2010,2015 Free 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,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_trace.3x,v 1.8 2007/02/24 17:33:49 tom Exp $
+.\" $Id: curs_trace.3x,v 1.13 2015/07/20 22:54:44 tom Exp $
+.de bP
+.IP \(bu 4
+..
 .TH curs_trace 3X ""
 .na
 .hy 0
@@ -36,105 +39,148 @@
 \fB_traceattr\fR,
 \fB_traceattr2\fR,
 \fB_nc_tracebits\fR,
+\fB_tracecchar_t\fR,
+\fB_tracecchar_t2\fR,
 \fB_tracechar\fR,
 \fB_tracechtype\fR,
 \fB_tracechtype2\fR,
 \fB_tracemouse\fR,
-\fBtrace\fR - \fBcurses\fR debugging routines
+\fBtrace\fR \- \fBcurses\fR debugging routines
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBvoid _tracef(const char *format, ...);\fR
+\fBvoid _tracef(const char *\fP\fIformat\fP\fB, ...);\fR
 .br
-\fBvoid _tracedump(const char *label, WINDOW *win);\fR
+\fBvoid _tracedump(const char *\fP\fIlabel\fP\fB, WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBchar *_traceattr(attr_t attr);\fR
+\fBchar *_traceattr(attr_t \fP\fIattr\fP\fB);\fR
 .br
-\fBchar *_traceattr2(int buffer, chtype ch);\fR
+\fBchar *_traceattr2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR
 .br
 \fBchar *_nc_tracebits(void);\fR
 .br
-\fBchar *_tracechar(int);\fR
+\fBchar * _tracecchar_t(const cchar_t *\fP\fIstring\fP\fB);\fR
 .br
-\fBchar *_tracechtype(chtype ch);\fR
+\fBchar * _tracecchar_t2(int \fP\fIbuffer\fP\fB, const cchar_t *\fP\fIstring\fP\fB);\fR
 .br
-\fBchar *_tracechtype2(int buffer, chtype ch);\fR
+\fBchar *_tracechar(int \fP\fIch\fP\fB);\fR
 .br
-\fBchar *_tracemouse(const MEVENT *event);\fR
+\fBchar *_tracechtype(chtype \fP\fIch\fP\fB);\fR
 .br
-\fBvoid trace(const unsigned int param);\fR
+\fBchar *_tracechtype2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR
+.br
+\fBchar *_tracemouse(const MEVENT *\fP\fIevent\fP\fB);\fR
+.br
+\fBvoid trace(const unsigned int \fP\fIparam\fP\fB);\fR
 .SH DESCRIPTION
 The \fBtrace\fR routines are used for debugging the ncurses libraries,
 as well as applications which use the ncurses libraries.
 These functions are normally available only with the debugging library
-\fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
+e.g., \fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
 profile) by defining the symbol \fBTRACE\fR.
+Additionally, some functions are only available with the wide-character
+configuration of the libraries.
 .PP
-The principal parts of this interface are the \fBtrace\fR routine which
-selectively enables different tracing features, and the \fB_tracef\fR
-routine which writes formatted data to the \fItrace\fR file.
+The principal parts of this interface are
+.bP
+\fBtrace\fR, which selectively enables different tracing features, and
+.bP
+\fB_tracef\fR, which writes formatted data to the \fItrace\fR file.
 .PP
 Calling \fBtrace\fR with a nonzero parameter opens the file \fBtrace\fR
-in the current directory for output.  The parameter is formed by OR'ing
+in the current directory for output.
+The parameter is formed by OR'ing
 values from the list of \fBTRACE_\fP\fIxxx\fR definitions in \fB<curses.h>\fR.
 These include:
 .TP 5
-TRACE_DISABLE
+.B TRACE_DISABLE
 turn off tracing.
 .TP 5
-TRACE_TIMES
+.B TRACE_TIMES
 trace user and system times of updates.
 .TP 5
-TRACE_TPUTS
+.B TRACE_TPUTS
 trace tputs calls.
 .TP 5
-TRACE_UPDATE
+.B TRACE_UPDATE
 trace update actions, old & new screens.
 .TP 5
-TRACE_MOVE
+.B TRACE_MOVE
 trace cursor movement and scrolling.
 .TP 5
-TRACE_CHARPUT
+.B TRACE_CHARPUT
 trace all character outputs.
 .TP 5
-TRACE_ORDINARY
+.B TRACE_ORDINARY
 trace all update actions.
 The old and new screen contents are written to the trace file
 for each refresh.
 .TP 5
-TRACE_CALLS
+.B TRACE_CALLS
 trace all curses calls.
 The parameters for each call are traced, as well as return values.
 .TP 5
-TRACE_VIRTPUT
+.B TRACE_VIRTPUT
 trace virtual character puts, i.e., calls to \fBaddch\fR.
 .TP 5
-TRACE_IEVENT
+.B TRACE_IEVENT
 trace low-level input processing, including timeouts.
 .TP 5
-TRACE_BITS
+.B TRACE_BITS
 trace state of TTY control bits.
 .TP 5
-TRACE_ICALLS
+.B TRACE_ICALLS
 trace internal/nested calls.
 .TP 5
-TRACE_CCALLS
+.B TRACE_CCALLS
 trace per-character calls.
 .TP 5
-TRACE_DATABASE
+.B TRACE_DATABASE
 trace read/write of terminfo/termcap data.
 .TP 5
-TRACE_ATTRS
+.B TRACE_ATTRS
 trace changes to video attributes and colors.
 .TP 5
-TRACE_MAXIMUM
+.B TRACE_MAXIMUM
 maximum trace level, enables all of the separate trace features.
 .PP
 Some tracing features are enabled whenever the \fBtrace\fR parameter
-is nonzero.  Some features overlap.
+is nonzero.
+Some features overlap.
 The specific names are used as a guideline.
+.PP
+The other functions either return a pointer to a string-area
+(allocated by the corresponding function),
+or return no value (such as \fB_tracedump\fP, which implements the
+screen dump for \fBTRACE_UPDATE\fP).
+The caller should not free these
+strings, since the allocation is reused on successive calls.
+To work around the problem of a single string-area per function,
+some use a buffer-number parameter, telling the library to allocate
+additional string-areas.
+.PP
+These functions check the \fBNCURSES_TRACE\fP environment variable,
+to set the tracing feature as if \fBtrace\fP was called:
+.RS
+.PP
+.na
+filter,
+initscr,
+new_prescr,
+newterm,
+nofilter,
+restartterm,
+ripoffline,
+setupterm,
+slk_init,
+tgetent,
+use_env,
+use_extended_names,
+use_tioctl
+.ad
+.RE
 .SH RETURN VALUE
 Routines which return a value are designed to be used as parameters
 to the \fB_tracef\fR routine.
@@ -145,9 +191,3 @@
 but they are not compatible with ncurses.
 .SH SEE ALSO
 \fBcurses\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_util.3x b/man/curs_util.3x
index 18e2b32..4d027db 100644
--- a/man/curs_util.3x
+++ b/man/curs_util.3x
@@ -1,5 +1,6 @@
+'\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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,15 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_util.3x,v 1.27 2008/10/25 23:45:41 tom Exp $
+.\" $Id: curs_util.3x,v 1.43 2015/06/06 23:36:27 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
+..
 .na
 .hy 0
 .SH NAME
@@ -41,7 +49,8 @@
 \fBputwin\fR,
 \fBunctrl\fR,
 \fBuse_env\fR,
-\fBwunctrl\fR - miscellaneous \fBcurses\fR utility routines
+\fBuse_tioctl\fR,
+\fBwunctrl\fR \- miscellaneous \fBcurses\fR utility routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -61,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
@@ -70,51 +81,50 @@
 \fBint flushinp(void);\fR
 .br
 .SH DESCRIPTION
+.SS unctrl
+.PP
 The \fBunctrl\fR routine returns a character string which is a printable
 representation of the character \fIc\fR, ignoring attributes.
 Control characters are displayed in the \fB^\fR\fIX\fR notation.
 Printing characters are displayed as is.
 The corresponding \fBwunctrl\fR returns a printable representation of
-a wide-character.
+a wide character.
+.SS keyname/key_name
 .PP
-The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR:
-.RS 3
-.TP 3
--
-Printable characters are displayed as themselves, e.g., a one-character string containing the key.
-.TP 3
--
+The \fBkeyname\fR routine returns a character string
+corresponding to the key \fIc\fR:
+.bP
+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.
-.TP 3
--
+.bP
 DEL (character 127) is displayed as \fB^?\fP.
-.TP 3
--
+.bP
 Values above 128 are either meta characters
 (if the screen has not been initialized,
-or if \fBmeta\fP has been called with a TRUE parameter),
-shown in the \fBM-\fR\fIX\fR notation,
+or if \fBmeta\fP has been called with a \fBTRUE\fP parameter),
+shown in the \fBM\-\fR\fIX\fR notation,
 or are displayed as themselves.
 In the latter case, the values may not be printable;
 this follows the X/Open specification.
-.TP 3
--
+.bP
 Values above 256 may be the names of the names of function keys.
-.TP 3
--
+.bP
 Otherwise (if there is no corresponding name) the function returns null,
 to denote an error.
 X/Open also lists an "UNKNOWN KEY" return value, which some implementations
 return rather than null.
-.RE
 .LP
 The corresponding \fBkey_name\fR returns a character string corresponding
 to the wide-character value \fIw\fR.
 The two functions do not return the same set of strings;
 the latter returns null where the former would display a meta character.
+.SS filter/nofilter
 .PP
 The \fBfilter\fR routine, if used, must be called before \fBinitscr\fR or
-\fBnewterm\fR are called.  The effect is that, during those calls, \fBLINES\fR
+\fBnewterm\fR are called.
+The effect is that, during those calls, \fBLINES\fR
 is set to 1; the capabilities \fBclear\fR, \fBcup\fR, \fBcud\fR, \fBcud1\fR,
 \fBcuu1\fR, \fBcuu\fR, \fBvpa\fR are disabled; and the \fBhome\fR string is
 set to the value of \fBcr\fR.
@@ -125,30 +135,111 @@
 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.
+.SS use_env
 .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,
+.SS use_tioctl
 .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
+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
+.SS putwin/getwin
+.PP
+The \fBputwin\fR routine writes all data associated
+with window (or pad) \fIwin\fR into
+the file to which \fIfilep\fR points.
+This information can be later retrieved
 using the \fBgetwin\fR function.
 .PP
 The \fBgetwin\fR routine reads window related data stored in the file by
-\fBputwin\fR.  The routine then creates and initializes a new window using that
-data.  It returns a pointer to the new window.
+\fBputwin\fR.
+The routine then creates and initializes a new window using that
+data.
+It returns a pointer to the new window.
+There are a few caveats:
+.bP
+the data written is a copy of the \fBWINDOW\fP structure,
+and its associated character cells.
+The format differs between the wide-character (ncursesw) and
+non-wide (ncurses) libraries.
+You can transfer data between the two, however.
+.bP
+the retrieved window is always created as a top-level window (or pad),
+rather than a subwindow.
+.bP
+the window's character cells contain the color pair \fIvalue\fP,
+but not the actual color \fInumbers\fP.
+If cells in the retrieved window use color pairs which have not been
+created in the application using \fBinit_pair\fP,
+they will not be colored when the window is refreshed.
+.SS delay_output
 .PP
 The \fBdelay_output\fR routine inserts an \fIms\fR millisecond pause
-in output.  This routine should not be used extensively because
+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.
+.SS flushinp
 .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.
@@ -173,36 +264,83 @@
 returns an error if the associated \fBfwrite\fP calls return an error.
 .RE
 .SH PORTABILITY
+.SS filter
+.PP
+The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest
+terms.
+The description here is adapted from the XSI Curses standard (which
+erroneously fails to describe the disabling of \fBcuu\fR).
+.SS keyname
+.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 \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
+the same value for different runs because user-defined codes are
+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.
+.SS nofilter/use_tioctl
+.PP
+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.
+.SS putwin/getwin
+.PP
+The \fBputwin\fP and \fBgetwin\fP functions have several issues with
+portability:
+.bP
+The files written and read by these functions
+use an implementation-specific format.
+Although the format is an obvious target for standardization,
+it has been overlooked.
+.IP
+Interestingly enough, according to the copyright dates in Solaris source,
+the functions (along with \fBscr_init\fP, etc.) originated with
+the University of California, Berkeley (in 1982)
+and were later (in 1988) incorporated into SVr4.
+Oddly, there are no such functions in the 4.3BSD curses sources.
+.bP
+Most implementations simply dump the binary \fBWINDOW\fP structure to the file.
+These include SVr4 curses, NetBSD and PDCurses, as well as older ncurses versions.
+This implementation (as well as the X/Open variant of Solaris curses, dated 1995)
+uses textual dumps.
+.IP
+The implementations which use binary dumps use block-I/O
+(the \fBfwrite\fP and \fBfread\fP functions).
+Those that use textual dumps use buffered-I/O.
+A few applications may happen to write extra data in the file using
+these functions.
+Doing that can run into problems mixing block- and buffered-I/O.
+This implementation reduces the problem on writes by flushing the output.
+However, reading from a file written using mixed schemes may not be successful.
+.SS unctrl/wunctrl
+.PP
 The XSI Curses standard, Issue 4 describes these functions.
 It states that \fBunctrl\fR and \fBwunctrl\fR will return a null pointer if
 unsuccessful, but does not define any error conditions.
 This implementation checks for three cases:
-.RS
-.TP 5
--
-the parameter is a 7-bit US-ASCII code.
+.bP
+the parameter is a 7-bit US\-ASCII code.
 This is the case that X/Open Curses documented.
-.TP 5
--
-the parameter is in the range 128-159, i.e., a C1 control code.
+.bP
+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.
-.TP 5
--
+and returns the \*(``~@\*('', etc., values in that case.
+.bP
 parameter values outside the 0 to 255 range.
 \fBunctrl\fP returns a null pointer.
-.RE
-.PP
-The SVr4 documentation describes the action of \fBfilter\fR only in the vaguest
-terms.  The description here is adapted from the XSI Curses standard (which
-erroneously fails to describe the disabling of \fBcuu\fR).
 .PP
 The strings returned by \fBunctrl\fR in this implementation are determined
 at compile time,
@@ -219,40 +357,19 @@
 .PP
 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).
+it determines whether to use the `M\-' prefix
+for \*(``meta\*('' keys (codes in the range 128 to 255).
 Both \fBuse_legacy_coding\fP and \fBmeta\fP succeed only after
-curses is initialized. 
+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.
-.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.
-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 
-the same value for different runs because user-defined codes are
-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.
-It is recommended that any code depending on ncurses extensions
-be conditioned using NCURSES_VERSION.
+this implementation returns strings \*(``M\-^@\*('', \*(``M\-^A\*('', etc.
 .SH SEE ALSO
 \fBlegacy_coding\fR(3X),
 \fBcurses\fR(3X),
 \fBcurs_initscr\fR(3X),
 \fBcurs_kernel\fR(3X),
 \fBcurs_scr_dump\fR(3X),
+\fBcurs_variables\fR(3X),
 \fBlegacy_coding\fR(3X).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/curs_variables.3x b/man/curs_variables.3x
new file mode 100644
index 0000000..efbe192
--- /dev/null
+++ b/man/curs_variables.3x
@@ -0,0 +1,136 @@
+.\"***************************************************************************
+.\" 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            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: curs_variables.3x,v 1.6 2013/12/21 18:41:32 tom Exp $
+.TH curs_variables 3X ""
+.de bP
+.IP \(bu 4
+..
+.ds n 5
+.na
+.hy 0
+.SH NAME
+\fBCOLORS\fR,
+\fBCOLOR_PAIRS\fR,
+\fBCOLS\fR,
+\fBESCDELAY\fR,
+\fBLINES\fR,
+\fBTABSIZE\fR,
+\fBcurscr\fR,
+\fBnewscr\fR,
+\fBstdscr\fR
+\- \fBcurses\fR global variables
+.ad
+.hy
+.SH SYNOPSIS
+.nf
+\fB#include <curses.h>\fR
+.PP
+\fBint COLOR_PAIRS;\fR
+.br
+\fBint COLORS;\fR
+.br
+\fBint COLS;\fR
+.br
+\fBint ESCDELAY;\fR
+.br
+\fBint LINES;\fR
+.br
+\fBint TABSIZE;\fR
+.br
+\fBWINDOW * curscr;\fR
+.br
+\fBWINDOW * newscr;\fR
+.br
+\fBWINDOW * stdscr;\fR
+.fi
+.SH DESCRIPTION
+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) 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.
+.SS COLOR_PAIRS
+After initializing curses, this variable contains the number of color pairs
+which the terminal can support.
+Usually the number of color pairs will be the product \fBCOLORS\fP*\fBCOLORS\fP,
+however this is not always true:
+.bP
+a few terminals use HLS colors, which do not follow this rule
+.bP
+terminals supporting a large number of colors are limited by the number
+of color pairs that can be represented in a \fIsigned short\fP value.
+.SS COLORS
+After initializing curses, this variable contains the number of colors
+which the terminal can support.
+.SS COLS
+After initializing curses, this variable contains the width of the screen,
+i.e., the number of columns.
+.SS ESCDELAY
+This variable holds the number of milliseconds to wait after reading an
+escape character,
+to distinguish between an individual escape character entered on the
+keyboard from escape sequences sent by cursor- and function-keys
+(see curses(3X).
+.SS LINES
+After initializing curses, this variable contains the height of the screen,
+i.e., the number of lines.
+.SS TABSIZE
+This variable holds the number of columns used by the \fIcurses\fP library
+when converting a tab character to spaces as it adds the tab to a window
+(see curs_addch(3X).
+.SS The Current Screen
+This implementation of curses uses a special window \fBcurscr\fP to
+record its updates to the terminal screen.
+.SS The New Screen
+This implementation of curses uses a special window \fBnewscr\fP to
+hold updates to the terminal screen before applying them to \fBcurscr\fP.
+.SS The Standard Screen
+Upon initializing curses,
+a default window called \fBstdscr\fP,
+which is the size of the terminal screen, is created.
+Many curses functions use this window.
+.SH NOTES
+The curses library is initialized using either \fBinitscr\fR(3X),
+or \fBnewterm\fR(3X).
+.PP
+If \fBcurses\fP is configured to use separate curses/terminfo libraries,
+most of these variables reside in the curses library.
+.SH PORTABILITY
+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(\*n).
diff --git a/man/curs_window.3x b/man/curs_window.3x
index 552862e..ba9d293 100644
--- a/man/curs_window.3x
+++ b/man/curs_window.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free 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_window.3x,v 1.14 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_window.3x,v 1.19 2015/07/21 08:25:23 tom Exp $
 .TH curs_window 3X ""
 .na
 .hy 0
@@ -41,87 +41,116 @@
 \fBwsyncup\fR,
 \fBsyncok\fR,
 \fBwcursyncup\fR,
-\fBwsyncdown\fR - create \fBcurses\fR windows
+\fBwsyncdown\fR \- create \fBcurses\fR windows
 .ad
 .hy
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
-\fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR
-      \fBint begin_x);\fR
+\fBWINDOW *newwin(\fR
+      \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR
+      \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR
 .br
-\fBint delwin(WINDOW *win);\fR
+\fBint delwin(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBint mvwin(WINDOW *win, int y, int x);\fR
+\fBint mvwin(WINDOW *\fP\fIwin\fP\fB, int \fP\fIy\fP\fB, int \fP\fIx\fP\fB);\fR
 .br
-\fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR
-      \fBint begin_y, int begin_x);\fR
+\fBWINDOW *subwin(WINDOW *\fP\fIorig\fP\fB,\fR
+      \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR
+      \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR
 .br
-\fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR
-      \fBint begin_y, int begin_x);\fR
+\fBWINDOW *derwin(WINDOW *\fP\fIorig\fP\fB,\fR
+      \fBint \fP\fInlines\fP\fB, int \fP\fIncols\fP\fB,\fR
+      \fBint \fP\fIbegin_y\fP\fB, int \fP\fIbegin_x\fP\fB);\fR
 .br
-\fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR
+\fBint mvderwin(WINDOW *\fP\fIwin\fP\fB, int \fP\fIpar_y\fP\fB, int \fP\fIpar_x\fP\fB);\fR
 .br
-\fBWINDOW *dupwin(WINDOW *win);\fR
+\fBWINDOW *dupwin(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBvoid wsyncup(WINDOW *win);\fR
+\fBvoid wsyncup(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBint syncok(WINDOW *win, bool bf);\fR
+\fBint syncok(WINDOW *\fP\fIwin\fP\fB, bool \fP\fIbf\fP\fB);\fR
 .br
-\fBvoid wcursyncup(WINDOW *win);\fR
+\fBvoid wcursyncup(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
-\fBvoid wsyncdown(WINDOW *win);\fR
+\fBvoid wsyncdown(WINDOW *\fP\fIwin\fP\fB);\fR
 .br
 .SH DESCRIPTION
+.SS newwin
 Calling \fBnewwin\fR creates and returns a pointer to a new window with the
-given number of lines and columns.  The upper left-hand corner of the window is
-at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR.  If either
-\fInlines\fR or \fIncols\fR is zero, they default to \fBLINES -\fR
-\fIbegin\fR_\fIy\fR and \fBCOLS -\fR \fIbegin\fR_\fIx\fR.  A new full-screen
-window is created by calling \fBnewwin(0,0,0,0)\fR.
+given number of lines and columns.
+The upper left-hand corner of the window is
+at
+.RS
+line \fIbegin\fR_\fIy\fR,
+.br
+column \fIbegin\fR_\fIx\fR
+.RE
+.PP
+If either
+\fInlines\fR or \fIncols\fR is zero, they default to
+.RS
+\fBLINES \-\fR \fIbegin\fR_\fIy\fR and
+.br
+\fBCOLS \-\fR \fIbegin\fR_\fIx\fR.
+.RE
+.PP
+A new full-screen window is created by calling \fBnewwin(0,0,0,0)\fR.
+.SS delwin
 .PP
 Calling \fBdelwin\fR deletes the named window, freeing all memory
 associated with it (it does not actually erase the window's screen
-image).  Subwindows must be deleted before the main window can be
-deleted.
+image).
+Subwindows must be deleted before the main window can be deleted.
+.SS mvwin
 .PP
 Calling \fBmvwin\fR moves the window so that the upper left-hand
-corner is at position (\fIx\fR, \fIy\fR).  If the move would cause the
-window to be off the screen, it is an error and the window is not
-moved.  Moving subwindows is allowed, but should be avoided.
+corner is at position (\fIx\fR, \fIy\fR).
+If the move would cause the window to be off the screen,
+it is an error and the window is not moved.
+Moving subwindows is allowed, but should be avoided.
+.SS subwin
 .PP
 Calling \fBsubwin\fR creates and returns a pointer to a new window
-with the given number of lines, \fInlines\fR, and columns,
-\fIncols\fR.  The window is at position (\fIbegin\fR_\fIy\fR,
-\fIbegin\fR_\fIx\fR) on the screen.  (This position is relative to the
-screen, and not to the window \fIorig\fR.)  The window is made in the
-middle of the window \fIorig\fR, so that changes made to one window
-will affect both windows.  The subwindow shares memory with the window
-\fIorig\fR.  When using this routine, it is necessary to call
+with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
+The window is at position (\fIbegin\fR_\fIy\fR,
+\fIbegin\fR_\fIx\fR) on the screen.
+The subwindow shares memory with the window \fIorig\fR,
+so that changes made to one window
+will affect both windows.
+When using this routine, it is necessary to call
 \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling
 \fBwrefresh\fR on the subwindow.
+.SS derwin
 .PP
 Calling \fBderwin\fR is the same as calling \fBsubwin,\fR except that
 \fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin
-of the window \fIorig\fR rather than the screen.  There is no
-difference between the subwindows and the derived windows.
+of the window \fIorig\fR rather than the screen.
+There is no difference between the subwindows and the derived windows.
 .PP
 Calling \fBmvderwin\fR moves a derived window (or subwindow)
-inside its parent window.  The screen-relative parameters of the
-window are not changed.  This routine is used to display different
+inside its parent window.
+The screen-relative parameters of the window are not changed.
+This routine is used to display different
 parts of the parent window at the same physical position on the
 screen.
+.SS dupwin
 .PP
 Calling \fBdupwin\fR creates an exact duplicate of the window \fIwin\fR.
+.SS wsyncup
 .PP
 Calling \fBwsyncup\fR touches all locations in ancestors of \fIwin\fR that are
-changed in \fIwin\fR.  If \fBsyncok\fR is called with second argument
+changed in \fIwin\fR.
+If \fBsyncok\fR is called with second argument
 \fBTRUE\fR then \fBwsyncup\fR is called automatically whenever there is a
 change in the window.
+.SS wsyncdown
 .PP
 The \fBwsyncdown\fR routine touches each location in \fIwin\fR that has been
-touched in any of its ancestor windows.  This routine is called by
+touched in any of its ancestor windows.
+This routine is called by
 \fBwrefresh\fR, so it should almost never be necessary to call it manually.
+.SS wcursyncup
 .PP
 The routine \fBwcursyncup\fR updates the current cursor position of all the
 ancestors of the window to reflect the current cursor position of the
@@ -135,11 +164,18 @@
 .PP
 X/Open defines no error conditions.
 In this implementation
-.RS
 .TP 5
 \fBdelwin\fR
 returns an error if the window pointer is null, or
 if the window is the parent of another window.
+.TP 5
+\fBderwin\fP
+returns an error if the parent window pointer is null, or
+if any of its ordinates or dimensions is negative, or
+if the resulting window does not fit inside the parent window.
+.TP 5
+\fBdupwin\fP
+returns an error if the window pointer is null.
 .IP
 This implementation also maintains a list of windows,
 and checks that the pointer passed to \fBdelwin\fP is one that
@@ -156,10 +192,23 @@
 if the window is really a pad, or
 if some part of the window would be placed off-screen.
 .TP 5
+\fBnewwin\fP
+will fail if either of its beginning ordinates is negative, or
+if either the number of lines or columns is negative.
+.TP 5
 \fBsyncok\fP
 returns an error
 if the window pointer is null.
-.RE
+.TP 5
+\fBsubwin\fP
+returns an error if the parent window pointer is null, or
+if any of its ordinates or dimensions is negative, or
+if the resulting window does not fit inside the parent window.
+.PP
+The functions which return a window pointer
+may also fail if there is insufficient memory for its data structures.
+Any of these functions will fail if the screen has not been initialized,
+i.e., with \fBinitscr\fP or \fBnewterm\fP.
 .SH NOTES
 If many small changes are made to the window, the \fBwsyncup\fR option could
 degrade performance.
@@ -171,18 +220,16 @@
 incompletely implemented, and not well tested.
 .PP
 The System V curses documentation is very unclear about what \fBwsyncup\fR
-and \fBwsyncdown\fR actually do.  It seems to imply that they are only
+and \fBwsyncdown\fR actually do.
+It seems to imply that they are only
 supposed to touch exactly those lines that are affected by ancestor changes.
 The language here, and the behavior of the \fBcurses\fR implementation,
-is patterned on the XPG4 curses standard.  The weaker XPG4 spec may result
-in slower updates.
+is patterned on the XPG4 curses standard.
+The weaker XPG4 spec may result in slower updates.
 .SH PORTABILITY
 The XSI Curses standard, Issue 4 describes these functions.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+\fBcurses\fR(3X),
+\fBcurs_refresh\fR(3X),
+\fBcurs_touch\fR(3X),
+\fBcurs_variables\fR(3X)
diff --git a/man/default_colors.3x b/man/default_colors.3x
index 32518ba..0b85598 100644
--- a/man/default_colors.3x
+++ b/man/default_colors.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 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            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 1997,1999,2000,2005
 .\"
-.\" $Id: default_colors.3x,v 1.20 2006/12/24 15:02:53 tom Exp $
+.\" $Id: default_colors.3x,v 1.23 2011/01/03 21:52:27 Tim.van.der.Molen Exp $
 .TH default_colors 3X ""
 .SH NAME
 \fBuse_default_colors\fR,
@@ -64,14 +64,14 @@
 The first function,
 .I use_default_colors()
 tells the curses library to assign terminal default
-foreground/background colors to color number -1. So init_pair(x,COLOR_RED,-1)
-will initialize pair x as red on default background and init_pair(x,-1,COLOR_BLUE) will
+foreground/background colors to color number \-1. So init_pair(x,COLOR_RED,\-1)
+will initialize pair x as red on default background and init_pair(x,\-1,COLOR_BLUE) will
 initialize pair x as default foreground on blue.
 .PP
 The other,
 .I assume_default_colors()
 is a refinement which tells which colors to paint for color pair 0.
-This function recognizes a special color number -1,
+This function recognizes a special color number \-1,
 which denotes the default terminal color.
 .PP
 The following are equivalent:
@@ -79,12 +79,12 @@
 .br
 .I use_default_colors();
 .br
-.I assume_default_colors(-1,-1);
+.I assume_default_colors(\-1,\-1);
 .RE
 .PP
 These are ncurses extensions.
 For other curses implementations, color
-number -1 does not mean anything, just as for ncurses before a
+number \-1 does not mean anything, just as for ncurses before a
 successful call of \fIuse_default_colors()\fP or \fIassume_default_colors()\fP.
 .PP
 Other curses implementations do not allow an application to modify color pair 0.
@@ -101,7 +101,7 @@
 These functions return the integer \fBERR\fP upon failure and \fBOK\fP on success.
 They will fail if either the terminal does not support
 the \fIorig_pair\fP or \fIorig_colors\fP capability.
-If the \fIinitialize_pair\fP capability is found, this causes an
+If the \fIinitialize_pair\fP capability is not found, this causes an
 error as well.
 .SH NOTES
 Associated with this extension, the \fBinit_pair\fR function accepts
@@ -136,9 +136,3 @@
 .SH AUTHOR
 Thomas Dickey (from an analysis of the requirements for color xterm
 for XFree86 3.1.2C, February 1996).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/define_key.3x b/man/define_key.3x
index 216a3cb..18eaff8 100644
--- a/man/define_key.3x
+++ b/man/define_key.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 1997
 .\"
-.\" $Id: define_key.3x,v 1.12 2006/02/25 21:49:19 tom Exp $
+.\" $Id: define_key.3x,v 1.14 2010/12/04 18:49:20 tom Exp $
 .TH define_key 3X ""
 .SH NAME
 \fBdefine_key\fP \- define a keycode
@@ -47,7 +47,11 @@
 Similarly, if the given keycode is negative or zero, any existing string
 for the given definition is removed.
 .SH RETURN VALUE
-The keycode must be greater than zero, else ERR is returned.
+The keycode must be greater than zero, and the string non-null,
+otherwise ERR is returned.
+ERR may also be returned if there is insufficient memory to allocate the
+data to store the definition.
+If no error is detected, OK is returned.
 .SH PORTABILITY
 These routines are specific to ncurses.  They were not supported on
 Version 7, BSD or System V implementations.  It is recommended that
@@ -57,9 +61,3 @@
 \fBkey_defined\fR(3X).
 .SH AUTHOR
 Thomas Dickey.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form.3x b/man/form.3x
index dcba19b..c379a4d 100644
--- a/man/form.3x
+++ b/man/form.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form.3x,v 1.22 2008/10/11 20:48:11 tom Exp $
+.\" $Id: form.3x,v 1.26 2015/08/02 18:14:50 tom Exp $
 .TH form 3X ""
 .SH NAME
-\fBform\fR - curses extension for programming forms
+\fBform\fR \- curses extension for programming forms
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -43,7 +43,7 @@
 .PP
 The \fBform\fR library uses the \fBcurses\fR libraries.
 To use the \fBform\fR library, link with the options
-\fB-lform -lcurses\fR.
+\fB\-lform \-lcurses\fR.
 .PP
 Your program should set up the locale, e.g.,
 .sp
@@ -96,6 +96,7 @@
 field_type	\fBform_field_validation\fR(3X)
 field_userptr	\fBform_field_userptr\fR(3X)
 form_driver	\fBform_driver\fR(3X)
+form_driver_w	\fBform_driver\fR(3X)*
 form_fields	\fBform_field\fR(3X)
 form_init	\fBform_hook\fR(3X)
 form_opts	\fBform_opts\fR(3X)
@@ -189,15 +190,12 @@
 .TP 5
 .B E_UNKNOWN_COMMAND
 The form driver code saw an unknown request code.
-.SH SEE ALSO
-\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed
-descriptions of the entry points.
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header files
 \fB<curses.h>\fR and \fB<eti.h>\fR.
 .PP
 In your library list, libform.a should be before libncurses.a; that is,
-you want to say `-lform -lncurses', not the other way around (which would
+you want to say `\-lform \-lncurses', not the other way around (which would
 give you a link error using most linkers).
 .SH PORTABILITY
 These routines emulate the System V forms library.  They were not supported on
@@ -206,11 +204,8 @@
 Juergen Pfeifer.  Manual pages and adaptation for ncurses by Eric
 S. Raymond.
 .SH SEE ALSO
+\fBcurses\fR(3X) and related pages whose names begin "form_" for detailed
+descriptions of the entry points.
+.PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_cursor.3x b/man/form_cursor.3x
index bf9f28d..ed4b420 100644
--- a/man/form_cursor.3x
+++ b/man/form_cursor.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_cursor.3x,v 1.6 2006/11/04 18:50:24 tom Exp $
+.\" $Id: form_cursor.3x,v 1.8 2010/12/04 18:40:45 tom Exp $
 .TH form_cursor 3X ""
 .SH NAME
-\fBform_cursor\fR - position a form window cursor
+\fBform_cursor\fR \- position a form window cursor
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -67,9 +67,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_data.3x b/man/form_data.3x
index 2ba004c..ed39bf5 100644
--- a/man/form_data.3x
+++ b/man/form_data.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_data.3x,v 1.8 2006/02/25 21:38:26 tom Exp $
+.\" $Id: form_data.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH form_data 3X ""
 .SH NAME
-\fBform_data\fR - test for off-screen data in given forms
+\fBform_data\fR \- test for off-screen data in given forms
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -55,9 +55,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_driver.3x b/man/form_driver.3x
index 4b0576f..4084eac 100644
--- a/man/form_driver.3x
+++ b/man/form_driver.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free 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,223 +26,122 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_driver.3x,v 1.16 2008/06/21 21:55:39 tom Exp $
+.\" $Id: form_driver.3x,v 1.24 2015/08/02 18:21:11 tom Exp $
 .TH form_driver 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
-\fBform_driver\fR - command-processing loop of the form system
+\fBform_driver\fR \- command-processing loop of the form system
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
-int form_driver(FORM *form, int c);
+\fBint form_driver(FORM *\fP\fIform\fP\fB, int \fP\fIc\fP\fB);\fP
+.br
+\fBint form_driver_w(FORM *\fP\fIform\fP\fB, int \fP\fIc\fP\fB, wchar_t \fP\fIwch\fP\fB);\fP
 .br
 .SH DESCRIPTION
+.SS form_driver
 Once a form has been posted (displayed), you should funnel input events to it
 through \fBform_driver\fR.  This routine has three major input cases:
-.TP 3
--
+.bP
 The input is a form navigation request.
 Navigation request codes are constants defined in \fB<form.h>\fP,
-which are distinct from the key- and character codes returned by \fBwgetch\fP.
-.TP 3
--
+which are distinct from the key- and character codes returned by \fBwgetch\fP(3X).
+.bP
 The input is a printable character.
 Printable characters (which must be positive, less than 256) are
 checked according to the program's locale settings.
-.TP 3
--
+.bP
 The input is the KEY_MOUSE special key associated with an mouse event.
+.SS form_driver_w
+.PP
+This extension simplifies the use of the forms library using wide characters.
+The input is either a key code (a request) or a wide character
+returned by \fBget_wch\fP(3X).
+The type must be passed as well,
+to enable the library to determine whether the parameter
+is a wide character or a request.
+.SS Form-driver requests
 .PP
 The form driver requests are as follows:
-.TP 5
-REQ_NEXT_PAGE
-Move to the next page.
-.TP 5
-REQ_PREV_PAGE
-Move to the previous page.
-.TP 5
-REQ_FIRST_PAGE
-Move to the first page.
-.TP 5
-REQ_LAST_PAGE
-Move to the last field.
-.sp
-.TP 5
-REQ_NEXT_FIELD
-Move to the next field.
-.TP 5
-REQ_PREV_FIELD
-Move to the previous field.
-.TP 5
-REQ_FIRST_FIELD
-Move to the first field.
-.TP 5
-REQ_LAST_FIELD
-Move to the last field.
-.TP 5
-REQ_SNEXT_FIELD
-Move to the sorted next field.
-.TP 5
-REQ_SPREV_FIELD
-Move to the sorted previous field.
-.TP 5
-REQ_SFIRST_FIELD
-Move to the sorted first field.
-.TP 5
-REQ_SLAST_FIELD
-Move to the sorted last field.
-.TP 5
-REQ_LEFT_FIELD
-Move left to a field.
-.TP 5
-REQ_RIGHT_FIELD
-Move right to a field.
-.TP 5
-REQ_UP_FIELD
-Move up to a field.
-.TP 5
-REQ_DOWN_FIELD
-Move down to a field.
-.sp
-.TP 5
-REQ_NEXT_CHAR
-Move to the next char.
-.TP 5
-REQ_PREV_CHAR
-Move to the previous char.
-.TP 5
-REQ_NEXT_LINE
-Move to the next line.
-.TP 5
-REQ_PREV_LINE
-Move to the previous line.
-.TP 5
-REQ_NEXT_WORD
-Move to the next word.
-.TP 5
-REQ_PREV_WORD
-Move to the previous word.
-.TP 5
-REQ_BEG_FIELD
-Move to the beginning of the field.
-.TP 5
-REQ_END_FIELD
-Move to the end of the field.
-.TP 5
-REQ_BEG_LINE
-Move to the beginning of the line.
-.TP 5
-REQ_END_LINE
-Move to the end of the line.
-.TP 5
-REQ_LEFT_CHAR
-Move left in the field.
-.TP 5
-REQ_RIGHT_CHAR
-Move right in the field.
-.TP 5
-REQ_UP_CHAR
-Move up in the field.
-.TP 5
-REQ_DOWN_CHAR
-Move down in the field.
-.sp
-.TP 5
-REQ_NEW_LINE
-Insert or overlay a new line.
-.TP 5
-REQ_INS_CHAR
-Insert a blank at the cursor.
-.TP 5
-REQ_INS_LINE
-Insert a blank line at the cursor.
-.TP 5
-REQ_DEL_CHAR
-Delete character at the cursor.
-.TP 5
-REQ_DEL_PREV
-Delete character before the cursor.
-.TP 5
-REQ_DEL_LINE
-Delete line at the cursor.
-.TP 5
-REQ_DEL_WORD
-Delete blank-delimited word at the cursor.
-.TP 5
-REQ_CLR_EOL
-Clear to end of line from cursor.
-.TP 5
-REQ_CLR_EOF
-Clear to end of field from cursor.
-.TP 5
-REQ_CLR_FIELD
-Clear the entire field.
-.TP 5
-REQ_OVL_MODE
-Enter overlay mode.
-.TP 5
-REQ_INS_MODE
-Enter insert mode.
-.sp
-.TP 5
-REQ_SCR_FLINE
-Scroll the field forward a line.
-.TP 5
-REQ_SCR_BLINE
-Scroll the field backward a line.
-.TP 5
-REQ_SCR_FPAGE
-Scroll the field forward a page.
-.TP 5
-REQ_SCR_BPAGE
-Scroll the field backward a page.
-.TP 5
-REQ_SCR_FHPAGE
-Scroll the field forward half a page.
-.TP 5
-REQ_SCR_BHPAGE
-Scroll the field backward half a page.
-.sp
-.TP 5
-REQ_SCR_FCHAR
-Scroll the field forward a character.
-.TP 5
-REQ_SCR_BCHAR
-Scroll the field backward a character.
-.TP 5
-REQ_SCR_HFLINE
-Horizontal scroll the field forward a line.
-.TP 5
-REQ_SCR_HBLINE
-Horizontal scroll the field backward a line.
-.TP 5
-REQ_SCR_HFHALF
-Horizontal scroll the field forward half a line.
-.TP 5
-REQ_SCR_HBHALF
-Horizontal scroll the field backward half a line.
-.sp
-.TP
-REQ_VALIDATION
-Validate field.
-.TP
-REQ_NEXT_CHOICE
-Display next field choice.
-.TP
-REQ_PREV_CHOICE
-Display previous field choice.
+.TS
+l l
+_ _ _
+l l.
+\fIName\fR	\fIDescription\fR
+REQ_BEG_FIELD	Move to the beginning of the field.
+REQ_BEG_LINE	Move to the beginning of the line.
+REQ_CLR_EOF	Clear to end of field from cursor.
+REQ_CLR_EOL	Clear to end of line from cursor.
+REQ_CLR_FIELD	Clear the entire field.
+REQ_DEL_CHAR	Delete character at the cursor.
+REQ_DEL_LINE	Delete line at the cursor.
+REQ_DEL_PREV	Delete character before the cursor.
+REQ_DEL_WORD	Delete blank-delimited word at the cursor.
+REQ_DOWN_CHAR	Move down in the field.
+REQ_DOWN_FIELD	Move down to a field.
+REQ_END_FIELD	Move to the end of the field.
+REQ_END_LINE	Move to the end of the line.
+REQ_FIRST_FIELD	Move to the first field.
+REQ_FIRST_PAGE	Move to the first page.
+REQ_INS_CHAR	Insert a blank at the cursor.
+REQ_INS_LINE	Insert a blank line at the cursor.
+REQ_INS_MODE	Enter insert mode.
+REQ_LAST_FIELD	Move to the last field.
+REQ_LAST_PAGE	Move to the last field.
+REQ_LEFT_CHAR	Move left in the field.
+REQ_LEFT_FIELD	Move left to a field.
+REQ_NEW_LINE	Insert or overlay a new line.
+REQ_NEXT_CHAR	Move to the next char.
+REQ_NEXT_CHOICE	Display next field choice.
+REQ_NEXT_FIELD	Move to the next field.
+REQ_NEXT_LINE	Move to the next line.
+REQ_NEXT_PAGE	Move to the next page.
+REQ_NEXT_PAGE	Move to the next page.
+REQ_NEXT_WORD	Move to the next word.
+REQ_OVL_MODE	Enter overlay mode.
+REQ_PREV_CHAR	Move to the previous char.
+REQ_PREV_CHOICE	Display previous field choice.
+REQ_PREV_FIELD	Move to the previous field.
+REQ_PREV_LINE	Move to the previous line.
+REQ_PREV_PAGE	Move to the previous page.
+REQ_PREV_WORD	Move to the previous word.
+REQ_RIGHT_CHAR	Move right in the field.
+REQ_RIGHT_FIELD	Move right to a field.
+REQ_SCR_BCHAR	Scroll the field backward a character.
+REQ_SCR_BHPAGE	Scroll the field backward half a page.
+REQ_SCR_BLINE	Scroll the field backward a line.
+REQ_SCR_BPAGE	Scroll the field backward a page.
+REQ_SCR_FCHAR	Scroll the field forward a character.
+REQ_SCR_FHPAGE	Scroll the field forward half a page.
+REQ_SCR_FLINE	Scroll the field forward a line.
+REQ_SCR_FPAGE	Scroll the field forward a page.
+REQ_SCR_HBHALF	Horizontal scroll the field backward half a line.
+REQ_SCR_HBLINE	Horizontal scroll the field backward a line.
+REQ_SCR_HFHALF	Horizontal scroll the field forward half a line.
+REQ_SCR_HFLINE	Horizontal scroll the field forward a line.
+REQ_SFIRST_FIELD	Move to the sorted first field.
+REQ_SLAST_FIELD	Move to the sorted last field.
+REQ_SNEXT_FIELD	Move to the sorted next field.
+REQ_SPREV_FIELD	Move to the sorted previous field.
+REQ_UP_CHAR	Move up in the field.
+REQ_UP_FIELD	Move up to a field.
+REQ_VALIDATION	Validate field.
+.TE
 .PP
 If the second argument is a printable character, the driver places it
 in the current position in the current field.  If it is one of the forms
 requests listed above, that request is executed.
-.SS MOUSE HANDLING
+.SS Mouse handling
 .PP
 If the second argument is the KEY_MOUSE special key, the associated
 mouse event is translated into one of the above pre-defined requests.
-Currently only clicks in the user window (e.g. inside the form display
+Currently only clicks in the user window (e.g., inside the form display
 area or the decoration window) are handled.
 .PP
 If you click above the display region of the form:
-.RS
+.RS 3
 .TP
 a REQ_PREV_FIELD is generated for a single click,
 .TP
@@ -252,7 +151,7 @@
 .RE
 .PP
 If you click below the display region of the form:
-.RS
+.RS 3
 .TP
 a REQ_NEXT_FIELD is generated for a single click,
 .TP
@@ -262,12 +161,10 @@
 .RE
 .PP
 If you click at an field inside the display area of the form:
-.RS
-.TP 3
--
+.RS 3
+.bP
 the form cursor is positioned to that field.
-.TP 3
--
+.bP
 If you double-click a field,
 the form cursor is positioned to that field
 and \fBE_UNKNOWN_COMMAND\fR is returned.
@@ -276,15 +173,14 @@
 be returned.
 It is exactly the purpose of this return value to signal that an
 application specific command should be executed.
-.TP 3
--
+.bP
 If a translation
 into a request was done, \fBform_driver\fR returns the result of this request.
 .RE
 .PP
 If you clicked outside the user window or the mouse event could not be translated
 into a form request an \fBE_REQUEST_DENIED\fR is returned.
-.SS APPLICATION-DEFINED COMMANDS
+.SS Application-defined commands
 .PP
 If the second argument is neither printable nor one of the above
 pre-defined form requests, the driver assumes it is an application-specific
@@ -321,7 +217,8 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBform\fR(3X),
-\fBwgetch\fR(3X).
+\fBform_variables\fR(3X),
+\fBgetch\fR(3X).
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header files
 \fB<curses.h>\fR.
@@ -331,9 +228,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field.3x b/man/form_field.3x
index f3a26c5..19a8b88 100644
--- a/man/form_field.3x
+++ b/man/form_field.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 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,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field.3x,v 1.8 2006/11/04 18:01:38 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
+\fBform_field\fR \- make and break connections between fields and forms
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -52,7 +52,7 @@
 .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
@@ -86,13 +86,7 @@
 Version 7 or BSD versions.
 .PP
 The SVr4 forms library documentation specifies the \fBfield_count\fR error value
-as -1 (which is the value of \fBERR\fR).
+as \-1 (which is the value of \fBERR\fR).
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_attributes.3x b/man/form_field_attributes.3x
index 90dc0f3..da3ad79 100644
--- a/man/form_field_attributes.3x
+++ b/man/form_field_attributes.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_attributes.3x,v 1.10 2006/11/04 18:51:26 tom Exp $
+.\" $Id: form_field_attributes.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH form_field_attributes 3X ""
 .SH NAME
-\fBform_field_attributes\fR - color and attribute control for form fields
+\fBform_field_attributes\fR \- color and attribute control for form fields
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -84,9 +84,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_buffer.3x b/man/form_field_buffer.3x
index 566072f..b4ff8cb 100644
--- a/man/form_field_buffer.3x
+++ b/man/form_field_buffer.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,13 +27,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_buffer.3x,v 1.15 2008/10/18 18:35:17 tom Exp $
+.\" $Id: form_field_buffer.3x,v 1.19 2010/12/04 18:38:55 tom Exp $
 .TH form_field_buffer 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
-\fBform_field_buffer\fR - field buffer control
+\fBform_field_buffer\fR \- field buffer control
 .SH SYNOPSIS
 \fB#include <form.h>\fR
-.br
+.sp
 int set_field_buffer(FIELD *field, int buf, const char *value);
 .br
 char *field_buffer(const FIELD *field, int buffer);
@@ -48,11 +51,9 @@
 The function \fBset_field_buffer\fR sets the numbered buffer of the given field
 to contain a given string:
 .RS 3
-.TP 3
--
+.bP
 Buffer 0 is the displayed value of the field.
-.TP 3
--
+.bP
 Other numbered buffers may be allocated by applications through the \fBnbuf\fR
 argument of (see \fBform_field_new\fR(3X))
 but are not manipulated by the forms library.
@@ -61,28 +62,23 @@
 The function \fBfield_buffer\fR returns a pointer to
 the contents of the given numbered buffer:
 .RS 3
-.TP 3
--
+.bP
 The buffer contents always have the same length,
 and are padded with trailing spaces
 as needed to ensure this length is the same.
-.TP 3
--
+.bP
 The buffer may contain leading spaces, depending on how it was set.
-.TP 3
--
+.bP
 The buffer contents are set with \fBset_field_buffer\fP,
 or as a side effect of any editing operations on the corresponding field.
-.TP 3
--
+.bP
 Editing operations are based on the \fIwindow\fP which displays the field,
 rather than a \fIstring\fP.
 The window contains only printable characters, and is filled with blanks.
 If you want the raw data, you must write your
 own routine that copies the value out of the buffer and removes the leading
 and trailing spaces.
-.TP 3
--
+.bP
 Because editing operations change the content of the buffer to
 correspond to the window, you should not rely on using buffers
 for long-term storage of form data.
@@ -122,7 +118,7 @@
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header file
 .PP
-When configured for wide-characters, \fBfield_buffer\fP returns a pointer
+When configured for wide characters, \fBfield_buffer\fP returns a pointer
 to temporary storage (allocated and freed by the library).
 The application should not attempt to modify the data.
 It will be freed on the next call to \fBfield_buffer\fP to return the
@@ -134,9 +130,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_info.3x b/man/form_field_info.3x
index bde3128..6a1af6c 100644
--- a/man/form_field_info.3x
+++ b/man/form_field_info.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_info.3x,v 1.10 2006/11/04 17:14:31 tom Exp $
+.\" $Id: form_field_info.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH form_field_info 3X ""
 .SH NAME
-\fBform_field_info\fR - retrieve field characteristics
+\fBform_field_info\fR \- retrieve field characteristics
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -77,9 +77,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_just.3x b/man/form_field_just.3x
index 15d6cb2..2f223e9 100644
--- a/man/form_field_just.3x
+++ b/man/form_field_just.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_just.3x,v 1.9 2006/11/04 17:12:00 tom Exp $
+.\" $Id: form_field_just.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH form_field_just 3X ""
 .SH NAME
-\fBform_field_just\fR - retrieve field characteristics
+\fBform_field_just\fR \- retrieve field characteristics
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -70,9 +70,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_new.3x b/man/form_field_new.3x
index 6095de1..23a3516 100644
--- a/man/form_field_new.3x
+++ b/man/form_field_new.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_new.3x,v 1.16 2007/06/02 20:40:07 tom Exp $
+.\" $Id: form_field_new.3x,v 1.18 2010/12/04 18:40:45 tom Exp $
 .TH form_field_new 3X ""
 .SH NAME
-\fBform_field_new\fR - create and destroy form fields
+\fBform_field_new\fR \- create and destroy form fields
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -98,9 +98,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_opts.3x b/man/form_field_opts.3x
index d505279..ff27fe1 100644
--- a/man/form_field_opts.3x
+++ b/man/form_field_opts.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,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            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_opts.3x,v 1.13 2007/02/24 17:34:27 tom Exp $
+.\" $Id: form_field_opts.3x,v 1.17 2014/07/26 21:21:57 tom Exp $
 .TH form_field_opts 3X ""
 .SH NAME
-\fBform_field_opts\fR - set and get field options
+\fBform_field_opts\fR \- set and get field options
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -54,42 +54,47 @@
 .PP
 The function \fBfield_opts\fR returns the field's current option bits.
 .PP
-The following options are defined (all are on by default):
-.TP 5
-O_VISIBLE
-The field is displayed.  If this option is off, display of the field is
-suppressed.
+The following standard options are defined (all are on by default):
 .TP 5
 O_ACTIVE
 The field is visited during processing.  If this option is off, the field will
 not be reachable by navigation keys. Please notice that an invisible field
 appears to be inactive also.
 .TP 5
-O_PUBLIC
-The field contents are displayed as data is entered.
-.TP 5
-O_EDIT
-The field can be edited.
-.TP 5
-O_WRAP
-Words that do not fit on a line are wrapped to the next line.  Words are
-blank-separated.
+O_AUTOSKIP
+Skip to the next field when this one fills.
 .TP 5
 O_BLANK
 The field is cleared whenever a character is entered at the first position.
 .TP 5
-O_AUTOSKIP
-Skip to the next field when this one fills.
+O_EDIT
+The field can be edited.
 .TP 5
 O_NULLOK
 Allow a blank field.
 .TP 5
+O_PASSOK
+Validate field only if modified by user.
+.TP 5
+O_PUBLIC
+The field contents are displayed as data is entered.
+.TP 5
 O_STATIC
 Field buffers are fixed to field's original size.
 Turn this option off to create a dynamic field.
 .TP 5
-O_PASSOK
-Validate field only if modified by user.
+O_VISIBLE
+The field is displayed.  If this option is off, display of the field is
+suppressed.
+.TP 5
+O_WRAP
+Words that do not fit on a line are wrapped to the next line.  Words are
+blank-separated.
+.PP
+One extension option is defined (extensions are off by default):
+.TP 5
+O_DYNAMIC_JUSTIFY
+Permit dynamic fields to be justified, like static fields.
 .SH RETURN VALUE
 Except for \fBfield_opts\fR, each routine returns one of the following:
 .TP 5
@@ -105,8 +110,9 @@
 .B E_SYSTEM_ERROR
 System error occurred (see \fBerrno\fR).
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBform\fR(3X).
-.TP 5
+\fBcurses\fR(3X),
+\fBform\fR(3X).
+\fBform_field_just\fR(3X).
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
@@ -116,9 +122,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_userptr.3x b/man/form_field_userptr.3x
index 47b9ed4..898da97 100644
--- a/man/form_field_userptr.3x
+++ b/man/form_field_userptr.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_userptr.3x,v 1.8 2006/11/04 18:04:37 tom Exp $
+.\" $Id: form_field_userptr.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH form_field_userptr 3X ""
 .SH NAME
-\fBform_field_userptr\fR - associate application data with a form field
+\fBform_field_userptr\fR \- associate application data with a form field
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -61,9 +61,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_field_validation.3x b/man/form_field_validation.3x
index 2da52ef..3505fdb 100644
--- a/man/form_field_validation.3x
+++ b/man/form_field_validation.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_validation.3x,v 1.16 2006/12/24 16:08:08 tom Exp $
+.\" $Id: form_field_validation.3x,v 1.20 2010/12/04 18:38:55 tom Exp $
 .TH form_field_validation 3X ""
 .SH NAME
-\fBform_field_validation\fR - data type validation for fields
+\fBform_field_validation\fR \- data type validation for fields
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -70,9 +70,7 @@
 case-sensitivity; and a fifth \fBint\fR flag argument specifying whether a partial
 match must be a unique one (if this flag is off, a prefix matches the first
 of any set of more than one list elements with that prefix). Please notice
-that the string list is not copied, only a reference to it is stored in the
-field. So you should avoid using a list that lives in automatic variables
-on the stack.
+that the string list is copied. So you may use a list that lives in automatic variables on the stack.
 .TP 5
 TYPE_INTEGER
 Integer data, parsable to an integer by \fBatoi(3)\fR.  Requires a third
@@ -101,10 +99,10 @@
 the data is valid if the regular expression matches it.  Regular expressions
 are in the format of \fBregcomp\fR and \fBregexec\fR. Please notice
 that the regular expression must match the whole field. If you have for
-example an eight character wide field, a regular expression "^[0-9]*$" always
+example an eight character wide field, a regular expression "^[0\-9]*$" always
 means that you have to fill all eight positions with digits. If you want to
-allow fewer digits, you may use for example "^[0-9]* *$" which is good for
-trailing spaces (up to an empty field), or "^ *[0-9]* *$" which is good for
+allow fewer digits, you may use for example "^[0\-9]* *$" which is good for
+trailing spaces (up to an empty field), or "^ *[0\-9]* *$" which is good for
 leading and trailing spaces around the digits.
 .TP 5
 TYPE_IPV4
@@ -126,7 +124,9 @@
 .B E_SYSTEM_ERROR
 System error occurred (see \fBerrno\fR).
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBform\fR(3X).
+\fBcurses\fR(3X),
+\fBform\fR(3X),
+\fBform_variables\fR(3X).
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
@@ -136,9 +136,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_fieldtype.3x b/man/form_fieldtype.3x
index 0d42fae..028e9b0 100644
--- a/man/form_fieldtype.3x
+++ b/man/form_fieldtype.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_fieldtype.3x,v 1.14 2006/11/04 17:12:00 tom Exp $
+.\" $Id: form_fieldtype.3x,v 1.16 2010/12/04 18:40:45 tom Exp $
 .TH form_fieldtype 3X ""
 .SH NAME
-\fBform_fieldtype\fR - define validation-field types
+\fBform_fieldtype\fR \- define validation-field types
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -140,9 +140,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_hook.3x b/man/form_hook.3x
index cd47a24..2943b88 100644
--- a/man/form_hook.3x
+++ b/man/form_hook.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_hook.3x,v 1.9 2007/02/24 17:34:18 tom Exp $
+.\" $Id: form_hook.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH form_hook 3X ""
 .SH NAME
-\fBform_hook\fR - set hooks for automatic invocation by applications
+\fBform_hook\fR \- set hooks for automatic invocation by applications
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -92,9 +92,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_new.3x b/man/form_new.3x
index cac4f50..b69f642 100644
--- a/man/form_new.3x
+++ b/man/form_new.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_new.3x,v 1.7 2006/11/04 17:12:00 tom Exp $
+.\" $Id: form_new.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH form_new 3X ""
 .SH NAME
-\fBform_new\fR - create and destroy forms
+\fBform_new\fR \- create and destroy forms
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -81,9 +81,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_new_page.3x b/man/form_new_page.3x
index 5b7f58d..635822d 100644
--- a/man/form_new_page.3x
+++ b/man/form_new_page.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_new_page.3x,v 1.8 2006/11/04 17:12:00 tom Exp $
+.\" $Id: form_new_page.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH form_new_page 3X ""
 .SH NAME
-\fBform_new_page\fR - form pagination functions
+\fBform_new_page\fR \- form pagination functions
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -69,9 +69,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_opts.3x b/man/form_opts.3x
index 0caaae7..f02cec6 100644
--- a/man/form_opts.3x
+++ b/man/form_opts.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_opts.3x,v 1.9 2007/02/24 17:34:36 tom Exp $
+.\" $Id: form_opts.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH form_opts 3X ""
 .SH NAME
-\fBform_opts\fR - set and get form options
+\fBform_opts\fR \- set and get form options
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -82,9 +82,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_page.3x b/man/form_page.3x
index 50ed54d..2211216 100644
--- a/man/form_page.3x
+++ b/man/form_page.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_page.3x,v 1.10 2006/11/04 18:52:32 tom Exp $
+.\" $Id: form_page.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH form_page 3X ""
 .SH NAME
-\fBform_page\fR - set and get form page number
+\fBform_page\fR \- set and get form page number
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -88,9 +88,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_post.3x b/man/form_post.3x
index 6bf1607..4799d9d 100644
--- a/man/form_post.3x
+++ b/man/form_post.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_post.3x,v 1.7 2006/11/04 18:53:20 tom Exp $
+.\" $Id: form_post.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH form_post 3X ""
 .SH NAME
-\fBform_post\fR - write or erase forms from associated subwindows
+\fBform_post\fR \- write or erase forms from associated subwindows
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -83,9 +83,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_requestname.3x b/man/form_requestname.3x
index a172f85..4a4e7eb 100644
--- a/man/form_requestname.3x
+++ b/man/form_requestname.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_requestname.3x,v 1.7 2006/11/04 17:57:49 tom Exp $
+.\" $Id: form_requestname.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH form_requestname 3X ""
 .SH NAME
-\fBform_requestname\fR - handle printable form request names
+\fBform_requestname\fR \- handle printable form request names
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -62,9 +62,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_userptr.3x b/man/form_userptr.3x
index 7be0bf8..bd29b54 100644
--- a/man/form_userptr.3x
+++ b/man/form_userptr.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_userptr.3x,v 1.11 2006/11/04 18:43:24 tom Exp $
+.\" $Id: form_userptr.3x,v 1.13 2010/12/04 18:40:45 tom Exp $
 .TH form_userptr 3X ""
 .SH NAME
-\fBform_userptr\fR - associate application data with a form item
+\fBform_userptr\fR \- associate application data with a form item
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -61,9 +61,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/form_variables.3x b/man/form_variables.3x
new file mode 100644
index 0000000..f4af349
--- /dev/null
+++ b/man/form_variables.3x
@@ -0,0 +1,80 @@
+.\"***************************************************************************
+.\" 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            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: form_variables.3x,v 1.4 2013/06/22 17:58:32 tom Exp $
+.TH form_variables 3X ""
+.ds n 5
+.na
+.hy 0
+.SH NAME
+\fBTYPE_ALNUM\fR,
+\fBTYPE_ALPHA\fR,
+\fBTYPE_ENUM\fR,
+\fBTYPE_INTEGER\fR,
+\fBTYPE_IPV4\fR,
+\fBTYPE_NUMERIC\fR,
+\fBTYPE_REGEXP\fR
+\- form system global variables
+.ad
+.hy
+.SH SYNOPSIS
+.nf
+\fB#include <form.h>\fR
+.PP
+\fBFIELDTYPE * TYPE_ALNUM;\fR
+\fBFIELDTYPE * TYPE_ALPHA;\fR
+\fBFIELDTYPE * TYPE_ENUM;\fR
+\fBFIELDTYPE * TYPE_INTEGER;\fR
+\fBFIELDTYPE * TYPE_IPV4;\fR
+\fBFIELDTYPE * TYPE_NUMERIC;\fR
+\fBFIELDTYPE * TYPE_REGEXP;\fR
+.fi
+.SH DESCRIPTION
+These are building blocks for the form library,
+defining fields that can be created using \fBset_fieldtype\fP(3X).
+Each provides functions for field- and character-validation,
+according to the given datatype.
+.SS TYPE_ALNUM
+This holds alphanumeric data.
+.SS TYPE_ALPHA
+This holds alphabetic data.
+.SS TYPE_ENUM
+This holds an enumerated type.
+.SS TYPE_INTEGER
+This holds a decimal integer.
+.SS TYPE_IPV4
+This holds an IPv4 internet address, e.g., "127.0.0.1".
+.SS TYPE_NUMERIC
+This holds a decimal number, with optional sign and decimal point.
+.SS TYPE_REGEXP
+This holds a regular expression.
+.SH PORTABILITY
+The \fBTYPE_IPV4\fP variable is an extension not provided by older
+implementations of the form library.
+.SH SEE ALSO
+\fBform\fR(3X).
diff --git a/man/form_win.3x b/man/form_win.3x
index c8f64f2..32af49b 100644
--- a/man/form_win.3x
+++ b/man/form_win.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_win.3x,v 1.10 2006/11/04 17:12:00 tom Exp $
+.\" $Id: form_win.3x,v 1.13 2010/12/04 18:38:55 tom Exp $
 .TH form_win 3X ""
 .SH NAME
-\fBform_win\fR - make and break form window and subwindow associations
+\fBform_win\fR \- make and break form window and subwindow associations
 .SH SYNOPSIS
 \fB#include <form.h>\fR
 .br
@@ -77,7 +77,9 @@
 .B E_NOT_CONNECTED
 No items are connected to the form.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBform\fR(3X).
+\fBcurses\fR(3X),
+\fBcurs_variables\fR(3X),
+\fBform\fR(3X).
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
@@ -87,9 +89,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/infocmp.1m b/man/infocmp.1m
index b1a88e7..8a3fef2 100644
--- a/man/infocmp.1m
+++ b/man/infocmp.1m
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,20 +27,25 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infocmp.1m,v 1.44 2006/12/24 18:16:31 tom Exp $
+.\" $Id: infocmp.1m,v 1.56 2015/05/23 20:50:00 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
+\fB@INFOCMP@\fR \- compare or print out \fIterminfo\fR descriptions
 .SH SYNOPSIS
-\fB@INFOCMP@\fR [\fB-\
+\fB@INFOCMP@\fR [\fB\-\
 1\
 C\
+D\
 E\
 F\
 G\
 I\
+K\
 L\
 T\
 U\
@@ -60,80 +65,111 @@
 x\
 \fR]
 .br
-      [\fB-v\fR \fIn\fR] [\fB-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB-R \fR\fBsubset\fR]
+      [\fB\-v\fR \fIn\fR] [\fB\-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB\-R \fR\fBsubset\fR]
 .br
-      [\fB-w\fR\ \fIwidth\fR] [\fB-A\fR\ \fIdirectory\fR] [\fB-B\fR\ \fIdirectory\fR]
+      [\fB\-w\fR\ \fIwidth\fR] [\fB\-A\fR\ \fIdirectory\fR] [\fB\-B\fR\ \fIdirectory\fR]
 .br
       [\fItermname\fR...]
 .SH DESCRIPTION
 \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,
-the \fB-d\fR option will be assumed.
-.SS Comparison Options [-d] [-c] [-n]
+\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
+\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
+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
 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
-used as a quick check to see if the \fB-u\fR option is worth using.
+The \fB\-c\fR option produces a list of each capability that is common between
+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
+.SS Source Listing Options [\-I] [\-L] [\-C] [\-r]
+The \fB\-I\fR, \fB\-L\fR, and \fB\-C\fR options will produce a source listing for
 each terminal named.
 .
 .TS
 center tab(/) ;
 l l .
-\fB-I\fR/use the \fBterminfo\fR names
-\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\-I\fR/use the \fBterminfo\fR names
+\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
 used for the terminal name.
 .PP
-The source produced by the \fB-C\fR option may be used directly as a
+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
@@ -153,30 +189,36 @@
 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
 .TE
-.SS Use= Option [-u]
-The \fB-u\fR option produces a \fBterminfo\fR source description of the first
+.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,31 +229,50 @@
 .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
+.SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
+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-1\fR
-causes the fields to be printed out one to a line.  Otherwise,
+\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,
 the fields will be printed several to a line to a maximum width
 of 60 characters.
 .TP
-\fB-a\fR
+\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
+\fB\-E\fR
 Dump the capabilities of the given terminal as tables, needed in
 the C initializer for a
 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
@@ -220,51 +281,61 @@
 The tables are all declared static, and are named according to the type
 and the name of the corresponding terminal entry.
 .sp
-Before ncurses 5.0, the split between the \fB-e\fP and \fB-E\fP
+Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP
 options was not needed; but support for extended names required making
 the arrays of terminal capabilities separate from the TERMTYPE structure.
 .TP 5
-\fB-e\fR
+\fB\-e\fR
 Dump the capabilities of the given terminal as a C initializer for a
 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
 This option is useful for preparing versions of the curses library hardwired
 for a given terminal type.
 .TP 5
-\fB-F\fR
-compare terminfo files.  This assumes that two following arguments are
-filenames.  The files are searched for pairwise matches between
+\fB\-F\fR
+compare terminfo files.
+This assumes that two following arguments are filenames.
+The files are searched for pairwise matches between
 entries, with two entries considered to match if any of their names do.
 The report printed to standard output lists entries with no matches in
-the other file, and entries with more than one match.  For entries
-with exactly one match it includes a difference report.  Normally,
+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.
+by also specifying \fB\-r\fR.
 .TP 5
-\fB-f\fR
+\fB\-f\fR
 Display complex terminfo strings which contain if/then/else/endif expressions
 indented for readability.
 .TP 5
-\fB-G\fR
+\fB\-G\fR
 Display constant literals in decimal form
 rather than their character equivalents.
 .TP 5
-\fB-g\fR
+\fB\-g\fR
 Display constant character literals in quoted form
 rather than their decimal equivalents.
 .TP 5
-\fB-i\fR
+\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,
+as well as those used for starting/stopping cursor-positioning mode
+(\fBsmcup\fP, \fBrmcup\fP) as well as starting/stopping keymap mode
+(\fBsmkx\fP, \fBrmkx\fP).
+.IP
+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
+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.
+.IP
+Here is a list of the DEC/ANSI
 special sequences recognized:
-i.
 .TS
 center tab(/) ;
 l l
@@ -291,48 +362,53 @@
 DECPNM/normal keypad mode
 DECANSI/enter ANSI mode
 =
-ECMA[+-]AM/keyboard action mode
-ECMA[+-]IRM/insert replace mode
-ECMA[+-]SRM/send receive mode
-ECMA[+-]LNM/linefeed mode
+ECMA[+\-]AM/keyboard action mode
+ECMA[+\-]IRM/insert replace mode
+ECMA[+\-]SRM/send receive mode
+ECMA[+\-]LNM/linefeed mode
 =
-DEC[+-]CKM/application cursor keys
-DEC[+-]ANM/set VT52 mode
-DEC[+-]COLM/132-column mode
-DEC[+-]SCLM/smooth scroll
-DEC[+-]SCNM/reverse video mode
-DEC[+-]OM/origin mode
-DEC[+-]AWM/wraparound mode
-DEC[+-]ARM/auto-repeat mode
+DEC[+\-]CKM/application cursor keys
+DEC[+\-]ANM/set VT52 mode
+DEC[+\-]COLM/132-column mode
+DEC[+\-]SCLM/smooth scroll
+DEC[+\-]SCNM/reverse video mode
+DEC[+\-]OM/origin mode
+DEC[+\-]AWM/wraparound mode
+DEC[+\-]ARM/auto-repeat mode
 .TE
 .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).
-.PP
+REVERSE.
+All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
+.IP
 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
 .TP 5
-\fB-l\fR
+\fB\-l\fR
 Set output format to terminfo.
 .TP 5
-\fB-p\fR
+\fB\-p\fR
 Ignore padding specifications when comparing strings.
 .TP 5
-\fB-q\fR
+\fB\-q\fR
 Make the comparison listing shorter by omitting subheadings, and using
-"-" for absent capabilities, "@" for canceled rather than "NULL".
+"\-" 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
+\fB\-R\fR\fIsubset\fR
+Restrict output to a given subset.
+This option is for use with archaic
 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
-that have their own extensions incompatible with SVr4/XSI.  Available terminfo
+that have their own extensions incompatible with SVr4/XSI.
+.IP
+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
-The \fB-s\fR option sorts the fields within each type according to the argument
+\fB\-s \fR\fI[d|i|l|c]\fR
+The \fB\-s\fR option sorts the fields within each type according to the argument
 below:
 .br
 .RS 5
@@ -350,70 +426,73 @@
 sort by the \fItermcap\fR name.
 .RE
 .IP
-If the \fB-s\fR option is not given, the fields printed out will be
+If the \fB\-s\fR option is not given, the fields printed out will be
 sorted alphabetically by the \fBterminfo\fR name within each type,
-except in the case of the \fB-C\fR or the \fB-L\fR options, which cause the
+except in the case of the \fB\-C\fR or the \fB\-L\fR options, which cause the
 sorting to be done by the \fBtermcap\fR name or the long C variable
 name, respectively.
 .TP 5
-\fB-T\fR
+\fB\-T\fR
 eliminates size-restrictions on the generated text.
 This is mainly useful for testing and analysis, since the compiled
 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
 .TP
-\fB-t\fR
-tells \fBtic\fP to discard commented-out capabilities.
+\fB\-t\fR
+tells \fB@TIC@\fP to discard commented-out capabilities.
 Normally when translating from terminfo to termcap,
 untranslatable capabilities are commented-out.
 .TP 5
-\fB-U\fR
+\fB\-U\fR
 tells \fB@INFOCMP@\fP to not post-process the data after parsing the source file.
 This feature helps when comparing the actual contents of two source files,
 since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
 data.
 .TP 5
-\fB-V\fR
+\fB\-V\fR
 reports the version of ncurses which was used in this program, and exits.
 .TP 5
-\fB-v\fR \fIn\fR
+\fB\-v\fR \fIn\fR
 prints out tracing information on standard error as the program runs.
 Higher values of n induce greater verbosity.
 .TP 5
-\fB-w\fR \fIwidth\fR
+\fB\-w\fR \fIwidth\fR
 changes the output to \fIwidth\fR characters.
 .TP
-\fB-x\fR
+\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-E\fR,
-\fB-F\fR,
-\fB-G\fR,
-\fB-R\fR,
-\fB-T\fR,
-\fB-V\fR,
-\fB-a\fR,
-\fB-e\fR,
-\fB-f\fR,
-\fB-g\fR,
-\fB-i\fR,
-\fB-l\fR,
-\fB-p\fR,
-\fB-q\fR and
-\fB-t\fR
+\fB\-0\fR,
+\fB\-1\fR,
+\fB\-E\fR,
+\fB\-F\fR,
+\fB\-G\fR,
+\fB\-R\fR,
+\fB\-T\fR,
+\fB\-V\fR,
+\fB\-a\fR,
+\fB\-e\fR,
+\fB\-f\fR,
+\fB\-g\fR,
+\fB\-i\fR,
+\fB\-l\fR,
+\fB\-p\fR,
+\fB\-q\fR and
+\fB\-t\fR
 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
-4.4BSD set, use \fB-r\fR \fB-RBSD\fR.
+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
+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.
+The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
 .SH SEE ALSO
 \fB@CAPTOINFO@\fR(1M),
 \fB@INFOTOCAP@\fR(1M),
@@ -421,6 +500,8 @@
 \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@).
@@ -429,9 +510,3 @@
 and
 .br
 Thomas E. Dickey <dickey@invisible-island.net>
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/infotocap.1m b/man/infotocap.1m
index 19160b4..d9b44f0 100644
--- a/man/infotocap.1m
+++ b/man/infotocap.1m
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1999-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1999-2006,2010 Free 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,40 +27,42 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infotocap.1m,v 1.8 2006/12/24 20:13:56 tom Exp $
+.\" $Id: infotocap.1m,v 1.11 2010/12/04 18:38:55 tom Exp $
 .TH @INFOTOCAP@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fB@INFOTOCAP@\fR - convert a \fIterminfo\fR description into a \fItermcap\fR description
+\fB@INFOTOCAP@\fR \- convert a \fIterminfo\fR description into a \fItermcap\fR description
 .SH SYNOPSIS
-\fB@INFOTOCAP@\fR [\fB-v\fR\fIn\fR \fIwidth\fR]  [\fB-V\fR] [\fB-1\fR] [\fB-w\fR \fIwidth\fR] \fIfile\fR . . .
+\fB@INFOTOCAP@\fR [\fB\-v\fR\fIn\fR \fIwidth\fR]  [\fB\-V\fR] [\fB\-1\fR] [\fB\-w\fR \fIwidth\fR] \fIfile\fR . . .
 .SH DESCRIPTION
-\fB@INFOTOCAP@\fR looks in \fIfile\fR for \fBterminfo\fR descriptions.  For each
-one found, an equivalent \fBtermcap\fR description is written to standard
-output.  Terminfo \fBuse\fR capabilities are translated directly to termcap
+\fB@INFOTOCAP@\fR looks in each given text
+\fIfile\fR for \fBterminfo\fR descriptions.
+For each terminfo description found,
+an equivalent \fBtermcap\fR description is written to standard output.
+Terminfo \fBuse\fR capabilities are translated directly to termcap
 \fBtc\fR capabilities.
 .TP 5
-\fB-v\fR
+\fB\-v\fR
 print out tracing information on standard error as the program runs.
 .TP 5
-\fB-V\fR
+\fB\-V\fR
 print out the version of the program in use on standard error and exit.
 .TP 5
-\fB-1\fR
-cause the fields to print out one to a line.  Otherwise, the fields
-will be printed several to a line to a maximum width of 60
-characters.
+\fB\-1\fR
+cause the fields to print out one to a line.
+Otherwise, the fields
+will be printed several to a line to a maximum width of 60 characters.
 .TP 5
-\fB-w\fR
+\fB\-w\fR
 change the output to \fIwidth\fR characters.
 .SH FILES
 .TP 20
 \*d
 Compiled terminal description database.
 .SH NOTES
-This utility is actually a link to \fI@TIC@\fR, running in \fI-C\fR mode.
-You can use other \fI@TIC@\fR options such as \fB-f\fR and  \fB-x\fR.
+This utility is actually a link to \fI@TIC@\fR, running in \fI\-C\fR mode.
+You can use other \fI@TIC@\fR options such as \fB\-f\fR and  \fB\-x\fR.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fB@TIC@\fR(1M),
@@ -69,9 +71,8 @@
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+.SH AUTHOR
+Eric S. Raymond <esr@snark.thyrsus.com>
+and
+.br
+Thomas E. Dickey <dickey@invisible-island.net>
diff --git a/man/key_defined.3x b/man/key_defined.3x
index d7413da..db6c531 100644
--- a/man/key_defined.3x
+++ b/man/key_defined.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2003-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2003-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 2003
 .\"
-.\" $Id: key_defined.3x,v 1.4 2006/02/25 21:50:01 tom Exp $
+.\" $Id: key_defined.3x,v 1.6 2010/12/04 18:40:45 tom Exp $
 .TH key_defined 3X ""
 .SH NAME
 \fBkey_defined\fP \- check if a keycode is defined
@@ -43,7 +43,7 @@
 .SH RETURN VALUE
 If the string is bound to a keycode, its value (greater than zero) is returned.
 If no keycode is bound, zero is returned.
-If the string conflicts with longer strings which are bound to keys, -1 is returned.
+If the string conflicts with longer strings which are bound to keys, \-1 is returned.
 .SH PORTABILITY
 These routines are specific to ncurses.  They were not supported on
 Version 7, BSD or System V implementations.  It is recommended that
@@ -52,9 +52,3 @@
 \fBdefine_key\fR(3X).
 .SH AUTHOR
 Thomas Dickey.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/keybound.3x b/man/keybound.3x
index 93e1794..5dd083a 100644
--- a/man/keybound.3x
+++ b/man/keybound.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1999-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1999-2008,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,8 +28,8 @@
 .\"
 .\" Author: Thomas E. Dickey 1999
 .\"
-.\" $Id: keybound.3x,v 1.6 2006/02/25 21:47:06 tom Exp $
-.TH keyok 3X ""
+.\" $Id: keybound.3x,v 1.8 2010/12/04 18:49:20 tom Exp $
+.TH keybound 3X ""
 .SH NAME
 \fBkeybound\fP \- return definition of keycode
 .SH SYNOPSIS
@@ -56,9 +56,3 @@
 \fBkeyok\fR(3X).
 .SH AUTHOR
 Thomas Dickey.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/keyok.3x b/man/keyok.3x
index 08c2a27..8eaf9a3 100644
--- a/man/keyok.3x
+++ b/man/keyok.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 1997
 .\"
-.\" $Id: keyok.3x,v 1.9 2006/02/25 21:47:06 tom Exp $
+.\" $Id: keyok.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH keyok 3X ""
 .SH NAME
 \fBkeyok\fP \- enable or disable a keycode
@@ -40,7 +40,7 @@
 This is an extension to the curses library.
 It permits an application to disable specific keycodes, rather than
 use the \fIkeypad\fP function to disable all keycodes.
-Keys that have been disabled can be reenabled.
+Keys that have been disabled can be re-enabled.
 .SH RETURN VALUE
 The keycode must be greater than zero, else ERR is returned.
 If it does not correspond to a defined key, then ERR is returned.
@@ -55,9 +55,3 @@
 \fBdefine_key\fR(3X).
 .SH AUTHOR
 Thomas Dickey.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/legacy_coding.3x b/man/legacy_coding.3x
index 42c49fe..fabb607 100644
--- a/man/legacy_coding.3x
+++ b/man/legacy_coding.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2005,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 2005-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey
 .\"
-.\" $Id: legacy_coding.3x,v 1.3 2006/12/24 15:12:55 tom Exp $
+.\" $Id: legacy_coding.3x,v 1.4 2010/12/04 18:49:20 tom Exp $
 .TH legacy_coding 3X ""
 .SH NAME
 \fBuse_legacy_coding\fR \- use terminal's default colors
@@ -74,9 +74,3 @@
 \fBunctrl\fR.
 .SH AUTHOR
 Thomas Dickey (to support lynx's font-switching feature).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/man_db.renames b/man/man_db.renames
index ff91eec..276d7ba 100644
--- a/man/man_db.renames
+++ b/man/man_db.renames
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2010,2015 Free 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: man_db.renames,v 0.41 2008/10/25 23:24:03 tom Exp $
+# $Id: man_db.renames,v 1.48 2015/04/18 16:47:55 tom Exp $
 # Manual-page renamings for the man_db program
 #
 # Files:
@@ -82,6 +82,7 @@
 curs_scr_dump.3x		scr_dump.3ncurses
 curs_scroll.3x			scroll.3ncurses
 curs_slk.3x			slk.3ncurses
+curs_sp_funcs.3x		sp_funcs.3ncurses
 curs_termattrs.3x		termattrs.3ncurses
 curs_termcap.3x			termcap.3ncurses
 curs_terminfo.3x		terminfo.3ncurses
@@ -89,6 +90,7 @@
 curs_touch.3x			touch.3ncurses
 curs_trace.3x			trace.3ncurses
 curs_util.3x			util.3ncurses
+curs_variables.3x		curses_variables.3ncurses
 curs_window.3x			window.3ncurses
 curses.3x			ncurses.3ncurses
 default_colors.3x		default_colors.3ncurses
@@ -115,6 +117,7 @@
 form_post.3x			post.3form
 form_requestname.3x		requestname.3form
 form_userptr.3x			userptr.3form
+form_variables.3x		form_variables.3form
 form_win.3x			win.3form
 infocmp.1m			infocmp.1
 infotocap.1m			infotocap.1
@@ -152,8 +155,10 @@
 resizeterm.3x			resizeterm.3ncurses
 scanf.3s			scanf.3
 system.3s			system.3
+tabs.1				tabs.1
 term.5				term.5
 term.7				term.7
+term_variables.3x		terminfo_variables.3ncurses
 terminfo.5			terminfo.5
 terminfo.\\\*n			terminfo.5
 tic.1m				tic.1
@@ -174,4 +179,19 @@
 regcomp.3x			regcomp.3
 regexec.3x			regexec.3
 #
+# The following are pages which may be generated depending on configuration:
+adacurses-config.1		adacurses-config.1
+adacurses5-config.1		adacurses5-config.1
+adacurses6-config.1		adacurses6-config.1
+#
+ncurses5-config.1		ncurses5-config.1
+ncursesw5-config.1		ncursesw5-config.1
+ncursest5-config.1		ncursest5-config.1
+ncursestw5-config.1		ncursestw5-config.1
+#
+ncurses6-config.1		ncurses6-config.1
+ncursesw6-config.1		ncursesw6-config.1
+ncursest6-config.1		ncursest6-config.1
+ncursestw6-config.1		ncursestw6-config.1
+#
 # vile:cfgmode
diff --git a/man/manhtml.aliases b/man/manhtml.aliases
new file mode 100644
index 0000000..a4ae047
--- /dev/null
+++ b/man/manhtml.aliases
@@ -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)
diff --git a/man/manhtml.externs b/man/manhtml.externs
new file mode 100644
index 0000000..d26b612
--- /dev/null
+++ b/man/manhtml.externs
@@ -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)
diff --git a/man/menu.3x b/man/menu.3x
index 17d6fc1..c0be469 100644
--- a/man/menu.3x
+++ b/man/menu.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,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            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu.3x,v 1.19 2006/11/04 18:38:29 tom Exp $
+.\" $Id: menu.3x,v 1.22 2014/08/16 20:32:08 tom Exp $
 .TH menu 3X ""
 .SH NAME
-\fBmenu\fR - curses extension for programming menus
+\fBmenu\fR \- curses extension for programming menus
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -43,7 +43,7 @@
 The \fBmenu\fR library uses the \fBcurses\fR libraries, and a curses
 initialization routine such as \fBinitscr\fR must be called before using any of
 these functions.  To use the \fBmenu\fR library, link with the options
-\fB-lmenu -lcurses\fR.
+\fB\-lmenu \-lcurses\fR.
 .
 .SS Current Default Values for Item Attributes
 .
@@ -166,15 +166,12 @@
 .TP 5
 .B E_UNKNOWN_COMMAND
 The menu driver code saw an unknown request code.
-.SH SEE ALSO
-\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed
-descriptions of the entry points.
 .SH NOTES
 The header file \fB<menu.h>\fR automatically includes the header files
 \fB<curses.h>\fR and \fB<eti.h>\fR.
 .PP
 In your library list, libmenu.a should be before libncurses.a; that is,
-you want to say `-lmenu -lncurses', not the other way around (which would
+you want to say `\-lmenu \-lncurses', not the other way around (which would
 usually give a link-error).
 .SH PORTABILITY
 These routines emulate the System V menu library.  They were not supported on
@@ -183,11 +180,8 @@
 Juergen Pfeifer.  Manual pages and adaptation for ncurses by Eric
 S. Raymond.
 .SH SEE ALSO
+\fBcurses\fR(3X) and related pages whose names begin "menu_" for detailed
+descriptions of the entry points.
+.PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_attributes.3x b/man/menu_attributes.3x
index 505edbc..c33059b 100644
--- a/man/menu_attributes.3x
+++ b/man/menu_attributes.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_attributes.3x,v 1.10 2008/08/23 18:24:23 tom Exp $
+.\" $Id: menu_attributes.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH menu_attributes 3X ""
 .SH NAME
-\fBmenu_attributes\fR - color and attribute control for menus
+\fBmenu_attributes\fR \- color and attribute control for menus
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -92,9 +92,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_cursor.3x b/man/menu_cursor.3x
index 4ade0bf..66a835b 100644
--- a/man/menu_cursor.3x
+++ b/man/menu_cursor.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_cursor.3x,v 1.6 2006/11/04 17:13:57 tom Exp $
+.\" $Id: menu_cursor.3x,v 1.8 2010/12/04 18:40:45 tom Exp $
 .TH menu_cursor 3X ""
 .SH NAME
-\fBmenu_cursor\fR - position a menu's cursor
+\fBmenu_cursor\fR \- position a menu's cursor
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -65,9 +65,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_driver.3x b/man/menu_driver.3x
index 5366040..1fe5001 100644
--- a/man/menu_driver.3x
+++ b/man/menu_driver.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,13 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_driver.3x,v 1.15 2008/06/21 21:55:30 tom Exp $
+.\" $Id: menu_driver.3x,v 1.20 2010/12/04 18:38:55 tom Exp $
 .TH menu_driver 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
-\fBmenu_driver\fR - command-processing loop of the menu system
+\fBmenu_driver\fR \- command-processing loop of the menu system
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -38,18 +41,15 @@
 .SH DESCRIPTION
 Once a menu has been posted (displayed), you should funnel input events to it
 through \fBmenu_driver\fR.  This routine has three major input cases:
-.TP 3
--
+.bP
 The input is a form navigation request.
 Navigation request codes are constants defined in \fB<form.h>\fP,
 which are distinct from the key- and character codes returned by \fBwgetch\fP.
-.TP 3
--
+.bP
 The input is a printable character.
 Printable characters (which must be positive, less than 256) are
 checked according to the program's locale settings.
-.TP 3
--
+.bP
 The input is the KEY_MOUSE special key associated with an mouse event.
 .PP
 The menu driver requests are as follows:
@@ -116,36 +116,29 @@
 .PP
 If the second argument is the KEY_MOUSE special key, the associated
 mouse event is translated into one of the above pre-defined requests.
-Currently only clicks in the user window (e.g. inside the menu display
+Currently only clicks in the user window (e.g., inside the menu display
 area or the decoration window) are handled.
 .PP
 If you click above the display region of the menu:
-.RS
-.TP
+.bP
 a REQ_SCR_ULINE is generated for a single click,
-.TP
+.bP
 a REQ_SCR_UPAGE is generated for a double-click and
-.TP
+.bP
 a REQ_FIRST_ITEM is generated for a triple-click.
-.RE
 .PP
 If you click below the display region of the menu:
-.RS
-.TP
+.bP
 a REQ_SCR_DLINE is generated for a single click,
-.TP
+.bP
 a REQ_SCR_DPAGE is generated for a double-click and
-.TP
+.bP
 a REQ_LAST_ITEM is generated for a triple-click.
-.RE
 .PP
 If you click at an item inside the display area of the menu:
-.RS
-.TP 3
--
+.bP
 the menu cursor is positioned to that item.
-.TP 3
--
+.bP
 If you double-click an item a REQ_TOGGLE_ITEM
 is generated and \fBE_UNKNOWN_COMMAND\fR is returned.
 This return value makes sense,
@@ -153,11 +146,9 @@
 be returned.
 It is exactly the purpose of this return value to signal that an
 application specific command should be executed.
-.TP 3
--
+.bP
 If a translation
 into a request was done, \fBmenu_driver\fR returns the result of this request.
-.RE
 .PP
 If you clicked outside the user window or the mouse event could not be translated
 into a menu request an \fBE_REQUEST_DENIED\fR is returned.
@@ -197,7 +188,7 @@
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBmenu\fR(3X),
-\fBwgetch\fR(3X).
+\fBgetch\fR(3X).
 .SH NOTES
 The header file \fB<menu.h>\fR automatically includes the header files
 \fB<curses.h>\fR.
@@ -207,9 +198,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_format.3x b/man/menu_format.3x
index f4d456f..b9a572b 100644
--- a/man/menu_format.3x
+++ b/man/menu_format.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2001,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_format.3x,v 1.10 2006/11/04 17:12:00 tom Exp $
+.\" $Id: menu_format.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH menu_format 3X ""
 .SH NAME
-\fBmenu_format\fR - set and get menu sizes
+\fBmenu_format\fR \- set and get menu sizes
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -79,9 +79,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_hook.3x b/man/menu_hook.3x
index 204e1ec..1fd74de 100644
--- a/man/menu_hook.3x
+++ b/man/menu_hook.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_hook.3x,v 1.9 2007/02/24 17:34:08 tom Exp $
+.\" $Id: menu_hook.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH menu_hook 3X ""
 .SH NAME
-\fBmenu_hook\fR - set hooks for automatic invocation by applications
+\fBmenu_hook\fR \- set hooks for automatic invocation by applications
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -93,9 +93,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_items.3x b/man/menu_items.3x
index 0915343..04b00ad 100644
--- a/man/menu_items.3x
+++ b/man/menu_items.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 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,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_items.3x,v 1.7 2006/11/04 18:35:31 tom Exp $
+.\" $Id: menu_items.3x,v 1.10 2012/11/03 23:03:59 tom Exp $
 .TH menu_items 3X ""
 .SH NAME
-\fBmenu_items\fR - make and break connections between items and menus
+\fBmenu_items\fR \- make and break connections between items and menus
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -47,7 +47,7 @@
 The function \fBmenu_items\fR returns the item array of the given menu.
 .PP
 The function \fBitem_count\fR returns the count of items in \fImenu\fR.
-.SH RETURN VALUES
+.SH RETURN VALUE
 The function \fBmenu_items\fR returns a pointer (which may be \fBNULL\fR).
 It does not set errno.
 .PP
@@ -81,13 +81,7 @@
 Version 7 or BSD versions.
 .PP
 The SVr4 menu library documentation specifies the \fBitem_count\fR error value
-as -1 (which is the value of \fBERR\fR).
+as \-1 (which is the value of \fBERR\fR).
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_mark.3x b/man/menu_mark.3x
index 1db2b3e..1425154 100644
--- a/man/menu_mark.3x
+++ b/man/menu_mark.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_mark.3x,v 1.9 2006/11/04 18:33:18 tom Exp $
+.\" $Id: menu_mark.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH menu_mark 3X ""
 .SH NAME
-\fBmenu_mark\fR - get and set the menu mark string
+\fBmenu_mark\fR \- get and set the menu mark string
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -48,7 +48,7 @@
 Note that changing the length of the mark string for a menu while the
 menu is posted is likely to produce unhelpful behavior.
 .PP
-The default string is "-" (a dash). Calling \fBset_menu_mark\fR with
+The default string is "\-" (a dash). Calling \fBset_menu_mark\fR with
 a non-\fBNULL\fR menu argument will change this default.
 .PP
 The function \fBmenu_mark\fR returns the menu's mark string (or \fBNULL\fR if
@@ -78,9 +78,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_new.3x b/man/menu_new.3x
index c2b98e4..1197654 100644
--- a/man/menu_new.3x
+++ b/man/menu_new.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_new.3x,v 1.9 2006/11/04 18:31:37 tom Exp $
+.\" $Id: menu_new.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH menu_new 3X ""
 .SH NAME
-\fBmenu_new\fR - create and destroy menus
+\fBmenu_new\fR \- create and destroy menus
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -78,9 +78,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_opts.3x b/man/menu_opts.3x
index dc927c4..5f4cb08 100644
--- a/man/menu_opts.3x
+++ b/man/menu_opts.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_opts.3x,v 1.10 2007/02/24 17:33:59 tom Exp $
+.\" $Id: menu_opts.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH menu_opts 3X ""
 .SH NAME
-\fBmenu_opts\fR - set and get menu options
+\fBmenu_opts\fR \- set and get menu options
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -96,9 +96,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_pattern.3x b/man/menu_pattern.3x
index 3cde165..e63a9f7 100644
--- a/man/menu_pattern.3x
+++ b/man/menu_pattern.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_pattern.3x,v 1.11 2008/06/21 21:58:20 tom Exp $
+.\" $Id: menu_pattern.3x,v 1.13 2010/12/04 18:40:45 tom Exp $
 .TH menu_pattern 3X ""
 .SH NAME
-\fBmenu_pattern\fR - get and set a menu's pattern buffer
+\fBmenu_pattern\fR \- get and set a menu's pattern buffer
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -83,9 +83,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_post.3x b/man/menu_post.3x
index e47facc..d09d0ca 100644
--- a/man/menu_post.3x
+++ b/man/menu_post.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_post.3x,v 1.9 2006/11/04 17:12:00 tom Exp $
+.\" $Id: menu_post.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH menu_post 3X ""
 .SH NAME
-\fBmenu_post\fR - write or erase menus from associated subwindows
+\fBmenu_post\fR \- write or erase menus from associated subwindows
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -83,9 +83,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_requestname.3x b/man/menu_requestname.3x
index 1345aa7..d1957a2 100644
--- a/man/menu_requestname.3x
+++ b/man/menu_requestname.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_requestname.3x,v 1.7 2006/11/04 17:56:09 tom Exp $
+.\" $Id: menu_requestname.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH menu_requestname 3X ""
 .SH NAME
-\fBmenu_requestname\fR - handle printable menu request names
+\fBmenu_requestname\fR \- handle printable menu request names
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -63,9 +63,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_spacing.3x b/man/menu_spacing.3x
index dfe03a8..9e7c3ea 100644
--- a/man/menu_spacing.3x
+++ b/man/menu_spacing.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2001,2004 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_spacing.3x,v 1.8 2004/12/11 23:39:07 tom Exp $
+.\" $Id: menu_spacing.3x,v 1.12 2010/12/04 18:38:55 tom Exp $
 .TH menu_spacing 3X ""
 .SH NAME
-\fBmenu_spacing\fR - Control spacing between menu items.
+\fBmenu_spacing\fR \- Control spacing between menu items.
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -45,40 +45,44 @@
                  int* spc_columns);
 .br
 .SH DESCRIPTION
-The function \fBset_menu_spacing\fR sets the spacing informations for the menu.
-\fBspc_description\fR controls the number of spaces between an item name and an item
-description. It must not be larger than \fBTABSIZE\fR. The menu system puts in the
-middle of this spacing area the pad character. The remaining parts are filled with
+The function \fBset_menu_spacing\fR sets the spacing information for the menu.
+Its parameter \fBspc_description\fR controls the number of spaces between an item name and an item
+description.
+It must not be larger than \fBTABSIZE\fR.
+The menu system puts in the
+middle of this spacing area the pad character.
+The remaining parts are filled with
 spaces.
-\fBspc_rows\fR controls the number of rows that are used for an item. It must not be
-larger than 3. The menu system inserts the blank lines between item rows, these lines
+The \fBspc_rows\fR parameter controls the number of rows that are used for an item.
+It must not be larger than 3.
+The menu system inserts the blank lines between item rows, these lines
 will contain the pad character in the appropriate positions.
-\fBspc_columns\fR controls the number of blanks between columns of items. It must not
-be larger than TABSIZE.
+The \fBspc_columns\fR parameter controls the number of blanks between columns of items.
+It must not be larger than TABSIZE.
 A value of 0 for all the spacing values resets them to the default, which is 1 for all
 of them.
 .br
-The function \fBmenu_spacing\fR passes back the spacing info for the menu. If a
+The function \fBmenu_spacing\fR passes back the spacing info for the menu.
+If a
 pointer is NULL, this specific info is simply not returned.
 .SH RETURN VALUE
-Both routines return \fBE_OK\fR on success. \fBset_menu_spacing\fR may return
+Both routines return \fBE_OK\fR on success.
+\fBset_menu_spacing\fR may return
 \fBE_POSTED\fR if the menu is posted, or \fBE_BAD_ARGUMENT\fR if one of the
 spacing values is out of range.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBmenu\fR(3X).
+\fBcurses\fR(3X),
+\fBcurs_variables\fR(3X),
+\fBmenu\fR(3X).
 .SH NOTES
 The header file \fB<menu.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
 .SH PORTABILITY
-These routines are specific to ncurses.  They were not supported on
-Version 7, BSD or System V implementations.  It is recommended that
+These routines are specific to ncurses.
+They were not supported on
+Version 7, BSD or System V implementations.
+It is recommended that
 any code depending on them be conditioned using NCURSES_VERSION.
 .SH AUTHORS
-Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
-S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+Juergen Pfeifer.
+Manual pages and adaptation for new curses by Eric S. Raymond.
diff --git a/man/menu_userptr.3x b/man/menu_userptr.3x
index b7be2ad..0455fe3 100644
--- a/man/menu_userptr.3x
+++ b/man/menu_userptr.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_userptr.3x,v 1.8 2006/11/04 18:21:03 tom Exp $
+.\" $Id: menu_userptr.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH menu_userptr 3X ""
 .SH NAME
-\fBmenu_userptr\fR - associate application data with a menu item
+\fBmenu_userptr\fR \- associate application data with a menu item
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -61,9 +61,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/menu_win.3x b/man/menu_win.3x
index aa356e1..774eafa 100644
--- a/man/menu_win.3x
+++ b/man/menu_win.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: menu_win.3x,v 1.8 2006/11/04 17:12:00 tom Exp $
+.\" $Id: menu_win.3x,v 1.11 2010/12/04 18:38:55 tom Exp $
 .TH menu_win 3X ""
 .SH NAME
-\fBmenu_win\fR - make and break menu window and subwindow associations
+\fBmenu_win\fR \- make and break menu window and subwindow associations
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -77,7 +77,9 @@
 .B E_NOT_CONNECTED
 No items are connected to the menu.
 .SH SEE ALSO
-\fBcurses\fR(3X), \fBmenu\fR(3X).
+\fBcurses\fR(3X),
+\fBcurs_variables\fR(3X),
+\fBmenu\fR(3X).
 .SH NOTES
 The header file \fB<menu.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
@@ -87,9 +89,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_current.3x b/man/mitem_current.3x
index 979f401..86c9b47 100644
--- a/man/mitem_current.3x
+++ b/man/mitem_current.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_current.3x,v 1.11 2006/11/04 18:18:19 tom Exp $
+.\" $Id: mitem_current.3x,v 1.13 2010/12/04 18:40:45 tom Exp $
 .TH mitem_current 3X ""
 .SH NAME
-\fBmitem_current\fR - set and get current_menu_item
+\fBmitem_current\fR \- set and get current_menu_item
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -90,13 +90,7 @@
 Version 7 or BSD versions.
 .PP
 The SVr4 menu library documentation specifies the \fBtop_row\fR and
-\fBindex_item\fR error value as -1 (which is the value of \fBERR\fR).
+\fBindex_item\fR error value as \-1 (which is the value of \fBERR\fR).
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_name.3x b/man/mitem_name.3x
index 12009ed..ff879e6 100644
--- a/man/mitem_name.3x
+++ b/man/mitem_name.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_name.3x,v 1.6 2006/11/04 17:53:40 tom Exp $
+.\" $Id: mitem_name.3x,v 1.8 2010/12/04 18:40:45 tom Exp $
 .TH mitem_name 3X ""
 .SH NAME
-\fBmitem_name\fR - get menu item name and description fields
+\fBmitem_name\fR \- get menu item name and description fields
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -57,9 +57,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_new.3x b/man/mitem_new.3x
index c0fa6ed..8e2449e 100644
--- a/man/mitem_new.3x
+++ b/man/mitem_new.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_new.3x,v 1.10 2006/11/04 18:16:36 tom Exp $
+.\" $Id: mitem_new.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH mitem_new 3X ""
 .SH NAME
-\fBmitem_new\fR - create and destroy menu items
+\fBmitem_new\fR \- create and destroy menu items
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -82,9 +82,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_opts.3x b/man/mitem_opts.3x
index 2459dab..37ea552 100644
--- a/man/mitem_opts.3x
+++ b/man/mitem_opts.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_opts.3x,v 1.9 2007/02/24 17:33:32 tom Exp $
+.\" $Id: mitem_opts.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH mitem_opts 3X ""
 .SH NAME
-\fBmitem_opts\fR - set and get menu item options
+\fBmitem_opts\fR \- set and get menu item options
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -76,9 +76,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_userptr.3x b/man/mitem_userptr.3x
index 5895193..7b51ec5 100644
--- a/man/mitem_userptr.3x
+++ b/man/mitem_userptr.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_userptr.3x,v 1.9 2006/11/04 18:21:03 tom Exp $
+.\" $Id: mitem_userptr.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
 .TH mitem_userptr 3X ""
 .SH NAME
-\fBmitem_userptr\fR - associate application data with a menu item
+\fBmitem_userptr\fR \- associate application data with a menu item
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -62,9 +62,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_value.3x b/man/mitem_value.3x
index 748fd52..57cfc53 100644
--- a/man/mitem_value.3x
+++ b/man/mitem_value.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,10 +26,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_value.3x,v 1.8 2006/11/04 17:12:00 tom Exp $
+.\" $Id: mitem_value.3x,v 1.10 2010/12/04 18:40:45 tom Exp $
 .TH mitem_value 3X ""
 .SH NAME
-\fBmitem_value\fR - set and get menu item values
+\fBmitem_value\fR \- set and get menu item values
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -68,9 +68,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/mitem_visible.3x b/man/mitem_visible.3x
index 8f9039c..4ff9405 100644
--- a/man/mitem_visible.3x
+++ b/man/mitem_visible.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 1998,2010 Free Software Foundation, Inc.                   *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,10 +27,10 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: mitem_visible.3x,v 1.5 1998/11/29 01:12:55 Rick.Ohnemus Exp $
+.\" $Id: mitem_visible.3x,v 1.7 2010/12/04 18:40:45 tom Exp $
 .TH mitem_visible 3X ""
 .SH NAME
-\fBmitem_visible\fR - check visibility of a menu item
+\fBmitem_visible\fR \- check visibility of a menu item
 .SH SYNOPSIS
 \fB#include <menu.h>\fR
 .br
@@ -51,9 +51,3 @@
 .SH AUTHORS
 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
 S. Raymond.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/ncurses.3x b/man/ncurses.3x
index 703a239..76d55c0 100644
--- a/man/ncurses.3x
+++ b/man/ncurses.3x
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2014,2015 Free 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,43 +27,52 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.92 2008/10/25 23:31:45 tom Exp $
+.\" $Id: ncurses.3x,v 1.124 2015/08/08 14:57:51 tom Exp $
 .hy 0
 .TH ncurses 3X ""
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
+.de bP
+.IP \(bu 4
+..
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fBncurses\fR - CRT screen handling and optimization package
+\fBncurses\fR \- CRT screen handling and optimization package
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .br
 .SH DESCRIPTION
 The \fBncurses\fR library routines give the user a terminal-independent method
 of updating character screens with reasonable optimization.
-This implementation is ``new curses'' (ncurses) and
+This implementation is \*(``new curses\*('' (ncurses) and
 is the approved replacement for
 4.4BSD classic curses, which has been discontinued.
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
 .PP
-The \fBncurses\fR library emulates the \fBcurses\fR(3X) library of
+The \fBncurses\fR library emulates the curses library of
 System V Release 4 UNIX,
 and XPG4 (X/Open Portability Guide) curses (also known as XSI curses).
 XSI stands for X/Open System Interfaces Extension.
 The \fBncurses\fR library is freely redistributable in source form.
 Differences from the SVr4
-curses are summarized under the \fBEXTENSIONS\fP and \fBPORTABILITY\fP sections below and
-described in detail in the respective \fBEXTENSIONS\fP, \fBPORTABILITY\fP and \fBBUGS\fP sections
+curses are summarized under the
+\fBEXTENSIONS\fP and \fBPORTABILITY\fP sections below and
+described in detail in the respective
+\fBEXTENSIONS\fP, \fBPORTABILITY\fP and \fBBUGS\fP sections
 of individual man pages.
 .PP
 The \fBncurses\fR library also provides many useful extensions,
 i.e., features which cannot be implemented by a simple add-on library
 but which require access to the internals of the library.
 .PP
-A program using these routines must be linked with the \fB-lncurses\fR option,
-or (if it has been generated) with the debugging library \fB-lncurses_g\fR.
+A program using these routines must be linked with the \fB\-lncurses\fR option,
+or (if it has been generated) with the debugging library \fB\-lncurses_g\fR.
 (Your system integrator may also have installed these libraries under
-the names \fB-lcurses\fR and \fB-lcurses_g\fR.)
+the names \fB\-lcurses\fR and \fB\-lcurses_g\fR.)
 The ncurses_g library generates trace logs (in a file called 'trace' in the
 current directory) that describe curses actions.
 See also the section on \fBALTERNATE CONFIGURATIONS\fP.
@@ -73,6 +82,7 @@
 terminal and \fBcurses\fR input and output options; environment query
 routines; color manipulation; use of soft label keys; terminfo capabilities;
 and access to low-level terminal-manipulation routines.
+.SS Initialization
 .PP
 The library uses the locale which the calling program has initialized.
 That is normally done with \fBsetlocale\fP:
@@ -80,7 +90,7 @@
       \fBsetlocale(LC_ALL, "");\fP
 .sp
 If the locale is not initialized,
-the library assumes that characters are printable as in ISO-8859-1,
+the library assumes that characters are printable as in ISO\-8859\-1,
 to work with certain legacy programs.
 You should initialize the locale and not rely on specific details of
 the library when the locale has not been setup.
@@ -105,10 +115,11 @@
 .sp
 Before a \fBcurses\fR program is run, the tab stops of the terminal
 should be set and its initialization strings, if defined, must be output.
-This can be done by executing the \fBtput init\fR command
+This can be done by executing the \fB@TPUT@ init\fR command
 after the shell environment variable \fBTERM\fR has been exported.
-\fBtset(1)\fR is usually responsible for doing this.
+\fB@TSET@(1)\fR is usually responsible for doing this.
 [See \fBterminfo\fR(\*n) for further details.]
+.SS Datatypes
 .PP
 The \fBncurses\fR library permits manipulation of data structures,
 called \fIwindows\fR, which can be thought of as two-dimensional
@@ -158,6 +169,7 @@
 The video attributes, line
 drawing characters, and input values use names, defined in \fB<curses.h>\fR,
 such as \fBA_REVERSE\fR, \fBACS_HLINE\fR, and \fBKEY_LEFT\fR.
+.SS Environment variables
 .PP
 If the environment variables \fBLINES\fR and \fBCOLUMNS\fR are set, or if the
 program is executing in a window environment, line and column information in
@@ -231,9 +243,9 @@
 This manual page describes functions which may appear in any configuration
 of the library.
 There are two common configurations of the library:
-.RS
+.RS 3
 .TP 5
-ncurses
+.I ncurses
 the "normal" library, which handles 8-bit characters.
 The normal (8-bit) library stores characters combined with attributes
 in \fBchtype\fP data.
@@ -244,19 +256,19 @@
 .IP
 Each cell (row and column) in a \fBWINDOW\fP is stored as a \fBchtype\fP.
 .TP 5
-ncursesw
+.I ncursesw
 the so-called "wide" library, which handles multibyte characters
-(See the section on \fBALTERNATE CONFIGURATIONS\fP).
+(see the section on \fBALTERNATE CONFIGURATIONS\fP).
 The "wide" library includes all of the calls from the "normal" library.
 It adds about one third more calls using data types which store
 multibyte characters:
-.RS
+.RS 5
 .TP 5
 .B cchar_t
 corresponds to \fBchtype\fP.
 However it is a structure, because more data is stored than can fit into
 an integer.
-The characters are large enough to require a full integer value - and there
+The characters are large enough to require a full integer value \- and there
 may be more than one character per cell.
 The video attributes and color are stored in separate fields of the structure.
 .IP
@@ -267,7 +279,7 @@
 Like \fBchtype\fP, this may be an integer.
 .TP 5
 .B wint_t
-stores a \fBwchar_t\fP or \fBWEOF\fP - not the same, though both may have
+stores a \fBwchar_t\fP or \fBWEOF\fP \- not the same, though both may have
 the same size.
 .RE
 .IP
@@ -432,7 +444,9 @@
 is_linetouched/\fBcurs_touch\fR(3X)
 is_nodelay/\fBcurs_opaque\fR(3X)*
 is_notimeout/\fBcurs_opaque\fR(3X)*
+is_pad/\fBcurs_opaque\fR(3X)*
 is_scrollok/\fBcurs_opaque\fR(3X)*
+is_subwin/\fBcurs_opaque\fR(3X)*
 is_syncok/\fBcurs_opaque\fR(3X)*
 is_term_resized/\fBresizeterm\fR(3X)*
 is_wintouched/\fBcurs_touch\fR(3X)
@@ -565,6 +579,7 @@
 reset_prog_mode/\fBcurs_kernel\fR(3X)
 reset_shell_mode/\fBcurs_kernel\fR(3X)
 resetty/\fBcurs_kernel\fR(3X)
+resize_term/\fBresizeterm\fR(3X)*
 resizeterm/\fBresizeterm\fR(3X)*
 restartterm/\fBcurs_terminfo\fR(3X)
 ripoffline/\fBcurs_kernel\fR(3X)
@@ -617,6 +632,7 @@
 tigetflag/\fBcurs_terminfo\fR(3X)
 tigetnum/\fBcurs_terminfo\fR(3X)
 tigetstr/\fBcurs_terminfo\fR(3X)
+tiparm/\fBcurs_terminfo\fR(3X)*
 timeout/\fBcurs_inopts\fR(3X)
 touchline/\fBcurs_touch\fR(3X)
 touchwin/\fBcurs_touch\fR(3X)
@@ -634,6 +650,7 @@
 use_env/\fBcurs_util\fR(3X)
 use_extended_names/\fBcurs_extend\fR(3X)*
 use_legacy_coding/\fBlegacy_coding\fR(3X)*
+use_tioctl/\fBcurs_util\fR(3X)
 vid_attr/\fBcurs_terminfo\fR(3X)
 vid_puts/\fBcurs_terminfo\fR(3X)
 vidattr/\fBcurs_terminfo\fR(3X)
@@ -683,8 +700,11 @@
 wget_wstr/\fBcurs_get_wstr\fR(3X)
 wgetbkgrnd/\fBcurs_bkgrnd\fR(3X)
 wgetch/\fBcurs_getch\fR(3X)
+wgetdelay/\fBcurs_opaque\fR(3X)*
 wgetn_wstr/\fBcurs_get_wstr\fR(3X)
 wgetnstr/\fBcurs_getstr\fR(3X)
+wgetparent/\fBcurs_opaque\fR(3X)*
+wgetscrreg/\fBcurs_opaque\fR(3X)*
 wgetstr/\fBcurs_getstr\fR(3X)
 whline/\fBcurs_border\fR(3X)
 whline_set/\fBcurs_border_set\fR(3X)
@@ -731,9 +751,16 @@
 integer value other than \fBERR\fR upon successful completion, unless
 otherwise noted in the routine descriptions.
 .PP
+As a general rule, routines check for null pointers passed as parameters,
+and handle this as an error.
+.PP
 All macros return the value of the \fBw\fR version, except \fBsetscrreg\fR,
 \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and \fBgetmaxyx\fR.
-The return values of \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBgetyx\fR, \fBgetbegyx\fR, and
+The return values of
+\fBsetscrreg\fR,
+\fBwsetscrreg\fR,
+\fBgetyx\fR,
+\fBgetbegyx\fR, and
 \fBgetmaxyx\fR are undefined (i.e., these should not be used as the
 right-hand side of assignment statements).
 .PP
@@ -742,83 +769,82 @@
 The following environment symbols are useful for customizing the
 runtime behavior of the \fBncurses\fR library.
 The most important ones have been already discussed in detail.
-.TP 5
-BAUDRATE
-The debugging library checks this environment symbol when the application
+.SS CC
+When set, change occurrences of the command_character
+(i.e., the \fBcmdch\fP capability)
+of the loaded terminfo entries to the value of this variable.
+Very few terminfo entries provide this feature.
+.PP
+Because this name is also used in development environments to represent
+the C compiler's name, \fBncurses\fR ignores it if it does not happen to
+be a single character.
+.SS BAUDRATE
+The debugging library checks this environment variable when the application
 has redirected output to a file.
-The symbol's numeric value is used for the baudrate.
+The variable's numeric value is used for the baudrate.
 If no value is found, \fBncurses\fR uses 9600.
 This allows testers to construct repeatable test-cases
 that take into account costs that depend on baudrate.
-.TP 5
-CC
-When set, change occurrences of the command_character
-(i.e., the \fBcmdch\fP capability)
-of the loaded terminfo entries to the value of this symbol.
-Very few terminfo entries provide this feature.
-.TP 5
-COLUMNS
+.SS COLUMNS
 Specify the width of the screen in characters.
 Applications running in a windowing environment usually are able to
 obtain the width of the window in which they are executing.
 If neither the \fBCOLUMNS\fP value nor the terminal's screen size is available,
 \fBncurses\fR uses the size which may be specified in the terminfo database
 (i.e., the \fBcols\fR capability).
-.IP
+.PP
 It is important that your application use a correct size for the screen.
 This is not always possible because your application may be
 running on a host which does not honor NAWS (Negotiations About Window
 Size), or because you are temporarily running as another user.
 However, setting \fBCOLUMNS\fP and/or \fBLINES\fP overrides the library's
 use of the screen size obtained from the operating system.
-.IP
+.PP
 Either \fBCOLUMNS\fP or \fBLINES\fP symbols may be specified independently.
 This is mainly useful to circumvent legacy misfeatures of terminal descriptions,
 e.g., xterm which commonly specifies a 65 line screen.
 For best results, \fBlines\fR and \fBcols\fR should not be specified in
 a terminal description for terminals which are run as emulations.
-.IP
+.PP
 Use the \fBuse_env\fR function to disable all use of external environment
-(including system calls) to determine the screen size.
-.TP 5
-ESCDELAY
+(but not including system calls) to determine the screen size.
+Use the \fBuse_tioctl\fR function to update \fBCOLUMNS\fP or \fBLINES\fP
+to match the screen size obtained from system calls or the terminal database.
+.SS ESCDELAY
 Specifies the total time, in milliseconds, for which ncurses will
 await a character sequence, e.g., a function key.
 The default value, 1000 milliseconds, is enough for most uses.
 However, it is made a variable to accommodate unusual applications.
-.IP
+.PP
 The most common instance where you may wish to change this value
 is to work with slow hosts, e.g., running on a network.
 If the host cannot read characters rapidly enough, it will have the same
 effect as if the terminal did not send characters rapidly enough.
 The library will still see a timeout.
-.IP
+.PP
 Note that xterm mouse events are built up from character sequences
 received from the xterm.
 If your application makes heavy use of multiple-clicking, you may
 wish to lengthen this default value because the timeout applies
 to the composed multi-click event as well as the individual clicks.
-.IP
+.PP
 In addition to the environment variable,
 this implementation provides a global variable with the same name.
 Portable applications should not rely upon the presence of ESCDELAY
 in either form,
 but setting the environment variable rather than the global variable
 does not create problems when compiling an application.
-.TP 5
-HOME
+.SS HOME
 Tells \fBncurses\fR where your home directory is.
 That is where it may read and write auxiliary terminal descriptions:
-.IP
+.PP
 $HOME/.termcap
 .br
 $HOME/.terminfo
-.TP 5
-LINES
+.SS LINES
 Like COLUMNS, specify the height of the screen in characters.
 See COLUMNS for a detailed description.
-.TP 5
-MOUSE_BUTTONS_123
+.SS MOUSE_BUTTONS_123
 This applies only to the OS/2 EMX port.
 It specifies the order of buttons on the mouse.
 OS/2 numbers a 3-button mouse inconsistently from other
@@ -830,47 +856,52 @@
 .br
 3 = middle.
 .sp
-This symbol lets you customize the mouse.
-The symbol must be three numeric digits 1-3 in any order, e.g., 123 or 321.
+This variable lets you customize the mouse.
+The variable must be three numeric digits 1\-3 in any order, e.g., 123 or 321.
 If it is not specified, \fBncurses\fR uses 132.
-.TP 5
-NCURSES_ASSUMED_COLORS
+.SS NCURSES_ASSUMED_COLORS
 Override the compiled-in assumption that the
 terminal's default colors are white-on-black
 (see \fBdefault_colors\fR(3X)).
 You may set the foreground and background color values with this environment
 variable by proving a 2-element list: foreground,background.
 For example, to tell ncurses to not assume anything
-about the colors, set this to "-1,-1".
+about the colors, set this to "\-1,\-1".
 To make it green-on-black, set it to "2,0".
 Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed.
-.TP 5
-NCURSES_GPM_TERMS
+.SS NCURSES_CONSOLE2
+This applies only to the MinGW port of ncurses.
+.PP
+The \fBConsole2\fP program's handling of the Microsoft Console API call
+\fBCreateConsoleScreenBuffer\fP is defective.
+Applications which use this will hang.
+However, it is possible to simulate the action of this call by
+mapping coordinates,
+explicitly saving and restoring the original screen contents.
+Setting the environment variable \fBNCGDB\fP has the same effect.
+.SS NCURSES_GPM_TERMS
 This applies only to ncurses configured to use the GPM interface.
-.IP
+.PP
 If present,
 the environment variable is a list of one or more terminal names
 against which the TERM environment variable is matched.
 Setting it to an empty value disables the GPM interface;
 using the built-in support for xterm, etc.
-.IP
+.PP
 If the environment variable is absent,
 ncurses will attempt to open GPM if TERM contains "linux".
-.TP 5
-NCURSES_NO_HARD_TABS
+.SS NCURSES_NO_HARD_TABS
 \fBNcurses\fP may use tabs as part of the cursor movement optimization.
 In some cases,
 your terminal driver may not handle these properly.
 Set this environment variable to disable the feature.
 You can also adjust your \fBstty\fP settings to avoid the problem.
-.TP 5
-NCURSES_NO_MAGIC_COOKIES
+NCURSES_NO_MAGIC_COOKIE
 Some terminals use a magic-cookie feature which requires special handling
 to make highlighting and other video attributes display properly.
 You can suppress the highlighting entirely for these terminals by
 setting this environment variable.
-.TP 5
-NCURSES_NO_PADDING
+.SS NCURSES_NO_PADDING
 Most of the terminal descriptions in the terminfo database are written
 for real "hardware" terminals.
 Many people use terminal emulators
@@ -886,32 +917,55 @@
 The cheapest solution (no hardware cost)
 is for your program to do this by pausing after
 operations that the terminal does slowly, such as clearing the display.
-.IP
+.PP
 As a result, many terminal descriptions (including the vt100)
 have delay times embedded.
 You may wish to use these descriptions,
 but not want to pay the performance penalty.
-.IP
-Set the NCURSES_NO_PADDING symbol to disable all but mandatory
+.PP
+Set the NCURSES_NO_PADDING environment variable to disable all but mandatory
 padding.
 Mandatory padding is used as a part of special control
 sequences such as \fIflash\fR.
-.TP 5
-NCURSES_NO_SETBUF
-Normally \fBncurses\fR enables buffered output during terminal initialization.
-This is done (as in SVr4 curses) for performance reasons.
+.SS NCURSES_NO_SETBUF
+This setting is obsolete.
+Before changes
+.RS 3
+.bP
+started with 5.9 patch 20120825
+and
+.bP
+continued
+though 5.9 patch 20130126
+.RE
+.PP
+\fBncurses\fR enabled buffered output during terminal initialization.
+This was done (as in SVr4 curses) for performance reasons.
 For testing purposes, both of \fBncurses\fR and certain applications,
-this feature is made optional.
+this feature was made optional.
 Setting the NCURSES_NO_SETBUF variable
-disables output buffering, leaving the output in the original (usually
+disabled output buffering, leaving the output in the original (usually
 line buffered) mode.
-.TP 5
-NCURSES_NO_UTF8_ACS
+.PP
+In the current implementation,
+ncurses performs its own buffering and does not require this workaround.
+It does not modify the buffering of the standard output.
+.PP
+The reason for the change was to make the behavior for interrupts and
+other signals more robust.
+One drawback is that certain nonconventional programs would mix
+ordinary stdio calls with ncurses calls and (usually) work.
+This is no longer possible since ncurses is not using
+the buffered standard output but its own output (to the same file descriptor).
+As a special case, the low-level calls such as \fBputp\fP still use the
+standard output.
+But high-level curses calls do not.
+.SS NCURSES_NO_UTF8_ACS
 During initialization, the \fBncurses\fR library
 checks for special cases where VT100 line-drawing (and the corresponding
 alternate character set capabilities) described in the terminfo are known
 to be missing.
-Specifically, when running in a UTF-8 locale,
+Specifically, when running in a UTF\-8 locale,
 the Linux console emulator and the GNU screen program ignore these.
 Ncurses checks the TERM environment variable for these.
 For other special cases, you should set this environment variable.
@@ -919,78 +973,127 @@
 the VT100 line-drawing glyphs.
 That works for the special cases cited,
 and is likely to work for terminal emulators.
-.IP
+.PP
 When setting this variable, you should set it to a nonzero value.
 Setting it to zero (or to a nonnumber)
-disables the special check for Linux and screen.
-.TP 5
-NCURSES_TRACE
+disables the special check for "linux" and "screen".
+.PP
+As an alternative to the environment variable,
+ncurses checks for an extended terminfo capability \fBU8\fP.
+This is a numeric capability which can be compiled using \fB@TIC@\ \-x\fP.
+For example
+.RS 3
+.ft CW
+.sp
+.nf
+# linux console, if patched to provide working
+# VT100 shift-in/shift-out, with corresponding font.
+linux-vt100|linux console with VT100 line-graphics,
+        U8#0, use=linux,
+.sp
+# uxterm with vt100Graphics resource set to false
+xterm-utf8|xterm relying on UTF-8 line-graphics,
+        U8#1, use=xterm,
+.fi
+.ft
+.RE
+.PP
+The name "U8" is chosen to be two characters,
+to permit it to be used by applications that use ncurses'
+termcap interface.
+.SS NCURSES_TRACE
 During initialization, the \fBncurses\fR debugging library
-checks the NCURSES_TRACE symbol.
+checks the NCURSES_TRACE environment variable.
 If it is defined, to a numeric value, \fBncurses\fR calls the \fBtrace\fR
 function, using that value as the argument.
-.IP
+.PP
 The argument values, which are defined in \fBcurses.h\fR, provide several
 types of information.
 When running with traces enabled, your application will write the
 file \fBtrace\fR to the current directory.
-.TP 5
-TERM
+.PP
+See \fBcurs_trace\fP(3X) for more information.
+.SS TERM
 Denotes your terminal type.
 Each terminal type is distinct, though many are similar.
-.TP 5
-TERMCAP
+.PP
+\fBTERM\fP is commonly set by terminal emulators to help
+applications find a workable terminal description.
+Some of those choose a popular approximation, e.g.,
+\*(``ansi\*('', \*(``vt100\*('', \*(``xterm\*('' rather than an exact fit.
+Not infrequently, your application will have problems with that approach,
+e.g., incorrect function-key definitions.
+.PP
+If you set \fBTERM\fP in your environment,
+it has no effect on the operation of the terminal emulator.
+It only affects the way applications work within the terminal.
+Likewise, as a general rule (\fBxterm\fP being a rare exception),
+terminal emulators which allow you to
+specify \fBTERM\fP as a parameter or configuration value do
+not change their behavior to match that setting.
+.SS TERMCAP
 If the \fBncurses\fR library has been configured with \fItermcap\fR
 support, \fBncurses\fR will check for a terminal's description in
 termcap form if it is not available in the terminfo database.
-.IP
-The TERMCAP symbol contains either a terminal description (with
+.PP
+The TERMCAP environment variable contains either a terminal description (with
 newlines stripped out),
-or a file name telling where the information denoted by the TERM symbol exists.
+or a file name telling where the information denoted by
+the TERM environment variable exists.
 In either case, setting it directs \fBncurses\fR to ignore
 the usual place for this information, e.g., /etc/termcap.
-.TP 5
-TERMINFO
+.SS TERMINFO
 Overrides the directory in which \fBncurses\fR searches for your terminal
 description.
 This is the simplest, but not the only way to change the list of directories.
 The complete list of directories in order follows:
-.RS
-.TP 3
--
+.RS 3
+.bP
 the last directory to which \fBncurses\fR wrote, if any, is searched first
-.TP 3
--
-the directory specified by the TERMINFO symbol
-.TP 3
--
+.bP
+the directory specified by the TERMINFO environment variable
+.bP
 $HOME/.terminfo
-.TP 3
--
-directories listed in the TERMINFO_DIRS symbol
-.TP 3
--
+.bP
+directories listed in the TERMINFO_DIRS environment variable
+.bP
 one or more directories whose names are configured and compiled into the
-ncurses library, e.g.,
-@TERMINFO@
+ncurses library, i.e.,
+.RS 3
+.bP
+@TERMINFO_DIRS@ (corresponding to the TERMINFO_DIRS variable)
+.bP
+@TERMINFO@ (corresponding to the TERMINFO variable)
 .RE
-.TP 5
-TERMINFO_DIRS
+.RE
+.SS TERMINFO_DIRS
 Specifies a list of directories to search for terminal descriptions.
 The list is separated by colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
-All of the terminal descriptions are in terminfo form, which makes
-a subdirectory named for the first letter of the terminal names therein.
-.TP 5
-TERMPATH
+.PP
+All of the terminal descriptions are in terminfo form.
+Normally these are stored in a directory tree,
+using subdirectories named by the first letter of the terminal names therein.
+.PP
+If \fBncurses\fP is built with a hashed database,
+then each entry in this list can also be the path of the corresponding
+database file.
+.PP
+If \fBncurses\fP is built with a support for reading termcap files
+directly, then an entry in this list may be the path of a termcap file.
+.SS TERMPATH
 If TERMCAP does not hold a file name then \fBncurses\fR checks
-the TERMPATH symbol.
-This is a list of filenames separated by spaces or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
-If the TERMPATH symbol is not set, \fBncurses\fR looks in the files
+the TERMPATH environment variable.
+This is a list of filenames separated by spaces or colons (i.e., ":") on Unix,
+semicolons on OS/2 EMX.
+.PP
+If the TERMPATH environment variable is not set,
+\fBncurses\fR looks in the files
 /etc/termcap, /usr/share/misc/termcap and $HOME/.termcap, in that order.
 .PP
 The library may be configured to disregard the following variables when the
 current user is the superuser (root), or if the application uses setuid or
 setgid permissions:
+.PP
 $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
 .SH ALTERNATE CONFIGURATIONS
 Several different configurations are possible,
@@ -998,9 +1101,9 @@
 There are a few main options whose effects are visible to the applications
 developer using \fBncurses\fP:
 .TP 5
---disable-overwrite
+\-\-disable\-overwrite
 The standard include for \fBncurses\fP is as noted in \fBSYNOPSIS\fP:
-.RS
+.RS 3
 .sp
 \fB#include <curses.h>\fR
 .RE
@@ -1009,28 +1112,29 @@
 is not the main implementation of curses of the computer.
 If \fBncurses\fP is installed disabling overwrite, it puts its headers in
 a subdirectory, e.g.,
-.RS
+.RS 3
 .sp
 \fB#include <ncurses/curses.h>\fR
 .RE
 .IP
-It also omits a symbolic link which would allow you to use \fB-lcurses\fP
+It also omits a symbolic link which would allow you to use \fB\-lcurses\fP
 to build executables.
 .TP 5
---enable-widec
-The configure script renames the library and (if the \fB--disable-overwrite\fP
-option is used) puts the header files in a different subdirectory.
+\-\-enable\-widec
+The configure script renames the library and
+(if the \fB\-\-disable\-overwrite\fP option is used)
+puts the header files in a different subdirectory.
 All of the library names have a "w" appended to them,
 i.e., instead of
-.RS
+.RS 3
 .sp
-\fB-lncurses\fR
+\fB\-lncurses\fR
 .RE
 .IP
 you link with
-.RS
+.RS 3
 .sp
-\fB-lncursesw\fR
+\fB\-lncursesw\fR
 .RE
 .IP
 You must also define \fB_XOPEN_SOURCE_EXTENDED\fP when compiling for the
@@ -1044,20 +1148,30 @@
 to allow applications to be built using either library
 from the same set of headers.
 .TP 5
---with-shared
+\-\-with\-pthread
+The configure script renames the library.
+All of the library names have a "t" appended to them
+(before any "w" added by \fB\-\-enable\-widec\fP).
+.IP
+The global variables such as \fBLINES\fP are replaced by macros to
+allow read-only access.
+At the same time, setter-functions are provided to set these values.
+Some applications (very few) may require changes to work with this convention.
+.TP 5
+\-\-with\-shared
 .TP
---with-normal
+\-\-with\-normal
 .TP
---with-debug
+\-\-with\-debug
 .TP
---with-profile
+\-\-with\-profile
 The shared and normal (static) library names differ by their suffixes,
 e.g., \fBlibncurses.so\fP and \fBlibncurses.a\fP.
 The debug and profiling libraries add a "_g" and a "_p" to the root
 names respectively,
 e.g., \fBlibncurses_g.a\fP and \fBlibncurses_p.a\fP.
 .TP 5
---with-trace
+\-\-with\-trace
 The \fBtrace\fP function normally resides in the debug library,
 but it is sometimes useful to configure this in the shared library.
 Configure scripts should check for the function's existence rather
@@ -1069,10 +1183,12 @@
 @TERMINFO@
 terminal capability database
 .SH SEE ALSO
-\fBterminfo\fR(\*n) and related pages whose names begin "curs_" for detailed routine
-descriptions.
+\fBterminfo\fR(\*n) and related pages whose names begin
+"curs_" for detailed routine descriptions.
+.br
+\fBcurs_variables\fR(3X)
 .SH EXTENSIONS
-The \fBncurses\fR library can be compiled with an option (\fB-DUSE_GETCAP\fR)
+The \fBncurses\fR library can be compiled with an option (\fB\-DUSE_GETCAP\fR)
 that falls back to the old-style /etc/termcap file if the terminal setup code
 cannot find a terminfo entry corresponding to \fBTERM\fR.
 Use of this feature
@@ -1098,7 +1214,7 @@
 and \fBkeyok\fR(3X) manual pages for details.
 .PP
 The \fBncurses\fR library can exploit the capabilities of terminals which
-implement the ISO-6429 SGR 39 and SGR 49 controls, which allow an application
+implement the ISO\-6429 SGR 39 and SGR 49 controls, which allow an application
 to reset the terminal to its original foreground and background colors.
 From the users' perspective, the application is able to draw colored
 text on a background whose color is set independently, providing better
@@ -1118,30 +1234,45 @@
 the XSI Curses and \fBncurses\fR calls) are described in \fBPORTABILITY\fR
 sections of the library man pages.
 .PP
-This implementation also contains several extensions:
-.RS 5
+Unlike other implementations, this one checks parameters such as pointers
+to WINDOW structures to ensure they are not null.
+The main reason for providing this behavior is to guard against programmer
+error.
+The standard interface does not provide a way for the library
+to tell an application which of several possible errors were detected.
+Relying on this (or some other) extension will adversely affect the
+portability of curses applications.
 .PP
+This implementation also contains several extensions:
+.bP
 The routine \fBhas_key\fR is not part of XPG4, nor is it present in SVr4.
 See the \fBcurs_getch\fR(3X) manual page for details.
-.PP
+.bP
 The routine \fBslk_attr\fR is not part of XPG4, nor is it present in SVr4.
 See the \fBcurs_slk\fR(3X) manual page for details.
-.PP
+.bP
 The routines \fBgetmouse\fR, \fBmousemask\fR, \fBungetmouse\fR,
 \fBmouseinterval\fR, and \fBwenclose\fR relating to mouse interfacing are not
 part of XPG4, nor are they present in SVr4.
 See the \fBcurs_mouse\fR(3X) manual page for details.
-.PP
+.bP
 The routine \fBmcprint\fR was not present in any previous curses implementation.
 See the \fBcurs_print\fR(3X) manual page for details.
-.PP
+.bP
 The routine \fBwresize\fR is not part of XPG4, nor is it present in SVr4.
 See the \fBwresize\fR(3X) manual page for details.
-.PP
+.bP
 The WINDOW structure's internal details can be hidden from application
 programs.
 See \fBcurs_opaque\fR(3X) for the discussion of \fBis_scrollok\fR, etc.
-.RE
+.bP
+This implementation can be configured to provide rudimentary support
+for multi-threaded applications.
+See \fBcurs_threads\fR(3X) for details.
+.bP
+This implementation can also be configured to provide a set of functions which
+improve the ability to manage multiple screens.
+See \fBcurs_sp_funcs\fR(3X) for details.
 .PP
 In historic curses versions, delays embedded in the capabilities \fBcr\fR,
 \fBind\fR, \fBcub1\fR, \fBff\fR and \fBtab\fR activated corresponding delay
@@ -1160,9 +1291,3 @@
 .SH AUTHORS
 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
 Based on pcurses by Pavel Curtis.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/panel.3x b/man/panel.3x
index 719a9e6..cc36d22 100644
--- a/man/panel.3x
+++ b/man/panel.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2020,2015 Free 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,16 +26,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: panel.3x,v 1.14 2007/05/12 20:45:20 tom Exp $
+.\" $Id: panel.3x,v 1.18 2015/04/11 10:23:49 tom Exp $
 .TH panel 3X ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-panel - panel stack extension for curses
+panel \- panel stack extension for curses
 .SH SYNOPSIS
 \fB#include <panel.h>\fR
 .P
-\fBcc [flags] sourcefiles -lpanel -lncurses\fR
+\fBcc [flags] sourcefiles \-lpanel \-lncurses\fR
 .P
 \fBPANEL *new_panel(WINDOW *win)\fR
 .br
@@ -93,8 +93,10 @@
 .B update_panels()
 refreshes the virtual screen to reflect the relations between the
 panels in the stack, but does not call doupdate() to refresh the
-physical screen.  Use this function and not wrefresh or wnoutrefresh.
-update_panels() may be called more than once before a call to
+physical screen.
+Use this function and not \fBwrefresh\fP or \fBwnoutrefresh\fP.
+.B update_panels
+may be called more than once before a call to
 doupdate(), but doupdate() is the function responsible for updating
 the physical screen.
 .TP
@@ -107,8 +109,8 @@
 view. The \fBPANEL\fR structure is not lost, merely removed from the stack.
 .TP
 .B panel_hidden(pan)
-returns TRUE if the panel is in the panel stack,
-FALSE if it is not.
+returns \fBTRUE\fP if the panel is in the panel stack,
+\fBFALSE\fP if it is not.
 If the panel is a null pointer, return ERR.
 .TP
 .B show_panel(pan)
@@ -170,7 +172,7 @@
 function to ensure compatibility with native panel libraries.
 .SH NOTE
 In your library list, libpanel.a should be before libncurses.a; that is,
-you want to say `-lpanel -lncurses', not the other way around (which would
+you want to say `\-lpanel \-lncurses', not the other way around (which would
 usually give a link-error).
 .SH FILES
 .P
@@ -180,7 +182,8 @@
 libpanel.a
 the panels library itself
 .SH SEE ALSO
-\fBcurses\fR(3X)
+\fBcurses\fR(3X),
+\fBcurs_variables\fR(3X),
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
diff --git a/man/resizeterm.3x b/man/resizeterm.3x
index 888eaaf..177e705 100644
--- a/man/resizeterm.3x
+++ b/man/resizeterm.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2013,2015 Free 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,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" Author: Thomas E. Dickey 1996-2005
+.\" Author: Thomas E. Dickey 1996-on
 .\"
-.\" $Id: resizeterm.3x,v 1.11 2005/06/25 22:19:42 tom Exp $
+.\" $Id: resizeterm.3x,v 1.19 2015/06/06 23:38:18 tom Exp $
 .TH resizeterm 3X ""
 .SH NAME
 \fBis_term_resized\fR,
 \fBresize_term\fR,
-\fBresizeterm\fR - change the curses terminal size
+\fBresizeterm\fR \- change the curses terminal size
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
@@ -43,13 +43,18 @@
 .br
 \fBint resizeterm(int lines, int columns);\fR
 .SH DESCRIPTION
+.PP
 This is an extension to the curses library.
 It provides callers with a hook into the \fBncurses\fR data to resize windows,
 primarily for use by programs running in an X Window terminal (e.g., xterm).
+.SS resizeterm
+.PP
 The function \fBresizeterm\fR resizes the standard and current windows
 to the specified dimensions, and adjusts other bookkeeping data used by
-the \fBncurses\fR library that record the window dimensions.
-.LP
+the \fBncurses\fR library that record the window dimensions
+such as the \fBLINES\fP and \fBCOLS\fP variables.
+.SS resize_term
+.PP
 Most of the work is done by the inner function \fBresize_term\fR.
 The outer function \fBresizeterm\fR adds bookkeeping for the SIGWINCH handler.
 When resizing the windows,
@@ -59,12 +64,13 @@
 However, due to the calling convention of pads,
 it is not possible to resize these
 without additional interaction with the application.
-.LP
+.SS is_term_resized
+.PP
 A support function \fBis_term_resized\fR is provided so that applications
 can check if the \fBresize_term\fR function would modify the window structures.
-It returns TRUE if the windows would be modified, and FALSE otherwise.
+It returns \fBTRUE\fP if the windows would be modified, and \fBFALSE\fP otherwise.
 .SH RETURN VALUE
-Except as notes, these function return
+Except as noted, these functions return
 the integer \fBERR\fR upon failure and \fBOK\fR on success.
 They will fail if either of the dimensions are less than or equal to zero,
 or if an error occurs while (re)allocating memory for the windows.
@@ -75,7 +81,7 @@
 since it uses those functions.
 .PP
 If ncurses is configured to supply its own SIGWINCH handler,
-the \fBresizeterm\fR function ungetch's a \fBKEY_RESIZE\fR which
+the \fBresizeterm\fR function \fBungetch\fP's a \fBKEY_RESIZE\fR which
 will be read on the next call to \fBgetch\fR.
 This is used to alert an application that the screen size has changed,
 and that it should repaint special features such as pads that cannot
@@ -86,15 +92,9 @@
 the operating system.
 Thus, even if a SIGWINCH is received,
 no screen size change may be recorded.
-In that case, no \fBKEY_RESIZE\fP is queued for the next call to \fBgetch\fP;
-an \fBERR\fP will be returned instead.
 .SH SEE ALSO
+\fBcurs_getch\fR(3X),
+\fBcurs_variables\fR(3X),
 \fBwresize\fR(3X).
 .SH AUTHOR
 Thomas Dickey (from an equivalent function written in 1988 for BSD curses).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/tabs.1 b/man/tabs.1
new file mode 100644
index 0000000..f6b797d
--- /dev/null
+++ b/man/tabs.1
@@ -0,0 +1,143 @@
+.\"***************************************************************************
+.\" Copyright (c) 2008-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"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: tabs.1,v 1.11 2013/06/22 18:11:57 tom Exp $
+.TH @TABS@ 1 ""
+.ds n 5
+.SH NAME
+\fB@TABS@\fR \- set tabs on a terminal
+.SH SYNOPSIS
+\fB@TABS@\fR [\fIoptions\fR]] \fI[tabstop-list]\fR
+.SH DESCRIPTION
+.PP
+The \fB@TABS@\fP program clears and sets tab-stops on the terminal.
+This uses the terminfo \fIclear_all_tabs\fP and \fIset_tab\fP capabilities.
+If either is absent, \fB@TABS@\fP is unable to clear/set tab-stops.
+The terminal should be configured to use hard tabs, e.g.,
+.sp
+.RS
+stty tab0
+.RE
+.SH OPTIONS
+.SS General Options
+.TP 5
+.BI \-T "name"
+Tell \fB@TABS@\fP which terminal type to use.
+If this option is not given, \fB@TABS@\fP will use the \fB$TERM\fP
+environment variable.
+If that is not set, it will use the \fIansi+tabs\fP entry.
+.TP 5
+.B \-d
+The debugging option shows a ruler line, followed by two data lines.
+The first data line shows the expected tab-stops marked with asterisks.
+The second data line shows the actual tab-stops, marked with asterisks.
+.TP 5
+.B \-n
+This option tells \fB@TABS@\fP to check the options and run any debugging
+option, but not to modify the terminal settings.
+.TP
+\fB\-V\fR
+reports the version of ncurses which was used in this program, and exits.
+.PP
+The \fB@TABS@\fP program processes a single list of tab stops.
+The last option to be processed which defines a list is the one that
+determines the list to be processed.
+.SS Implicit Lists
+Use a single number as an option, e.g., "\fB\-5\fP" to set tabs at the given
+interval (in this case 1, 6, 11, 16, 21, etc.).  Tabs are repeated up to
+the right margin of the screen.
+.PP
+Use "\fB\-0\fP" to clear all tabs.
+.PP
+Use "\fB\-8\fP" to set tabs to the standard interval.
+.SS Explicit Lists
+An explicit list can be defined after the options (this does not use a "\-").
+The values in the list must be in increasing numeric order, and greater than
+zero.  They are separated by a comma or a blank, for example,
+.sp
+.RS
+tabs 1,6,11,16,21
+.br
+tabs 1 6 11 16 21
+.RE
+Use a '+' to treat a number as an increment relative to the previous value,
+e.g.,
+.sp
+.RS
+tabs 1,+5,+5,+5,+5
+.RE
+which is equivalent to the 1,6,11,16,21 example.
+.SS Predefined Tab-Stops
+X/Open defines several predefined lists of tab stops.
+.TP 5
+.B \-a
+Assembler, IBM S/370, first format
+.TP 5
+.B \-a2
+Assembler, IBM S/370, second format
+.TP 5
+.B \-c
+COBOL, normal format
+.TP 5
+.B \-c2
+COBOL compact format
+.TP 5
+.B \-c3
+COBOL compact format extended
+.TP 5
+.B \-f
+FORTRAN
+.TP 5
+.B \-p
+PL/I
+.TP 5
+.B \-s
+SNOBOL
+.TP 5
+.B \-u
+UNIVAC 1100 Assembler
+.SH PORTABILITY
+.PP
+X/Open describes a \fB+m\fP option, to set a terminal's left-margin.
+Very few of the entries in the terminal database provide this capability.
+.PP
+The \fB\-d\fP (debug) and \fB\-n\fP (no-op) options are extensions not provided
+by other implementations.
+.PP
+Documentation for other implementations states that there is a limit on the
+number of tab stops.  While some terminals may not accept an arbitrary number
+of tab stops, this implementation will attempt to set tab stops up to the
+right margin of the screen, if the given list happens to be that long.
+.SH SEE ALSO
+\fB@TSET@\fR(1),
+\fB@INFOCMP@\fR(1M),
+\fBcurses\fR(3X),
+\fBterminfo\fR(\*n).
+.PP
+This describes \fBncurses\fR
+version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
diff --git a/man/term.5 b/man/term.5
index 19af62a..a4cca9c 100644
--- a/man/term.5
+++ b/man/term.5
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2015 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.5,v 1.19 2006/12/24 18:12:38 tom Exp $
+.\" $Id: term.5,v 1.22 2015/04/26 14:50:23 tom Exp $
 .TH term 5
 .ds n 5
 .ds d @TERMINFO@
@@ -109,7 +109,7 @@
 The first byte contains the least significant 8 bits of the value,
 and the second byte contains the most significant 8 bits.
 (Thus, the value represented is 256*second+first.)
-The value -1 is represented by the two bytes 0377, 0377; other negative
+The value \-1 is represented by the two bytes 0377, 0377; other negative
 values are illegal. This value generally
 means that the corresponding capability is missing from this terminal.
 Note that this format corresponds to the hardware of the \s-1VAX\s+1
@@ -130,7 +130,7 @@
 Between the boolean section and the number section,
 a null byte will be inserted, if necessary,
 to ensure that the number section begins on an even byte (this is a
-relic of the PDP-11's word-addressed architecture, originally
+relic of the PDP\-11's word-addressed architecture, originally
 designed in to avoid IOT traps induced by addressing a word on an
 odd byte boundary).
 All short integers are aligned on a short word boundary.
@@ -138,11 +138,11 @@
 The numbers section is similar to the flags section.
 Each capability takes up two bytes,
 and is stored as a little-endian short integer.
-If the value represented is -1, the capability is taken to be missing.
+If the value represented is \-1, the capability is taken to be missing.
 .PP
 The strings section is also similar.
 Each capability is stored as a short integer, in the format above.
-A value of -1 means the capability is missing.
+A value of \-1 means the capability is missing.
 Otherwise, the value is taken as an offset from the beginning
 of the string table.
 Special characters in ^X or \ec notation are stored in their
@@ -188,7 +188,7 @@
 .RE
 .PP
 Using the counts and sizes, ncurses allocates arrays and reads data
-for the extended capabilties in the same order as the header information.
+for the extended capabilities in the same order as the header information.
 .PP
 The extended string table contains values for string capabilities.
 After the end of these values, it contains the names for each of
@@ -217,14 +217,14 @@
 Despite the consistent use of little-endian for numbers and the otherwise
 self-describing format, it is not wise to count on portability of binary
 terminfo entries between commercial UNIX versions.  The problem is that there
-are at least three versions of terminfo (under HP-UX, AIX, and OSF/1) which
+are at least three versions of terminfo (under HP\-UX, AIX, and OSF/1) which
 diverged from System V terminfo after SVr1, and have added extension
 capabilities to the string table that (in the binary format) collide with
 System V and XSI Curses extensions.  See \fBterminfo\fR(\*n) for detailed
 discussion of terminfo source compatibility issues.
 .SH EXAMPLE
 As an example, here is a hex dump of the description for the Lear-Siegler
-ADM-3, a popular though rather stupid early terminal:
+ADM\-3, a popular though rather stupid early terminal:
 .nf
 .sp
 adm3a|lsi adm3a,
@@ -275,9 +275,3 @@
 hashed database support for ncurses 5.6
 .sp
 Eric S. Raymond
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/term.7 b/man/term.7
index 7eda6fb..cee8a01 100644
--- a/man/term.7
+++ b/man/term.7
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.7,v 1.18 2007/06/02 20:40:07 tom Exp $
+.\" $Id: term.7,v 1.23 2011/12/17 23:32:17 tom Exp $
 .TH term 7
 .ds n 5
 .ds d @TERMINFO@
@@ -39,9 +39,9 @@
 is critical for all screen-oriented programs, including your editor and mailer.
 .PP
 A default \fBTERM\fR value will be set on a per-line basis by either
-\fB/etc/inittab\fR (Linux and System-V-like UNIXes) or \fB/etc/ttys\fR (BSD
-UNIXes).  This will nearly always suffice for workstation and microcomputer
-consoles.
+\fB/etc/inittab\fR (e.g., System\-V-like UNIXes)
+or \fB/etc/ttys\fR (BSD UNIXes).
+This will nearly always suffice for workstation and microcomputer consoles.
 .PP
 If you use a dialup line, the type of device attached to it may vary.  Older
 UNIX systems pre-set a very dumb terminal type like `dumb' or `dialup' on
@@ -55,7 +55,7 @@
 are in fact using a VT100-superset console, terminal, or terminal emulator.)
 .PP
 In any case, you are free to override the system \fBTERM\fR setting to your
-taste in your shell profile.  The \fBtset\fP(1) utility may be of assistance;
+taste in your shell profile.  The \fB@TSET@\fP(1) utility may be of assistance;
 you can give it a set of rules for deducing or requesting a terminal type based
 on the tty device and baud rate.
 .PP
@@ -73,9 +73,9 @@
 to examine an entry, you must use the \fB@INFOCMP@\fR(1M) command.
 Invoke it as follows:
 .sp
-	@INFOCMP@ \fIentry-name\fR
+	@INFOCMP@ \fIentry_name\fR
 .sp
-where \fIentry-name\fR is the name of the type you wish to examine (and the
+where \fIentry_name\fR is the name of the type you wish to examine (and the
 name of its capability file the subdirectory of \*d named for its first
 letter).  This command dumps a capability file in the text format described by
 \fBterminfo\fR(\*n).
@@ -114,14 +114,14 @@
 thus \fBvt100\fR, \fBhp2621\fR, \fBwy50\fR.
 .PP
 The root name for a PC-Unix console type should be the OS name,
-i.e. \fBlinux\fR, \fBbsdos\fR, \fBfreebsd\fR, \fBnetbsd\fR.  It should
+i.e., \fBlinux\fR, \fBbsdos\fR, \fBfreebsd\fR, \fBnetbsd\fR.  It should
 \fInot\fR be \fBconsole\fR or any other generic that might cause confusion in a
 multi-platform environment!  If a model number follows, it should indicate
 either the OS release level or the console driver release level.
 .PP
 The root name for a terminal emulator (assuming it does not fit one of the
 standard ANSI or vt100 types) should be the program name or a readily
-recognizable abbreviation of it (i.e. \fBversaterm\fR, \fBctrm\fR).
+recognizable abbreviation of it (i.e., \fBversaterm\fR, \fBctrm\fR).
 .PP
 Following the root name, you may add any reasonable number of hyphen-separated
 feature suffixes.
@@ -135,52 +135,52 @@
 with another that has this suffix and uses magic cookies to support multiple
 attributes.
 .TP 5
--am
+\-am
 Enable auto-margin (right-margin wraparound).
 .TP 5
--m
-Mono mode - suppress color support.
+\-m
+Mono mode \- suppress color support.
 .TP 5
--na
-No arrow keys - termcap ignores arrow keys which are actually there on the
+\-na
+No arrow keys \- termcap ignores arrow keys which are actually there on the
 terminal, so the user can use the arrow keys locally.
 .TP 5
--nam
-No auto-margin - suppress am capability.
+\-nam
+No auto-margin \- suppress am capability.
 .TP 5
--nl
-No labels - suppress soft labels.
+\-nl
+No labels \- suppress soft labels.
 .TP 5
--nsl
-No status line - suppress status line.
+\-nsl
+No status line \- suppress status line.
 .TP 5
--pp
+\-pp
 Has a printer port which is used.
 .TP 5
--rv
+\-rv
 Terminal in reverse video mode (black on white).
 .TP 5
--s
+\-s
 Enable status line.
 .TP 5
--vb
+\-vb
 Use visible bell (flash) rather than beep.
 .TP 5
--w
+\-w
 Wide; terminal is in 132 column mode.
 .PP
 Conventionally, if your terminal type is a variant intended to specify a
 line height, that suffix should go first.  So, for a hypothetical FuBarCo
 model 2317 terminal in 30-line mode with reverse video, best form would be
-\fBfubar-30-rv\fR (rather than, say, `fubar-rv-30').
+\fBfubar\-30\-rv\fR (rather than, say, `fubar\-rv\-30').
 .PP
 Terminal types that are written not as standalone entries, but rather as
 components to be plugged into other entries via \fBuse\fP capabilities,
 are distinguished by using embedded plus signs rather than dashes.
 .PP
-Commands which use a terminal type to control display often accept a -T
+Commands which use a terminal type to control display often accept a \-T
 option that accepts a terminal name argument.  Such programs should fall back
-on the \fBTERM\fR environment variable when no -T option is specified.
+on the \fBTERM\fR environment variable when no \-T option is specified.
 .SH PORTABILITY
 For maximum compatibility with older System V UNIXes, names and aliases
 should be unique within the first 14 characters.
@@ -196,9 +196,3 @@
 tty line initialization (BSD-like UNIXes)
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBterm\fR(\*n).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/term_variables.3x b/man/term_variables.3x
new file mode 100644
index 0000000..ea24737
--- /dev/null
+++ b/man/term_variables.3x
@@ -0,0 +1,181 @@
+.\"***************************************************************************
+.\" Copyright (c) 2011-2013,2015 Free Software Foundation, Inc.              *
+.\"                                                                          *
+.\" Permission is hereby granted, free of charge, to any person obtaining a  *
+.\" copy of this software and associated documentation files (the            *
+.\" "Software"), to deal in the Software without restriction, including      *
+.\" without limitation the rights to use, copy, modify, merge, publish,      *
+.\" distribute, distribute with modifications, sublicense, and/or sell       *
+.\" copies of the Software, and to permit persons to whom the Software is    *
+.\" furnished to do so, subject to the following conditions:                 *
+.\"                                                                          *
+.\" The above copyright notice and this permission notice shall be included  *
+.\" in all copies or substantial portions of the Software.                   *
+.\"                                                                          *
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+.\"                                                                          *
+.\" Except as contained in this notice, the name(s) of the above copyright   *
+.\" holders shall not be used in advertising or otherwise to promote the     *
+.\" sale, use or other dealings in this Software without prior written       *
+.\" authorization.                                                           *
+.\"***************************************************************************
+.\"
+.\" $Id: term_variables.3x,v 1.6 2015/04/22 00:34:49 tom Exp $
+.TH term_variables 3X ""
+.ds n 5
+.na
+.hy 0
+.SH NAME
+\fBSP\fP,
+\fBacs_map\fP,
+\fBboolcodes\fP,
+\fBboolfnames\fP,
+\fBboolnames\fP,
+\fBcur_term\fP,
+\fBnumcodes\fP,
+\fBnumfnames\fP,
+\fBnumnames\fP,
+\fBstrcodes\fP,
+\fBstrfnames\fP,
+\fBstrnames\fP,
+\fBttytype\fP
+\- \fBcurses\fR terminfo global variables
+.ad
+.hy
+.SH SYNOPSIS
+.nf
+\fB#include <curses.h>\fR
+.br
+\fB#include <term.h>\fR
+.PP
+\fBchtype acs_map[];\fR
+.sp
+\fBTERMINAL * cur_term;\fR
+.sp
+\fBchar ttytype[];\fR
+.sp
+\fBNCURSES_CONST char * const * boolcodes;\fR
+.br
+\fBNCURSES_CONST char * const * boolfnames;\fR
+.br
+\fBNCURSES_CONST char * const * boolnames;\fR
+.sp
+\fBNCURSES_CONST char * const * numcodes;\fR
+.br
+\fBNCURSES_CONST char * const * numfnames;\fR
+.br
+\fBNCURSES_CONST char * const * numnames;\fR
+.sp
+\fBNCURSES_CONST char * const * strcodes;\fR
+.br
+\fBNCURSES_CONST char * const * strfnames;\fR
+.br
+\fBNCURSES_CONST char * const * strnames;\fR
+.br
+.fi
+.SH DESCRIPTION
+This page summarizes variables provided by the \fBcurses\fP library's
+low-level terminfo interface.
+A more complete description is given in the \fBcurs_terminfo\fP(3X) manual page.
+.PP
+Depending on the configuration, these may be actual variables,
+or macros (see \fBcurs_threads\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.
+.SS Alternate Character Set Mapping
+After initializing the curses or terminfo interfaces,
+the \fBacs_map\fP array holds information used to translate cells
+with the \fBA_ALTCHARSET\fP video attribute into line-drawing characters.
+.PP
+The encoding of the information in this array has changed periodically.
+Application developers need only know that it is used for the "ACS_"
+constants in <curses.h>.
+.PP
+The comparable data for the wide-character library is a private variable.
+.SS Current Terminal Data
+After initializing the curses or terminfo interfaces,
+the \fBcur_term\fP contains data describing the current terminal.
+This variable is also set as a side-effect of \fBset_term\fP(3X)
+and \fBdelscreen\fP(3X).
+.PP
+It is possible to save a value of \fBcur_term\fP for subsequent
+use as a parameter to \fBset_term\fP, for switching between screens.
+Alternatively, one can save the return value from \fBnewterm\fP
+or \fBsetupterm\fP to reuse in \fBset_term\fP.
+.SS Terminfo Names
+The \fB@TIC@\fP(1) and \fB@INFOCMP@\fP(1) programs use lookup tables for
+the long and short names of terminfo capabilities,
+as well as the corresponding names for termcap capabilities.
+These are available to other applications,
+although the hash-tables used by
+the terminfo and termcap functions are not available.
+.PP
+The long terminfo capability names use a "l" (ell) in their names:
+\fBboolfnames\fP,
+\fBnumfnames\fP, and
+\fBstrfnames\fP.
+.PP
+These are the short names for terminfo capabilities:
+\fBboolnames\fP,
+\fBnumnames\fP, and
+\fBstrnames\fP.
+.PP
+These are the corresponding names used for termcap descriptions:
+\fBboolcodes\fP,
+\fBnumcodes\fP, and
+\fBstrcodes\fP.
+.\"
+.SS Terminal Type
+On initialization of the curses or terminfo interfaces,
+\fBsetupterm\fP copies the terminal name to the array \fBttytype\fP.
+.\"
+.SS Terminfo Names
+.PP
+In addition to the variables, \fB<term.h>\fP also defines a symbol for each
+terminfo capability \fIlong name\fP.
+These are in terms of the symbol \fBCUR\fP,
+which is defined
+.PP
+.nf
+.ft CW
+#define CUR cur_term->type.
+.fi
+.ft R
+.PP
+These symbols provide a faster method of accessing terminfo capabilities
+than using \fBtigetstr\fR(3X), etc.
+.\"
+.SH NOTES
+The low-level terminfo interface is initialized using
+.hy 0
+\fBsetupterm\fR(3X).
+.hy
+The upper-level curses interface uses the low-level terminfo interface,
+internally.
+.\"
+.SH PORTABILITY
+X/Open Curses does not describe any of these except for \fBcur_term\fP.
+(The inclusion of \fBcur_term\fP appears to be an oversight,
+since other comparable low-level information is omitted by X/Open).
+.PP
+Other implementations may have comparable variables.
+Some implementations provide the variables in their libraries,
+but omit them from the header files.
+.PP
+All implementations which provide terminfo interfaces add definitions
+as described in the \fBTerminfo Names\fP section.
+Most, but not all, base the definition upon the \fBcur_term\fP variable.
+.SH SEE ALSO
+.hy 0
+\fBcurses\fR(3X),
+\fBcurs_terminfo\fR(3X),
+\fBcurs_threads\fR(3X),
+\fBterminfo\fR(\*n).
+.hy
diff --git a/man/terminfo.5 b/man/terminfo.5
deleted file mode 100644
index 2933c96..0000000
--- a/man/terminfo.5
+++ /dev/null
@@ -1,3337 +0,0 @@
-'\" t
-.\" DO NOT EDIT THIS FILE BY HAND!
-.\" It is generated from terminfo.head, Caps, and terminfo.tail.
-.\"
-.\" Note: this must be run through tbl before nroff.
-.\" The magic cookie on the first line triggers this under some man programs.
-.\"***************************************************************************
-.\" Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
-.\"                                                                          *
-.\" Permission is hereby granted, free of charge, to any person obtaining a  *
-.\" copy of this software and associated documentation files (the            *
-.\" "Software"), to deal in the Software without restriction, including      *
-.\" without limitation the rights to use, copy, modify, merge, publish,      *
-.\" distribute, distribute with modifications, sublicense, and/or sell       *
-.\" copies of the Software, and to permit persons to whom the Software is    *
-.\" furnished to do so, subject to the following conditions:                 *
-.\"                                                                          *
-.\" The above copyright notice and this permission notice shall be included  *
-.\" in all copies or substantial portions of the Software.                   *
-.\"                                                                          *
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
-.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
-.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
-.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
-.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
-.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
-.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
-.\"                                                                          *
-.\" Except as contained in this notice, the name(s) of the above copyright   *
-.\" holders shall not be used in advertising or otherwise to promote the     *
-.\" sale, use or other dealings in this Software without prior written       *
-.\" authorization.                                                           *
-.\"***************************************************************************
-.\"
-.\" $Id: terminfo.head,v 1.16 2007/03/04 00:09:46 tom Exp $
-.TH terminfo 5 "" "" "File Formats"
-.ds n 5
-.ds d @TERMINFO@
-.SH NAME
-terminfo \- terminal capability data base
-.SH SYNOPSIS
-\*d/*/*
-.SH DESCRIPTION
-.I Terminfo
-is a data base describing terminals, used by screen-oriented programs such as
-\fBnvi\fR(1),
-\fBrogue\fR(1)
-and libraries such as
-\fBcurses\fR(3X).
-.I Terminfo
-describes terminals by giving a set of capabilities which they
-have, by specifying how to perform screen operations, and by
-specifying padding requirements and initialization sequences.
-This describes \fBncurses\fR
-version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.PP
-Entries in
-.I terminfo
-consist of a sequence of `,' separated fields (embedded commas may be
-escaped with a backslash or notated as \\054).
-White space after the `,' separator is ignored.
-The first entry for each terminal gives the names which are known for the
-terminal, separated by `|' characters.
-The first name given is the most common abbreviation for the terminal,
-the last name given should be a long name fully identifying the terminal,
-and all others are understood as synonyms for the terminal name.
-All names but the last should be in lower case and contain no blanks;
-the last name may well contain upper case and blanks for readability.
-.PP
-Lines beginning with a `#' in the first column are treated as comments.
-While comment lines are legal at any point, the output of \fB@CAPTOINFO@\fP
-and \fB@INFOTOCAP@\fP (aliases for \fB@TIC@\fP)
-will move comments so they occur only between entries.
-.PP
-Newlines and leading tabs may be used for formatting entries for readability.
-These are removed from parsed entries.
-The \fB@INFOCMP@\ -f\fP option relies on this to format if-then-else expressions:
-the result can be read by \fB@TIC@\fP.
-.PP
-Terminal names (except for the last, verbose entry) should
-be chosen using the following conventions.
-The particular piece of hardware making up the terminal should
-have a root name, thus ``hp2621''.
-This name should not contain hyphens.
-Modes that the hardware can be in, or user preferences, should
-be indicated by appending a hyphen and a mode suffix.
-Thus, a vt100 in 132 column mode would be vt100-w.
-The following suffixes should be used where possible:
-.PP
-.TS
-center ;
-l c l
-l l l.
-\fBSuffix	Meaning	Example\fP
--\fInn\fP	Number of lines on the screen	aaa-60
--\fIn\fPp	Number of pages of memory	c100-4p
--am	With automargins (usually the default)	vt100-am
--m	Mono mode; suppress color       	ansi-m
--mc	Magic cookie; spaces when highlighting	wy30-mc
--na	No arrow keys (leave them in local)	c100-na
--nam	Without automatic margins       	vt100-nam
--nl	No status line                  	att4415-nl
--ns	No status line                  	hp2626-ns
--rv	Reverse video                   	c100-rv
--s	Enable status line              	vt100-s
--vb	Use visible bell instead of beep	wy370-vb
--w	Wide mode (> 80 columns, usually 132)	vt100-w
-.TE
-.PP
-For more on terminal naming conventions, see the \fBterm(7)\fR manual page.
-.SS Capabilities
-.\" Head of terminfo man page ends here
-.ps -1
-The following is a complete table of the capabilities included in a
-terminfo description block and available to terminfo-using code.  In each
-line of the table,
-
-The \fBvariable\fR is the name by which the programmer (at the terminfo level)
-accesses the capability.
-
-The \fBcapname\fR is the short name used in the text of the database,
-and is used by a person updating the database.
-Whenever possible, capnames are chosen to be the same as or similar to
-the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses
-identical or very similar names).  Semantics are also intended to match
-those of the specification.
-
-The termcap code is the old
-.B termcap
-capability name (some capabilities are new, and have names which termcap
-did not originate).
-.P
-Capability names have no hard length limit, but an informal limit of 5
-characters has been adopted to keep them short and to allow the tabs in
-the source file
-.B Caps
-to line up nicely.
-
-Finally, the description field attempts to convey the semantics of the
-capability.  You may find some codes in the description field:
-.TP
-(P)
-indicates that padding may be specified
-.TP
-#[1-9]
-in the description field indicates that the string is passed through tparm with
-parms as given (#\fIi\fP).
-.TP
-(P*)
-indicates that padding may vary in proportion to the number of
-lines affected
-.TP
-(#\d\fIi\fP\u)
-indicates the \fIi\fP\uth\d parameter.
-
-.PP
-These are the boolean capabilities:
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw20.
-\fBVariable	Cap-	TCap	Description\fR
-\fBBooleans	name	Code\fR
-auto_left_margin	bw	bw	T{
-cub1 wraps from column 0 to last column
-T}
-auto_right_margin	am	am	T{
-terminal has automatic margins
-T}
-back_color_erase	bce	ut	T{
-screen erased with background color
-T}
-can_change	ccc	cc	T{
-terminal can re-define existing colors
-T}
-ceol_standout_glitch	xhp	xs	T{
-standout not erased by overwriting (hp)
-T}
-col_addr_glitch	xhpa	YA	T{
-only positive motion for hpa/mhpa caps
-T}
-cpi_changes_res	cpix	YF	T{
-changing character pitch changes resolution
-T}
-cr_cancels_micro_mode	crxm	YB	T{
-using cr turns off micro mode
-T}
-dest_tabs_magic_smso	xt	xt	T{
-tabs destructive, magic so char (t1061)
-T}
-eat_newline_glitch	xenl	xn	T{
-newline ignored after 80 cols (concept)
-T}
-erase_overstrike	eo	eo	T{
-can erase overstrikes with a blank
-T}
-generic_type	gn	gn	T{
-generic line type
-T}
-hard_copy	hc	hc	T{
-hardcopy terminal
-T}
-hard_cursor	chts	HC	T{
-cursor is hard to see
-T}
-has_meta_key	km	km	T{
-Has a meta key (i.e., sets 8th-bit)
-T}
-has_print_wheel	daisy	YC	T{
-printer needs operator to change character set
-T}
-has_status_line	hs	hs	T{
-has extra status line
-T}
-hue_lightness_saturation	hls	hl	T{
-terminal uses only HLS color notation (Tektronix)
-T}
-insert_null_glitch	in	in	T{
-insert mode distinguishes nulls
-T}
-lpi_changes_res	lpix	YG	T{
-changing line pitch changes resolution
-T}
-memory_above	da	da	T{
-display may be retained above the screen
-T}
-memory_below	db	db	T{
-display may be retained below the screen
-T}
-move_insert_mode	mir	mi	T{
-safe to move while in insert mode
-T}
-move_standout_mode	msgr	ms	T{
-safe to move while in standout mode
-T}
-needs_xon_xoff	nxon	nx	T{
-padding will not work, xon/xoff required
-T}
-no_esc_ctlc	xsb	xb	T{
-beehive (f1=escape, f2=ctrl C)
-T}
-no_pad_char	npc	NP	T{
-pad character does not exist
-T}
-non_dest_scroll_region	ndscr	ND	T{
-scrolling region is non-destructive
-T}
-non_rev_rmcup	nrrmc	NR	T{
-smcup does not reverse rmcup
-T}
-over_strike	os	os	T{
-terminal can overstrike
-T}
-prtr_silent	mc5i	5i	T{
-printer will not echo on screen
-T}
-row_addr_glitch	xvpa	YD	T{
-only positive motion for vpa/mvpa caps
-T}
-semi_auto_right_margin	sam	YE	T{
-printing in last column causes cr
-T}
-status_line_esc_ok	eslok	es	T{
-escape can be used on the status line
-T}
-tilde_glitch	hz	hz	T{
-cannot print ~'s (hazeltine)
-T}
-transparent_underline	ul	ul	T{
-underline character overstrikes
-T}
-xon_xoff	xon	xo	T{
-terminal uses xon/xoff handshaking
-T}
-.TE
-.ad
-
-These are the numeric capabilities:
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw20.
-\fBVariable	Cap-	TCap	Description\fR
-\fBNumeric	name	Code\fR
-columns	cols	co	T{
-number of columns in a line
-T}
-init_tabs	it	it	T{
-tabs initially every # spaces
-T}
-label_height	lh	lh	T{
-rows in each label
-T}
-label_width	lw	lw	T{
-columns in each label
-T}
-lines	lines	li	T{
-number of lines on screen or page
-T}
-lines_of_memory	lm	lm	T{
-lines of memory if > line. 0 means varies
-T}
-magic_cookie_glitch	xmc	sg	T{
-number of blank characters left by smso or rmso
-T}
-max_attributes	ma	ma	T{
-maximum combined attributes terminal can handle
-T}
-max_colors	colors	Co	T{
-maximum number of colors on screen
-T}
-max_pairs	pairs	pa	T{
-maximum number of color-pairs on the screen
-T}
-maximum_windows	wnum	MW	T{
-maximum number of defineable windows
-T}
-no_color_video	ncv	NC	T{
-video attributes that cannot be used with colors
-T}
-num_labels	nlab	Nl	T{
-number of labels on screen
-T}
-padding_baud_rate	pb	pb	T{
-lowest baud rate where padding needed
-T}
-virtual_terminal	vt	vt	T{
-virtual terminal number (CB/unix)
-T}
-width_status_line	wsl	ws	T{
-number of columns in status line
-T}
-.TE
-.ad
-
-The following numeric capabilities are present in the SVr4.0 term structure,
-but are not yet documented in the man page.  They came in with SVr4's
-printer support.
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw20.
-\fBVariable	Cap-	TCap	Description\fR
-\fBNumeric	name	Code\fR
-bit_image_entwining	bitwin	Yo	T{
-number of passes for each bit-image row
-T}
-bit_image_type	bitype	Yp	T{
-type of bit-image device
-T}
-buffer_capacity	bufsz	Ya	T{
-numbers of bytes buffered before printing
-T}
-buttons	btns	BT	T{
-number of buttons on mouse
-T}
-dot_horz_spacing	spinh	Yc	T{
-spacing of dots horizontally in dots per inch
-T}
-dot_vert_spacing	spinv	Yb	T{
-spacing of pins vertically in pins per inch
-T}
-max_micro_address	maddr	Yd	T{
-maximum value in micro_..._address
-T}
-max_micro_jump	mjump	Ye	T{
-maximum value in parm_..._micro
-T}
-micro_col_size	mcs	Yf	T{
-character step size when in micro mode
-T}
-micro_line_size	mls	Yg	T{
-line step size when in micro mode
-T}
-number_of_pins	npins	Yh	T{
-numbers of pins in print-head
-T}
-output_res_char	orc	Yi	T{
-horizontal resolution in units per line
-T}
-output_res_horz_inch	orhi	Yk	T{
-horizontal resolution in units per inch
-T}
-output_res_line	orl	Yj	T{
-vertical resolution in units per line
-T}
-output_res_vert_inch	orvi	Yl	T{
-vertical resolution in units per inch
-T}
-print_rate	cps	Ym	T{
-print rate in characters per second
-T}
-wide_char_size	widcs	Yn	T{
-character step size when in double wide mode
-T}
-.TE
-.ad
-
-These are the string capabilities:
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw20.
-\fBVariable	Cap-	TCap	Description\fR
-\fBString	name	Code\fR
-acs_chars	acsc	ac	T{
-graphics charset pairs, based on vt100
-T}
-back_tab	cbt	bt	T{
-back tab (P)
-T}
-bell	bel	bl	T{
-audible signal (bell) (P)
-T}
-carriage_return	cr	cr	T{
-carriage return (P*) (P*)
-T}
-change_char_pitch	cpi	ZA	T{
-Change number of characters per inch to #1
-T}
-change_line_pitch	lpi	ZB	T{
-Change number of lines per inch to #1
-T}
-change_res_horz	chr	ZC	T{
-Change horizontal resolution to #1
-T}
-change_res_vert	cvr	ZD	T{
-Change vertical resolution to #1
-T}
-change_scroll_region	csr	cs	T{
-change region to line #1 to line #2 (P)
-T}
-char_padding	rmp	rP	T{
-like ip but when in insert mode
-T}
-clear_all_tabs	tbc	ct	T{
-clear all tab stops (P)
-T}
-clear_margins	mgc	MC	T{
-clear right and left soft margins
-T}
-clear_screen	clear	cl	T{
-clear screen and home cursor (P*)
-T}
-clr_bol	el1	cb	T{
-Clear to beginning of line
-T}
-clr_eol	el	ce	T{
-clear to end of line (P)
-T}
-clr_eos	ed	cd	T{
-clear to end of screen (P*)
-T}
-column_address	hpa	ch	T{
-horizontal position #1, absolute (P)
-T}
-command_character	cmdch	CC	T{
-terminal settable cmd character in prototype !?
-T}
-create_window	cwin	CW	T{
-define a window #1 from #2,#3 to #4,#5
-T}
-cursor_address	cup	cm	T{
-move to row #1 columns #2
-T}
-cursor_down	cud1	do	T{
-down one line
-T}
-cursor_home	home	ho	T{
-home cursor (if no cup)
-T}
-cursor_invisible	civis	vi	T{
-make cursor invisible
-T}
-cursor_left	cub1	le	T{
-move left one space
-T}
-cursor_mem_address	mrcup	CM	T{
-memory relative cursor addressing, move to row #1 columns #2
-T}
-cursor_normal	cnorm	ve	T{
-make cursor appear normal (undo civis/cvvis)
-T}
-cursor_right	cuf1	nd	T{
-non-destructive space (move right one space)
-T}
-cursor_to_ll	ll	ll	T{
-last line, first column (if no cup)
-T}
-cursor_up	cuu1	up	T{
-up one line
-T}
-cursor_visible	cvvis	vs	T{
-make cursor very visible
-T}
-define_char	defc	ZE	T{
-Define a character #1, #2 dots wide, descender #3
-T}
-delete_character	dch1	dc	T{
-delete character (P*)
-T}
-delete_line	dl1	dl	T{
-delete line (P*)
-T}
-dial_phone	dial	DI	T{
-dial number #1
-T}
-dis_status_line	dsl	ds	T{
-disable status line
-T}
-display_clock	dclk	DK	T{
-display clock
-T}
-down_half_line	hd	hd	T{
-half a line down
-T}
-ena_acs	enacs	eA	T{
-enable alternate char set
-T}
-enter_alt_charset_mode	smacs	as	T{
-start alternate character set (P)
-T}
-enter_am_mode	smam	SA	T{
-turn on automatic margins
-T}
-enter_blink_mode	blink	mb	T{
-turn on blinking
-T}
-enter_bold_mode	bold	md	T{
-turn on bold (extra bright) mode
-T}
-enter_ca_mode	smcup	ti	T{
-string to start programs using cup
-T}
-enter_delete_mode	smdc	dm	T{
-enter delete mode
-T}
-enter_dim_mode	dim	mh	T{
-turn on half-bright mode
-T}
-enter_doublewide_mode	swidm	ZF	T{
-Enter double-wide mode
-T}
-enter_draft_quality	sdrfq	ZG	T{
-Enter draft-quality mode
-T}
-enter_insert_mode	smir	im	T{
-enter insert mode
-T}
-enter_italics_mode	sitm	ZH	T{
-Enter italic mode
-T}
-enter_leftward_mode	slm	ZI	T{
-Start leftward carriage motion
-T}
-enter_micro_mode	smicm	ZJ	T{
-Start micro-motion mode
-T}
-enter_near_letter_quality	snlq	ZK	T{
-Enter NLQ mode
-T}
-enter_normal_quality	snrmq	ZL	T{
-Enter normal-quality mode
-T}
-enter_protected_mode	prot	mp	T{
-turn on protected mode
-T}
-enter_reverse_mode	rev	mr	T{
-turn on reverse video mode
-T}
-enter_secure_mode	invis	mk	T{
-turn on blank mode (characters invisible)
-T}
-enter_shadow_mode	sshm	ZM	T{
-Enter shadow-print mode
-T}
-enter_standout_mode	smso	so	T{
-begin standout mode
-T}
-enter_subscript_mode	ssubm	ZN	T{
-Enter subscript mode
-T}
-enter_superscript_mode	ssupm	ZO	T{
-Enter superscript mode
-T}
-enter_underline_mode	smul	us	T{
-begin underline mode
-T}
-enter_upward_mode	sum	ZP	T{
-Start upward carriage motion
-T}
-enter_xon_mode	smxon	SX	T{
-turn on xon/xoff handshaking
-T}
-erase_chars	ech	ec	T{
-erase #1 characters (P)
-T}
-exit_alt_charset_mode	rmacs	ae	T{
-end alternate character set (P)
-T}
-exit_am_mode	rmam	RA	T{
-turn off automatic margins
-T}
-exit_attribute_mode	sgr0	me	T{
-turn off all attributes
-T}
-exit_ca_mode	rmcup	te	T{
-strings to end programs using cup
-T}
-exit_delete_mode	rmdc	ed	T{
-end delete mode
-T}
-exit_doublewide_mode	rwidm	ZQ	T{
-End double-wide mode
-T}
-exit_insert_mode	rmir	ei	T{
-exit insert mode
-T}
-exit_italics_mode	ritm	ZR	T{
-End italic mode
-T}
-exit_leftward_mode	rlm	ZS	T{
-End left-motion mode
-T}
-exit_micro_mode	rmicm	ZT	T{
-End micro-motion mode
-T}
-exit_shadow_mode	rshm	ZU	T{
-End shadow-print mode
-T}
-exit_standout_mode	rmso	se	T{
-exit standout mode
-T}
-exit_subscript_mode	rsubm	ZV	T{
-End subscript mode
-T}
-exit_superscript_mode	rsupm	ZW	T{
-End superscript mode
-T}
-exit_underline_mode	rmul	ue	T{
-exit underline mode
-T}
-exit_upward_mode	rum	ZX	T{
-End reverse character motion
-T}
-exit_xon_mode	rmxon	RX	T{
-turn off xon/xoff handshaking
-T}
-fixed_pause	pause	PA	T{
-pause for 2-3 seconds
-T}
-flash_hook	hook	fh	T{
-flash switch hook
-T}
-flash_screen	flash	vb	T{
-visible bell (may not move cursor)
-T}
-form_feed	ff	ff	T{
-hardcopy terminal page eject (P*)
-T}
-from_status_line	fsl	fs	T{
-return from status line
-T}
-goto_window	wingo	WG	T{
-go to window #1
-T}
-hangup	hup	HU	T{
-hang-up phone
-T}
-init_1string	is1	i1	T{
-initialization string
-T}
-init_2string	is2	is	T{
-initialization string
-T}
-init_3string	is3	i3	T{
-initialization string
-T}
-init_file	if	if	T{
-name of initialization file
-T}
-init_prog	iprog	iP	T{
-path name of program for initialization
-T}
-initialize_color	initc	Ic	T{
-initialize color #1 to (#2,#3,#4)
-T}
-initialize_pair	initp	Ip	T{
-Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7)
-T}
-insert_character	ich1	ic	T{
-insert character (P)
-T}
-insert_line	il1	al	T{
-insert line (P*)
-T}
-insert_padding	ip	ip	T{
-insert padding after inserted character
-T}
-key_a1	ka1	K1	T{
-upper left of keypad
-T}
-key_a3	ka3	K3	T{
-upper right of keypad
-T}
-key_b2	kb2	K2	T{
-center of keypad
-T}
-key_backspace	kbs	kb	T{
-backspace key
-T}
-key_beg	kbeg	@1	T{
-begin key
-T}
-key_btab	kcbt	kB	T{
-back-tab key
-T}
-key_c1	kc1	K4	T{
-lower left of keypad
-T}
-key_c3	kc3	K5	T{
-lower right of keypad
-T}
-key_cancel	kcan	@2	T{
-cancel key
-T}
-key_catab	ktbc	ka	T{
-clear-all-tabs key
-T}
-key_clear	kclr	kC	T{
-clear-screen or erase key
-T}
-key_close	kclo	@3	T{
-close key
-T}
-key_command	kcmd	@4	T{
-command key
-T}
-key_copy	kcpy	@5	T{
-copy key
-T}
-key_create	kcrt	@6	T{
-create key
-T}
-key_ctab	kctab	kt	T{
-clear-tab key
-T}
-key_dc	kdch1	kD	T{
-delete-character key
-T}
-key_dl	kdl1	kL	T{
-delete-line key
-T}
-key_down	kcud1	kd	T{
-down-arrow key
-T}
-key_eic	krmir	kM	T{
-sent by rmir or smir in insert mode
-T}
-key_end	kend	@7	T{
-end key
-T}
-key_enter	kent	@8	T{
-enter/send key
-T}
-key_eol	kel	kE	T{
-clear-to-end-of-line key
-T}
-key_eos	ked	kS	T{
-clear-to-end-of-screen key
-T}
-key_exit	kext	@9	T{
-exit key
-T}
-key_f0	kf0	k0	T{
-F0 function key
-T}
-key_f1	kf1	k1	T{
-F1 function key
-T}
-key_f10	kf10	k;	T{
-F10 function key
-T}
-key_f11	kf11	F1	T{
-F11 function key
-T}
-key_f12	kf12	F2	T{
-F12 function key
-T}
-key_f13	kf13	F3	T{
-F13 function key
-T}
-key_f14	kf14	F4	T{
-F14 function key
-T}
-key_f15	kf15	F5	T{
-F15 function key
-T}
-key_f16	kf16	F6	T{
-F16 function key
-T}
-key_f17	kf17	F7	T{
-F17 function key
-T}
-key_f18	kf18	F8	T{
-F18 function key
-T}
-key_f19	kf19	F9	T{
-F19 function key
-T}
-key_f2	kf2	k2	T{
-F2 function key
-T}
-key_f20	kf20	FA	T{
-F20 function key
-T}
-key_f21	kf21	FB	T{
-F21 function key
-T}
-key_f22	kf22	FC	T{
-F22 function key
-T}
-key_f23	kf23	FD	T{
-F23 function key
-T}
-key_f24	kf24	FE	T{
-F24 function key
-T}
-key_f25	kf25	FF	T{
-F25 function key
-T}
-key_f26	kf26	FG	T{
-F26 function key
-T}
-key_f27	kf27	FH	T{
-F27 function key
-T}
-key_f28	kf28	FI	T{
-F28 function key
-T}
-key_f29	kf29	FJ	T{
-F29 function key
-T}
-key_f3	kf3	k3	T{
-F3 function key
-T}
-key_f30	kf30	FK	T{
-F30 function key
-T}
-key_f31	kf31	FL	T{
-F31 function key
-T}
-key_f32	kf32	FM	T{
-F32 function key
-T}
-key_f33	kf33	FN	T{
-F33 function key
-T}
-key_f34	kf34	FO	T{
-F34 function key
-T}
-key_f35	kf35	FP	T{
-F35 function key
-T}
-key_f36	kf36	FQ	T{
-F36 function key
-T}
-key_f37	kf37	FR	T{
-F37 function key
-T}
-key_f38	kf38	FS	T{
-F38 function key
-T}
-key_f39	kf39	FT	T{
-F39 function key
-T}
-key_f4	kf4	k4	T{
-F4 function key
-T}
-key_f40	kf40	FU	T{
-F40 function key
-T}
-key_f41	kf41	FV	T{
-F41 function key
-T}
-key_f42	kf42	FW	T{
-F42 function key
-T}
-key_f43	kf43	FX	T{
-F43 function key
-T}
-key_f44	kf44	FY	T{
-F44 function key
-T}
-key_f45	kf45	FZ	T{
-F45 function key
-T}
-key_f46	kf46	Fa	T{
-F46 function key
-T}
-key_f47	kf47	Fb	T{
-F47 function key
-T}
-key_f48	kf48	Fc	T{
-F48 function key
-T}
-key_f49	kf49	Fd	T{
-F49 function key
-T}
-key_f5	kf5	k5	T{
-F5 function key
-T}
-key_f50	kf50	Fe	T{
-F50 function key
-T}
-key_f51	kf51	Ff	T{
-F51 function key
-T}
-key_f52	kf52	Fg	T{
-F52 function key
-T}
-key_f53	kf53	Fh	T{
-F53 function key
-T}
-key_f54	kf54	Fi	T{
-F54 function key
-T}
-key_f55	kf55	Fj	T{
-F55 function key
-T}
-key_f56	kf56	Fk	T{
-F56 function key
-T}
-key_f57	kf57	Fl	T{
-F57 function key
-T}
-key_f58	kf58	Fm	T{
-F58 function key
-T}
-key_f59	kf59	Fn	T{
-F59 function key
-T}
-key_f6	kf6	k6	T{
-F6 function key
-T}
-key_f60	kf60	Fo	T{
-F60 function key
-T}
-key_f61	kf61	Fp	T{
-F61 function key
-T}
-key_f62	kf62	Fq	T{
-F62 function key
-T}
-key_f63	kf63	Fr	T{
-F63 function key
-T}
-key_f7	kf7	k7	T{
-F7 function key
-T}
-key_f8	kf8	k8	T{
-F8 function key
-T}
-key_f9	kf9	k9	T{
-F9 function key
-T}
-key_find	kfnd	@0	T{
-find key
-T}
-key_help	khlp	%1	T{
-help key
-T}
-key_home	khome	kh	T{
-home key
-T}
-key_ic	kich1	kI	T{
-insert-character key
-T}
-key_il	kil1	kA	T{
-insert-line key
-T}
-key_left	kcub1	kl	T{
-left-arrow key
-T}
-key_ll	kll	kH	T{
-lower-left key (home down)
-T}
-key_mark	kmrk	%2	T{
-mark key
-T}
-key_message	kmsg	%3	T{
-message key
-T}
-key_move	kmov	%4	T{
-move key
-T}
-key_next	knxt	%5	T{
-next key
-T}
-key_npage	knp	kN	T{
-next-page key
-T}
-key_open	kopn	%6	T{
-open key
-T}
-key_options	kopt	%7	T{
-options key
-T}
-key_ppage	kpp	kP	T{
-previous-page key
-T}
-key_previous	kprv	%8	T{
-previous key
-T}
-key_print	kprt	%9	T{
-print key
-T}
-key_redo	krdo	%0	T{
-redo key
-T}
-key_reference	kref	&1	T{
-reference key
-T}
-key_refresh	krfr	&2	T{
-refresh key
-T}
-key_replace	krpl	&3	T{
-replace key
-T}
-key_restart	krst	&4	T{
-restart key
-T}
-key_resume	kres	&5	T{
-resume key
-T}
-key_right	kcuf1	kr	T{
-right-arrow key
-T}
-key_save	ksav	&6	T{
-save key
-T}
-key_sbeg	kBEG	&9	T{
-shifted begin key
-T}
-key_scancel	kCAN	&0	T{
-shifted cancel key
-T}
-key_scommand	kCMD	*1	T{
-shifted command key
-T}
-key_scopy	kCPY	*2	T{
-shifted copy key
-T}
-key_screate	kCRT	*3	T{
-shifted create key
-T}
-key_sdc	kDC	*4	T{
-shifted delete-character key
-T}
-key_sdl	kDL	*5	T{
-shifted delete-line key
-T}
-key_select	kslt	*6	T{
-select key
-T}
-key_send	kEND	*7	T{
-shifted end key
-T}
-key_seol	kEOL	*8	T{
-shifted clear-to-end-of-line key
-T}
-key_sexit	kEXT	*9	T{
-shifted exit key
-T}
-key_sf	kind	kF	T{
-scroll-forward key
-T}
-key_sfind	kFND	*0	T{
-shifted find key
-T}
-key_shelp	kHLP	#1	T{
-shifted help key
-T}
-key_shome	kHOM	#2	T{
-shifted home key
-T}
-key_sic	kIC	#3	T{
-shifted insert-character key
-T}
-key_sleft	kLFT	#4	T{
-shifted left-arrow key
-T}
-key_smessage	kMSG	%a	T{
-shifted message key
-T}
-key_smove	kMOV	%b	T{
-shifted move key
-T}
-key_snext	kNXT	%c	T{
-shifted next key
-T}
-key_soptions	kOPT	%d	T{
-shifted options key
-T}
-key_sprevious	kPRV	%e	T{
-shifted previous key
-T}
-key_sprint	kPRT	%f	T{
-shifted print key
-T}
-key_sr	kri	kR	T{
-scroll-backward key
-T}
-key_sredo	kRDO	%g	T{
-shifted redo key
-T}
-key_sreplace	kRPL	%h	T{
-shifted replace key
-T}
-key_sright	kRIT	%i	T{
-shifted right-arrow key
-T}
-key_srsume	kRES	%j	T{
-shifted resume key
-T}
-key_ssave	kSAV	!1	T{
-shifted save key
-T}
-key_ssuspend	kSPD	!2	T{
-shifted suspend key
-T}
-key_stab	khts	kT	T{
-set-tab key
-T}
-key_sundo	kUND	!3	T{
-shifted undo key
-T}
-key_suspend	kspd	&7	T{
-suspend key
-T}
-key_undo	kund	&8	T{
-undo key
-T}
-key_up	kcuu1	ku	T{
-up-arrow key
-T}
-keypad_local	rmkx	ke	T{
-leave 'keyboard_transmit' mode
-T}
-keypad_xmit	smkx	ks	T{
-enter 'keyboard_transmit' mode
-T}
-lab_f0	lf0	l0	T{
-label on function key f0 if not f0
-T}
-lab_f1	lf1	l1	T{
-label on function key f1 if not f1
-T}
-lab_f10	lf10	la	T{
-label on function key f10 if not f10
-T}
-lab_f2	lf2	l2	T{
-label on function key f2 if not f2
-T}
-lab_f3	lf3	l3	T{
-label on function key f3 if not f3
-T}
-lab_f4	lf4	l4	T{
-label on function key f4 if not f4
-T}
-lab_f5	lf5	l5	T{
-label on function key f5 if not f5
-T}
-lab_f6	lf6	l6	T{
-label on function key f6 if not f6
-T}
-lab_f7	lf7	l7	T{
-label on function key f7 if not f7
-T}
-lab_f8	lf8	l8	T{
-label on function key f8 if not f8
-T}
-lab_f9	lf9	l9	T{
-label on function key f9 if not f9
-T}
-label_format	fln	Lf	T{
-label format
-T}
-label_off	rmln	LF	T{
-turn off soft labels
-T}
-label_on	smln	LO	T{
-turn on soft labels
-T}
-meta_off	rmm	mo	T{
-turn off meta mode
-T}
-meta_on	smm	mm	T{
-turn on meta mode (8th-bit on)
-T}
-micro_column_address	mhpa	ZY	T{
-Like column_address in micro mode
-T}
-micro_down	mcud1	ZZ	T{
-Like cursor_down in micro mode
-T}
-micro_left	mcub1	Za	T{
-Like cursor_left in micro mode
-T}
-micro_right	mcuf1	Zb	T{
-Like cursor_right in micro mode
-T}
-micro_row_address	mvpa	Zc	T{
-Like row_address #1 in micro mode
-T}
-micro_up	mcuu1	Zd	T{
-Like cursor_up in micro mode
-T}
-newline	nel	nw	T{
-newline (behave like cr followed by lf)
-T}
-order_of_pins	porder	Ze	T{
-Match software bits to print-head pins
-T}
-orig_colors	oc	oc	T{
-Set all color pairs to the original ones
-T}
-orig_pair	op	op	T{
-Set default pair to its original value
-T}
-pad_char	pad	pc	T{
-padding char (instead of null)
-T}
-parm_dch	dch	DC	T{
-delete #1 characters (P*)
-T}
-parm_delete_line	dl	DL	T{
-delete #1 lines (P*)
-T}
-parm_down_cursor	cud	DO	T{
-down #1 lines (P*)
-T}
-parm_down_micro	mcud	Zf	T{
-Like parm_down_cursor in micro mode
-T}
-parm_ich	ich	IC	T{
-insert #1 characters (P*)
-T}
-parm_index	indn	SF	T{
-scroll forward #1 lines (P)
-T}
-parm_insert_line	il	AL	T{
-insert #1 lines (P*)
-T}
-parm_left_cursor	cub	LE	T{
-move #1 characters to the left (P)
-T}
-parm_left_micro	mcub	Zg	T{
-Like parm_left_cursor in micro mode
-T}
-parm_right_cursor	cuf	RI	T{
-move #1 characters to the right (P*)
-T}
-parm_right_micro	mcuf	Zh	T{
-Like parm_right_cursor in micro mode
-T}
-parm_rindex	rin	SR	T{
-scroll back #1 lines (P)
-T}
-parm_up_cursor	cuu	UP	T{
-up #1 lines (P*)
-T}
-parm_up_micro	mcuu	Zi	T{
-Like parm_up_cursor in micro mode
-T}
-pkey_key	pfkey	pk	T{
-program function key #1 to type string #2
-T}
-pkey_local	pfloc	pl	T{
-program function key #1 to execute string #2
-T}
-pkey_xmit	pfx	px	T{
-program function key #1 to transmit string #2
-T}
-plab_norm	pln	pn	T{
-program label #1 to show string #2
-T}
-print_screen	mc0	ps	T{
-print contents of screen
-T}
-prtr_non	mc5p	pO	T{
-turn on printer for #1 bytes
-T}
-prtr_off	mc4	pf	T{
-turn off printer
-T}
-prtr_on	mc5	po	T{
-turn on printer
-T}
-pulse	pulse	PU	T{
-select pulse dialing
-T}
-quick_dial	qdial	QD	T{
-dial number #1 without checking
-T}
-remove_clock	rmclk	RC	T{
-remove clock
-T}
-repeat_char	rep	rp	T{
-repeat char #1 #2 times (P*)
-T}
-req_for_input	rfi	RF	T{
-send next input char (for ptys)
-T}
-reset_1string	rs1	r1	T{
-reset string
-T}
-reset_2string	rs2	r2	T{
-reset string
-T}
-reset_3string	rs3	r3	T{
-reset string
-T}
-reset_file	rf	rf	T{
-name of reset file
-T}
-restore_cursor	rc	rc	T{
-restore cursor to position of last save_cursor
-T}
-row_address	vpa	cv	T{
-vertical position #1 absolute (P)
-T}
-save_cursor	sc	sc	T{
-save current cursor position (P)
-T}
-scroll_forward	ind	sf	T{
-scroll text up (P)
-T}
-scroll_reverse	ri	sr	T{
-scroll text down (P)
-T}
-select_char_set	scs	Zj	T{
-Select character set, #1
-T}
-set_attributes	sgr	sa	T{
-define video attributes #1-#9 (PG9)
-T}
-set_background	setb	Sb	T{
-Set background color #1
-T}
-set_bottom_margin	smgb	Zk	T{
-Set bottom margin at current line
-T}
-set_bottom_margin_parm	smgbp	Zl	T{
-Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
-T}
-set_clock	sclk	SC	T{
-set clock, #1 hrs #2 mins #3 secs
-T}
-set_color_pair	scp	sp	T{
-Set current color pair to #1
-T}
-set_foreground	setf	Sf	T{
-Set foreground color #1
-T}
-set_left_margin	smgl	ML	T{
-set left soft margin at current column.	 See smgl. (ML is not in BSD termcap).
-T}
-set_left_margin_parm	smglp	Zm	T{
-Set left (right) margin at column #1
-T}
-set_right_margin	smgr	MR	T{
-set right soft margin at current column
-T}
-set_right_margin_parm	smgrp	Zn	T{
-Set right margin at column #1
-T}
-set_tab	hts	st	T{
-set a tab in every row, current columns
-T}
-set_top_margin	smgt	Zo	T{
-Set top margin at current line
-T}
-set_top_margin_parm	smgtp	Zp	T{
-Set top (bottom) margin at row #1
-T}
-set_window	wind	wi	T{
-current window is lines #1-#2 cols #3-#4
-T}
-start_bit_image	sbim	Zq	T{
-Start printing bit image graphics
-T}
-start_char_set_def	scsd	Zr	T{
-Start character set definition #1, with #2 characters in the set
-T}
-stop_bit_image	rbim	Zs	T{
-Stop printing bit image graphics
-T}
-stop_char_set_def	rcsd	Zt	T{
-End definition of character set #1
-T}
-subscript_characters	subcs	Zu	T{
-List of subscriptable characters
-T}
-superscript_characters	supcs	Zv	T{
-List of superscriptable characters
-T}
-tab	ht	ta	T{
-tab to next 8-space hardware tab stop
-T}
-these_cause_cr	docr	Zw	T{
-Printing any of these characters causes CR
-T}
-to_status_line	tsl	ts	T{
-move to status line, column #1
-T}
-tone	tone	TO	T{
-select touch tone dialing
-T}
-underline_char	uc	uc	T{
-underline char and move past it
-T}
-up_half_line	hu	hu	T{
-half a line up
-T}
-user0	u0	u0	T{
-User string #0
-T}
-user1	u1	u1	T{
-User string #1
-T}
-user2	u2	u2	T{
-User string #2
-T}
-user3	u3	u3	T{
-User string #3
-T}
-user4	u4	u4	T{
-User string #4
-T}
-user5	u5	u5	T{
-User string #5
-T}
-user6	u6	u6	T{
-User string #6
-T}
-user7	u7	u7	T{
-User string #7
-T}
-user8	u8	u8	T{
-User string #8
-T}
-user9	u9	u9	T{
-User string #9
-T}
-wait_tone	wait	WA	T{
-wait for dial-tone
-T}
-xoff_character	xoffc	XF	T{
-XOFF character
-T}
-xon_character	xonc	XN	T{
-XON character
-T}
-zero_motion	zerom	Zx	T{
-No motion for subsequent character
-T}
-.TE
-.ad
-
-The following string capabilities are present in the SVr4.0 term structure,
-but were originally not documented in the man page.
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw18.
-\fBVariable	Cap-	TCap	Description\fR
-\fBString	name	Code\fR
-alt_scancode_esc	scesa	S8	T{
-Alternate escape for scancode emulation
-T}
-bit_image_carriage_return	bicr	Yv	T{
-Move to beginning of same row
-T}
-bit_image_newline	binel	Zz	T{
-Move to next row of the bit image
-T}
-bit_image_repeat	birep	Xy	T{
-Repeat bit image cell #1 #2 times
-T}
-char_set_names	csnm	Zy	T{
-Produce #1'th item from list of character set names
-T}
-code_set_init	csin	ci	T{
-Init sequence for multiple codesets
-T}
-color_names	colornm	Yw	T{
-Give name for color #1
-T}
-define_bit_image_region	defbi	Yx	T{
-Define rectangualar bit image region
-T}
-device_type	devt	dv	T{
-Indicate language/codeset support
-T}
-display_pc_char	dispc	S1	T{
-Display PC character #1
-T}
-end_bit_image_region	endbi	Yy	T{
-End a bit-image region
-T}
-enter_pc_charset_mode	smpch	S2	T{
-Enter PC character display mode
-T}
-enter_scancode_mode	smsc	S4	T{
-Enter PC scancode mode
-T}
-exit_pc_charset_mode	rmpch	S3	T{
-Exit PC character display mode
-T}
-exit_scancode_mode	rmsc	S5	T{
-Exit PC scancode mode
-T}
-get_mouse	getm	Gm	T{
-Curses should get button events, parameter #1 not documented.
-T}
-key_mouse	kmous	Km	T{
-Mouse event has occurred
-T}
-mouse_info	minfo	Mi	T{
-Mouse status information
-T}
-pc_term_options	pctrm	S6	T{
-PC terminal options
-T}
-pkey_plab	pfxl	xl	T{
-Program function key #1 to type string #2 and show string #3
-T}
-req_mouse_pos	reqmp	RQ	T{
-Request mouse position
-T}
-scancode_escape	scesc	S7	T{
-Escape for scancode emulation
-T}
-set0_des_seq	s0ds	s0	T{
-Shift to codeset 0 (EUC set 0, ASCII)
-T}
-set1_des_seq	s1ds	s1	T{
-Shift to codeset 1
-T}
-set2_des_seq	s2ds	s2	T{
-Shift to codeset 2
-T}
-set3_des_seq	s3ds	s3	T{
-Shift to codeset 3
-T}
-set_a_background	setab	AB	T{
-Set background color to #1, using ANSI escape
-T}
-set_a_foreground	setaf	AF	T{
-Set foreground color to #1, using ANSI escape
-T}
-set_color_band	setcolor	Yz	T{
-Change to ribbon color #1
-T}
-set_lr_margin	smglr	ML	T{
-Set both left and right margins to #1, #2.  (ML is not in BSD termcap).
-T}
-set_page_length	slines	YZ	T{
-Set page length to #1 lines
-T}
-set_tb_margin	smgtb	MT	T{
-Sets both top and bottom margins to #1, #2
-T}
-.TE
-.ad
-
-.in .8i
-The XSI Curses standard added these.  They are some post-4.1
-versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
-The \fBncurses\fR termcap names for them are invented; according to the
-XSI Curses standard, they have no termcap names.  If your compiled terminfo
-entries use these, they may not be binary-compatible with System V terminfo
-entries after SVr4.1; beware!
-
-.na
-.TS H
-center expand;
-c l l c
-c l l c
-lw25 lw6 lw2 lw20.
-\fBVariable	Cap-	TCap	Description\fR
-\fBString	name	Code\fR
-enter_horizontal_hl_mode	ehhlm	Xh	T{
-Enter horizontal highlight mode
-T}
-enter_left_hl_mode	elhlm	Xl	T{
-Enter left highlight mode
-T}
-enter_low_hl_mode	elohlm	Xo	T{
-Enter low highlight mode
-T}
-enter_right_hl_mode	erhlm	Xr	T{
-Enter right highlight mode
-T}
-enter_top_hl_mode	ethlm	Xt	T{
-Enter top highlight mode
-T}
-enter_vertical_hl_mode	evhlm	Xv	T{
-Enter vertical highlight mode
-T}
-set_a_attributes	sgr1	sA	T{
-Define second set of video attributes #1-#6
-T}
-set_pglen_inch	slength	sL	T{
-YI Set page length to #1 hundredth of an inch
-T}
-.TE
-.ad
-.\" $Id: terminfo.tail,v 1.49 2008/02/16 20:57:43 tom Exp $
-.\" Beginning of terminfo.tail file
-.\" This file is part of ncurses.
-.\" See "terminfo.head" for copyright.
-.ps +1
-.
-.SS A Sample Entry
-.
-The following entry, describing an ANSI-standard terminal, is representative
-of what a \fBterminfo\fR entry for a modern terminal typically looks like.
-.PP
-.nf
-.in -2
-.ta .3i
-.ft CW
-\s-2ansi|ansi/pc-term compatible with color,
-        mc5i,
-        colors#8, ncv#3, pairs#64,
-        cub=\\E[%p1%dD, cud=\\E[%p1%dB, cuf=\\E[%p1%dC,
-        cuu=\\E[%p1%dA, dch=\\E[%p1%dP, dl=\\E[%p1%dM,
-        ech=\\E[%p1%dX, el1=\\E[1K, hpa=\\E[%p1%dG, ht=\\E[I,
-        ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, .indn=\\E[%p1%dT,
-        kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, kcud1=\\E[B,
-        kcuf1=\\E[C, kcuu1=\\E[A, kf1=\\E[M, kf10=\\E[V,
-        kf11=\\E[W, kf12=\\E[X, kf2=\\E[N, kf3=\\E[O, kf4=\\E[P,
-        kf5=\\E[Q, kf6=\\E[R, kf7=\\E[S, kf8=\\E[T, kf9=\\E[U,
-        kich1=\\E[L, mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S,
-        op=\\E[37;40m, rep=%p1%c\\E[%p2%{1}%-%db,
-        rin=\\E[%p1%dT, s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B,
-        s3ds=\\E+B, setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
-        setb=\\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-        setf=\\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-        sgr=\\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
-        sgr0=\\E[0;10m, tbc=\\E[2g, u6=\\E[%d;%dR, u7=\\E[6n,
-        u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%p1%dd,\s+2
-.in +2
-.fi
-.ft R
-.PP
-Entries may continue onto multiple lines by placing white space at
-the beginning of each line except the first.
-Comments may be included on lines beginning with ``#''.
-Capabilities in
-.I terminfo
-are of three types:
-Boolean capabilities which indicate that the terminal has
-some particular feature, numeric capabilities giving the size of the terminal
-or the size of particular delays, and string
-capabilities, which give a sequence which can be used to perform particular
-terminal operations.
-.PP
-.SS Types of Capabilities
-.PP
-All capabilities have names.
-For instance, the fact that
-ANSI-standard terminals have
-.I "automatic margins"
-(i.e., an automatic return and line-feed
-when the end of a line is reached) is indicated by the capability \fBam\fR.
-Hence the description of ansi includes \fBam\fR.
-Numeric capabilities are followed by the character `#' and then a positive value.
-Thus \fBcols\fR, which indicates the number of columns the terminal has,
-gives the value `80' for ansi.
-Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
-using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
-.PP
-Finally, string valued capabilities, such as \fBel\fR (clear to end of line
-sequence) are given by the two-character code, an `=', and then a string
-ending at the next following `,'.
-.PP
-A number of escape sequences are provided in the string valued capabilities
-for easy encoding of characters there.
-Both \fB\eE\fR and \fB\ee\fR
-map to an \s-1ESCAPE\s0 character,
-\fB^x\fR maps to a control-x for any appropriate x, and the sequences
-\fB\en \el \er \et \eb \ef \es\fR give
-a newline, line-feed, return, tab, backspace, form-feed, and space.
-Other escapes include \fB\e^\fR for \fB^\fR,
-\fB\e\e\fR for \fB\e\fR,
-\fB\e\fR, for comma,
-\fB\e:\fR for \fB:\fR,
-and \fB\e0\fR for null.
-(\fB\e0\fR will produce \e200, which does not terminate a string but behaves
-as a null character on most terminals, providing CS7 is specified.
-See stty(1).)
-Finally, characters may be given as three octal digits after a \fB\e\fR.
-.PP
-A delay in milliseconds may appear anywhere in a string capability, enclosed in
-$<..> brackets, as in \fBel\fP=\eEK$<5>, and padding characters are supplied by
-.I tputs
-to provide this delay.
-The delay must be a number with at most one decimal
-place of precision; it may be followed by suffixes `*' or '/' or both.
-A `*'
-indicates that the padding required is proportional to the number of lines
-affected by the operation, and the amount given is the per-affected-unit
-padding required.
-(In the case of insert character, the factor is still the
-number of
-.IR lines
-affected.)  Normally, padding is advisory if the device has the \fBxon\fR
-capability; it is used for cost computation but does not trigger delays.
-A `/'
-suffix indicates that the padding is mandatory and forces a delay of the given
-number of milliseconds even on devices for which \fBxon\fR is present to
-indicate flow control.
-.PP
-Sometimes individual capabilities must be commented out.
-To do this, put a period before the capability name.
-For example, see the second
-.B ind
-in the example above.
-.br
-.ne 5
-.PP
-.SS Fetching Compiled Descriptions
-.PP
-If the environment variable TERMINFO is set, it is interpreted as the pathname
-of a directory containing the compiled description you are working on.
-Only
-that directory is searched.
-.PP
-If TERMINFO is not set, the \fBncurses\fR version of the terminfo reader code
-will instead look in the directory \fB$HOME/.terminfo\fR
-for a compiled description.
-If it fails to find one there, and the environment variable TERMINFO_DIRS is
-set, it will interpret the contents of that variable as a list of colon-
-separated directories to be searched (an empty entry is interpreted as a
-command to search \fI\*d\fR).
-If no description is found in any of the
-TERMINFO_DIRS directories, the fetch fails.
-.PP
-If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will be the
-system terminfo directory, \fI\*d\fR.
-.PP
-(Neither the \fB$HOME/.terminfo\fR lookups nor TERMINFO_DIRS extensions are
-supported under stock System V terminfo/curses.)
-.PP
-.SS Preparing Descriptions
-.PP
-We now outline how to prepare descriptions of terminals.
-The most effective way to prepare a terminal description is by imitating
-the description of a similar terminal in
-.I terminfo
-and to build up a description gradually, using partial descriptions
-with
-.I vi
-or some other screen-oriented program to check that they are correct.
-Be aware that a very unusual terminal may expose deficiencies in
-the ability of the
-.I terminfo
-file to describe it
-or bugs in the screen-handling code of the test program.
-.PP
-To get the padding for insert line right (if the terminal manufacturer
-did not document it) a severe test is to edit a large file at 9600 baud,
-delete 16 or so lines from the middle of the screen, then hit the `u'
-key several times quickly.
-If the terminal messes up, more padding is usually needed.
-A similar test can be used for insert character.
-.PP
-.SS Basic Capabilities
-.PP
-The number of columns on each line for the terminal is given by the
-\fBcols\fR numeric capability.
-If the terminal is a \s-1CRT\s0, then the
-number of lines on the screen is given by the \fBlines\fR capability.
-If the terminal wraps around to the beginning of the next line when
-it reaches the right margin, then it should have the \fBam\fR capability.
-If the terminal can clear its screen, leaving the cursor in the home
-position, then this is given by the \fBclear\fR string capability.
-If the terminal overstrikes
-(rather than clearing a position when a character is struck over)
-then it should have the \fBos\fR capability.
-If the terminal is a printing terminal, with no soft copy unit,
-give it both
-.B hc
-and
-.BR os .
-.RB ( os
-applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
-series, as well as hard copy and APL terminals.)
-If there is a code to move the cursor to the left edge of the current
-row, give this as
-.BR cr .
-(Normally this will be carriage return, control M.)
-If there is a code to produce an audible signal (bell, beep, etc)
-give this as
-.BR bel .
-.PP
-If there is a code to move the cursor one position to the left
-(such as backspace) that capability should be given as
-.BR cub1 .
-Similarly, codes to move to the right, up, and down should be
-given as
-.BR cuf1 ,
-.BR cuu1 ,
-and
-.BR cud1 .
-These local cursor motions should not alter the text they pass over,
-for example, you would not normally use `\fBcuf1\fP=\ ' because the
-space would erase the character moved over.
-.PP
-A very important point here is that the local cursor motions encoded
-in
-.I terminfo
-are undefined at the left and top edges of a \s-1CRT\s0 terminal.
-Programs should never attempt to backspace around the left edge,
-unless
-.B bw
-is given,
-and never attempt to go up locally off the top.
-In order to scroll text up, a program will go to the bottom left corner
-of the screen and send the
-.B ind
-(index) string.
-.PP
-To scroll text down, a program goes to the top left corner
-of the screen and sends the
-.B ri
-(reverse index) string.
-The strings
-.B ind
-and
-.B ri
-are undefined when not on their respective corners of the screen.
-.PP
-Parameterized versions of the scrolling sequences are
-.B indn
-and
-.B rin
-which have the same semantics as
-.B ind
-and
-.B ri
-except that they take one parameter, and scroll that many lines.
-They are also undefined except at the appropriate edge of the screen.
-.PP
-The \fBam\fR capability tells whether the cursor sticks at the right
-edge of the screen when text is output, but this does not necessarily
-apply to a
-.B cuf1
-from the last column.
-The only local motion which is defined from the left edge is if
-.B bw
-is given, then a
-.B cub1
-from the left edge will move to the right edge of the previous row.
-If
-.B bw
-is not given, the effect is undefined.
-This is useful for drawing a box around the edge of the screen, for example.
-If the terminal has switch selectable automatic margins,
-the
-.I terminfo
-file usually assumes that this is on; i.e., \fBam\fR.
-If the terminal has a command which moves to the first column of the next
-line, that command can be given as
-.B nel
-(newline).
-It does not matter if the command clears the remainder of the current line,
-so if the terminal has no
-.B cr
-and
-.B lf
-it may still be possible to craft a working
-.B nel
-out of one or both of them.
-.PP
-These capabilities suffice to describe hard-copy and \*(lqglass-tty\*(rq terminals.
-Thus the model 33 teletype is described as
-.PP
-.DT
-.nf
-.ft CW
-.\".in -2
-\s-133\||\|tty33\||\|tty\||\|model 33 teletype,
-	bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
-.\".in +2
-.ft R
-.PP
-while the Lear Siegler \s-1ADM-3\s0 is described as
-.PP
-.DT
-.nf
-.ft CW
-.\".in -2
-\s-1adm3\||\|3\||\|lsi adm3,
-	am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
-	ind=^J, lines#24,\s+1
-.\".in +2
-.ft R
-.fi
-.PP
-.SS Parameterized Strings
-.PP
-Cursor addressing and other strings requiring parameters
-in the terminal are described by a
-parameterized string capability, with
-.IR printf (3)
-like escapes \fB%x\fR in it.
-For example, to address the cursor, the
-.B cup
-capability is given, using two parameters:
-the row and column to address to.
-(Rows and columns are numbered from zero and refer to the
-physical screen visible to the user, not to any unseen memory.)
-If the terminal has memory relative cursor addressing,
-that can be indicated by
-.BR mrcup .
-.PP
-The parameter mechanism uses a stack and special \fB%\fP codes
-to manipulate it.
-Typically a sequence will push one of the
-parameters onto the stack and then print it in some format.
-Print (e.g., "%d") is a special case.
-Other operations, including "%t" pop their operand from the stack.
-It is noted that more complex operations are often necessary,
-e.g., in the \fBsgr\fP string.
-.PP
-The \fB%\fR encodings have the following meanings:
-.PP
-.TP 5
-\s-1%%
-outputs `%'
-.TP
-%\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
-as in \fBprintf\fP, flags are [-+#] and space.
-Use a `:' to allow the next character to be a `-' flag,
-avoiding interpreting "%-" as an operator.
-.TP
-%c
-print pop() like %c in \fBprintf\fP
-.TP
-%s
-print pop() like %s in \fBprintf\fP
-.TP
-%p[1-9]
-push \fIi\fP'th parameter
-.TP
-%P[a-z]
-set dynamic variable [a-z] to pop()
-.TP
-%g[a-z]
-get dynamic variable [a-z] and push it
-.TP
-%P[A-Z]
-set static variable [a-z] to pop()
-.TP
-%g[A-Z]
-get static variable [a-z] and push it
-.IP
-The terms "static" and "dynamic" are misleading.
-Historically, these are simply two different sets of variables,
-whose values are not reset between calls to \fBtparm\fP.
-However, that fact is not documented in other implementations.
-Relying on it will adversely impact portability to other implementations.
-.TP
-%'\fIc\fP'
-char constant \fIc\fP
-.TP
-%{\fInn\fP}
-integer constant \fInn\fP
-.TP
-%l
-push strlen(pop)
-.TP
-%+ %- %* %/ %m
-arithmetic (%m is mod): push(pop() op pop())
-.TP
-%& %| %^
-bit operations (AND, OR and exclusive-OR): push(pop() op pop())
-.TP
-%= %> %<
-logical operations: push(pop() op pop())
-.TP
-%A, %O
-logical AND and OR operations (for conditionals)
-.TP
-%! %~
-unary operations (logical and bit complement): push(op pop())
-.TP
-%i
-add 1 to first two parameters (for ANSI terminals)
-.TP
-%? \fIexpr\fP %t \fIthenpart\fP %e \fIelsepart\fP %;
-This forms an if-then-else.
-The %e \fIelsepart\fP is optional.
-Usually the %? \fIexpr\fP part pushes a value onto the stack,
-and %t pops it from the stack, testing if it is nonzero (true).
-If it is zero (false), control passes to the %e (else) part.
-.IP
-It is possible to form else-if's a la Algol 68:
-.RS
-%? c\d1\u %t b\d1\u %e c\d2\u %t b\d2\u %e c\d3\u %t b\d3\u %e c\d4\u %t b\d4\u %e %;
-.RE
-.IP
-where c\di\u are conditions, b\di\u are bodies.
-.IP
-Use the \fB-f\fP option of \fBtic\fP or \fB@INFOCMP@\fP to see
-the structure of if-the-else's.
-Some strings, e.g., \fBsgr\fP can be very complicated when written
-on one line.
-The \fB-f\fP option splits the string into lines with the parts indented.
-.PP
-Binary operations are in postfix form with the operands in the usual order.
-That is, to get x-5 one would use "%gx%{5}%-".
-%P and %g variables are
-persistent across escape-string evaluations.
-.PP
-Consider the HP2645, which, to get to row 3 and column 12, needs
-to be sent \eE&a12c03Y padded for 6 milliseconds.
-Note that the order
-of the rows and columns is inverted here, and that the row and column
-are printed as two digits.
-Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq.
-.PP
-The Microterm \s-1ACT-IV\s0 needs the current row and column sent
-preceded by a \fB^T\fR, with the row and column simply encoded in binary,
-\*(lqcup=^T%p1%c%p2%c\*(rq.
-Terminals which use \*(lq%c\*(rq need to be able to
-backspace the cursor (\fBcub1\fR),
-and to move the cursor up one line on the screen (\fBcuu1\fR).
-This is necessary because it is not always safe to transmit \fB\en\fR
-\fB^D\fR and \fB\er\fR, as the system may change or discard them.
-(The library routines dealing with terminfo set tty modes so that
-tabs are never expanded, so \et is safe to send.
-This turns out to be essential for the Ann Arbor 4080.)
-.PP
-A final example is the \s-1LSI ADM\s0-3a, which uses row and column
-offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
-After sending `\eE=', this pushes the first parameter, pushes the
-ASCII value for a space (32), adds them (pushing the sum on the stack
-in place of the two previous values) and outputs that value as a character.
-Then the same is done for the second parameter.
-More complex arithmetic is possible using the stack.
-.PP
-.SS Cursor Motions
-.PP
-If the terminal has a fast way to home the cursor
-(to very upper left corner of screen) then this can be given as
-\fBhome\fR; similarly a fast way of getting to the lower left-hand corner
-can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
-from the home position,
-but a program should never do this itself (unless \fBll\fR does) because it
-can make no assumption about the effect of moving up from the home position.
-Note that the home position is the same as addressing to (0,0):
-to the top left corner of the screen, not of memory.
-(Thus, the \eEH sequence on HP terminals cannot be used for
-.BR home .)
-.PP
-If the terminal has row or column absolute cursor addressing,
-these can be given as single parameter capabilities
-.B hpa
-(horizontal position absolute)
-and
-.B vpa
-(vertical position absolute).
-Sometimes these are shorter than the more general two parameter
-sequence (as with the hp2645) and can be used in preference to
-.BR cup .
-If there are parameterized local motions (e.g., move
-.I n
-spaces to the right) these can be given as
-.BR cud ,
-.BR cub ,
-.BR cuf ,
-and
-.BR cuu
-with a single parameter indicating how many spaces to move.
-These are primarily useful if the terminal does not have
-.BR cup ,
-such as the \s-1TEKTRONIX\s+1 4025.
-.PP
-If the terminal needs to be in a special mode when running
-a program that uses these capabilities,
-the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
-This arises, for example, from terminals like the Concept with more than
-one page of memory.
-If the terminal has only memory relative cursor addressing and not screen
-relative cursor addressing, a one screen-sized window must be fixed into
-the terminal for cursor addressing to work properly.
-This is also used for the \s-1TEKTRONIX\s+1 4025,
-where
-.B smcup
-sets the command character to be the one used by terminfo.
-If the \fBsmcup\fP sequence will not restore the screen after an
-\fBrmcup\fP sequence is output (to the state prior to outputting
-\fBrmcup\fP), specify \fBnrrmc\fP.
-.PP
-.SS Area Clears
-.PP
-If the terminal can clear from the current position to the end of the
-line, leaving the cursor where it is, this should be given as \fBel\fR.
-If the terminal can clear from the beginning of the line to the current
-position inclusive, leaving
-the cursor where it is, this should be given as \fBel1\fP.
-If the terminal can clear from the current position to the end of the
-display, then this should be given as \fBed\fR.
-\fBEd\fR is only defined from the first column of a line.
-(Thus, it can be simulated by a request to delete a large number of lines,
-if a true
-.B ed
-is not available.)
-.PP
-.SS Insert/delete line and vertical motions
-.PP
-If the terminal can open a new blank line before the line where the cursor
-is, this should be given as \fBil1\fR; this is done only from the first
-position of a line.
-The cursor must then appear on the newly blank line.
-If the terminal can delete the line which the cursor is on, then this
-should be given as \fBdl1\fR; this is done only from the first position on
-the line to be deleted.
-Versions of
-.B il1
-and
-.B dl1
-which take a single parameter and insert or delete that many lines can
-be given as
-.B il
-and
-.BR dl .
-.PP
-If the terminal has a settable scrolling region (like the vt100)
-the command to set this can be described with the
-.B csr
-capability, which takes two parameters:
-the top and bottom lines of the scrolling region.
-The cursor position is, alas, undefined after using this command.
-.PP
-It is possible to get the effect of insert or delete line using
-.B csr
-on a properly chosen region; the
-.B sc
-and
-.B rc
-(save and restore cursor) commands may be useful for ensuring that
-your synthesized insert/delete string does not move the cursor.
-(Note that the \fBncurses\fR(3X) library does this synthesis
-automatically, so you need not compose insert/delete strings for
-an entry with \fBcsr\fR).
-.PP
-Yet another way to construct insert and delete might be to use a combination of
-index with the memory-lock feature found on some terminals (like the HP-700/90
-series, which however also has insert/delete).
-.PP
-Inserting lines at the top or bottom of the screen can also be
-done using
-.B ri
-or
-.B ind
-on many terminals without a true insert/delete line,
-and is often faster even on terminals with those features.
-.PP
-The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling
-window is effectively a view port on a screen-sized canvas.
-To test for
-this capability, create a scrolling region in the middle of the screen,
-write something to the bottom line, move the cursor to the top of the region,
-and do \fBri\fR followed by \fBdl1\fR or \fBind\fR.
-If the data scrolled
-off the bottom of the region by the \fBri\fR re-appears, then scrolling
-is non-destructive.
-System V and XSI Curses expect that \fBind\fR, \fBri\fR,
-\fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their
-documentation cautions you not to define \fBcsr\fR unless this is true.
-This \fBcurses\fR implementation is more liberal and will do explicit erases
-after scrolling if \fBndstr\fR is defined.
-.PP
-If the terminal has the ability to define a window as part of
-memory, which all commands affect,
-it should be given as the parameterized string
-.BR wind .
-The four parameters are the starting and ending lines in memory
-and the starting and ending columns in memory, in that order.
-.PP
-If the terminal can retain display memory above, then the
-\fBda\fR capability should be given; if display memory can be retained
-below, then \fBdb\fR should be given.
-These indicate
-that deleting a line or scrolling may bring non-blank lines up from below
-or that scrolling back with \fBri\fR may bring down non-blank lines.
-.PP
-.SS Insert/Delete Character
-.PP
-There are two basic kinds of intelligent terminals with respect to
-insert/delete character which can be described using
-.I terminfo.
-The most common insert/delete character operations affect only the characters
-on the current line and shift characters off the end of the line rigidly.
-Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
-a distinction between typed and untyped blanks on the screen, shifting
-upon an insert or delete only to an untyped blank on the screen which is
-either eliminated, or expanded to two untyped blanks.
-You can determine the
-kind of terminal you have by clearing the screen and then typing
-text separated by cursor motions.
-Type \*(lqabc\ \ \ \ def\*(rq using local
-cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
-Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
-mode.
-If typing characters causes the rest of the line to shift
-rigidly and characters to fall off the end, then your terminal does
-not distinguish between blanks and untyped positions.
-If the \*(lqabc\*(rq
-shifts over to the \*(lqdef\*(rq which then move together around the end of the
-current line and onto the next as you insert, you have the second type of
-terminal, and should give the capability \fBin\fR, which stands for
-\*(lqinsert null\*(rq.
-While these are two logically separate attributes (one line versus multi-line
-insert mode, and special treatment of untyped spaces) we have seen no
-terminals whose insert mode cannot be described with the single attribute.
-.PP
-Terminfo can describe both terminals which have an insert mode, and terminals
-which send a simple sequence to open a blank position on the current line.
-Give as \fBsmir\fR the sequence to get into insert mode.
-Give as \fBrmir\fR the sequence to leave insert mode.
-Now give as \fBich1\fR any sequence needed to be sent just before sending
-the character to be inserted.
-Most terminals with a true insert mode
-will not give \fBich1\fR; terminals which send a sequence to open a screen
-position should give it here.
-.PP
-If your terminal has both, insert mode is usually preferable to \fBich1\fR.
-Technically, you should not give both unless the terminal actually requires
-both to be used in combination.
-Accordingly, some non-curses applications get
-confused if both are present; the symptom is doubled characters in an update
-using insert.
-This requirement is now rare; most \fBich\fR sequences do not
-require previous smir, and most smir insert modes do not require \fBich1\fR
-before each character.
-Therefore, the new \fBcurses\fR actually assumes this
-is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as
-appropriate (but not both).
-If you have to write an entry to be used under
-new curses for a terminal old enough to need both, include the
-\fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR.
-.PP
-If post insert padding is needed, give this as a number of milliseconds
-in \fBip\fR (a string option).
-Any other sequence which may need to be
-sent after an insert of a single character may also be given in \fBip\fR.
-If your terminal needs both to be placed into an `insert mode' and
-a special code to precede each inserted character, then both
-.BR smir / rmir
-and
-.B ich1
-can be given, and both will be used.
-The
-.B ich
-capability, with one parameter,
-.IR n ,
-will repeat the effects of
-.B ich1
-.I n
-times.
-.PP
-If padding is necessary between characters typed while not
-in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
-.PP
-It is occasionally necessary to move around while in insert mode
-to delete characters on the same line (e.g., if there is a tab after
-the insertion position).
-If your terminal allows motion while in
-insert mode you can give the capability \fBmir\fR to speed up inserting
-in this case.
-Omitting \fBmir\fR will affect only speed.
-Some terminals
-(notably Datamedia's) must not have \fBmir\fR because of the way their
-insert mode works.
-.PP
-Finally, you can specify
-.B dch1
-to delete a single character,
-.B dch
-with one parameter,
-.IR n ,
-to delete
-.I n characters,
-and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
-to enter and exit delete mode (any mode the terminal needs to be placed
-in for
-.B dch1
-to work).
-.PP
-A command to erase
-.I n
-characters (equivalent to outputting
-.I n
-blanks without moving the cursor)
-can be given as
-.B ech
-with one parameter.
-.PP
-.SS "Highlighting, Underlining, and Visible Bells"
-.PP
-If your terminal has one or more kinds of display attributes,
-these can be represented in a number of different ways.
-You should choose one display form as
-\f2standout mode\fR,
-representing a good, high contrast, easy-on-the-eyes,
-format for highlighting error messages and other attention getters.
-(If you have a choice, reverse video plus half-bright is good,
-or reverse video alone.)
-The sequences to enter and exit standout mode
-are given as \fBsmso\fR and \fBrmso\fR, respectively.
-If the code to change into or out of standout
-mode leaves one or even two blank spaces on the screen,
-as the TVI 912 and Teleray 1061 do,
-then \fBxmc\fR should be given to tell how many spaces are left.
-.PP
-Codes to begin underlining and end underlining can be given as \fBsmul\fR
-and \fBrmul\fR respectively.
-If the terminal has a code to underline the current character and move
-the cursor one space to the right,
-such as the Microterm Mime,
-this can be given as \fBuc\fR.
-.PP
-Other capabilities to enter various highlighting modes include
-.B blink
-(blinking)
-.B bold
-(bold or extra bright)
-.B dim
-(dim or half-bright)
-.B invis
-(blanking or invisible text)
-.B prot
-(protected)
-.B rev
-(reverse video)
-.B sgr0
-(turn off
-.I all
-attribute modes)
-.B smacs
-(enter alternate character set mode)
-and
-.B rmacs
-(exit alternate character set mode).
-Turning on any of these modes singly may or may not turn off other modes.
-.PP
-If there is a sequence to set arbitrary combinations of modes,
-this should be given as
-.B sgr
-(set attributes),
-taking 9 parameters.
-Each parameter is either 0 or nonzero, as the corresponding attribute is on or off.
-The 9 parameters are, in order:
-standout, underline, reverse, blink, dim, bold, blank, protect, alternate
-character set.
-Not all modes need be supported by
-.BR sgr ,
-only those for which corresponding separate attribute commands exist.
-.PP
-For example, the DEC vt220 supports most of the modes:
-.PP
-.TS
-center;
-l c c
-l c c
-lw28 lw6 lw2 lw20.
-\fBtparm parameter	attribute	escape sequence\fP
-
-none	none	\\E[0m
-p1	standout	\\E[0;1;7m
-p2	underline	\\E[0;4m
-p3	reverse	\\E[0;7m
-p4	blink	\\E[0;5m
-p5	dim	not available
-p6	bold	\\E[0;1m
-p7	invis	\\E[0;8m
-p8	protect	not used
-p9	altcharset	^O (off) ^N (on)
-.TE
-.PP
-We begin each escape sequence by turning off any existing modes, since
-there is no quick way to determine whether they are active.
-Standout is set up to be the combination of reverse and bold.
-The vt220 terminal has a protect mode,
-though it is not commonly used in sgr
-because it protects characters on the screen from the host's erasures.
-The altcharset mode also is different in that it is either ^O or ^N,
-depending on whether it is off or on.
-If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.
-.PP
-Some sequences are common to different modes.
-For example, ;7 is output when either p1 or p3 is true, that is, if
-either standout or reverse modes are turned on.
-.PP
-Writing out the above sequences, along with their dependencies yields
-.PP
-.TS
-center;
-l c c
-l c c
-lw28 lw6 lw2 lw20.
-\fBsequence	when to output	terminfo translation\fP
-
-\\E[0	always	\\E[0
-;1	if p1 or p6	%?%p1%p6%|%t;1%;
-;4	if p2	%?%p2%|%t;4%;
-;5	if p4	%?%p4%|%t;5%;
-;7	if p1 or p3	%?%p1%p3%|%t;7%;
-;8	if p7	%?%p7%|%t;8%;
-m	always	m
-^N or ^O	if p9 ^N, else ^O	%?%p9%t^N%e^O%;
-.TE
-.PP
-Putting this all together into the sgr sequence gives:
-.PP
-.nf
-    sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
-        %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
-.fi
-.PP
-Remember that if you specify sgr, you must also specify sgr0.
-Also, some implementations rely on sgr being given if sgr0 is,
-Not all terminfo entries necessarily have an sgr string, however.
-Many terminfo entries are derived from termcap entries
-which have no sgr string.
-The only drawback to adding an sgr string is that termcap also
-assumes that sgr0 does not exit alternate character set mode.
-.PP
-Terminals with the ``magic cookie'' glitch
-.RB ( xmc )
-deposit special ``cookies'' when they receive mode-setting sequences,
-which affect the display algorithm rather than having extra bits for
-each character.
-Some terminals, such as the HP 2621, automatically leave standout
-mode when they move to a new line or the cursor is addressed.
-Programs using standout mode should exit standout mode before
-moving the cursor or sending a newline,
-unless the
-.B msgr
-capability, asserting that it is safe to move in standout mode, is present.
-.PP
-If the terminal has
-a way of flashing the screen to indicate an error quietly (a bell replacement)
-then this can be given as \fBflash\fR; it must not move the cursor.
-.PP
-If the cursor needs to be made more visible than normal when it is
-not on the bottom line (to make, for example, a non-blinking underline into an
-easier to find block or blinking underline)
-give this sequence as
-.BR cvvis .
-If there is a way to make the cursor completely invisible, give that as
-.BR civis .
-The capability
-.BR cnorm
-should be given which undoes the effects of both of these modes.
-.PP
-If your terminal correctly generates underlined characters
-(with no special codes needed)
-even though it does not overstrike,
-then you should give the capability \fBul\fR.
-If a character overstriking another leaves both characters on the screen,
-specify the capability \fBos\fP.
-If overstrikes are erasable with a blank,
-then this should be indicated by giving \fBeo\fR.
-.PP
-.SS Keypad and Function Keys
-.PP
-If the terminal has a keypad that transmits codes when the keys are pressed,
-this information can be given.
-Note that it is not possible to handle
-terminals where the keypad only works in local (this applies, for example,
-to the unshifted HP 2621 keys).
-If the keypad can be set to transmit or not transmit,
-give these codes as \fBsmkx\fR and \fBrmkx\fR.
-Otherwise the keypad is assumed to always transmit.
-The codes sent by the left arrow, right arrow, up arrow, down arrow,
-and home keys can be given as
-\fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
-If there are function keys such as f0, f1, ..., f10, the codes they send
-can be given as \fBkf0, kf1, ..., kf10\fR.
-If these keys have labels other than the default f0 through f10, the labels
-can be given as \fBlf0, lf1, ..., lf10\fR.
-The codes transmitted by certain other special keys can be given:
-.B kll
-(home down),
-.B kbs
-(backspace),
-.B ktbc
-(clear all tabs),
-.B kctab
-(clear the tab stop in this column),
-.B kclr
-(clear screen or erase key),
-.B kdch1
-(delete character),
-.B kdl1
-(delete line),
-.B krmir
-(exit insert mode),
-.B kel
-(clear to end of line),
-.B ked
-(clear to end of screen),
-.B kich1
-(insert character or enter insert mode),
-.B kil1
-(insert line),
-.B knp
-(next page),
-.B kpp
-(previous page),
-.B kind
-(scroll forward/down),
-.B kri
-(scroll backward/up),
-.B khts
-(set a tab stop in this column).
-In addition, if the keypad has a 3 by 3 array of keys including the four
-arrow keys, the other five keys can be given as
-.BR ka1 ,
-.BR ka3 ,
-.BR kb2 ,
-.BR kc1 ,
-and
-.BR kc3 .
-These keys are useful when the effects of a 3 by 3 directional pad are needed.
-.PP
-Strings to program function keys can be given as
-.BR pfkey ,
-.BR pfloc ,
-and
-.BR pfx .
-A string to program screen labels should be specified as \fBpln\fP.
-Each of these strings takes two parameters: the function key number to
-program (from 0 to 10) and the string to program it with.
-Function key numbers out of this range may program undefined keys in
-a terminal dependent manner.
-The difference between the capabilities is that
-.B pfkey
-causes pressing the given key to be the same as the user typing the
-given string;
-.B pfloc
-causes the string to be executed by the terminal in local; and
-.B pfx
-causes the string to be transmitted to the computer.
-.PP
-The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
-define the number of programmable
-screen labels and their width and height.
-If there are commands to turn the labels on and off,
-give them in \fBsmln\fP and \fBrmln\fP.
-\fBsmln\fP is normally output after one or more pln
-sequences to make sure that the change becomes visible.
-.PP
-.SS Tabs and Initialization
-.PP
-If the terminal has hardware tabs, the command to advance to the next
-tab stop can be given as
-.B ht
-(usually control I).
-A ``back-tab'' command which moves leftward to the preceding tab stop can
-be given as
-.BR cbt .
-By convention, if the teletype modes indicate that tabs are being
-expanded by the computer rather than being sent to the terminal,
-programs should not use
-.B ht
-or
-.B cbt
-even if they are present, since the user may not have the tab stops
-properly set.
-If the terminal has hardware tabs which are initially set every
-.I n
-spaces when the terminal is powered up,
-the numeric parameter
-.B it
-is given, showing the number of spaces the tabs are set to.
-This is normally used by the
-.IR tset
-command to determine whether to set the mode for hardware tab expansion,
-and whether to set the tab stops.
-If the terminal has tab stops that can be saved in non-volatile memory,
-the terminfo description can assume that they are properly set.
-.PP
-Other capabilities
-include
-.BR is1 ,
-.BR is2 ,
-and
-.BR is3 ,
-initialization strings for the terminal,
-.BR iprog ,
-the path name of a program to be run to initialize the terminal,
-and \fBif\fR, the name of a file containing long initialization strings.
-These strings are expected to set the terminal into modes consistent
-with the rest of the terminfo description.
-They are normally sent to the terminal, by the
-.I init
-option of the
-.IR @TPUT@
-program, each time the user logs in.
-They will be printed in the following order:
-.RS
-.TP
-run the program
-.BR iprog
-.TP
-output
-.BR is1
-.BR is2
-.TP
-set the margins using
-.BR mgc ,
-.BR smgl
-and
-.BR smgr
-.TP
-set tabs using
-.B tbc
-and
-.BR hts
-.TP
-print the file
-.BR if
-.TP
-and finally
-output
-.BR is3 .
-.RE
-.PP
-Most initialization is done with
-.BR is2 .
-Special terminal modes can be set up without duplicating strings
-by putting the common sequences in
-.B is2
-and special cases in
-.B is1
-and
-.BR is3 .
-.PP
-A set of sequences that does a harder reset from a totally unknown state
-can be given as
-.BR rs1 ,
-.BR rs2 ,
-.BR rf
-and
-.BR rs3 ,
-analogous to
-.B is1 ,
-.B is2 ,
-.B if
-and
-.BR is3
-respectively.
-These strings are output by the
-.IR reset
-program, which is used when the terminal gets into a wedged state.
-Commands are normally placed in
-.BR rs1 ,
-.BR rs2
-.B rs3
-and
-.B rf
-only if they produce annoying effects on the screen and are not
-necessary when logging in.
-For example, the command to set the vt100 into 80-column mode would
-normally be part of
-.BR is2 ,
-but it causes an annoying glitch of the screen and is not normally
-needed since the terminal is usually already in 80 column mode.
-.PP
-The
-.IR reset
-program writes strings
-including
-.BR iprog ,
-etc., in the same order as the
-.IR init
-program, using 
-.BR rs1 ,
-etc., instead of
-.BR is1 ,
-etc.
-If any of
-.BR rs1 ,
-.BR rs2 ,
-.BR rs3 ,
-or
-.BR rf
-reset capability strings are missing, the
-.IR reset
-program falls back upon the corresponding initialization capability string.
-.PP
-If there are commands to set and clear tab stops, they can be given as
-.B tbc
-(clear all tab stops)
-and
-.B hts
-(set a tab stop in the current column of every row).
-If a more complex sequence is needed to set the tabs than can be
-described by this, the sequence can be placed in
-.B is2
-or
-.BR if .
-.SS Delays and Padding
-.PP
-Many older and slower terminals do not support either XON/XOFF or DTR
-handshaking, including hard copy terminals and some very archaic CRTs
-(including, for example, DEC VT100s).
-These may require padding characters
-after certain cursor motions and screen changes.
-.PP
-If the terminal uses xon/xoff handshaking for flow control (that is,
-it automatically emits ^S back to the host when its input buffers are
-close to full), set
-.BR xon .
-This capability suppresses the emission of padding.
-You can also set it
-for memory-mapped console devices effectively that do not have a speed limit.
-Padding information should still be included so that routines can
-make better decisions about relative costs, but actual pad characters will
-not be transmitted.
-.PP
-If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
-below the value of \fBpb\fR.
-If the entry has no padding baud rate, then
-whether padding is emitted or not is completely controlled by \fBxon\fR.
-.PP
-If the terminal requires other than a null (zero) character as a pad,
-then this can be given as \fBpad\fR.
-Only the first character of the
-.B pad
-string is used.
-.PP
-.SS Status Lines
-Some terminals have an extra `status line' which is not normally used by
-software (and thus not counted in the terminal's \fBlines\fR capability).
-.PP
-The simplest case is a status line which is cursor-addressable but not
-part of the main scrolling region on the screen; the Heathkit H19 has
-a status line of this kind, as would a 24-line VT100 with a 23-line
-scrolling region set up on initialization.
-This situation is indicated
-by the \fBhs\fR capability.
-.PP
-Some terminals with status lines need special sequences to access the
-status line.
-These may be expressed as a string with single parameter
-\fBtsl\fR which takes the cursor to a given zero-origin column on the
-status line.
-The capability \fBfsl\fR must return to the main-screen
-cursor positions before the last \fBtsl\fR.
-You may need to embed the
-string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
-in \fBtsl\fR and \fBfsl\fR to accomplish this.
-.PP
-The status line is normally assumed to be the same width as the width
-of the terminal.
-If this is untrue, you can specify it with the numeric
-capability \fBwsl\fR.
-.PP
-A command to erase or blank the status line may be specified as \fBdsl\fR.
-.PP
-The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
-etc., work ordinarily in the status line.
-.PP
-The \fBncurses\fR implementation does not yet use any of these capabilities.
-They are documented here in case they ever become important.
-.PP
-.SS Line Graphics
-.PP
-Many terminals have alternate character sets useful for forms-drawing.
-Terminfo and \fBcurses\fR build in support for the drawing characters
-supported by the VT100, with some characters from the AT&T 4410v1 added.
-This alternate character set may be specified by the \fBacsc\fR capability.
-.PP
-.TS H
-center expand;
-c l l c
-c l l c
-lw28 lw6 lw2 lw20.
-.\".TH
-\fBGlyph	ACS	Ascii	VT100\fR
-\fBName	Name	Default	Name\fR
-UK pound sign        	ACS_STERLING	f	}
-arrow pointing down	ACS_DARROW	v	.
-arrow pointing left	ACS_LARROW	<	,
-arrow pointing right	ACS_RARROW	>	+
-arrow pointing up	ACS_UARROW	^	-
-board of squares	ACS_BOARD	#	h
-bullet          	ACS_BULLET	o	~
-checker board (stipple)	ACS_CKBOARD	:	a
-degree symbol   	ACS_DEGREE	\e	f
-diamond         	ACS_DIAMOND	+	`
-greater-than-or-equal-to	ACS_GEQUAL	>	z
-greek pi        	ACS_PI	*	{
-horizontal line 	ACS_HLINE	-	q
-lantern symbol  	ACS_LANTERN	#	i
-large plus or crossover	ACS_PLUS	+	n
-less-than-or-equal-to	ACS_LEQUAL	<	y
-lower left corner	ACS_LLCORNER	+	m
-lower right corner	ACS_LRCORNER	+	j
-not-equal       	ACS_NEQUAL	!	|
-plus/minus      	ACS_PLMINUS	#	g
-scan line 1     	ACS_S1  	~	o
-scan line 3     	ACS_S3  	-	p
-scan line 7     	ACS_S7  	-	r
-scan line 9     	ACS_S9  	\&_	s
-solid square block	ACS_BLOCK	#	0
-tee pointing down	ACS_TTEE	+	w
-tee pointing left	ACS_RTEE	+	u
-tee pointing right	ACS_LTEE	+	t
-tee pointing up 	ACS_BTEE	+	v
-upper left corner	ACS_ULCORNER	+	l
-upper right corner	ACS_URCORNER	+	k
-vertical line   	ACS_VLINE	|	x
-.TE
-.PP
-The best way to define a new device's graphics set is to add a column
-to a copy of this table for your terminal, giving the character which
-(when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
-as the corresponding graphic.
-Then read off the VT100/your terminal
-character pairs right to left in sequence; these become the ACSC string.
-.PP
-.SS Color Handling
-.PP
-Most color terminals are either `Tektronix-like' or `HP-like'.
-Tektronix-like
-terminals have a predefined set of N colors (where N usually 8), and can set
-character-cell foreground and background characters independently, mixing them
-into N * N color-pairs.
-On HP-like terminals, the use must set each color
-pair up separately (foreground and background are not independently settable).
-Up to M color-pairs may be set up from 2*M different colors.
-ANSI-compatible
-terminals are Tektronix-like.
-.PP
-Some basic color capabilities are independent of the color method.
-The numeric
-capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
-and color-pairs that can be displayed simultaneously.
-The \fBop\fR (original
-pair) string resets foreground and background colors to their default values
-for the terminal.
-The \fBoc\fR string resets all colors or color-pairs to
-their default values for the terminal.
-Some terminals (including many PC
-terminal emulators) erase screen areas with the current background color rather
-than the power-up default background; these should have the boolean capability
-\fBbce\fR.
-.PP
-To change the current foreground or background color on a Tektronix-type
-terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
-background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
-These take one parameter, the color number.
-The SVr4 documentation describes
-only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
-supports ANSI escape sequences to set background and foreground, they should
-be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
-If the terminal
-supports other escape sequences to set background and foreground, they should
-be coded as \fBsetf\fR and \fBsetb\fR, respectively.
-The \fIvidputs()\fR
-function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are
-defined."
-.PP
-The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
-single numeric argument each.
-Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
-follows (the middle column is the symbolic #define available in the header for
-the \fBcurses\fR or \fBncurses\fR libraries).
-The terminal hardware is free to
-map these as it likes, but the RGB values indicate normal locations in color
-space.
-.PP
-.TS H
-center;
-l c c c
-l l n l.
-\fBColor	#define 	Value	RGB\fR
-black	\fBCOLOR_BLACK\fR	0	0, 0, 0
-red	\fBCOLOR_RED\ \fR	1	max,0,0
-green	\fBCOLOR_GREEN\fR	2	0,max,0
-yellow	\fBCOLOR_YELLOW\fR	3	max,max,0
-blue	\fBCOLOR_BLUE\fR	4	0,0,max
-magenta	\fBCOLOR_MAGENTA\fR	5	max,0,max
-cyan	\fBCOLOR_CYAN\fR	6	0,max,max
-white	\fBCOLOR_WHITE\fR	7	max,max,max
-.TE
-.PP
-The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
-a different mapping, i.e.,
-.TS H
-center;
-l c c c
-l l n l.
-\fBColor	#define 	Value	RGB\fR
-black	\fBCOLOR_BLACK\fR	0	0, 0, 0
-blue	\fBCOLOR_BLUE\fR	1	0,0,max
-green	\fBCOLOR_GREEN\fR	2	0,max,0
-cyan	\fBCOLOR_CYAN\fR	3	0,max,max
-red	\fBCOLOR_RED\ \fR	4	max,0,0
-magenta	\fBCOLOR_MAGENTA\fR	5	max,0,max
-yellow	\fBCOLOR_YELLOW\fR	6	max,max,0
-white	\fBCOLOR_WHITE\fR	7	max,max,max
-.TE
-It is important to not confuse the two sets of color capabilities;
-otherwise red/blue will be interchanged on the display.
-.PP
-On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
-which color pair is current.
-.PP
-On a Tektronix-like terminal, the capability \fBccc\fR may be present to
-indicate that colors can be modified.
-If so, the \fBinitc\fR capability will
-take a color number (0 to \fBcolors\fR - 1)and three more parameters which
-describe the color.
-These three parameters default to being interpreted as RGB
-(Red, Green, Blue) values.
-If the boolean capability \fBhls\fR is present,
-they are instead as HLS (Hue, Lightness, Saturation) indices.
-The ranges are
-terminal-dependent.
-.PP
-On an HP-like terminal, \fBinitp\fR may give a capability for changing a
-color-pair value.
-It will take seven parameters; a color-pair number (0 to
-\fBmax_pairs\fR - 1), and two triples describing first background and then
-foreground colors.
-These parameters must be (Red, Green, Blue) or
-(Hue, Lightness, Saturation) depending on \fBhls\fR.
-.PP
-On some color terminals, colors collide with highlights.
-You can register
-these collisions with the \fBncv\fR capability.
-This is a bit-mask of
-attributes not to be used when colors are enabled.
-The correspondence with the
-attributes understood by \fBcurses\fR is as follows:
-.PP
-.TS
-center;
-l c c
-lw25 lw2 lw10.
-\fBAttribute	Bit	Decimal\fR
-A_STANDOUT	0	1
-A_UNDERLINE	1	2
-A_REVERSE	2	4
-A_BLINK   	3	8
-A_DIM      	4	16
-A_BOLD    	5	32
-A_INVIS   	6	64
-A_PROTECT	7	128
-A_ALTCHARSET	8	256
-.TE
-.PP
-For example, on many IBM PC consoles, the underline attribute collides with the
-foreground color blue and is not available in color mode.
-These should have
-an \fBncv\fR capability of 2.
-.PP
-SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
-the output in favor of colors.
-.PP
-.SS Miscellaneous
-If the terminal requires other than a null (zero) character as a pad, then this
-can be given as pad.
-Only the first character of the pad string is used.
-If the terminal does not have a pad character, specify npc.
-Note that ncurses implements the termcap-compatible \fBPC\fR variable;
-though the application may set this value to something other than
-a null, ncurses will test \fBnpc\fR first and use napms if the terminal
-has no pad character.
-.PP
-If the terminal can move up or down half a line,
-this can be indicated with
-.B hu
-(half-line up)
-and
-.B hd
-(half-line down).
-This is primarily useful for superscripts and subscripts on hard-copy terminals.
-If a hard-copy terminal can eject to the next page (form feed), give this as
-.B ff
-(usually control L).
-.PP
-If there is a command to repeat a given character a given number of
-times (to save time transmitting a large number of identical characters)
-this can be indicated with the parameterized string
-.BR rep .
-The first parameter is the character to be repeated and the second
-is the number of times to repeat it.
-Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'.
-.PP
-If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
-this can be indicated with
-.BR cmdch .
-A prototype command character is chosen which is used in all capabilities.
-This character is given in the
-.B cmdch
-capability to identify it.
-The following convention is supported on some UNIX systems:
-The environment is to be searched for a
-.B CC
-variable, and if found, all
-occurrences of the prototype character are replaced with the character
-in the environment variable.
-.PP
-Terminal descriptions that do not represent a specific kind of known
-terminal, such as
-.IR switch ,
-.IR dialup ,
-.IR patch ,
-and
-.IR network ,
-should include the
-.B gn
-(generic) capability so that programs can complain that they do not know
-how to talk to the terminal.
-(This capability does not apply to
-.I virtual
-terminal descriptions for which the escape sequences are known.)
-.PP
-If the terminal has a ``meta key'' which acts as a shift key,
-setting the 8th bit of any character transmitted, this fact can
-be indicated with
-.BR km .
-Otherwise, software will assume that the 8th bit is parity and it
-will usually be cleared.
-If strings exist to turn this ``meta mode'' on and off, they
-can be given as
-.B smm
-and
-.BR rmm .
-.PP
-If the terminal has more lines of memory than will fit on the screen
-at once, the number of lines of memory can be indicated with
-.BR lm .
-A value of
-.BR lm #0
-indicates that the number of lines is not fixed,
-but that there is still more memory than fits on the screen.
-.PP
-If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
-terminal protocol, the terminal number can be given as
-.BR vt .
-.PP
-Media copy
-strings which control an auxiliary printer connected to the terminal
-can be given as
-.BR mc0 :
-print the contents of the screen,
-.BR mc4 :
-turn off the printer, and
-.BR mc5 :
-turn on the printer.
-When the printer is on, all text sent to the terminal will be sent
-to the printer.
-It is undefined whether the text is also displayed on the terminal screen
-when the printer is on.
-A variation
-.B mc5p
-takes one parameter, and leaves the printer on for as many characters
-as the value of the parameter, then turns the printer off.
-The parameter should not exceed 255.
-All text, including
-.BR mc4 ,
-is transparently passed to the printer while an
-.B mc5p
-is in effect.
-.PP
-.SS Glitches and Braindamage
-.PP
-Hazeltine terminals, which do not allow `~' characters to be displayed should
-indicate \fBhz\fR.
-.PP
-Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
-such as the Concept and vt100,
-should indicate \fBxenl\fR.
-.PP
-If
-.B el
-is required to get rid of standout
-(instead of merely writing normal text on top of it),
-\fBxhp\fP should be given.
-.PP
-Teleray terminals, where tabs turn all characters moved over to blanks,
-should indicate \fBxt\fR (destructive tabs).
-Note: the variable indicating this is now `dest_tabs_magic_smso'; in
-older versions, it was teleray_glitch.
-This glitch is also taken to mean that it is not possible to position
-the cursor on top of a ``magic cookie'',
-that to erase standout mode it is instead necessary to use
-delete and insert line.
-The ncurses implementation ignores this glitch.
-.PP
-The Beehive Superbee, which is unable to correctly transmit the escape
-or control C characters, has
-.BR xsb ,
-indicating that the f1 key is used for escape and f2 for control C.
-(Only certain Superbees have this problem, depending on the ROM.)
-Note that in older terminfo versions, this capability was called
-`beehive_glitch'; it is now `no_esc_ctl_c'.
-.PP
-Other specific terminal problems may be corrected by adding more
-capabilities of the form \fBx\fR\fIx\fR.
-.PP
-.SS Similar Terminals
-.PP
-If there are two very similar terminals, one (the variant) can be defined as
-being just like the other (the base) with certain exceptions.
-In the
-definition of the variant, the string capability \fBuse\fR can be given with
-the name of the base terminal.
-The capabilities given before
-.B use
-override those in the base type named by
-.BR use .
-If there are multiple \fBuse\fR capabilities, they are merged in reverse order.
-That is, the rightmost \fBuse\fR reference is processed first, then the one to
-its left, and so forth.
-Capabilities given explicitly in the entry override
-those brought in by \fBuse\fR references.
-.PP
-A capability can be canceled by placing \fBxx@\fR to the left of the
-use reference that imports it, where \fIxx\fP is the capability.
-For example, the entry
-.PP
-	2621-nl, smkx@, rmkx@, use=2621,
-.PP
-defines a 2621-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
-and hence does not turn on the function key labels when in visual mode.
-This is useful for different modes for a terminal, or for different
-user preferences.
-.PP
-.SS Pitfalls of Long Entries
-.PP
-Long terminfo entries are unlikely to be a problem; to date, no entry has even
-approached terminfo's 4096-byte string-table maximum.
-Unfortunately, the termcap
-translations are much more strictly limited (to 1023 bytes), thus termcap translations
-of long terminfo entries can cause problems.
-.PP
-The man pages for 4.3BSD and older versions of \fBtgetent()\fP instruct the user to
-allocate a 1024-byte buffer for the termcap entry.
-The entry gets null-terminated by
-the termcap library, so that makes the maximum safe length for a termcap entry
-1k-1 (1023) bytes.
-Depending on what the application and the termcap library
-being used does, and where in the termcap file the terminal type that \fBtgetent()\fP
-is searching for is, several bad things can happen.
-.PP
-Some termcap libraries print a warning message or exit if they find an
-entry that's longer than 1023 bytes; others do not; others truncate the
-entries to 1023 bytes.
-Some application programs allocate more than
-the recommended 1K for the termcap entry; others do not.
-.PP
-Each termcap entry has two important sizes associated with it: before
-"tc" expansion, and after "tc" expansion.
-"tc" is the capability that
-tacks on another termcap entry to the end of the current one, to add
-on its capabilities.
-If a termcap entry does not use the "tc"
-capability, then of course the two lengths are the same.
-.PP
-The "before tc expansion" length is the most important one, because it
-affects more than just users of that particular terminal.
-This is the
-length of the entry as it exists in /etc/termcap, minus the
-backslash-newline pairs, which \fBtgetent()\fP strips out while reading it.
-Some termcap libraries strip off the final newline, too (GNU termcap does not).
-Now suppose:
-.TP 5
-*
-a termcap entry before expansion is more than 1023 bytes long,
-.TP 5
-*
-and the application has only allocated a 1k buffer,
-.TP 5
-*
-and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
-the whole entry into the buffer, no matter what its length, to see
-if it is the entry it wants,
-.TP 5
-*
-and \fBtgetent()\fP is searching for a terminal type that either is the
-long entry, appears in the termcap file after the long entry, or
-does not appear in the file at all (so that \fBtgetent()\fP has to search
-the whole termcap file).
-.PP
-Then \fBtgetent()\fP will overwrite memory, perhaps its stack, and probably core dump
-the program.
-Programs like telnet are particularly vulnerable; modern telnets
-pass along values like the terminal type automatically.
-The results are almost
-as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
-prints warning messages when it reads an overly long termcap entry.
-If a
-termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
-here but will return incorrect data for the terminal.
-.PP
-The "after tc expansion" length will have a similar effect to the
-above, but only for people who actually set TERM to that terminal
-type, since \fBtgetent()\fP only does "tc" expansion once it is found the
-terminal type it was looking for, not while searching.
-.PP
-In summary, a termcap entry that is longer than 1023 bytes can cause,
-on various combinations of termcap libraries and applications, a core
-dump, warnings, or incorrect operation.
-If it is too long even before
-"tc" expansion, it will have this effect even for users of some other
-terminal types and users whose TERM variable does not have a termcap
-entry.
-.PP
-When in -C (translate to termcap) mode, the \fBncurses\fR implementation of
-\fB@TIC@\fR(1M) issues warning messages when the pre-tc length of a termcap
-translation is too long.
-The -c (check) option also checks resolved (after tc
-expansion) lengths.
-.SS Binary Compatibility
-It is not wise to count on portability of binary terminfo entries between
-commercial UNIX versions.
-The problem is that there are at least two versions
-of terminfo (under HP-UX and AIX) which diverged from System V terminfo after
-SVr1, and have added extension capabilities to the string table that (in the
-binary format) collide with System V and XSI Curses extensions.
-.SH EXTENSIONS
-Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
-interpret the %A and %O operators in parameter strings.
-.PP
-SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
-an alternate-character-set mode (such modes may, among other things, map
-CR and NL to characters that do not trigger local motions).
-The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
-mode.
-This raises the possibility that an XPG4
-implementation making the opposite interpretation may need terminfo
-entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
-.PP
-The \fBncurses\fR library handles insert-character and insert-character modes
-in a slightly non-standard way to get better update efficiency.
-See
-the \fBInsert/Delete Character\fR subsection above.
-.PP
-The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
-not documented in SVr4 or the XSI Curses standard.
-They are deduced from the
-documentation for the AT&T 505 terminal.
-.PP
-Be careful assigning the \fBkmous\fR capability.
-The \fBncurses\fR wants to
-interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm
-that can return mouse-tracking information in the keyboard-input stream.
-.PP
-Different commercial ports of terminfo and curses support different subsets of
-the XSI Curses standard and (in some cases) different extension sets.
-Here
-is a summary, accurate as of October 1995:
-.PP
-\fBSVR4, Solaris, ncurses\fR --
-These support all SVr4 capabilities.
-.PP
-\fBSGI\fR --
-Supports the SVr4 set, adds one undocumented extended string
-capability (\fBset_pglen\fR).
-.PP
-\fBSVr1, Ultrix\fR --
-These support a restricted subset of terminfo capabilities.
-The booleans
-end with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and the
-strings with \fBprtr_non\fR.
-.PP
-\fBHP/UX\fR --
-Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
-\fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
-\fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
-extensions in the string table.
-.PP
-\fBAIX\fR --
-Supports the SVr1 subset, plus function keys 11 through 63, plus a number
-of incompatible string table extensions.
-.PP
-\fBOSF\fR --
-Supports both the SVr4 set and the AIX extensions.
-.SH FILES
-.TP 25
-\*d/?/*
-files containing terminal descriptions
-.SH SEE ALSO
-\fB@TIC@\fR(1M),
-\fB@INFOCMP@\fR(1M),
-\fBcurses\fR(3X),
-\fBprintf\fR(3),
-\fBterm\fR(\*n).
-.SH AUTHORS
-Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
-Based on pcurses by Pavel Curtis.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/terminfo.head b/man/terminfo.head
index 7455675..c4cc072 100644
--- a/man/terminfo.head
+++ b/man/terminfo.head
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2006 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,10 +26,17 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: terminfo.head,v 1.16 2007/03/04 00:09:46 tom Exp $
+.\" $Id: terminfo.head,v 1.21 2013/03/09 22:11:36 tom Exp $
 .TH terminfo 5 "" "" "File Formats"
 .ds n 5
 .ds d @TERMINFO@
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
+.de bP
+.IP \(bu 4
+..
 .SH NAME
 terminfo \- terminal capability data base
 .SH SYNOPSIS
@@ -68,17 +75,17 @@
 .PP
 Newlines and leading tabs may be used for formatting entries for readability.
 These are removed from parsed entries.
-The \fB@INFOCMP@\ -f\fP option relies on this to format if-then-else expressions:
+The \fB@INFOCMP@\ \-f\fP option relies on this to format if-then-else expressions:
 the result can be read by \fB@TIC@\fP.
 .PP
 Terminal names (except for the last, verbose entry) should
 be chosen using the following conventions.
 The particular piece of hardware making up the terminal should
-have a root name, thus ``hp2621''.
+have a root name, thus \*(``hp2621\*(''.
 This name should not contain hyphens.
 Modes that the hardware can be in, or user preferences, should
 be indicated by appending a hyphen and a mode suffix.
-Thus, a vt100 in 132 column mode would be vt100-w.
+Thus, a vt100 in 132 column mode would be vt100\-w.
 The following suffixes should be used where possible:
 .PP
 .TS
@@ -86,22 +93,22 @@
 l c l
 l l l.
 \fBSuffix	Meaning	Example\fP
--\fInn\fP	Number of lines on the screen	aaa-60
--\fIn\fPp	Number of pages of memory	c100-4p
--am	With automargins (usually the default)	vt100-am
--m	Mono mode; suppress color       	ansi-m
--mc	Magic cookie; spaces when highlighting	wy30-mc
--na	No arrow keys (leave them in local)	c100-na
--nam	Without automatic margins       	vt100-nam
--nl	No status line                  	att4415-nl
--ns	No status line                  	hp2626-ns
--rv	Reverse video                   	c100-rv
--s	Enable status line              	vt100-s
--vb	Use visible bell instead of beep	wy370-vb
--w	Wide mode (> 80 columns, usually 132)	vt100-w
+\-\fInn\fP	Number of lines on the screen	aaa\-60
+\-\fIn\fPp	Number of pages of memory	c100\-4p
+\-am	With automargins (usually the default)	vt100\-am
+\-m	Mono mode; suppress color       	ansi\-m
+\-mc	Magic cookie; spaces when highlighting	wy30\-mc
+\-na	No arrow keys (leave them in local)	c100\-na
+\-nam	Without automatic margins       	vt100\-nam
+\-nl	No status line                  	att4415\-nl
+\-ns	No status line                  	hp2626\-ns
+\-rv	Reverse video                   	c100\-rv
+\-s	Enable status line              	vt100\-s
+\-vb	Use visible bell instead of beep	wy370\-vb
+\-w	Wide mode (> 80 columns, usually 132)	vt100\-w
 .TE
 .PP
 For more on terminal naming conventions, see the \fBterm(7)\fR manual page.
-.SS Capabilities
+.SS Predefined Capabilities
 .\" Head of terminfo man page ends here
 .ps -1
diff --git a/man/terminfo.tail b/man/terminfo.tail
index d06d3a9..bd8568f 100644
--- a/man/terminfo.tail
+++ b/man/terminfo.tail
@@ -1,8 +1,51 @@
-.\" $Id: terminfo.tail,v 1.49 2008/02/16 20:57:43 tom Exp $
+.\" $Id: terminfo.tail,v 1.69 2015/04/26 14:47:23 tom Exp $
 .\" Beginning of terminfo.tail file
 .\" This file is part of ncurses.
 .\" See "terminfo.head" for copyright.
 .ps +1
+.SS User-Defined Capabilities
+.
+The preceding section listed the \fIpredefined\fP capabilities.
+They deal with some special features for terminals no longer
+(or possibly never) produced.
+Occasionally there are special features of newer terminals which
+are awkward or impossible to represent by reusing the predefined
+capabilities.
+.PP
+\fBncurses\fP addresses this limitation by allowing user-defined capabilities.
+The \fB@TIC@\fP and \fB@INFOCMP@\fP programs provide
+the \fB\-x\fP option for this purpose.
+When \fB\-x\fP is set,
+\fB@TIC@\fP treats unknown capabilities as user-defined.
+That is, if \fB@TIC@\fP encounters a capability name
+which it does not recognize,
+it infers its type (boolean, number or string) from the syntax
+and makes an extended table entry for that capability.
+The \fBuse_extended_names\fP function makes this information
+conditionally available to applications.
+The ncurses library provides the data leaving most of the behavior
+to applications:
+.bP
+User-defined capability strings whose name begins
+with \*(``k\*('' are treated as function keys.
+.bP
+The types (boolean, number, string) determined by \fB@TIC@\fP
+can be inferred by successful calls on \fBtigetflag\fP, etc.
+.bP
+If the capability name happens to be two characters,
+the capability is also available through the termcap interface.
+.PP
+While termcap is said to be extensible because it does not use a predefined set
+of capabilities,
+in practice it has been limited to the capabilities defined by
+terminfo implementations.
+As a rule,
+user-defined capabilities intended for use by termcap applications should
+be limited to booleans and numbers to avoid running past the 1023 byte
+limit assumed by termcap implementations and their applications.
+In particular, providing extended sets of function keys (past the 60
+numbered keys and the handful of special named keys) is best done using
+the longer names available using terminfo.
 .
 .SS A Sample Entry
 .
@@ -10,42 +53,54 @@
 of what a \fBterminfo\fR entry for a modern terminal typically looks like.
 .PP
 .nf
-.in -2
-.ta .3i
 .ft CW
 \s-2ansi|ansi/pc-term compatible with color,
-        mc5i,
-        colors#8, ncv#3, pairs#64,
-        cub=\\E[%p1%dD, cud=\\E[%p1%dB, cuf=\\E[%p1%dC,
-        cuu=\\E[%p1%dA, dch=\\E[%p1%dP, dl=\\E[%p1%dM,
-        ech=\\E[%p1%dX, el1=\\E[1K, hpa=\\E[%p1%dG, ht=\\E[I,
-        ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, .indn=\\E[%p1%dT,
-        kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, kcud1=\\E[B,
-        kcuf1=\\E[C, kcuu1=\\E[A, kf1=\\E[M, kf10=\\E[V,
-        kf11=\\E[W, kf12=\\E[X, kf2=\\E[N, kf3=\\E[O, kf4=\\E[P,
-        kf5=\\E[Q, kf6=\\E[R, kf7=\\E[S, kf8=\\E[T, kf9=\\E[U,
-        kich1=\\E[L, mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S,
-        op=\\E[37;40m, rep=%p1%c\\E[%p2%{1}%-%db,
-        rin=\\E[%p1%dT, s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B,
-        s3ds=\\E+B, setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
-        setb=\\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-        setf=\\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-        sgr=\\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
-        sgr0=\\E[0;10m, tbc=\\E[2g, u6=\\E[%d;%dR, u7=\\E[6n,
-        u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%p1%dd,\s+2
-.in +2
+        am, mc5i, mir, msgr,
+        colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
+        acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
+             j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
+             u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
+        bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
+        cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
+        cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
+        cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
+        dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
+        el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
+        ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
+        indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
+        kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
+        mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
+        rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
+        rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
+        s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
+        setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
+        sgr=\\E[0;10%?%p1%t;7%;
+                   %?%p2%t;4%;
+                   %?%p3%t;7%;
+                   %?%p4%t;5%;
+                   %?%p6%t;1%;
+                   %?%p7%t;8%;
+                   %?%p9%t;11%;m,
+        sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
+        smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
+        u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
 .fi
 .ft R
 .PP
 Entries may continue onto multiple lines by placing white space at
 the beginning of each line except the first.
-Comments may be included on lines beginning with ``#''.
+Comments may be included on lines beginning with \*(``#\*(''.
 Capabilities in
 .I terminfo
 are of three types:
+.bP
 Boolean capabilities which indicate that the terminal has
-some particular feature, numeric capabilities giving the size of the terminal
-or the size of particular delays, and string
+some particular feature,
+.bP
+numeric capabilities giving the size of the terminal
+or the size of particular delays, and
+.bP
+string
 capabilities, which give a sequence which can be used to perform particular
 terminal operations.
 .PP
@@ -58,15 +113,15 @@
 (i.e., an automatic return and line-feed
 when the end of a line is reached) is indicated by the capability \fBam\fR.
 Hence the description of ansi includes \fBam\fR.
-Numeric capabilities are followed by the character `#' and then a positive value.
+Numeric capabilities are followed by the character \*(``#\*('' and then a positive value.
 Thus \fBcols\fR, which indicates the number of columns the terminal has,
-gives the value `80' for ansi.
+gives the value \*(``80\*('' for ansi.
 Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
 using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
 .PP
 Finally, string valued capabilities, such as \fBel\fR (clear to end of line
-sequence) are given by the two-character code, an `=', and then a string
-ending at the next following `,'.
+sequence) are given by the two-character code, an \*(``=\*('', and then a string
+ending at the next following \*(``,\*(''.
 .PP
 A number of escape sequences are provided in the string valued capabilities
 for easy encoding of characters there.
@@ -75,14 +130,29 @@
 \fB^x\fR maps to a control-x for any appropriate x, and the sequences
 \fB\en \el \er \et \eb \ef \es\fR give
 a newline, line-feed, return, tab, backspace, form-feed, and space.
-Other escapes include \fB\e^\fR for \fB^\fR,
+Other escapes include
+.bP
+\fB\e^\fR for \fB^\fR,
+.bP
 \fB\e\e\fR for \fB\e\fR,
+.bP
 \fB\e\fR, for comma,
+.bP
 \fB\e:\fR for \fB:\fR,
+.bP
 and \fB\e0\fR for null.
-(\fB\e0\fR will produce \e200, which does not terminate a string but behaves
+.IP
+\fB\e0\fR will produce \e200, which does not terminate a string but behaves
 as a null character on most terminals, providing CS7 is specified.
-See stty(1).)
+See stty(1).
+.IP
+The reason for this quirk is to maintain binary compatibility of the
+compiled terminfo files with other implementations,
+e.g., the SVr4 systems, which document this.
+Compiled terminfo files use null-terminated strings, with no lengths.
+Modifying this would require a new binary format, 
+which would not work with other implementations.
+.PP
 Finally, characters may be given as three octal digits after a \fB\e\fR.
 .PP
 A delay in milliseconds may appear anywhere in a string capability, enclosed in
@@ -90,8 +160,8 @@
 .I tputs
 to provide this delay.
 The delay must be a number with at most one decimal
-place of precision; it may be followed by suffixes `*' or '/' or both.
-A `*'
+place of precision; it may be followed by suffixes \*(``*\*('' or \*(``/\*('' or both.
+A \*(``*\*(''
 indicates that the padding required is proportional to the number of lines
 affected by the operation, and the amount given is the per-affected-unit
 padding required.
@@ -100,7 +170,7 @@
 .IR lines
 affected.)  Normally, padding is advisory if the device has the \fBxon\fR
 capability; it is used for cost computation but does not trigger delays.
-A `/'
+A \*(``/\*(''
 suffix indicates that the padding is mandatory and forces a delay of the given
 number of milliseconds even on devices for which \fBxon\fR is present to
 indicate flow control.
@@ -115,27 +185,36 @@
 .PP
 .SS Fetching Compiled Descriptions
 .PP
+The \fBncurses\fP library searches for terminal descriptions in several places.
+It uses only the first description found.
+The library has a compiled-in list of places to search
+which can be overridden by environment variables.
+Before starting to search,
+\fBncurses\fP eliminates duplicates in its search list.
+.bP
 If the environment variable TERMINFO is set, it is interpreted as the pathname
 of a directory containing the compiled description you are working on.
-Only
-that directory is searched.
-.PP
-If TERMINFO is not set, the \fBncurses\fR version of the terminfo reader code
-will instead look in the directory \fB$HOME/.terminfo\fR
+Only that directory is searched.
+.bP
+If TERMINFO is not set,
+\fBncurses\fR will instead look in the directory \fB$HOME/.terminfo\fR
 for a compiled description.
-If it fails to find one there, and the environment variable TERMINFO_DIRS is
-set, it will interpret the contents of that variable as a list of colon-
-separated directories to be searched (an empty entry is interpreted as a
-command to search \fI\*d\fR).
-If no description is found in any of the
-TERMINFO_DIRS directories, the fetch fails.
-.PP
-If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will be the
-system terminfo directory, \fI\*d\fR.
-.PP
-(Neither the \fB$HOME/.terminfo\fR lookups nor TERMINFO_DIRS extensions are
-supported under stock System V terminfo/curses.)
-.PP
+.bP
+Next, if the environment variable TERMINFO_DIRS is set,
+\fBncurses\fR will interpret the contents of that variable
+as a list of colon-separated directories (or database files) to be searched.
+.IP
+An empty directory name (i.e., if the variable begins or ends
+with a colon, or contains adjacent colons)
+is interpreted as the system location \fI\*d\fR.
+.bP
+Finally, \fBncurses\fP searches these compiled-in locations:
+.RS
+.bP
+a list of directories (@TERMINFO_DIRS@), and
+.bP
+the system terminfo directory, \fI\*d\fR (the compiled-in default).
+.RE
 .SS Preparing Descriptions
 .PP
 We now outline how to prepare descriptions of terminals.
@@ -154,7 +233,7 @@
 .PP
 To get the padding for insert line right (if the terminal manufacturer
 did not document it) a severe test is to edit a large file at 9600 baud,
-delete 16 or so lines from the middle of the screen, then hit the `u'
+delete 16 or so lines from the middle of the screen, then hit the \*(``u\*(''
 key several times quickly.
 If the terminal messes up, more padding is usually needed.
 A similar test can be used for insert character.
@@ -198,7 +277,7 @@
 and
 .BR cud1 .
 These local cursor motions should not alter the text they pass over,
-for example, you would not normally use `\fBcuf1\fP=\ ' because the
+for example, you would not normally use \*(``\fBcuf1\fP=\ \*('' because the
 space would erase the character moved over.
 .PP
 A very important point here is that the local cursor motions encoded
@@ -275,9 +354,10 @@
 .ft CW
 .\".in -2
 \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
-	bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
+        bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
 .\".in +2
 .ft R
+.fi
 .PP
 while the Lear Siegler \s-1ADM-3\s0 is described as
 .PP
@@ -286,8 +366,8 @@
 .ft CW
 .\".in -2
 \s-1adm3\||\|3\||\|lsi adm3,
-	am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
-	ind=^J, lines#24,\s+1
+        am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
+        ind=^J, lines#24,\s+1
 .\".in +2
 .ft R
 .fi
@@ -296,9 +376,8 @@
 .PP
 Cursor addressing and other strings requiring parameters
 in the terminal are described by a
-parameterized string capability, with
-.IR printf (3)
-like escapes \fB%x\fR in it.
+parameterized string capability,
+with \fIprintf\fP-like escapes such as \fI%x\fR in it.
 For example, to address the cursor, the
 .B cup
 capability is given, using two parameters:
@@ -321,34 +400,34 @@
 The \fB%\fR encodings have the following meanings:
 .PP
 .TP 5
-\s-1%%
-outputs `%'
+\fB%%\fP
+outputs \*(``%\*(''
 .TP
-%\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
-as in \fBprintf\fP, flags are [-+#] and space.
-Use a `:' to allow the next character to be a `-' flag,
-avoiding interpreting "%-" as an operator.
+\fB%\fP\fI[[\fP:\fI]flags][width[.precision]][\fP\fBdoxXs\fP\fI]\fP
+as in \fBprintf\fP, flags are \fI[\-+#]\fP and \fIspace\fP.
+Use a \*(``:\*('' to allow the next character to be a \*(``\-\*('' flag,
+avoiding interpreting "%\-" as an operator.
 .TP
-%c
+\f(CW%c\fP
 print pop() like %c in \fBprintf\fP
 .TP
-%s
+\fB%s\fP
 print pop() like %s in \fBprintf\fP
 .TP
-%p[1-9]
+\fB%p\fP\fI[1\-9]\fP
 push \fIi\fP'th parameter
 .TP
-%P[a-z]
-set dynamic variable [a-z] to pop()
+\fB%P\fP\fI[a\-z]\fP
+set dynamic variable \fI[a\-z]\fP to pop()
 .TP
-%g[a-z]
-get dynamic variable [a-z] and push it
+\fB%g\fP\fI[a\-z]/\fP
+get dynamic variable \fI[a\-z]\fP and push it
 .TP
-%P[A-Z]
-set static variable [a-z] to pop()
+\fB%P\fP\fI[A\-Z]\fP
+set static variable \fI[a\-z]\fP to \fIpop()\fP
 .TP
-%g[A-Z]
-get static variable [a-z] and push it
+\fB%g\fP\fI[A\-Z]\fP
+get static variable \fI[a\-z]\fP and push it
 .IP
 The terms "static" and "dynamic" are misleading.
 Historically, these are simply two different sets of variables,
@@ -356,56 +435,56 @@
 However, that fact is not documented in other implementations.
 Relying on it will adversely impact portability to other implementations.
 .TP
-%'\fIc\fP'
+\fB%'\fP\fIc\fP\fB'\fP
 char constant \fIc\fP
 .TP
-%{\fInn\fP}
+\fB%{\fP\fInn\fP\fB}\fP
 integer constant \fInn\fP
 .TP
-%l
+\fB%l\fP
 push strlen(pop)
 .TP
-%+ %- %* %/ %m
-arithmetic (%m is mod): push(pop() op pop())
+\fB%+\fP, \fB%\-\fP, \fB%*\fP, \fB%/\fP, \fB%m\fP
+arithmetic (%m is mod): \fIpush(pop() op pop())\fP
 .TP
-%& %| %^
-bit operations (AND, OR and exclusive-OR): push(pop() op pop())
+\fB%&\fP, \fB%|\fP, \fB%^\fP
+bit operations (AND, OR and exclusive-OR): \fIpush(pop() op pop())\fP
 .TP
-%= %> %<
-logical operations: push(pop() op pop())
+\fB%=\fP, \fB%>\fP, \fB%<\fP
+logical operations: \fIpush(pop() op pop())\fP
 .TP
-%A, %O
+\fB%A\fP, \fB%O\fP
 logical AND and OR operations (for conditionals)
 .TP
-%! %~
+\fB%!\fP, \fB%~\fP
 unary operations (logical and bit complement): push(op pop())
 .TP
-%i
+\fB%i\fP
 add 1 to first two parameters (for ANSI terminals)
 .TP
-%? \fIexpr\fP %t \fIthenpart\fP %e \fIelsepart\fP %;
+\fB%?\fP \fIexpr\fP \fB%t\fP \fIthenpart\fP \fB%e\fP \fIelsepart\fP \fB%;\fP
 This forms an if-then-else.
-The %e \fIelsepart\fP is optional.
-Usually the %? \fIexpr\fP part pushes a value onto the stack,
-and %t pops it from the stack, testing if it is nonzero (true).
-If it is zero (false), control passes to the %e (else) part.
+The \fB%e\fP \fIelsepart\fP is optional.
+Usually the \fB%?\fP \fIexpr\fP part pushes a value onto the stack,
+and \fB%t\fP pops it from the stack, testing if it is nonzero (true).
+If it is zero (false), control passes to the \fB%e\fP (else) part.
 .IP
 It is possible to form else-if's a la Algol 68:
 .RS
-%? c\d1\u %t b\d1\u %e c\d2\u %t b\d2\u %e c\d3\u %t b\d3\u %e c\d4\u %t b\d4\u %e %;
+\fB%?\fP c\d1\u \fB%t\fP b\d1\u \fB%e\fP c\d2\u \fB%t\fP b\d2\u \fB%e\fP c\d3\u \fB%t\fP b\d3\u \fB%e\fP c\d4\u \fB%t\fP b\d4\u \fB%e\fP \fB%;\fP
 .RE
 .IP
 where c\di\u are conditions, b\di\u are bodies.
 .IP
-Use the \fB-f\fP option of \fBtic\fP or \fB@INFOCMP@\fP to see
-the structure of if-the-else's.
+Use the \fB\-f\fP option of \fB@TIC@\fP or \fB@INFOCMP@\fP to see
+the structure of if-then-else's.
 Some strings, e.g., \fBsgr\fP can be very complicated when written
 on one line.
-The \fB-f\fP option splits the string into lines with the parts indented.
+The \fB\-f\fP option splits the string into lines with the parts indented.
 .PP
 Binary operations are in postfix form with the operands in the usual order.
-That is, to get x-5 one would use "%gx%{5}%-".
-%P and %g variables are
+That is, to get x\-5 one would use "%gx%{5}%-".
+\fB%P\fP and \fB%g\fP variables are
 persistent across escape-string evaluations.
 .PP
 Consider the HP2645, which, to get to row 3 and column 12, needs
@@ -429,7 +508,7 @@
 .PP
 A final example is the \s-1LSI ADM\s0-3a, which uses row and column
 offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
-After sending `\eE=', this pushes the first parameter, pushes the
+After sending \*(``\eE=\*('', this pushes the first parameter, pushes the
 ASCII value for a space (32), adds them (pushing the sum on the stack
 in place of the two previous values) and outputs that value as a character.
 Then the same is done for the second parameter.
@@ -542,7 +621,7 @@
 an entry with \fBcsr\fR).
 .PP
 Yet another way to construct insert and delete might be to use a combination of
-index with the memory-lock feature found on some terminals (like the HP-700/90
+index with the memory-lock feature found on some terminals (like the HP\-700/90
 series, which however also has insert/delete).
 .PP
 Inserting lines at the top or bottom of the screen can also be
@@ -593,6 +672,7 @@
 a distinction between typed and untyped blanks on the screen, shifting
 upon an insert or delete only to an untyped blank on the screen which is
 either eliminated, or expanded to two untyped blanks.
+.PP
 You can determine the
 kind of terminal you have by clearing the screen and then typing
 text separated by cursor motions.
@@ -608,6 +688,7 @@
 current line and onto the next as you insert, you have the second type of
 terminal, and should give the capability \fBin\fR, which stands for
 \*(lqinsert null\*(rq.
+.PP
 While these are two logically separate attributes (one line versus multi-line
 insert mode, and special treatment of untyped spaces) we have seen no
 terminals whose insert mode cannot be described with the single attribute.
@@ -642,7 +723,7 @@
 in \fBip\fR (a string option).
 Any other sequence which may need to be
 sent after an insert of a single character may also be given in \fBip\fR.
-If your terminal needs both to be placed into an `insert mode' and
+If your terminal needs both to be placed into an \*(``insert mode\*('' and
 a special code to precede each inserted character, then both
 .BR smir / rmir
 and
@@ -759,9 +840,9 @@
 .PP
 .TS
 center;
-l c c
-l c c
-lw28 lw6 lw2 lw20.
+l l l
+l l l
+lw18 lw14 lw18.
 \fBtparm parameter	attribute	escape sequence\fP
 
 none	none	\\E[0m
@@ -792,13 +873,15 @@
 .PP
 Writing out the above sequences, along with their dependencies yields
 .PP
+.ne 11
 .TS
 center;
-l c c
-l c c
-lw28 lw6 lw2 lw20.
+l l l
+l l l
+lw18 lw14 lw18.
 \fBsequence	when to output	terminfo translation\fP
 
+.ft CW
 \\E[0	always	\\E[0
 ;1	if p1 or p6	%?%p1%p6%|%t;1%;
 ;4	if p2	%?%p2%|%t;4%;
@@ -807,14 +890,17 @@
 ;8	if p7	%?%p7%|%t;8%;
 m	always	m
 ^N or ^O	if p9 ^N, else ^O	%?%p9%t^N%e^O%;
+.ft R
 .TE
 .PP
 Putting this all together into the sgr sequence gives:
 .PP
+.ft CW
 .nf
-    sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
-        %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
+    sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
+        %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
 .fi
+.ft R
 .PP
 Remember that if you specify sgr, you must also specify sgr0.
 Also, some implementations rely on sgr being given if sgr0 is,
@@ -824,9 +910,9 @@
 The only drawback to adding an sgr string is that termcap also
 assumes that sgr0 does not exit alternate character set mode.
 .PP
-Terminals with the ``magic cookie'' glitch
+Terminals with the \*(``magic cookie\*('' glitch
 .RB ( xmc )
-deposit special ``cookies'' when they receive mode-setting sequences,
+deposit special \*(``cookies\*('' when they receive mode-setting sequences,
 which affect the display algorithm rather than having extra bits for
 each character.
 Some terminals, such as the HP 2621, automatically leave standout
@@ -871,6 +957,7 @@
 If the keypad can be set to transmit or not transmit,
 give these codes as \fBsmkx\fR and \fBrmkx\fR.
 Otherwise the keypad is assumed to always transmit.
+.PP
 The codes sent by the left arrow, right arrow, up arrow, down arrow,
 and home keys can be given as
 \fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
@@ -878,41 +965,60 @@
 can be given as \fBkf0, kf1, ..., kf10\fR.
 If these keys have labels other than the default f0 through f10, the labels
 can be given as \fBlf0, lf1, ..., lf10\fR.
+.PP
 The codes transmitted by certain other special keys can be given:
+.bP
 .B kll
 (home down),
+.bP
 .B kbs
 (backspace),
+.bP
 .B ktbc
 (clear all tabs),
+.bP
 .B kctab
 (clear the tab stop in this column),
+.bP
 .B kclr
 (clear screen or erase key),
+.bP
 .B kdch1
 (delete character),
+.bP
 .B kdl1
 (delete line),
+.bP
 .B krmir
 (exit insert mode),
+.bP
 .B kel
 (clear to end of line),
+.bP
 .B ked
 (clear to end of screen),
+.bP
 .B kich1
 (insert character or enter insert mode),
+.bP
 .B kil1
 (insert line),
+.bP
 .B knp
 (next page),
+.bP
 .B kpp
 (previous page),
+.bP
 .B kind
 (scroll forward/down),
+.bP
 .B kri
 (scroll backward/up),
+.bP
 .B khts
 (set a tab stop in this column).
+.PP
 In addition, if the keypad has a 3 by 3 array of keys including the four
 arrow keys, the other five keys can be given as
 .BR ka1 ,
@@ -956,7 +1062,7 @@
 tab stop can be given as
 .B ht
 (usually control I).
-A ``back-tab'' command which moves leftward to the preceding tab stop can
+A \*(``back-tab\*('' command which moves leftward to the preceding tab stop can
 be given as
 .BR cbt .
 By convention, if the teletype modes indicate that tabs are being
@@ -974,7 +1080,7 @@
 .B it
 is given, showing the number of spaces the tabs are set to.
 This is normally used by the
-.IR tset
+.IR @TSET@
 command to determine whether to set the mode for hardware tab expansion,
 and whether to set the tab stops.
 If the terminal has tab stops that can be saved in non-volatile memory,
@@ -1131,7 +1237,7 @@
 string is used.
 .PP
 .SS Status Lines
-Some terminals have an extra `status line' which is not normally used by
+Some terminals have an extra \*(``status line\*('' which is not normally used by
 software (and thus not counted in the terminal's \fBlines\fR capability).
 .PP
 The simplest case is a status line which is cursor-addressable but not
@@ -1174,9 +1280,9 @@
 .PP
 .TS H
 center expand;
-c l l c
-c l l c
-lw28 lw6 lw2 lw20.
+l l l l
+l l l l
+lw25 lw10 lw6 lw6.
 .\".TH
 \fBGlyph	ACS	Ascii	VT100\fR
 \fBName	Name	Default	Name\fR
@@ -1184,7 +1290,7 @@
 arrow pointing down	ACS_DARROW	v	.
 arrow pointing left	ACS_LARROW	<	,
 arrow pointing right	ACS_RARROW	>	+
-arrow pointing up	ACS_UARROW	^	-
+arrow pointing up	ACS_UARROW	^	\-
 board of squares	ACS_BOARD	#	h
 bullet          	ACS_BULLET	o	~
 checker board (stipple)	ACS_CKBOARD	:	a
@@ -1192,7 +1298,7 @@
 diamond         	ACS_DIAMOND	+	`
 greater-than-or-equal-to	ACS_GEQUAL	>	z
 greek pi        	ACS_PI	*	{
-horizontal line 	ACS_HLINE	-	q
+horizontal line 	ACS_HLINE	\-	q
 lantern symbol  	ACS_LANTERN	#	i
 large plus or crossover	ACS_PLUS	+	n
 less-than-or-equal-to	ACS_LEQUAL	<	y
@@ -1201,8 +1307,8 @@
 not-equal       	ACS_NEQUAL	!	|
 plus/minus      	ACS_PLMINUS	#	g
 scan line 1     	ACS_S1  	~	o
-scan line 3     	ACS_S3  	-	p
-scan line 7     	ACS_S7  	-	r
+scan line 3     	ACS_S3  	\-	p
+scan line 7     	ACS_S7  	\-	r
 scan line 9     	ACS_S9  	\&_	s
 solid square block	ACS_BLOCK	#	0
 tee pointing down	ACS_TTEE	+	w
@@ -1223,11 +1329,11 @@
 .PP
 .SS Color Handling
 .PP
-Most color terminals are either `Tektronix-like' or `HP-like'.
+Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*(''.
 Tektronix-like
 terminals have a predefined set of N colors (where N usually 8), and can set
 character-cell foreground and background characters independently, mixing them
-into N * N color-pairs.
+into N\ *\ N color-pairs.
 On HP-like terminals, the use must set each color
 pair up separately (foreground and background are not independently settable).
 Up to M color-pairs may be set up from 2*M different colors.
@@ -1303,6 +1409,7 @@
 yellow	\fBCOLOR_YELLOW\fR	6	max,max,0
 white	\fBCOLOR_WHITE\fR	7	max,max,max
 .TE
+.PP
 It is important to not confuse the two sets of color capabilities;
 otherwise red/blue will be interchanged on the display.
 .PP
@@ -1312,7 +1419,7 @@
 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
 indicate that colors can be modified.
 If so, the \fBinitc\fR capability will
-take a color number (0 to \fBcolors\fR - 1)and three more parameters which
+take a color number (0 to \fBcolors\fR \- 1)and three more parameters which
 describe the color.
 These three parameters default to being interpreted as RGB
 (Red, Green, Blue) values.
@@ -1324,7 +1431,7 @@
 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
 color-pair value.
 It will take seven parameters; a color-pair number (0 to
-\fBmax_pairs\fR - 1), and two triples describing first background and then
+\fBmax_pairs\fR \- 1), and two triples describing first background and then
 foreground colors.
 These parameters must be (Red, Green, Blue) or
 (Hue, Lightness, Saturation) depending on \fBhls\fR.
@@ -1339,18 +1446,25 @@
 .PP
 .TS
 center;
-l c c
-lw25 lw2 lw10.
-\fBAttribute	Bit	Decimal\fR
-A_STANDOUT	0	1
-A_UNDERLINE	1	2
-A_REVERSE	2	4
-A_BLINK   	3	8
-A_DIM      	4	16
-A_BOLD    	5	32
-A_INVIS   	6	64
-A_PROTECT	7	128
-A_ALTCHARSET	8	256
+l l l l
+lw20 lw2 lw10 lw10.
+\fBAttribute	Bit	Decimal	Set by\fR
+A_STANDOUT	0	1	sgr
+A_UNDERLINE	1	2	sgr
+A_REVERSE	2	4	sgr
+A_BLINK   	3	8	sgr
+A_DIM      	4	16	sgr
+A_BOLD    	5	32	sgr
+A_INVIS   	6	64	sgr
+A_PROTECT	7	128	sgr
+A_ALTCHARSET	8	256	sgr
+A_HORIZONTAL	9	512	sgr1
+A_LEFT	10	1024	sgr1
+A_LOW	11	2048	sgr1
+A_RIGHT	12	4096	sgr1
+A_TOP	13	8192	sgr1
+A_VERTICAL	14	16384	sgr1
+A_ITALIC	15	32768	sitm
 .TE
 .PP
 For example, on many IBM PC consoles, the underline attribute collides with the
@@ -1389,7 +1503,7 @@
 .BR rep .
 The first parameter is the character to be repeated and the second
 is the number of times to repeat it.
-Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'.
+Thus, tparm(repeat_char, 'x', 10) is the same as \*(``xxxxxxxxxx\*(''.
 .PP
 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
 this can be indicated with
@@ -1420,13 +1534,13 @@
 .I virtual
 terminal descriptions for which the escape sequences are known.)
 .PP
-If the terminal has a ``meta key'' which acts as a shift key,
+If the terminal has a \*(``meta key\*('' which acts as a shift key,
 setting the 8th bit of any character transmitted, this fact can
 be indicated with
 .BR km .
 Otherwise, software will assume that the 8th bit is parity and it
 will usually be cleared.
-If strings exist to turn this ``meta mode'' on and off, they
+If strings exist to turn this \*(``meta mode\*('' on and off, they
 can be given as
 .B smm
 and
@@ -1470,7 +1584,7 @@
 .PP
 .SS Glitches and Braindamage
 .PP
-Hazeltine terminals, which do not allow `~' characters to be displayed should
+Hazeltine terminals, which do not allow \*(``~\*('' characters to be displayed should
 indicate \fBhz\fR.
 .PP
 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
@@ -1485,10 +1599,10 @@
 .PP
 Teleray terminals, where tabs turn all characters moved over to blanks,
 should indicate \fBxt\fR (destructive tabs).
-Note: the variable indicating this is now `dest_tabs_magic_smso'; in
+Note: the variable indicating this is now \*(``dest_tabs_magic_smso\*(''; in
 older versions, it was teleray_glitch.
 This glitch is also taken to mean that it is not possible to position
-the cursor on top of a ``magic cookie'',
+the cursor on top of a \*(``magic cookie\*('',
 that to erase standout mode it is instead necessary to use
 delete and insert line.
 The ncurses implementation ignores this glitch.
@@ -1499,7 +1613,7 @@
 indicating that the f1 key is used for escape and f2 for control C.
 (Only certain Superbees have this problem, depending on the ROM.)
 Note that in older terminfo versions, this capability was called
-`beehive_glitch'; it is now `no_esc_ctl_c'.
+\*(``beehive_glitch\*(''; it is now \*(``no_esc_ctl_c\*(''.
 .PP
 Other specific terminal problems may be corrected by adding more
 capabilities of the form \fBx\fR\fIx\fR.
@@ -1524,10 +1638,12 @@
 A capability can be canceled by placing \fBxx@\fR to the left of the
 use reference that imports it, where \fIxx\fP is the capability.
 For example, the entry
+.RS
 .PP
-	2621-nl, smkx@, rmkx@, use=2621,
+2621\-nl, smkx@, rmkx@, use=2621,
+.RE
 .PP
-defines a 2621-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
+defines a 2621\-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
 and hence does not turn on the function key labels when in visual mode.
 This is useful for different modes for a terminal, or for different
 user preferences.
@@ -1544,7 +1660,7 @@
 allocate a 1024-byte buffer for the termcap entry.
 The entry gets null-terminated by
 the termcap library, so that makes the maximum safe length for a termcap entry
-1k-1 (1023) bytes.
+1k\-1 (1023) bytes.
 Depending on what the application and the termcap library
 being used does, and where in the termcap file the terminal type that \fBtgetent()\fP
 is searching for is, several bad things can happen.
@@ -1570,19 +1686,15 @@
 backslash-newline pairs, which \fBtgetent()\fP strips out while reading it.
 Some termcap libraries strip off the final newline, too (GNU termcap does not).
 Now suppose:
-.TP 5
-*
+.bP
 a termcap entry before expansion is more than 1023 bytes long,
-.TP 5
-*
+.bP
 and the application has only allocated a 1k buffer,
-.TP 5
-*
+.bP
 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
 the whole entry into the buffer, no matter what its length, to see
 if it is the entry it wants,
-.TP 5
-*
+.bP
 and \fBtgetent()\fP is searching for a terminal type that either is the
 long entry, appears in the termcap file after the long entry, or
 does not appear in the file at all (so that \fBtgetent()\fP has to search
@@ -1612,19 +1724,24 @@
 terminal types and users whose TERM variable does not have a termcap
 entry.
 .PP
-When in -C (translate to termcap) mode, the \fBncurses\fR implementation of
+When in \-C (translate to termcap) mode, the \fBncurses\fR implementation of
 \fB@TIC@\fR(1M) issues warning messages when the pre-tc length of a termcap
 translation is too long.
-The -c (check) option also checks resolved (after tc
+The \-c (check) option also checks resolved (after tc
 expansion) lengths.
 .SS Binary Compatibility
 It is not wise to count on portability of binary terminfo entries between
 commercial UNIX versions.
 The problem is that there are at least two versions
-of terminfo (under HP-UX and AIX) which diverged from System V terminfo after
+of terminfo (under HP\-UX and AIX) which diverged from System V terminfo after
 SVr1, and have added extension capabilities to the string table that (in the
 binary format) collide with System V and XSI Curses extensions.
 .SH EXTENSIONS
+.PP
+Searching for terminal descriptions in
+\fB$HOME/.terminfo\fR and TERMINFO_DIRS 
+is not supported by older implementations.
+.PP
 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
 interpret the %A and %O operators in parameter strings.
 .PP
@@ -1652,35 +1769,44 @@
 interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm
 that can return mouse-tracking information in the keyboard-input stream.
 .PP
+X/Open Curses does not mention italics.
+Portable applications must assume that numeric capabilities are
+signed 16-bit values.
+This includes the \fIno_color_video\fP (ncv) capability.
+The 32768 mask value used for italics with ncv can be confused with
+an absent or cancelled ncv.
+If italics should work with colors,
+then the ncv value must be specified, even if it is zero.
+.PP
 Different commercial ports of terminfo and curses support different subsets of
 the XSI Curses standard and (in some cases) different extension sets.
 Here
 is a summary, accurate as of October 1995:
 .PP
-\fBSVR4, Solaris, ncurses\fR --
+\fBSVR4, Solaris, ncurses\fR \-\-
 These support all SVr4 capabilities.
 .PP
-\fBSGI\fR --
+\fBSGI\fR \-\-
 Supports the SVr4 set, adds one undocumented extended string
 capability (\fBset_pglen\fR).
 .PP
-\fBSVr1, Ultrix\fR --
+\fBSVr1, Ultrix\fR \-\-
 These support a restricted subset of terminfo capabilities.
-The booleans
-end with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and the
-strings with \fBprtr_non\fR.
+The booleans end with \fBxon_xoff\fR;
+the numerics with \fBwidth_status_line\fR;
+and the strings with \fBprtr_non\fR.
 .PP
-\fBHP/UX\fR --
+\fBHP/UX\fR \-\-
 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
 extensions in the string table.
 .PP
-\fBAIX\fR --
+\fBAIX\fR \-\-
 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
 of incompatible string table extensions.
 .PP
-\fBOSF\fR --
+\fBOSF\fR \-\-
 Supports both the SVr4 set and the AIX extensions.
 .SH FILES
 .TP 25
@@ -1692,12 +1818,7 @@
 \fBcurses\fR(3X),
 \fBprintf\fR(3),
 \fBterm\fR(\*n).
+\fBterm_variables\fR(3X).
 .SH AUTHORS
 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
 Based on pcurses by Pavel Curtis.
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/tic.1m b/man/tic.1m
index 343ec32..878e213 100644
--- a/man/tic.1m
+++ b/man/tic.1m
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 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            *
@@ -26,19 +26,29 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tic.1m,v 1.44 2006/12/24 17:59:11 tom Exp $
+.\" $Id: tic.1m,v 1.60 2014/05/24 22:00:11 tom Exp $
 .TH @TIC@ 1M ""
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
 .ds n 5
 .ds d @TERMINFO@
+.de bP
+.IP \(bu 4
+..
 .SH NAME
-\fBtic\fR - the \fIterminfo\fR entry-description compiler
+\fB@TIC@\fR \- the \fIterminfo\fR entry-description compiler
 .SH SYNOPSIS
-\fBtic\fR
-[\fB-\
+\fB@TIC@\fR
+[\fB\-\
+0\
 1\
 C\
+D\
 G\
 I\
+K\
 L\
 N\
 T\
@@ -53,59 +63,137 @@
 t\
 x\
 \fR]
-[\fB-e\fR \fInames\fR]
-[\fB-o\fR \fIdir\fR]
-[\fB-R\fR \fIsubset\fR]
-[\fB-v\fR[\fIn\fR]]
-[\fB-w\fR[\fIn\fR]]
+[\fB\-e\fR \fInames\fR]
+[\fB\-o\fR \fIdir\fR]
+[\fB\-R\fR \fIsubset\fR]
+[\fB\-v\fR[\fIn\fR]]
+[\fB\-w\fR[\fIn\fR]]
 \fIfile\fR
 .br
 .SH DESCRIPTION
-The command \fBtic\fR translates a \fBterminfo\fR file from source
-format into compiled format.  The compiled format is necessary for use with
+The \fB@TIC@\fR command translates a \fBterminfo\fR file from source
+format into compiled format.
+The compiled format is necessary for use with
 the library routines in \fBncurses\fR(3X).
 .PP
-The results are normally placed in the system terminfo
-directory \fB\*d\fR.  There are two ways to change this behavior.
+As described in \fBterm\fR(\*n), the database may be either a directory
+tree (one file per terminal entry) or a hashed database (one record per entry).
+The \fB@TIC@\fR command writes only one type of entry,
+depending on how it was built:
+.bP
+For directory trees, the top-level directory, e.g., /usr/share/terminfo,
+specifies the location of the database.
+.bP
+For hashed databases, a filename is needed.
+If the given file is not found by that name,
+but can be found by adding the suffix ".db",
+then that is used.
+.IP
+The default name for the hashed database is the same as the
+default directory name (only adding a ".db" suffix).
 .PP
-First, you may override the system default by setting the variable
-\fBTERMINFO\fR in your shell environment to a valid (existing) directory name.
+In either case (directory or hashed database),
+\fB@TIC@\fP will create the container if it does not exist.
+For a directory, this would be the "terminfo" leaf,
+versus a "terminfo.db" file.
 .PP
-Secondly, if \fBtic\fR cannot get access to \fI\*d\fR or your TERMINFO
-directory, it looks for the directory \fI$HOME/.terminfo\fR; if that directory
-exists, the entry is placed there.
+The results are normally placed in the system terminfo database \fB\*d\fR.
+The compiled terminal description can be placed
+in a different terminfo database.
+There are two ways to achieve this:
+.bP
+First, you may override the system default either by
+using the \fB\-o\fP option,
+or by setting the variable \fBTERMINFO\fR
+in your shell environment to a valid database location.
+.bP
+Secondly, if \fB@TIC@\fR cannot write in \fI\*d\fR
+or the location specified using your TERMINFO variable,
+it looks for the directory \fI$HOME/.terminfo\fR
+(or hashed database \fI$HOME/.terminfo.db)\fR;
+if that location exists, the entry is placed there.
 .PP
-Libraries that read terminfo entries are expected to check for a TERMINFO
-directory first, look at \fI$HOME/.terminfo\fR if TERMINFO is not set, and
-finally look in \fI\*d\fR.
+Libraries that read terminfo entries are expected to check in succession
+.bP
+a location specified with the TERMINFO environment variable,
+.bP
+\fI$HOME/.terminfo\fR,
+.bP
+directories listed in the TERMINFO_DIRS environment variable,
+.bP
+a compiled-in list of directories (@TERMINFO_DIRS@), and
+.bP
+the system terminfo database (\fI\*d\fR).
+.SS OPTIONS
 .TP
-\fB-1\fR
+\fB\-0\fR
+restricts the output to a single line
+.TP
+\fB\-1\fR
 restricts the output to a single column
 .TP
-\fB-a\fR
-tells \fBtic\fP to retain commented-out capabilities rather than discarding
-them.  Capabilities are commented by prefixing them with a period.
-This sets the \fB-x\fR option, because it treats the commented-out
+\fB\-a\fR
+tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
+them.
+Capabilities are commented by prefixing them with a period.
+This sets the \fB\-x\fR option, because it treats the commented-out
 entries as user-defined names.
 If the source is termcap, accept the 2-character names required by version 6.
 Otherwise these are ignored.
 .TP
-\fB-C\fR
-Force source translation to termcap format.  Note: this differs from the \fB-C\fR
+\fB\-C\fR
+Force source translation to termcap format.
+Note: this differs from the \fB\-C\fR
 option of \fB@INFOCMP@\fR(1M) in that it does not merely translate capability
-names, but also translates terminfo strings to termcap format.  Capabilities
+names, but also translates terminfo strings to termcap format.
+Capabilities
 that are not translatable are left in the entry under their terminfo names
 but commented out with two preceding dots.
+The actual format used incorporates some improvements for escaped characters
+from terminfo format.
+For a stricter BSD-compatible translation, add the \fB\-K\fR option.
+.IP
+If this is combined with \fB\-c\fR, \fB@TIC@\fR makes additional checks
+to report cases where the terminfo values do not have an exact equivalent
+in termcap form.
+For example:
+.RS
+.bP
+\fBsgr\fP usually will not convert, because termcap lacks the ability to
+work with more than two parameters, and because termcap lacks many of
+the arithmetic/logical operators used in terminfo.
+.bP
+capabilities with more than one delay or with delays before the end of
+the string will not convert completely.
+.RE
 .TP
-\fB-c\fR
-tells \fBtic\fP to only check \fIfile\fR for errors, including syntax problems and
-bad use links.  If you specify \fB-C\fR (\fB-I\fR) with this option, the code
+\fB\-c\fR
+tells \fB@TIC@\fP to only check \fIfile\fR for errors, including syntax problems and
+bad use links.
+If you specify \fB\-C\fR (\fB\-I\fR) with this option, the code
 will print warnings about entries which, after use resolution, are more than
-1023 (4096) bytes long.  Due to a fixed buffer length in older termcap
-libraries (and a documented limit in terminfo), these entries may cause core
-dumps.
+1023 (4096) bytes long.
+Due to a fixed buffer length in older termcap libraries,
+as well as buggy checking for the buffer length
+(and a documented limit in terminfo),
+these entries may cause core
+dumps with other implementations.
+.IP
+\fB@TIC@\fP checks string capabilities to ensure that those with parameters
+will be valid expressions.
+It does this check only for the predefined string capabilities;
+those which are defined with the \fB\-x\fP option are ignored.
 .TP
-\fB-e \fR\fInames\fR
+\fB\-D\fR
+tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
+The first location shown is the one to which it would write compiled
+terminal descriptions.
+If \fB@TIC@\fP is not able to find a writable database location
+according to the rules summarized above,
+it will print a diagnostic and exit with an error rather than
+printing a list of database locations.
+.TP
+\fB\-e \fR\fInames\fR
 Limit writes and translations to the following comma-separated list of
 terminals.
 If any name or alias of a terminal matches one of the names in
@@ -113,105 +201,96 @@
 Otherwise no output will be generated for it.
 The option value is interpreted as a file containing the list if it
 contains a '/'.
-(Note: depending on how tic was compiled, this option may require \fB-I\fR or \fB-C\fR.)
+(Note: depending on how tic was compiled, this option may require \fB\-I\fR or \fB\-C\fR.)
 .TP
-\fB-f\fR
+\fB\-f\fR
 Display complex terminfo strings which contain if/then/else/endif expressions
 indented for readability.
 .TP
-\fB-G\fR
+\fB\-G\fR
 Display constant literals in decimal form
 rather than their character equivalents.
 .TP
-\fB-g\fR
+\fB\-g\fR
 Display constant character literals in quoted form
 rather than their decimal equivalents.
 .TP
-\fB-I\fR
+\fB\-I\fR
 Force source translation to terminfo format.
 .TP
-\fB-L\fR
+\fB\-K\fR
+Suppress some longstanding ncurses extensions to termcap format,
+e.g., "\\s" for space.
+.TP
+\fB\-L\fR
 Force source translation to terminfo format
 using the long C variable names listed in <\fBterm.h\fR>
 .TP
-\fB-N\fR
-Disable smart defaults. 
+\fB\-N\fR
+Disable smart defaults.
 Normally, when translating from termcap to terminfo, the compiler makes
 a number of assumptions about the defaults of string capabilities
 \fBreset1_string\fR, \fBcarriage_return\fR, \fBcursor_left\fR,
 \fBcursor_down\fR, \fBscroll_forward\fR, \fBtab\fR, \fBnewline\fR,
 \fBkey_backspace\fR, \fBkey_left\fR, and \fBkey_down\fR, then attempts
-to use obsolete termcap capabilities to deduce correct values.  It also
+to use obsolete termcap capabilities to deduce correct values.
+It also
 normally suppresses output of obsolete termcap capabilities such as \fBbs\fR.
 This option forces a more literal translation that also preserves the
 obsolete capabilities.
 .TP
-\fB-o\fR\fIdir\fR
-Write compiled entries to given directory.  Overrides the TERMINFO environment
-variable.
+\fB\-o\fR\fIdir\fR
+Write compiled entries to given database location.
+Overrides the TERMINFO environment variable.
 .TP
-\fB-R\fR\fIsubset\fR
-Restrict output to a given subset.  This option is for use with archaic
+\fB\-R\fR\fIsubset\fR
+Restrict output to a given subset.
+This option is for use with archaic
 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
-that have their own extensions incompatible with SVr4/XSI.  Available subsets
+that have their own extensions incompatible with SVr4/XSI.
+Available subsets
 are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see \fBterminfo\fR(\*n) for details.
 .TP
-\fB-r\fR
+\fB\-r\fR
 Force entry resolution (so there are no remaining tc capabilities) even
-when doing translation to termcap format.  This may be needed if you are
+when doing translation to termcap format.
+This may be needed if you are
 preparing a termcap file for a termcap library (such as GNU termcap through
 version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
 tc capabilities per entry.
 .TP
-\fB-s\fR
-Summarize the compile by showing the directory into which entries
+\fB\-s\fR
+Summarize the compile by showing the database location into which entries
 are written, and the number of entries which are compiled.
 .TP
-\fB-T\fR
+\fB\-T\fR
 eliminates size-restrictions on the generated text.
 This is mainly useful for testing and analysis, since the compiled
 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
 .TP
-\fB-t\fR
-tells \fBtic\fP to discard commented-out capabilities.
+\fB\-t\fR
+tells \fB@TIC@\fP to discard commented-out capabilities.
 Normally when translating from terminfo to termcap,
 untranslatable capabilities are commented-out.
 .TP 5
-\fB-U\fR
-tells \fBtic\fP to not post-process the data after parsing the source file.
+\fB\-U\fR
+tells \fB@TIC@\fP to not post-process the data after parsing the source file.
 Normally, it infers data which is commonly missing in older terminfo data,
 or in termcaps.
 .TP
-\fB-V\fR
+\fB\-V\fR
 reports the version of ncurses which was used in this program, and exits.
 .TP
-\fB-v\fR\fIn\fR
+\fB\-v\fR\fIn\fR
 specifies that (verbose) output be written to standard error trace
-information showing \fBtic\fR's progress.
+information showing \fB@TIC@\fR's progress.
 The optional parameter \fIn\fR is a number from 1 to 10, inclusive,
 indicating the desired level of detail of information.
 If \fIn\fR is omitted, the default level is 1.
 If \fIn\fR is specified and greater than 1, the level of
 detail is increased.
-.TP
-\fB-w\fR\fIn\fR
-specifies the width of the output.
-The parameter is optional.
-If it is omitted, it defaults to 60.
-.TP
-\fB-x\fR
-Treat unknown capabilities as user-defined.
-That is, if you supply a capability name which \fBtic\fP does not recognize,
-it will infer its type (boolean, number or string) from the syntax and
-make an extended table entry for that.
-User-defined capability strings
-whose name begins with ``k'' are treated as function keys.
-.TP
-\fIfile\fR
-contains one or more \fBterminfo\fR terminal descriptions in source
-format [see \fBterminfo\fR(\*n)].  Each description in the file
-describes the capabilities of a particular terminal.
+.RS
 .PP
 The debug flag levels are as follows:
 .TP
@@ -219,7 +298,7 @@
 Names of files created and linked
 .TP
 2
-Information related to the ``use'' facility
+Information related to the \*(``use\*('' facility
 .TP
 3
 Statistics from the hashing algorithm
@@ -237,17 +316,43 @@
 All values computed in construction of the hash table
 .LP
 If the debug level \fIn\fR is not given, it is taken to be one.
+.RE
+.TP
+\fB\-w\fR\fIn\fR
+specifies the width of the output.
+The parameter is optional.
+If it is omitted, it defaults to 60.
+.TP
+\fB\-x\fR
+Treat unknown capabilities as user-defined.
+That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
+it will infer its type (boolean, number or string) from the syntax and
+make an extended table entry for that.
+User-defined capability strings
+whose name begins with \*(``k\*('' are treated as function keys.
+.SS PARAMETERS
+.TP
+\fIfile\fR
+contains one or more \fBterminfo\fR terminal descriptions in source
+format [see \fBterminfo\fR(\*n)].
+Each description in the file
+describes the capabilities of a particular terminal.
+.IP
+If \fIfile\fR is \*(``-\*('', then the data is read from the standard input.
+The \fIfile\fR parameter may also be the path of a character-device.
+.SS PROCESSING
 .PP
-All but one of the capabilities recognized by \fBtic\fR are documented
-in \fBterminfo\fR(\*n).  The exception is the \fBuse\fR capability.
+All but one of the capabilities recognized by \fB@TIC@\fR are documented
+in \fBterminfo\fR(\*n).
+The exception is the \fBuse\fR capability.
 .PP
-When a \fBuse\fR=\fIentry\fR-\fIname\fR field is discovered in a
-terminal entry currently being compiled, \fBtic\fR reads in the binary
-from \fB\*d\fR to complete the entry.  (Entries created from
-\fIfile\fR will be used first.  If the environment variable
-\fBTERMINFO\fR is set, that directory is searched instead of
-\fB\*d\fR.)  \fBtic\fR duplicates the capabilities in
-\fIentry\fR-\fIname\fR for the current entry, with the exception of
+When a \fBuse\fR=\fIentry\fR\-\fIname\fR field is discovered in a
+terminal entry currently being compiled, \fB@TIC@\fR reads in the binary
+from \fB\*d\fR to complete the entry.
+(Entries created from
+\fIfile\fR will be used first.
+\fB@TIC@\fR duplicates the capabilities in
+\fIentry\fR\-\fIname\fR for the current entry, with the exception of
 those capabilities that explicitly are defined in the current entry.
 .PP
 When an entry, e.g., \fBentry_name_1\fR, contains a
@@ -256,59 +361,65 @@
 \fBentry_name_1\fR before \fBuse=\fR for these capabilities to be
 canceled in \fBentry_name_1\fR.
 .PP
-If the environment variable \fBTERMINFO\fR is set, the compiled
-results are placed there instead of \fB\*d\fR.
-.PP
-Total compiled entries cannot exceed 4096 bytes.  The name field cannot
-exceed 512 bytes.  Terminal names exceeding the maximum alias length
+Total compiled entries cannot exceed 4096 bytes.
+The name field cannot
+exceed 512 bytes.
+Terminal names exceeding the maximum alias length
 (32 characters on systems with long filenames, 14 characters otherwise)
 will be truncated to the maximum alias length and a warning message will be printed.
 .SH COMPATIBILITY
-There is some evidence that historic \fBtic\fR implementations treated
+There is some evidence that historic \fB@TIC@\fR implementations treated
 description fields with no whitespace in them as additional aliases or
-short names.  This \fBtic\fR does not do that, but it does warn when
+short names.
+This \fB@TIC@\fR does not do that, but it does warn when
 description fields may be treated that way and check them for dangerous
 characters.
 .SH EXTENSIONS
-Unlike the stock SVr4 \fBtic\fR command, this implementation can actually
-compile termcap sources.  In fact, entries in terminfo and termcap syntax can
-be mixed in a single source file.  See \fBterminfo\fR(\*n) for the list of
+Unlike the SVr4 \fB@TIC@\fR command, this implementation can actually
+compile termcap sources.
+In fact, entries in terminfo and termcap syntax can
+be mixed in a single source file.
+See \fBterminfo\fR(\*n) for the list of
 termcap names taken to be equivalent to terminfo names.
 .PP
 The SVr4 manual pages are not clear on the resolution rules for \fBuse\fR
 capabilities.
-This implementation of \fBtic\fR will find \fBuse\fR targets anywhere
+This implementation of \fB@TIC@\fR will find \fBuse\fR targets anywhere
 in the source file, or anywhere in the file tree rooted at \fBTERMINFO\fR (if
-\fBTERMINFO\fR is defined), or in the user's \fI$HOME/.terminfo\fR directory
-(if it exists), or (finally) anywhere in the system's file tree of
+\fBTERMINFO\fR is defined),
+or in the user's \fI$HOME/.terminfo\fR database
+(if it exists),
+or (finally) anywhere in the system's file tree of
 compiled entries.
 .PP
-The error messages from this \fBtic\fR have the same format as GNU C
+The error messages from this \fB@TIC@\fR have the same format as GNU C
 error messages, and can be parsed by GNU Emacs's compile facility.
 .PP
 The
-\fB-C\fR,
-\fB-G\fR,
-\fB-I\fR,
-\fB-N\fR,
-\fB-R\fR,
-\fB-T\fR,
-\fB-V\fR,
-\fB-a\fR,
-\fB-e\fR,
-\fB-f\fR,
-\fB-g\fR,
-\fB-o\fR,
-\fB-r\fR,
-\fB-s\fR,
-\fB-t\fR and
-\fB-x\fR
+\fB\-0\fR,
+\fB\-1\fR,
+\fB\-C\fR,
+\fB\-G\fR,
+\fB\-I\fR,
+\fB\-N\fR,
+\fB\-R\fR,
+\fB\-T\fR,
+\fB\-V\fR,
+\fB\-a\fR,
+\fB\-e\fR,
+\fB\-f\fR,
+\fB\-g\fR,
+\fB\-o\fR,
+\fB\-r\fR,
+\fB\-s\fR,
+\fB\-t\fR and
+\fB\-x\fR
 options
 are not supported under SVr4.
-The SVr4 \fB-c\fR mode does not report bad use links.
+The SVr4 \fB\-c\fR mode does not report bad use links.
 .PP
 System V does not compile entries to or read entries from your
-\fI$HOME/.terminfo\fR directory unless TERMINFO is explicitly set to it.
+\fI$HOME/.terminfo\fR database unless TERMINFO is explicitly set to it.
 .SH FILES
 .TP 5
 \fB\*d/?/*\fR
@@ -319,13 +430,13 @@
 \fB@INFOTOCAP@\fR(1M),
 \fB@TOE@\fR(1M),
 \fBcurses\fR(3X),
+\fBterm\fR(\*n).
 \fBterminfo\fR(\*n).
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
+.SH AUTHOR
+Eric S. Raymond <esr@snark.thyrsus.com>
+and
+.br
+Thomas E. Dickey <dickey@invisible-island.net>
diff --git a/man/toe.1m b/man/toe.1m
index 1530354..26af319 100644
--- a/man/toe.1m
+++ b/man/toe.1m
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2008 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            *
@@ -26,34 +26,43 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: toe.1m,v 1.21 2008/01/05 20:57:16 tom Exp $
+.\" $Id: toe.1m,v 1.26 2012/01/01 00:40:51 tom Exp $
 .TH @TOE@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fBtoe\fR - table of (terminfo) entries
+\fB@TOE@\fR \- table of (terminfo) entries
 .SH SYNOPSIS
-\fBtoe\fR [\fB-v\fR[\fIn\fR]] [\fB-ahuUV\fR] \fIfile...\fR
+\fB@TOE@\fR [\fB\-v\fR[\fIn\fR]] [\fB\-ahsuUV\fR] \fIfile...\fR
 .br
 .SH DESCRIPTION
 .PP
 With no options,
-\fBtoe\fR lists all available terminal types by primary name
+\fB@TOE@\fR lists all available terminal types by primary name
 with descriptions.
 File arguments specify the directories to be scanned; if no
 such arguments are given,
 your default terminfo directory is scanned.
-If you also specify the \fB-h\fR option,
+If you also specify the \fB\-h\fR option,
 a directory header will be issued as each
 directory is entered.
 .PP
 There are other options intended for use by terminfo file maintainers:
 .TP
-\fB-a\fR
+\fB\-a\fR
 report on all of the terminal databases which ncurses would search,
 rather than only the first one that it finds.
+.IP
+If the \fB\-s\fR is also given, \fB@TOE@\fR
+adds a column to the report,
+showing (like \fBconflict\fP(1)) which entries which 
+belong to a given terminal database.
+An "*" marks entries which differ, and "+" marks equivalent entries.
 .TP
-\fB-u\fR \fIfile\fR
+\fB\-s\fR
+sort the output by the entry names.
+.TP
+\fB\-u\fR \fIfile\fR
 says to write a report to the standard output,
 listing dependencies in the given terminfo/termcap source file.
 The report condenses the `use' relation:
@@ -65,7 +74,7 @@
 capabilities,
 followed by a newline
 .TP
-\fB-U\fR \fIfile\fR
+\fB\-U\fR \fIfile\fR
 says to write a report to the standard output,
 listing reverse dependencies in the given terminfo/termcap source file.
 The report reverses the `use' relation:
@@ -76,13 +85,13 @@
 whitespace-separated primary names of all terminals which depend on it,
 followed by a newline.
 .TP
-\fB-v\fR\fIn\fR
+\fB\-v\fR\fIn\fR
 specifies that (verbose) output be written to standard error,
-showing \fBtoe\fR's progress.
+showing \fB@TOE@\fR's progress.
 The optional parameter \fIn\fR is a number from 1 to 10,
 interpreted as for \fB@TIC@\fR(1M).
 .TP
-\fB-V\fR
+\fB\-V\fR
 reports the version of ncurses which was used in this program,
 and exits.
 .SH FILES
@@ -99,9 +108,3 @@
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/tput.1 b/man/tput.1
index bada0b1..a1b81bc 100644
--- a/man/tput.1
+++ b/man/tput.1
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,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            *
@@ -27,24 +27,24 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tput.1,v 1.27 2006/12/24 18:11:31 tom Exp $
+.\" $Id: tput.1,v 1.32 2012/07/14 21:06:45 tom Exp $
 .TH @TPUT@ 1 ""
 .ds d @TERMINFO@
 .ds n 1
 .SH NAME
-\fB@TPUT@\fR, \fBreset\fR - initialize a terminal or query terminfo database
+\fB@TPUT@\fR, \fBreset\fR \- initialize a terminal or query terminfo database
 .SH SYNOPSIS
-\fB@TPUT@\fR [\fB-T\fR\fItype\fR] \fIcapname\fR [\fIparms\fR ... ]
+\fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fIcapname\fR [\fIparms\fR ... ]
 .br
-\fB@TPUT@\fR [\fB-T\fR\fItype\fR] \fBinit\fR
+\fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBinit\fR
 .br
-\fB@TPUT@\fR [\fB-T\fR\fItype\fR] \fBreset\fR
+\fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBreset\fR
 .br
-\fB@TPUT@\fR [\fB-T\fR\fItype\fR] \fBlongname\fR
+\fB@TPUT@\fR [\fB\-T\fR\fItype\fR] \fBlongname\fR
 .br
-\fB@TPUT@ -S\fR  \fB<<\fR
+\fB@TPUT@ \-S\fR  \fB<<\fR
 .br
-\fB@TPUT@ -V\fR
+\fB@TPUT@ \-V\fR
 .br
 .SH DESCRIPTION
 The \fB@TPUT@\fR utility uses the \fBterminfo\fR database to make the
@@ -76,12 +76,13 @@
 For a complete list of capabilities
 and the \fIcapname\fR associated with each, see \fBterminfo\fR(5).
 .TP
-\fB-T\fR\fItype\fR
-indicates the \fItype\fR of terminal.  Normally this option is
+\fB\-T\fR\fItype\fR
+indicates the \fItype\fR of terminal.
+Normally this option is
 unnecessary, because the default is taken from the environment
-variable \fBTERM\fR.  If \fB-T\fR is specified, then the shell
-variables \fBLINES\fR and \fBCOLUMNS\fR will be ignored,and the
-operating system will not be queried for the actual screen size.
+variable \fBTERM\fR.
+If \fB\-T\fR is specified, then the shell
+variables \fBLINES\fR and \fBCOLUMNS\fR will also be ignored.
 .TP
 \fIcapname\fR
 indicates the capability from the \fBterminfo\fR database.  When
@@ -99,12 +100,12 @@
 If no parameters are given for the capability,
 \fB@TPUT@\fR writes the string without performing the substitution.
 .TP
-\fB-S\fR
+\fB\-S\fR
 allows more than one capability per invocation of \fB@TPUT@\fR.  The
 capabilities must be passed to \fB@TPUT@\fR from the standard input
 instead of from the command line (see example).
 Only one \fIcapname\fR is allowed per line.
-The \fB-S\fR option changes the
+The \fB\-S\fR option changes the
 meaning of the \fB0\fR and \fB1\fR boolean and string exit codes (see the
 EXIT CODES section).
 .IP
@@ -112,12 +113,12 @@
 to decide whether to use \fBtparm\fR (3X),
 and how to interpret the parameters.
 .TP
-\fB-V\fR
+\fB\-V\fR
 reports the version of ncurses which was used in this program, and exits.
 .TP
 \fBinit\fR
 If the \fBterminfo\fR database is present and an entry for the user's
-terminal exists (see \fB-T\fR\fItype\fR, above), the following will
+terminal exists (see \fB\-T\fR\fItype\fR, above), the following will
 occur:
 .RS
 .TP
@@ -152,14 +153,14 @@
 .TP
 \fBlongname\fR
 If the \fBterminfo\fR database is present and an entry for the
-user's terminal exists (see \fB-T\fR\fItype\fR above), then the long name
+user's terminal exists (see \fB\-T\fR\fItype\fR above), then the long name
 of the terminal will be put out.  The long name is the last
 name in the first line of the terminal's description in the
 \fBterminfo\fR database [see \fBterm\fR(5)].
 .PP
 If \fB@TPUT@\fR is invoked by a link named \fBreset\fR, this has the
 same effect as \fB@TPUT@ reset\fR.
-See \fBtset\fR for comparison, which has similar behavior.
+See \fB@TSET@\fR for comparison, which has similar behavior.
 .SH EXAMPLES
 .TP 5
 \fB@TPUT@ init\fR
@@ -169,7 +170,7 @@
 the environmental variable \fBTERM\fR has been exported, as
 illustrated on the \fBprofile\fR(5) manual page.
 .TP 5
-\fB@TPUT@ -T5620 reset\fR
+\fB@TPUT@ \-T5620 reset\fR
 Reset an AT&T 5620 terminal, overriding the type of
 terminal in the environmental variable \fBTERM\fR.
 .TP 5
@@ -184,7 +185,7 @@
 \fB@TPUT@ cols\fR
 Print the number of columns for the current terminal.
 .TP 5
-\fB@TPUT@ -T450 cols\fR
+\fB@TPUT@ \-T450 cols\fR
 Print the number of columns for the 450 terminal.
 .TP 5
 \fBbold=`@TPUT@ smso` offbold=`@TPUT@ rmso`\fR
@@ -208,7 +209,7 @@
 variable \fBTERM\fR.
 .PP
 .RS 5
-\fB@TPUT@ -S <<!\fR
+\fB@TPUT@ \-S <<!\fR
 .br
 \fB> clear\fR
 .br
@@ -237,7 +238,7 @@
 information, see the "Tabs and Initialization"
 section of \fBterminfo\fR(5)
 .SH EXIT CODES
-If the \fB-S\fR option is used,
+If the \fB\-S\fR option is used,
 \fB@TPUT@\fR checks for errors from each line,
 and if any errors are found, will set the exit code to 4 plus the
 number of lines with errors.
@@ -245,7 +246,7 @@
 No indication of which line failed can be given so
 exit code \fB1\fR will never appear.  Exit codes \fB2\fR, \fB3\fR, and
 \fB4\fR retain their usual interpretation.
-If the \fB-S\fR option is not used,
+If the \fB\-S\fR option is not used,
 the exit code depends on the type of \fIcapname\fR:
 .RS 5
 .TP
@@ -265,7 +266,7 @@
 whether or not \fIcapname\fR is defined for this terminal \fItype\fR.
 To determine if \fIcapname\fR is defined for this terminal \fItype\fR,
 the user must test the value written to standard output.
-A value of \fB-1\fR
+A value of \fB\-1\fR
 means that \fIcapname\fR is not defined for this terminal \fItype\fR.
 .TP
 .I other
@@ -275,7 +276,7 @@
 .PP
 Any other exit code indicates an error; see the DIAGNOSTICS section.
 .SH DIAGNOSTICS
-\fBtput\fR prints the following error messages and sets the corresponding exit
+\fB@TPUT@\fR prints the following error messages and sets the corresponding exit
 codes.
 .PP
 .ne 15
@@ -286,40 +287,46 @@
 \fB0\fR	T{
 (\fIcapname\fR is a numeric variable that is not specified in the
 \fBterminfo\fR(5) database for this terminal type, e.g.
-\fB@TPUT@ -T450 lines\fR and \fB@TPUT@ -T2621 xmc\fR)
+\fB@TPUT@ \-T450 lines\fR and \fB@TPUT@ \-T2621 xmc\fR)
 T}
 \fB1\fR	no error message is printed, see the \fBEXIT CODES\fR section.
 \fB2\fR	usage error
 \fB3\fR	unknown terminal \fItype\fR or no \fBterminfo\fR database
 \fB4\fR	unknown \fBterminfo\fR capability \fIcapname\fR
-\fB>4\fR	error occurred in -S
+\fB>4\fR	error occurred in \-S
 =
 .TE
 .SH PORTABILITY
 .PP
-The \fBlongname\fR and \fB-S\fR options, and the parameter-substitution
+The \fBlongname\fR and \fB\-S\fR options, and the parameter-substitution
 features used in the \fBcup\fR example, are not supported in BSD curses or in
 AT&T/USL curses before SVr4.
 .PP
 X/Open documents only the operands for \fBclear\fP, \fBinit\fP and \fBreset\fP.
 In this implementation, \fBclear\fP is part of the \fIcapname\fR support.
-Other implementations of \fBtput\fP on
+Other implementations of \fB@TPUT@\fP on
 SVr4-based systems such as Solaris, IRIX64 and HPUX
 as well as others such as AIX and Tru64
 provide support for \fIcapname\fR operands.
+.PP
 A few platforms such as FreeBSD and NetBSD recognize termcap names rather
-than terminfo capability names in their respective \fBtput\fP commands.
+than terminfo capability names in their respective \fB@TPUT@\fP commands.
+.PP
+Most implementations which provide support for \fIcapname\fR operands
+use the \fItparm\fP function to expand parameters in it.
+That function expects a mixture of numeric and string parameters,
+requiring \fB@TPUT@\fP to know which type to use.
+This implementation uses a table to determine that for
+the standard \fIcapname\fR operands, and an internal library
+function to analyze nonstandard \fIcapname\fR operands.
+Other implementations may simply guess that an operand containing only digits
+is intended to be a number.
 .SH SEE ALSO
 \fB@CLEAR@\fR(1),
 \fBstty\fR(1),
 \fBtabs\fR(\*n),
-\fBterminfo\fR(5).
+\fBterminfo\fR(5),
+\fBcurs_termcap\fR(3X).
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/tset.1 b/man/tset.1
index e023064..e151e75 100644
--- a/man/tset.1
+++ b/man/tset.1
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 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            *
@@ -26,14 +26,18 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tset.1,v 1.19 2006/12/24 15:00:30 tom Exp $
-.TH tset 1 ""
+.\" $Id: tset.1,v 1.29 2013/12/21 22:15:53 tom Exp $
+.TH @TSET@ 1 ""
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
 .SH NAME
-\fBtset\fR, \fBreset\fR - terminal initialization
+\fB@TSET@\fR, \fBreset\fR \- terminal initialization
 .SH SYNOPSIS
-\fBtset\fR [\fB-IQVcqrsw\fR] [\fB-\fR] [\fB-e\fR \fIch\fR] [\fB-i\fR \fIch\fR] [\fB-k\fR \fIch\fR] [\fB-m\fR \fImapping\fR] [\fIterminal\fR]
+\fB@TSET@\fR [\fB\-IQVcqrsw\fR] [\fB\-\fR] [\fB\-e\fR \fIch\fR] [\fB\-i\fR \fIch\fR] [\fB\-k\fR \fIch\fR] [\fB\-m\fR \fImapping\fR] [\fIterminal\fR]
 .br
-\fBreset\fR [\fB-IQVcqrsw\fR] [\fB-\fR] [\fB-e\fR \fIch\fR] [\fB-i\fR \fIch\fR] [\fB-k\fR \fIch\fR] [\fB-m\fR \fImapping\fR] [\fIterminal\fR]
+\fBreset\fR [\fB\-IQVcqrsw\fR] [\fB\-\fR] [\fB\-e\fR \fIch\fR] [\fB\-i\fR \fIch\fR] [\fB\-k\fR \fIch\fR] [\fB\-m\fR \fImapping\fR] [\fIterminal\fR]
 .SH DESCRIPTION
 \&\fBTset\fR initializes terminals.
 \fBTset\fR first determines the type of terminal that you are using.
@@ -44,17 +48,18 @@
 2. The value of the \fBTERM\fR environmental variable.
 .PP
 3. (BSD systems only.) The terminal type associated with the standard
-error output device in the \fI/etc/ttys\fR file.  (On Linux and
-System-V-like UNIXes, \fIgetty\fR does this job by setting
+error output device in the \fI/etc/ttys\fR file.
+(On System\-V-like UNIXes and systems using that convention,
+\fIgetty\fR does this job by setting
 \fBTERM\fR according to the type passed to it by \fI/etc/inittab\fR.)
 .PP
-4. The default terminal type, ``unknown''.
+4. The default terminal type, \*(``unknown\*(''.
 .PP
-If the terminal type was not specified on the command-line, the \fB-m\fR
+If the terminal type was not specified on the command-line, the \fB\-m\fR
 option mappings are then applied (see the section
 .B TERMINAL TYPE MAPPING
 for more information).
-Then, if the terminal type begins with a question mark (``?''), the
+Then, if the terminal type begins with a question mark (\*(``?\*(''), the
 user is prompted for confirmation of the terminal type.  An empty
 response confirms the type, or, another type can be entered to specify
 a new type.  Once the terminal type has been determined, the terminfo
@@ -67,11 +72,11 @@
 Finally, if the erase, interrupt and line kill characters have changed,
 or are not set to their default values, their values are displayed to the
 standard error output.
-Use the \fB-c\fP or \fB-w\fP option to select only the window sizing
+Use the \fB\-c\fP or \fB\-w\fP option to select only the window sizing
 versus the other initialization.
 If neither option is given, both are assumed.
 .PP
-When invoked as \fBreset\fR, \fBtset\fR sets cooked and echo modes,
+When invoked as \fBreset\fR, \fB@TSET@\fR sets cooked and echo modes,
 turns off cbreak and raw modes, turns on newline translation and
 resets any unset special characters to their default values before
 doing the terminal initialization described above.  This is useful
@@ -86,99 +91,106 @@
 .PP
 The options are as follows:
 .TP 5
-.B -c
+.B \-c
 Set control characters and modes.
-.B -e
+.TP 5
+.B \-e
 Set the erase character to \fIch\fR.
 .TP
-.B -I
+.B \-I
 Do not send the terminal or tab initialization strings to the terminal.
 .TP
-.B -i
+.B \-i
 Set the interrupt character to \fIch\fR.
 .TP
-.B -k
+.B \-k
 Set the line kill character to \fIch\fR.
 .TP
-.B -m
+.B \-m
 Specify a mapping from a port type to a terminal.
 See the section
 .B TERMINAL TYPE MAPPING
 for more information.
 .TP
-.B -Q
+.B \-Q
 Do not display any values for the erase, interrupt and line kill characters.
-Normally \fBtset\fR displays the values for control characters which
+Normally \fB@TSET@\fR displays the values for control characters which
 differ from the system's default values.
 .TP
-.B -q
+.B \-q
 The terminal type is displayed to the standard output, and the terminal is
-not initialized in any way.  The option `-' by itself is equivalent but
+not initialized in any way.  The option `\-' by itself is equivalent but
 archaic.
 .TP
-.B -r
+.B \-r
 Print the terminal type to the standard error output.
 .TP
-.B -s
+.B \-s
 Print the sequence of shell commands to initialize the environment variable
 \fBTERM\fR to the standard output.
 See the section
 .B SETTING THE ENVIRONMENT
 for details.
 .TP
-.B -V
+.B \-V
 reports the version of ncurses which was used in this program, and exits.
 .TP
-.B -w
+.B \-w
 Resize the window to match the size deduced via \fBsetupterm\fP.
 Normally this has no effect,
 unless \fBsetupterm\fP is not able to detect the window size.
 .PP
-The arguments for the \fB-e\fR, \fB-i\fR, and \fB-k\fR
+The arguments for the \fB\-e\fR, \fB\-i\fR, and \fB\-k\fR
 options may either be entered as actual characters or by using the `hat'
-notation, i.e. control-h may be specified as ``^H'' or ``^h''.
+notation, i.e., control-h may be specified as \*(``^H\*('' or \*(``^h\*(''.
 .
 .SH SETTING THE ENVIRONMENT
 It is often desirable to enter the terminal type and information about
 the terminal's capabilities into the shell's environment.
-This is done using the \fB-s\fR option.
+This is done using the \fB\-s\fR option.
 .PP
-When the \fB-s\fR option is specified, the commands to enter the information
+When the \fB\-s\fR option is specified, the commands to enter the information
 into the shell's environment are written to the standard output.  If
-the \fBSHELL\fR environmental variable ends in ``csh'', the commands
+the \fBSHELL\fR environmental variable ends in \*(``csh\*('', the commands
 are for \fBcsh\fR, otherwise, they are for \fBsh\fR.
 Note, the \fBcsh\fR commands set and unset the shell variable
 \fBnoglob\fR, leaving it unset.  The following line in the \fB.login\fR
 or \fB.profile\fR files will initialize the environment correctly:
 .sp
-    eval \`tset -s options ... \`
+    eval \`@TSET@ \-s options ... \`
 .
 .SH TERMINAL TYPE MAPPING
 When the terminal is not hardwired into the system (or the current
 system information is incorrect) the terminal type derived from the
 \fI/etc/ttys\fR file or the \fBTERM\fR environmental variable is often
 something generic like \fBnetwork\fR, \fBdialup\fR, or \fBunknown\fR.
-When \fBtset\fR is used in a startup script it is often desirable to
+When \fB@TSET@\fR is used in a startup script it is often desirable to
 provide information about the type of terminal used on such ports.
 .PP
-The purpose of the \fB-m\fR option is to map
+The purpose of the \fB\-m\fR option is to map
 from some set of conditions to a terminal type, that is, to
-tell \fBtset\fR
-``If I'm on this port at a particular speed, guess that I'm on that
-kind of terminal''.
+tell \fB@TSET@\fR
+\*(``If I'm on this port at a particular speed,
+guess that I'm on that kind of terminal\*(''.
 .PP
-The argument to the \fB-m\fR option consists of an optional port type, an
+The argument to the \fB\-m\fR option consists of an optional port type, an
 optional operator, an optional baud rate specification, an optional
-colon (``:'') character and a terminal type.  The port type is a
-string (delimited by either the operator or the colon character).  The
-operator may be any combination of ``>'', ``<'', ``@'', and ``!''; ``>''
-means greater than, ``<'' means less than, ``@'' means equal to
-and ``!'' inverts the sense of the test.
+colon (\*(``:\*('') character and a terminal type.  The port type is a
+string (delimited by either the operator or the colon character).
+The operator may be any combination of
+\*(``>\*('',
+\*(``<\*('',
+\*(``@\*('',
+and \*(``!\*('';
+\*(``>\*('' means greater than,
+\*(``<\*('' means less than,
+\*(``@\*('' means equal to and
+\*(``!\*('' inverts the sense of the test.
 The baud rate is specified as a number and is compared with the speed
 of the standard error output (which should be the control terminal).
 The terminal type is a string.
 .PP
-If the terminal type is not specified on the command line, the \fB-m\fR
+If the terminal type is not specified on the command line, the \fB\-m\fR
 mappings are applied to the terminal type.  If the port type and baud
 rate match the mapping, the terminal type specified in the mapping
 replaces the current type.  If more than one mapping is specified, the
@@ -193,63 +205,67 @@
 .PP
 If no baud rate is specified, the terminal type will match any baud rate.
 If no port type is specified, the terminal type will match any port type.
-For example, \fB-m dialup:vt100 -m :?xterm\fR
+For example, \fB\-m dialup:vt100 \-m :?xterm\fR
 will cause any dialup port, regardless of baud rate, to match the terminal
 type vt100, and any non-dialup port type to match the terminal type ?xterm.
 Note, because of the leading question mark, the user will be
 queried on a default port as to whether they are actually using an xterm
 terminal.
 .PP
-No whitespace characters are permitted in the \fB-m\fR option argument.
+No whitespace characters are permitted in the \fB\-m\fR option argument.
 Also, to avoid problems with meta-characters, it is suggested that the
-entire \fB-m\fR option argument be placed within single quote characters,
-and that \fBcsh\fR users insert a backslash character (``\e'') before
-any exclamation marks (``!'').
+entire \fB\-m\fR option argument be placed within single quote characters,
+and that \fBcsh\fR users insert a backslash character (\*(``\e\*('') before
+any exclamation marks (\*(``!\*('').
 .SH HISTORY
-The \fBtset\fR command appeared in BSD 3.0.  The \fBncurses\fR implementation
+The \fB@TSET@\fR command appeared in BSD 3.0.  The \fBncurses\fR implementation
 was lightly adapted from the 4.4BSD sources for a terminfo environment by Eric
 S. Raymond <esr@snark.thyrsus.com>.
 .SH COMPATIBILITY
-The \fBtset\fR utility has been provided for backward-compatibility with BSD
+The \fB@TSET@\fR utility has been provided for backward-compatibility with BSD
 environments (under most modern UNIXes, \fB/etc/inittab\fR and \fIgetty\fR(1)
 can set \fBTERM\fR appropriately for each dial-up line; this obviates what was
-\fBtset\fR's most important use).  This implementation behaves like 4.4BSD
+\fB@TSET@\fR's most important use).  This implementation behaves like 4.4BSD
 tset, with a few exceptions specified here.
 .PP
-The \fB-S\fR option of BSD tset no longer works; it prints an error message to stderr
-and dies.  The \fB-s\fR option only sets \fBTERM\fR, not \fBTERMCAP\fP.  Both these
-changes are because the \fBTERMCAP\fR variable is no longer supported under
-terminfo-based \fBncurses\fR, which makes \fBtset -S\fR useless (we made it die
-noisily rather than silently induce lossage).
+The \fB\-S\fR option of BSD tset no longer works;
+it prints an error message to stderr and dies.
+The \fB\-s\fR option only sets \fBTERM\fR, not \fBTERMCAP\fP.
+Both of these changes are because the \fBTERMCAP\fR variable
+is no longer supported under terminfo-based \fBncurses\fR,
+which makes \fB@TSET@ \-S\fR useless
+(we made it die noisily rather than silently induce lossage).
 .PP
 There was an undocumented 4.4BSD feature that invoking tset via a link named
 `TSET` (or via any other name beginning with an upper-case letter) set the
 terminal to use upper-case only.  This feature has been omitted.
 .PP
-The \fB-A\fR, \fB-E\fR, \fB-h\fR, \fB-u\fR and \fB-v\fR
-options were deleted from the \fBtset\fR
+The \fB\-A\fR, \fB\-E\fR, \fB\-h\fR, \fB\-u\fR and \fB\-v\fR
+options were deleted from the \fB@TSET@\fR
 utility in 4.4BSD.
 None of them were documented in 4.3BSD and all are
 of limited utility at best.
-The \fB-a\fR, \fB-d\fR, and \fB-p\fR options are similarly
+The \fB\-a\fR, \fB\-d\fR, and \fB\-p\fR options are similarly
 not documented or useful, but were retained as they appear to be in
 widespread use.  It is strongly recommended that any usage of these
-three options be changed to use the \fB-m\fR option instead.  The
--n option remains, but has no effect.  The \fB-adnp\fR options are therefore
-omitted from the usage summary above.
+three options be changed to use the \fB\-m\fR option instead.
+The \fB\-n\fP option remains, but has no effect.
+The \fB\-adnp\fR options are therefore omitted from the usage summary above.
 .PP
-It is still permissible to specify the \fB-e\fR, \fB-i\fR, and \fB-k\fR options without
-arguments, although it is strongly recommended that such usage be fixed to
+It is still permissible to specify the \fB\-e\fR, \fB\-i\fR,
+and \fB\-k\fR options without arguments,
+although it is strongly recommended that such usage be fixed to
 explicitly specify the character.
 .PP
-As of 4.4BSD, executing \fBtset\fR as \fBreset\fR no longer implies the \fB-Q\fR
-option.  Also, the interaction between the - option and the \fIterminal\fR
-argument in some historic implementations of \fBtset\fR has been removed.
+As of 4.4BSD,
+executing \fB@TSET@\fR as \fBreset\fR no longer implies the \fB\-Q\fR option.
+Also, the interaction between the \- option and the \fIterminal\fR
+argument in some historic implementations of \fB@TSET@\fR has been removed.
 .SH ENVIRONMENT
-The \fBtset\fR command uses these environment variables:
+The \fB@TSET@\fR command uses these environment variables:
 .TP 5
 SHELL
-tells \fBtset\fP whether to initialize \fBTERM\fP using \fBsh\fP or
+tells \fB@TSET@\fP whether to initialize \fBTERM\fP using \fBsh\fP or
 \fBcsh\fP syntax.
 .TP 5
 TERM
@@ -259,7 +275,7 @@
 TERMCAP
 may denote the location of a termcap database.
 If it is not an absolute pathname, e.g., begins with a `/',
-\fBtset\fP removes the variable from the environment before looking
+\fB@TSET@\fP removes the variable from the environment before looking
 for the terminal description.
 .SH FILES
 .TP 5
@@ -269,6 +285,7 @@
 @TERMINFO@
 terminal capability database
 .SH SEE ALSO
+.hy 0
 csh(1),
 sh(1),
 stty(1),
@@ -277,12 +294,7 @@
 terminfo(5),
 ttys(5),
 environ(7)
+.hy
 .PP
 This describes \fBncurses\fR
 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff --git a/man/wresize.3x b/man/wresize.3x
index 4d05d3e..0832450 100644
--- a/man/wresize.3x
+++ b/man/wresize.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,20 +28,21 @@
 .\"
 .\" Author: Thomas E. Dickey 1996
 .\"
-.\" $Id: wresize.3x,v 1.9 2006/02/25 21:47:06 tom Exp $
+.\" $Id: wresize.3x,v 1.13 2010/12/04 18:40:45 tom Exp $
 .TH wresize 3X ""
 .SH NAME
-\fBwresize\fR - resize a curses window
+\fBwresize\fR \- resize a curses window
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
 \fBint wresize(WINDOW *win, int lines, int columns);\fR
 .SH DESCRIPTION
-The \fBwresize\fR function reallocates storage for an \fBncurses\fR
+This is an extension to the curses library.                                    
+It reallocates storage for an \fBncurses\fR 
 window to adjust its dimensions to the specified values.
 If either dimension is larger than the current values, the
 window's data is filled with blanks that have the current background rendition
-(as set by \fBwbkgndset\fR) merged into them.
+(as set by \fBwbkgdset\fR) merged into them.
 .SH RETURN VALUE
 The function returns the integer \fBERR\fR upon failure and \fBOK\fR on success.
 It will fail if either of the dimensions less than or equal to zero,
@@ -56,9 +57,3 @@
 \fBresizeterm\fR(3X).
 .SH AUTHOR
 Thomas Dickey (from an equivalent function written in 1988 for BSD curses).
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End: